CLI: Exit when user does not select a storybook project type#23201
Conversation
01fb91b to
c85081b
Compare
|
|
||
| logger.log(); | ||
| logger.log('For more information about installing Storybook: https://storybook.js.org/docs'); | ||
| process.exit(0); |
There was a problem hiding this comment.
@shilman reminder to check this later, thanks!
There was a problem hiding this comment.
I'm ok with this. I think it's not great for our telemetry, but hopefully it's a small corner case.
|
|
||
| logger.log(); | ||
| logger.log('For more information about installing Storybook: https://storybook.js.org/docs'); | ||
| process.exit(0); |
There was a problem hiding this comment.
I'm ok with this. I think it's not great for our telemetry, but hopefully it's a small corner case.
| UNSUPPORTED = 'UNSUPPORTED', | ||
| REACT_SCRIPTS = 'REACT_SCRIPTS', | ||
| REACT = 'REACT', | ||
| REACT_SCRIPTS = 'REACT_SCRIPTS', |
There was a problem hiding this comment.
We have a big error count regarding "Storybook does not support react-scripts < 5.0.0" and this error can also be thrown when you choose react-scripts from the list of projects to install, but you don't have react-scripts installed.
I suspect what is influencing this count so much is that people just press enter when they get a list of options, and react-scripts is the first in the list. By changing the order, people will get react instead, free of the possibility of crashing with the react-scripts issue.
…roject CLI: Exit when user does not want to select a storybook project type (cherry picked from commit dcb93a7)
…roject CLI: Exit when user does not want to select a storybook project type (cherry picked from commit dcb93a7)
…roject CLI: Exit when user does not want to select a storybook project type (cherry picked from commit dcb93a7)
…roject CLI: Exit when user does not want to select a storybook project type (cherry picked from commit dcb93a7)
…roject CLI: Exit when user does not want to select a storybook project type (cherry picked from commit dcb93a7)
…roject CLI: Exit when user does not want to select a storybook project type (cherry picked from commit dcb93a7)
Closes #
What I did
Currently, when users try to install Storybook in a directory where no project type is detected, we prompt if they would like to select from a list. However, if the user selects "no", the process will continue and will get into a failure:
This PR fixes it by exiting the process successfully and providing link to the docs:
How to test
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:mergedorci:dailyGH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]