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: Fix init help for storybook command #29480

Merged

Conversation

toothlessdev
Copy link
Contributor

@toothlessdev toothlessdev commented Oct 29, 2024

Fixes part of #29276

What I did

  • Add test code for common CLI commands help
  • Add init command to common CLI commands help

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 78.2 MB 78.2 MB 0 B 0.98 0%
initSize 143 MB 143 MB 0 B 1.06 0%
diffSize 65.2 MB 65.2 MB 0 B 0.61 0%
buildSize 6.88 MB 6.88 MB 0 B 1.22 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B 0.58 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.9 MB 1.9 MB 0 B 1.22 0%
buildSbPreviewSize 271 kB 271 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.88 MB 3.88 MB 0 B 1.22 0%
buildPreviewSize 3 MB 3 MB 0 B - 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 7.6s 22.6s 15s 1.22 66.4%
generateTime 23.4s 19.3s -4s -167ms -0.73 -21.6%
initTime 16.9s 14.2s -2s -714ms -0.85 -19%
buildTime 11s 7.9s -3s -76ms -0.91 -38.6%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.3s 6.4s 1.1s 0.92 17.6%
devManagerResponsive 3.3s 4s 796ms 1.3 🔺19.4%
devManagerHeaderVisible 560ms 602ms 42ms 0.55 7%
devManagerIndexVisible 633ms 694ms 61ms 0.84 8.8%
devStoryVisibleUncached 945ms 1.3s 395ms 1.35 🔺29.5%
devStoryVisible 627ms 689ms 62ms 1.03 9%
devAutodocsVisible 519ms 504ms -15ms -0.28 -3%
devMDXVisible 482ms 610ms 128ms 1.08 21%
buildManagerHeaderVisible 703ms 704ms 1ms 1.74 0.1%
buildManagerIndexVisible 725ms 714ms -11ms 1.56 -1.5%
buildStoryVisible 704ms 702ms -2ms 1.74 -0.3%
buildAutodocsVisible 566ms 507ms -59ms 0.66 -11.6%
buildMDXVisible 596ms 589ms -7ms 2.07 -1.2%

Greptile Summary

Added the 'init' command and related tests to the Storybook CLI help output, ensuring users can see initialization options when running storybook --help.

  • Added init command to code/lib/cli-storybook/src/bin/index.ts with options for package manager, builder, and initialization preferences
  • Added test coverage in code/lib/cli-storybook/test/default/cli.test.cjs to verify init command appears in help output
  • Fixed missing documentation for core CLI commands (init, dev, build) in help text
  • Integrated with existing telemetry and error handling patterns

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile

code/lib/cli-storybook/src/bin/index.ts Outdated Show resolved Hide resolved
code/lib/cli-storybook/src/bin/index.ts Outdated Show resolved Hide resolved
code/lib/cli-storybook/test/default/cli.test.cjs Outdated Show resolved Hide resolved
code/lib/cli-storybook/test/default/cli.test.cjs Outdated Show resolved Hide resolved
@shilman shilman changed the title Add init common cli command CLI: Fix init help for storybook command Nov 4, 2024
Copy link

nx-cloud bot commented Nov 11, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 0ec7128. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Nov 11, 2024

Package Benchmarks

Commit: 0ec7128, ran on 13 November 2024 at 00:51:03 UTC

No significant changes detected, all good. 👏

@kasperpeulen kasperpeulen merged commit 28b94f8 into storybookjs:next Nov 14, 2024
55 checks passed
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.

4 participants