Skip to content
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

Merged
merged 5 commits into from
Oct 10, 2018
Merged

Rename CLI to sb #4345

merged 5 commits into from
Oct 10, 2018

Conversation

shilman
Copy link
Member

@shilman shilman commented Oct 10, 2018

Issue: #4168

What I did

Per discussion with @Keraito @tmeasday @ndelangen

  1. Rename storybook CLI to sb to avoid conflicts with storybook NPM script. We use yarn storybook everywhere and creating a CLI called storybook introduces a name conflict. After the rename, users can add the CLI locally in the project and access it by running yarn sb xxx. This isn't important now since init is the only supported command, but it will be important later when we start adding more commands. Plus sb is shorter.
  2. Remove start/build commands. 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 and keep things simple.
  3. Update documentation

Note

I tried to make npx @storybook/cli init work, but it currently uses getstorybook 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

npx -p @storybook/cli@test sb init

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
Copy link

codecov bot commented Oct 10, 2018

Codecov Report

Merging #4345 into master will increase coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
lib/cli/lib/initiate.js 0% <0%> (ø) ⬆️
lib/cli/bin/generate.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfe44a9...79499d4. Read the comment docs.

Copy link
Contributor

@Keraito Keraito left a 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:
Copy link
Contributor

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/'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two logs were replaced in #4184. Just a heads up depending on which PR gets merged first.

Copy link
Member Author

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

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants