-
-
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 upgrade utility with version consistency check #11396
Conversation
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.
Mostly looks good, although what's up with this:
WARN Found 1 outdated packages (relative to '@storybook/[email protected]')
WARN Please make sure your packages are updated to ensure a consistent experience.
WARN - @storybook/[email protected]
lib/cli/src/upgrade.ts
Outdated
warnPackages(outdated); | ||
} | ||
|
||
if (semver.gt(latestVersion, '5.4.0')) { |
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.
Would we have to update this magic constant every release? Should we not pull it from package.json
?
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.
Made this more general, but maybe not in the way you had in mind
This is a dependency of |
describe.each([ | ||
['│ │ │ ├── @babel/[email protected] deduped', null], | ||
[ | ||
'│ ├── @storybook/[email protected] extraneous', | ||
{ package: '@storybook/theming', version: '6.0.0-beta.37' }, | ||
], | ||
[ | ||
'├─┬ @storybook/[email protected]', | ||
{ package: '@storybook/preset-create-react-app', version: '3.1.2' }, | ||
], | ||
['│ ├─┬ @storybook/[email protected]', { package: '@storybook/node-logger', version: '5.3.19' }], | ||
[ | ||
'npm ERR! peer dep missing: @storybook/react@>=5.2, required by @storybook/[email protected]', | ||
null, | ||
], | ||
])('getStorybookVersion', (input, output) => { | ||
it(input, () => { | ||
expect(getStorybookVersion(input)).toEqual(output); | ||
}); | ||
}); |
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'm confused what this is testing
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.
This is the output of npm ls
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 see.
NOTE: I have over 100 random storybook projects on my machine (mostly user repros). I ran |
Perhaps some time in the future we can also automate running codemods on user's repos? |
Super awesome!!!! A few ideas for the future regarding this: |
Thanks @yannbf, great suggestions. ❤️ Will address in a follow up PR for 1 -- low-hanging. 2 & 3 are both great but future work. 4 is done and it's called |
Issue: #11382 #11383
What I did
How to test