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: Fix getFrameworkPackage logic #22559

Merged
merged 1 commit into from
May 15, 2023
Merged

CLI: Fix getFrameworkPackage logic #22559

merged 1 commit into from
May 15, 2023

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented May 15, 2023

Relates to #18360

What I did

The CLI had a bug in the way it tried to detect a framework package. That caused the following issue:
Sorry, for now, you can not do this, please use a framework such as @storybook/react-webpack5

This PR fixes that bug, and also throws a descriptive error to assist users in case they hit this scenario

How to test

  1. Go to a project without Storybook
  2. Build the CLI and use it like so: storybook init --builder XYZ:
    a. --builder vite (should work)
    b. --builder @storybook/builder-vite (should work)
    c. --builder vitest (should throw an error telling you to check if the package exists)

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"]

@yannbf yannbf added bug cli patch:yes Bugfix & documentation PR that need to be picked to main branch labels May 15, 2023
@yannbf yannbf changed the title CLI: fix getFrameworkPackage logic CLI: Fix getFrameworkPackage logic May 15, 2023
@yannbf yannbf merged commit aa113ea into next May 15, 2023
@yannbf yannbf deleted the fix/builder-option branch May 15, 2023 14:39
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 15, 2023
shilman pushed a commit that referenced this pull request May 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