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: Run storybook dev as part of storybook init #22928

Merged
merged 12 commits into from
Jun 13, 2023
Merged

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Jun 5, 2023

Closes #22871

What I did

  • add --initial-path option to the CLI
  • run storybook dev as part of storybook init

How to test

  1. Build all packages
  2. Create a new project with the CLI e.g. ./code/lib/cli/bin/index.js init --initial-path=/settings/shortcuts
  3. Expect Storybook to open in that route

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 ci: do not merge cli patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jun 5, 2023
@yannbf yannbf requested a review from a team as a code owner June 5, 2023 16:10
@yannbf yannbf force-pushed the feat/initial-paths-cli-flag branch from 01c0b8d to 4cfd5da Compare June 6, 2023 10:19
@yannbf yannbf force-pushed the feat/initial-paths-cli-flag branch from 05f448d to ac9fc72 Compare June 6, 2023 14:05
code/lib/cli/src/initiate.ts Outdated Show resolved Hide resolved
@yannbf yannbf changed the title CLI: run storybook dev as part of storybook init CLI: Run storybook dev as part of storybook init Jun 8, 2023
@yannbf yannbf added feature request and removed patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jun 8, 2023
process.env.CI !== 'true' &&
process.env.IN_STORYBOOK_SANDBOX !== 'true';
if (shouldRunDev) {
logger.log('\nRunning Storybook');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running Storybook automatically. To run it manually, use the following command: xyz

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add it in a box

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shilman @jonniebigodes here's how it looks like after the change:

For Vite:
image

For Angular Webpack (the most verbose we have):
image

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'm sure we can clean all this up if we rework the CLI, but for now I'd say ship it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Project - Onboarding]: Automate call to storybook dev <url-params> after storybook init
6 participants