Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Apr 4, 2025

Closes #

What I did

This PR adds a new autoblock that prevents users from upgrading to Storybook 9 if they have @storybook/experimental-addon-test installed and are using Vitest < 3. This is necessary because in Storybook 9, the experimental addon is being stabilized (renamed to @storybook/addon-vitest) and as part of this stabilization, we've dropped support for Vitest 2.

Changes

  • Added new autoblock block-experimental-addon-test.ts that:
    • Checks for presence of @storybook/experimental-addon-test in dependencies
    • Verifies Vitest version using package manager
    • Blocks upgrade if Vitest < 3.0.0 is detected
  • Added comprehensive test suite covering all scenarios
  • Added clear user messaging explaining the required actions

Testing

The changes include a test suite that verifies:

  • ✅ Returns false when experimental addon is not installed
  • ✅ Returns false when Vitest is not installed
  • ✅ Returns true (blocks) when Vitest < 3.0.0 is detected
  • ✅ Returns false when Vitest >= 3.0.0 is detected
  • ✅ Checks both dependencies and devDependencies
  • ✅ Provides clear user guidance in the log message

User Impact

When users with @storybook/experimental-addon-test and Vitest < 3 attempt to upgrade to Storybook 9, they will see a message explaining:

  • That the addon is being stabilized in Storybook 9
  • The new name of the addon (@storybook/addon-vitest)
  • Their options:
    1. Remove the experimental addon if not needed
    2. Upgrade to Vitest 3 to continue using the addon

image

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-31068-sha-6e3bb0f4. 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-31068-sha-6e3bb0f4
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/introduce-experimental-addon-test-autoblock
Commit 6e3bb0f4
Datetime Fri Apr 4 09:22:54 UTC 2025 (1743758574)
Workflow run 14262219854

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=31068

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.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Apr 4, 2025

View your CI Pipeline Execution ↗ for commit 6cc4481.

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

☁️ Nx Cloud last updated this comment at 2025-04-04 10:00:55 UTC

@valentinpalkovic valentinpalkovic force-pushed the valentin/introduce-experimental-addon-test-autoblock branch from 2dc180b to 6e3bb0f Compare April 4, 2025 09:21
… readability. Mock picocolors in tests to ensure consistent output.
@valentinpalkovic valentinpalkovic merged commit cff3858 into next Apr 4, 2025
50 of 53 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/introduce-experimental-addon-test-autoblock branch April 4, 2025 11:30
@github-actions github-actions bot mentioned this pull request Apr 4, 2025
9 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