Skip to content

Addon-Vitest: Support Vitest canaries#33833

Merged
valentinpalkovic merged 1 commit intonextfrom
valentin/support-canary-releases-of-vite
Feb 12, 2026
Merged

Addon-Vitest: Support Vitest canaries#33833
valentinpalkovic merged 1 commit intonextfrom
valentin/support-canary-releases-of-vite

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

@valentinpalkovic valentinpalkovic commented Feb 12, 2026

Closes #33832

What I did

When adding @storybook/addon-vitest to a project that uses a canary version of Vitest, the initialization/postinstall process failed. Now, Vitest canaries are supported during init.

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

Caution

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 publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • New Features
    • Vitest prerelease versions (such as 3.0.0-beta.1) are now fully supported, allowing development teams to test with beta builds without compatibility issues.
    • Vitest canary versions are now recognized as compatible, enabling seamless integration with the latest experimental development builds.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 12, 2026

Fails
🚫 The "#### Manual testing" section must be filled in. Please describe how to test the changes you've made, step by step, so that reviewers can confirm your PR works as intended.

Generated by 🚫 dangerJS against b6d6bf1

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Feb 12, 2026

View your CI Pipeline Execution ↗ for commit b6d6bf1

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ✅ Succeeded 9m 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-12 10:57:48 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The changes add support for Vitest canary and prerelease versions by introducing a canary version detection mechanism (checking if version starts with 0.0.0) in the validation logic, along with corresponding test cases to verify these versions are treated as compatible.

Changes

Cohort / File(s) Summary
Vitest Canary Version Support
code/core/src/cli/AddonVitestService.ts, code/core/src/cli/AddonVitestService.test.ts
Added canary version bypass using isCanary computed property that checks for 0.0.0 prefix; introduced two new test cases validating prerelease and canary versions are considered compatible when MSW is not installed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing touches
  • 📝 Generate docstrings

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@valentinpalkovic valentinpalkovic merged commit 992d908 into next Feb 12, 2026
130 of 135 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/support-canary-releases-of-vite branch February 12, 2026 13:46
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.

[Bug]: addon-vitest fails to initialize when using Vitest canary versions

2 participants