-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Rename CLI to sb #4345
Rename CLI to sb #4345
Conversation
We use "yarn storybook" everywhere and creating a CLI called "storybook" introduces a name conflict. Plus "sb" is shorter.
"sb start/build" should call start-storybook and build-storybook directly, rather than calling "yarn storybook". This way we can use "sb start/build" in the package.json NPM scripts and expose users to the CLI that way. For now let's remove it.
Codecov Report
@@ Coverage Diff @@
## master #4345 +/- ##
==========================================
+ Coverage 39.98% 40.04% +0.06%
==========================================
Files 504 503 -1
Lines 5912 5903 -9
Branches 795 795
==========================================
Hits 2364 2364
+ Misses 3165 3156 -9
Partials 383 383
Continue to review full report at Codecov.
|
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.
Small typo. LGTM
MIGRATION.md
Outdated
@@ -134,6 +135,14 @@ Also make sure you have a `.babelrc` in your project directory. You probably alr | |||
|
|||
If you're using `start-storybook` on CI, you may need to opt out of this using the new `--ci` flag. | |||
|
|||
### CLI Rename | |||
|
|||
We've deprecated the `getstorybook` CLI in 4.0. The new way to install storybook is `sb init`. We recommend installing using `npx` for convenience and to make sure you're always using the latest version of the CLI: |
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.
installing
); | ||
paddedLog( | ||
'You can also install storybook for plain HTML snippets with `storybook init --html` or follow some of the slow start guides: https://storybook.js.org/basics/slow-start-guide/' | ||
'You can also install storybook for plain HTML snippets with `sb init --html` or follow some of the slow start guides: https://storybook.js.org/basics/slow-start-guide/' |
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.
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.
@Keraito Merging now --- sorry to create extra work on the resolve, but my change is a small one
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.
No problem, won't be too much
Issue: #4168
What I did
Per discussion with @Keraito @tmeasday @ndelangen
sb
to avoid conflicts with storybook NPM script. We useyarn storybook
everywhere and creating a CLI calledstorybook
introduces a name conflict. After the rename, users can add the CLI locally in the project and access it by runningyarn sb xxx
. This isn't important now sinceinit
is the only supported command, but it will be important later when we start adding more commands. Plussb
is shorter.sb start/build
should call start-storybook and build-storybook directly, rather than callingyarn storybook
. This way we can usesb start/build
in thepackage.json
NPM scripts and expose users to the CLI that way. For now let's remove it and keep things simple.Note
I tried to make
npx @storybook/cli init
work, but it currently usesgetstorybook
as the associated binary. I reordered the binary declaration in this PR, but that didn't seem to change things. For now-p
works and is much better than a global install IMHO.How to test