-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: Add Yarn 2 compatibility #9866
Conversation
362dcbc
to
65ec39f
Compare
…ir own functions Preparatory refactoring to simplify future compatibility with Yarn 2.
65ec39f
to
03ccdc8
Compare
@@ -35,6 +42,7 @@ export default async (npmOptions, { storyFormat = 'csf' }) => { | |||
`@storybook/mithril@${storybookVersion}`, | |||
`@storybook/addon-actions@${actionsVersion}`, | |||
`@storybook/addon-links@${linksVersion}`, | |||
`@storybook/addon-knobs@${knobsVersion}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added knobs
because it is listed in addons
of the configuration: https://github.com/storybookjs/storybook/blob/3dd714d3532687d958c41e093187b84ffca603ee/lib/cli/src/generators/MITHRIL/template-csf/.storybook/main.js but it is not used in template stories so maybe it should be deleted from configuration instead? 🤷♂
At the opposite @storybook/addon-links
is added and used in template stories but is not declared in addons
config, so we can maybe remove it?
@@ -43,6 +45,7 @@ export default async (npmOptions, { storyFormat = 'csf' }) => { | |||
`@storybook/react@${storybookVersion}`, | |||
`@storybook/addon-actions@${actionsVersion}`, | |||
`@storybook/addon-links@${linksVersion}`, | |||
`@storybook/addon-knobs@${knobsVersion}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as https://github.com/storybookjs/storybook/pull/9866/files#r379884879 for Mithril
Before, it was assumed that "When working with `create-react-app@>=2.0.0`, we know `babel-loader` is installed." But `babel` is a peer dependency of `@storybook/core` (itself dep of `@storybook/react`) and so it must be added to the project's `package.json`
These tests mimic the ones done to test SB CLI with "classic" yarn. However, some magic setup and `package.json` customization are needed in order to make Yarn 2 works inside a Yarn v1 workspace.
`riot-tmpl` is a peerDependency of `riot-compiler`
03ccdc8
to
e629f50
Compare
@Hypnosphi there are 2 broken TeamCity checks, should I mind or rely on all other checks only? |
@gaetanmaisse you can ignore the TeamCity checks for now. |
Issue:
Part of #9527
What I did
package.json
customization are needed in order to make Yarn 2 works inside a Yarn v1 workspace.yarn sb init
will not fails because all frameworks or the SB integration are currently not compatible with Yarn 2. Especially projects using:Cause: Error: Unable to load tag ([.yarn/berry/cache/marko-npm-4.18.46-d693c4c719-2.zip/node_modules/marko/src/core-tags/cache/marko.json → <cached-fragment>])
Error: Couldn't find preset "./babel-preset.js" relative to directory ".yarn/berry/cache/react-static-npm-5.9.12-e804e3b66e-2.zip/node_modules/react-static"
How to test
I add a new GitHub Actions workflow running tests related to SB CLI with Yarn 2.
It should be 🟢.