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: Add "intents" question & auto-install test addon & improve test-addon compatibility #30202

Open
wants to merge 192 commits into
base: next
Choose a base branch
from

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Jan 7, 2025

Closes #

What I did

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-storybook/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 pull request has been released as version 0.0.0-pr-30202-sha-f7878745. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-30202-sha-f7878745
Triggered by @ndelangen
Repository storybookjs/storybook
Branch norbert/cli-with-ink
Commit f7878745
Datetime Tue Feb 4 21:08:52 UTC 2025 (1738703332)
Workflow run 13144868393

To request a new release of this pull request, mention the @storybookjs/core team.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 78.3 MB 78 MB -308 kB -0.31 -0.4%
initSize 132 MB 131 MB -551 kB -0.69 -0.4%
diffSize 53.2 MB 53 MB -243 kB -1.73 -0.5%
buildSize 7.22 MB 7.17 MB -48.1 kB -0.23 -0.7%
buildSbAddonsSize 1.87 MB 1.85 MB -25.5 kB -0.23 -1.4%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.86 MB -14.1 kB -0.23 -0.8%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.95 MB 3.91 MB -39.5 kB -0.23 -1%
buildPreviewSize 3.27 MB 3.26 MB -8.52 kB -0.22 -0.3%
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 21.7s 8.6s -13s -149ms -1.52 🔰-152.4%
generateTime 20.7s 18s -2s -795ms -1.13 -15.5%
initTime 12.6s 11.2s -1s -433ms -1.11 -12.8%
buildTime 8.7s 13.3s 4.5s 3.74 🔺34.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.6s 4.7s -1s -934ms -0.96 -41.1%
devManagerResponsive 4.7s 3.6s -1s -167ms -0.74 -32.1%
devManagerHeaderVisible 982ms 654ms -328ms -1.11 -50.2%
devManagerIndexVisible 1s 663ms -337ms -1.55 🔰-50.8%
devStoryVisibleUncached 4.5s 2.4s -2s -94ms -2.87 🔰-84.9%
devStoryVisible 1s 681ms -389ms -1.4 🔰-57.1%
devAutodocsVisible 921ms 599ms -322ms -1.44 🔰-53.8%
devMDXVisible 883ms 614ms -269ms -1.18 -43.8%
buildManagerHeaderVisible 1s 891ms -195ms 0.95 -21.9%
buildManagerIndexVisible 1s 963ms -134ms 0.74 -13.9%
buildStoryVisible 843ms 879ms 36ms 1.65 4.1%
buildAutodocsVisible 761ms 860ms 99ms 2.15 🔺11.5%
buildMDXVisible 713ms 870ms 157ms 3.19 🔺18%

Greptile Summary

This PR significantly enhances the Storybook CLI with new features for test addon integration and improved framework compatibility checks.

  • Added new "intents" question during initialization to determine if users plan to use Storybook for development, documentation, or testing in code/lib/create-storybook/src/initiate.ts
  • Implemented framework compatibility checks for test addon in code/lib/create-storybook/src/ink/steps/checks/frameworkTest.tsx
  • Added Vitest configuration validation and auto-setup in code/lib/create-storybook/src/ink/steps/checks/vitestConfigFiles.tsx
  • Modernized CLI architecture with Zod validation and TypeScript improvements in code/lib/create-storybook/src/bin/modernInputs.ts
  • Switched from CommonJS to ESM modules across CLI packages with proper error handling

The changes look comprehensive but the commented-out render functions in several new files suggest some UI components may not be fully implemented yet.

Copy link

nx-cloud bot commented Jan 7, 2025

View your CI Pipeline Execution ↗ for commit baec739.

Command Status Duration Result
nx affected -t check -c production --parallel=7 ✅ Succeeded <1s View ↗
nx run-many -t build -c production --parallel=3 ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-05 09:58:30 UTC

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Jan 7, 2025

Package Benchmarks

Commit: baec739, ran on 5 February 2025 at 10:05:55 UTC

The following packages have significant changes to their size or dependencies:

@storybook/addon-a11y

Before After Difference
Dependency count 56 59 🚨 +3 🚨
Self size 332 KB 228 KB 🎉 -104 KB 🎉
Dependency size 12.71 MB 13.47 MB 🚨 +755 KB 🚨
Bundle Size Analyzer Link Link

@storybook/core

Before After Difference
Dependency count 54 54 0
Self size 19.22 MB 18.98 MB 🎉 -240 KB 🎉
Dependency size 14.44 MB 14.44 MB 0 B
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 55 55 0
Self size 22 KB 23 KB 🚨 +1 KB 🚨
Dependency size 33.66 MB 33.42 MB 🎉 -240 KB 🎉
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 56 56 0
Self size 1 KB 1 KB 0 B
Dependency size 33.68 MB 33.44 MB 🎉 -239 KB 🎉
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 388 359 🎉 -29 🎉
Self size 503 KB 261 KB 🎉 -242 KB 🎉
Dependency size 75.54 MB 83.84 MB 🚨 +8.30 MB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 277 277 0
Self size 617 KB 617 KB 0 B
Dependency size 65.62 MB 65.38 MB 🎉 -240 KB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 113 7 🎉 -106 🎉
Self size 1.11 MB 10.27 MB 🚨 +9.16 MB 🚨
Dependency size 42.79 MB 2.24 MB 🎉 -40.55 MB 🎉
Bundle Size Analyzer Link Link

@ndelangen ndelangen self-assigned this Jan 8, 2025
ghengeveld and others added 30 commits February 3, 2025 10:12
… get replaced by the experimental-addon-test
…for our own CI, to be able to keep testing NextJS.

NOrmally the test intent would be enabled by default, but the postinstall would then migrate the nextjs framework to experimental-nextjs-vite framework, thus not allowing us to keep testing the nextjs framework.
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.

2 participants