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

storybook init: Detach automigrate from init #22346

Closed
Tracked by #22243
yannbf opened this issue May 2, 2023 · 1 comment · Fixed by #22523
Closed
Tracked by #22243

storybook init: Detach automigrate from init #22346

yannbf opened this issue May 2, 2023 · 1 comment · Fixed by #22523
Assignees
Labels
cli maintenance User-facing maintenance tasks

Comments

@yannbf
Copy link
Member

yannbf commented May 2, 2023

Error location: automigrate

Suggested work:

This is a bug where the fixes object from running automigration is not an object. It seems to be related to these early bails when running automigrations that could happen due to the CLI:

  • not detecting main.js (user has to run the command again with —config-dir, but it does not make sense when running sb init)
  • having errors trying to parse the main.js file (maybe something else failed and there is no main.js)

This happens because we always run automigrate as part of init, and it can cause potential issues for users without necessity for that.

We currently run automigrations as part of init because for select packages, typescript (or some babel features) are not supported out of the box:

@storybook/react-webpack5
@storybook/vue-webpack5
@storybook/vue3-webpack5
@storybook/html-webpack5
@storybook/web-components-webpack5

As part of this task, we should detach automigrate from init, and provide a better solution for the projects listed above to work out of the box, such as running the code from missing-babelrc automigration as part of the init step, only for that select group of frameworks.

The other reason we run automigrations is to provide users the option to install eslint-storybook-plugin automatically, which is really helpful. We should also move this suggestion to the sb init command.

@yannbf yannbf added the cli label May 2, 2023
@yannbf yannbf changed the title storybook init: Cannot convert undefined or null to object storybook init: Detach automigrate from init May 2, 2023
@yannbf yannbf added the maintenance User-facing maintenance tasks label May 2, 2023
@yannbf yannbf self-assigned this May 2, 2023
@shilman
Copy link
Member

shilman commented May 15, 2023

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.12 containing PR #22523 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli maintenance User-facing maintenance tasks
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants