Skip to content

Core: Correctly fallback to first detected vitest config file#33865

Merged
yannbf merged 1 commit into
nextfrom
yann/vitest-workspace-detection
Mar 11, 2026
Merged

Core: Correctly fallback to first detected vitest config file#33865
yannbf merged 1 commit into
nextfrom
yann/vitest-workspace-detection

Conversation

@yannbf
Copy link
Copy Markdown
Member

@yannbf yannbf commented Feb 18, 2026

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

  1. Run Storybook in the monorepo
  2. Open Storybook in your browser
  3. Run tests via the widget
  4. It should work

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

  • Bug Fixes
    • Improved Vitest configuration discovery to correctly determine the workspace root directory when configuration files are present.

@yannbf yannbf self-assigned this Feb 18, 2026
@yannbf yannbf added bug patch:yes Bugfix & documentation PR that need to be picked to main branch core ci:merged Run the CI jobs that normally run when merged. labels Feb 18, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Feb 18, 2026

View your CI Pipeline Execution ↗ for commit 394c8a8

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ❌ Failed 10m 10s View ↗

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

In the Vitest config discovery process within vitest-manager.ts, the assignment of firstVitestConfig has been modified to store the directory path of the located config file instead of the file path itself, thereby adjusting the directory used for the fallback root determination.

Changes

Cohort / File(s) Summary
Vitest Config Discovery
code/addons/vitest/src/node/vitest-manager.ts
Modified config discovery logic to store the config file's directory instead of the file path in firstVitestConfig, affecting the fallback root location determination.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • storybookjs/storybook#33814 — Also modifies vitest-manager.ts to change directory-based root selection for Vitest config discovery.
✨ Finishing Touches
  • 📝 Generate docstrings

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

@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: 394c8a8, ran on 18 February 2026 at 10:48:18 UTC

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

@storybook/nextjs-vite

Before After Difference
Dependency count 94 92 🎉 -2 🎉
Self size 1.12 MB 1.12 MB 0 B
Dependency size 23.51 MB 22.34 MB 🎉 -1.17 MB 🎉
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 126 124 🎉 -2 🎉
Self size 30 KB 30 KB 🚨 +18 B 🚨
Dependency size 24.80 MB 23.62 MB 🎉 -1.17 MB 🎉
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 84 82 🎉 -2 🎉
Self size 35 KB 35 KB 0 B
Dependency size 21.29 MB 20.12 MB 🎉 -1.17 MB 🎉
Bundle Size Analyzer Link Link

@github-actions github-actions Bot added the Stale label Mar 2, 2026
@yannbf yannbf merged commit 943b2b6 into next Mar 11, 2026
181 of 189 checks passed
@yannbf yannbf deleted the yann/vitest-workspace-detection branch March 11, 2026 09:14
yannbf added a commit that referenced this pull request Mar 13, 2026
…ction

Core: Correctly fallback to first detected vitest config file
(cherry picked from commit 943b2b6)
@github-actions github-actions Bot mentioned this pull request Mar 13, 2026
5 tasks
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci:merged Run the CI jobs that normally run when merged. core patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants