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

Addon Test: Add prerequisite check for MSW #30193

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Jan 6, 2025

Closes #

What I did

This PR does two things:

  • Addon Test postinstall: Add prerequisite check for MSW <2.0.0 if it is present in a project
  • CLI's add command: respect the --yes flag when addon is already installed

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 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 77.8 MB 77.8 MB -5.16 kB 0.51 0%
initSize 131 MB 131 MB -5.16 kB -1.73 0%
diffSize 53 MB 53 MB 0 B -1.73 0%
buildSize 7.19 MB 7.19 MB 0 B -0.49 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B -0.48 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B 0.82 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB 0 B -0.47 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B -4.36 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 6.5s 6.6s 157ms -0.84 2.3%
generateTime 19.2s 20s 773ms -0.05 3.9%
initTime 13.2s 12.7s -532ms -0.79 -4.2%
buildTime 11.1s 8.1s -2s -946ms -1.1 -36.1%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.9s 4.8s -76ms -0.57 -1.6%
devManagerResponsive 3.6s 3.4s -171ms -0.97 -5%
devManagerHeaderVisible 728ms 603ms -125ms -0.46 -20.7%
devManagerIndexVisible 768ms 630ms -138ms -0.46 -21.9%
devStoryVisibleUncached 2s 1s -925ms -1.94 🔰-85.3%
devStoryVisible 767ms 631ms -136ms -0.64 -21.6%
devAutodocsVisible 599ms 448ms -151ms -1.75 🔰-33.7%
devMDXVisible 567ms 501ms -66ms -0.7 -13.2%
buildManagerHeaderVisible 553ms 518ms -35ms -1.35 🔰-6.8%
buildManagerIndexVisible 643ms 602ms -41ms -1.33 🔰-6.8%
buildStoryVisible 534ms 501ms -33ms -1.44 🔰-6.6%
buildAutodocsVisible 543ms 433ms -110ms -1.2 -25.4%
buildMDXVisible 456ms 444ms -12ms -0.82 -2.7%

Greptile Summary

Based on the provided information, I'll create a concise summary of the PR changes:

Adds MSW version compatibility check to Storybook Test addon installation process and improves the CLI's addon installation behavior with respect to the --yes flag.

  • Added prerequisite check in code/addons/test/src/postinstall.ts to ensure MSW version ≥2.0.0 if installed
  • Modified code/lib/cli-storybook/src/add.ts to respect --yes flag when reinstalling existing addons
  • Added separator line between error messages for better readability
  • Improved error message formatting for package incompatibilities

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, 1 comment(s)
Edit PR Review Bot Settings | Greptile

code/addons/test/src/postinstall.ts Outdated Show resolved Hide resolved
Copy link

nx-cloud bot commented Jan 6, 2025

View your CI Pipeline Execution ↗ for commit 987d698.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 5s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-06 17:50:07 UTC

@JReinhold JReinhold merged commit 125bdd3 into next Jan 8, 2025
59 of 60 checks passed
@JReinhold JReinhold deleted the yann/addon-test-postinstall-msw-fix branch January 8, 2025 05:49
@github-actions github-actions bot mentioned this pull request Jan 8, 2025
8 tasks
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