Skip to content

CLI: Improve steps in storybook init#22502

Merged
yannbf merged 2 commits into
nextfrom
feat/generate-files-later-in-init
Jun 13, 2023
Merged

CLI: Improve steps in storybook init#22502
yannbf merged 2 commits into
nextfrom
feat/generate-files-later-in-init

Conversation

@yannbf

@yannbf yannbf commented May 10, 2023

Copy link
Copy Markdown
Member

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

@shilman shilman left a comment

Copy link
Copy Markdown
Member

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
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants