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

[Feature Request]: Support storybook init within an empty directory #22983

Closed
4 tasks
vanessayuenn opened this issue Jun 8, 2023 · 1 comment
Closed
4 tasks

Comments

@vanessayuenn
Copy link
Contributor

vanessayuenn commented Jun 8, 2023

Is your feature request related to a problem? Please describe

As it stands, the storybook init command is not meant to be run within an empty directory. While the documentation explicitly advises against using the command in this scenario, users often expect the init command to work similarly to other popular command-line tools' init commands. So let's support running storybook init in an empty directory to help new users streamline the initial setup process.

Describe the solution you'd like

Since we already have the storybook sandbox command that creates reproductions in templates of the users' choosing, I think we can leverage that to help new users bootstrap a working Storybook in an empty directory. The flow would go:

  1. Detect user ran init within an empty directory
  2. Run a modified version of storybook sandbox:
    • the "intro" and "outro" copy should change since they are currently designed for reproduction purposes only
    • output directory should default to root
    • a subset of existing templates
  3. Run storybook dev (and for react templates, run it with the onboarding flag) automatically after a successful init.

Unresolved Questions

  • How do we define "empty directory"?
  • Which templates do we want to make available?

Follow-up TODOs

(not officially in scope for this feature request but writing it down here so we don't forget)

  • Update documentation
  • Add npx storybook init prominently to the Storybook frontpage

Describe alternatives you've considered

No response

Are you able to assist to bring the feature to reality?

no

Additional context

No response

cc @shilman @yannbf

@vanessayuenn
Copy link
Contributor Author

already done

@vanessayuenn vanessayuenn closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants