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

CLI: Improve steps in storybook init #22502

Merged
merged 2 commits into from
Jun 13, 2023
Merged

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented May 10, 2023

What I did

Switched the order of actions to:

  1. install dependencies
  2. on success, write storybook config files

Before, if installing deps failed, users would end up with Storybook files, but no dependencies or package scripts. It's better to fail early and only proceed with config files when deps are installed correctly

How to test

  1. Build the CLI
  2. Get a project without Storybook, make it contain an invalid entry on package.json
  3. Run init, it should fail
  4. It should not contain Storybook files

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

1. install dependencies
2. on success, write storybook config files
@yannbf yannbf added bug cli patch:yes Bugfix & documentation PR that need to be picked to main branch labels May 10, 2023
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM!

@yannbf yannbf changed the title CLI: improve steps in storybook init CLI: Improve steps in storybook init Jun 13, 2023
@yannbf yannbf merged commit b50aa50 into next Jun 13, 2023
@yannbf yannbf deleted the feat/generate-files-later-in-init branch June 13, 2023 07:40
github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
@github-actions github-actions bot mentioned this pull request Jun 13, 2023
69 tasks
github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
github-actions bot pushed a commit that referenced this pull request Jun 14, 2023
…in-init

CLI: Improve steps in storybook init
(cherry picked from commit b50aa50)
@JReinhold JReinhold added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants