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 sb init prompt when framework type is undetected #13520
Conversation
@shilman @ndelangen after the work done in #13013 I believe the CLI can't install Storybook in typescript projects anymore. Would any of you care to help? Maybe the fix would suit in this PR? The ESM/CJS build result won't contain the typescript files from the templates. When running What I mean by copying an empty folder you can see with the result of the esm build in the cli project: |
b3c8697
to
b902594
Compare
@gaetanmaisse you're the best ❤️ |
I inverted the logic to check if we are in the SB CLI package as this is the only package that require extra check on filenames.
b902594
to
c4ba07c
Compare
Signed-off-by: Gaëtan Maisse <gaetanmaisse@gmail.com>
Issue: When inquirer was replaced with prompts in #13226,
sb init
had a bug that wouldn't display a list of installable projects when no framework was detected.What I did
Set the correct prompt type in the prompt function.
Result of
sb init
in @next:Result of
sb init
with this PR:How to test
1 -
yarn build cli
1 - create a folder with just a package.json like with
npm init
2 - run
node ../../storybook/lib/cli/dist/esm/generate init
(adjust the path to where you folder will be)