-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Build: Use projects instead of workspaces in Vitest #33080
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
Conversation
|
View your CI Pipeline Execution ↗ for commit e2ff8a1
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughApproximately 40 vitest configuration files across the monorepo update their import source for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (7)
code/frameworks/svelte-vite/vitest.config.ts (1)
3-3: LGTM!Import path update is consistent with the migration from deprecated
workspacestoprojectsin Vitest.code/addons/docs/vitest.config.ts (1)
3-3: LGTM!Import path correctly updated to use the shared configuration module.
code/renderers/server/vitest.config.ts (1)
3-3: LGTM!Import path update aligns with the repository-wide refactor.
code/renderers/react/vitest.config.ts (1)
3-3: LGTM!Import path correctly updated. The additional
test.setupFilesconfiguration is properly preserved.code/builders/builder-vite/vitest.config.ts (1)
3-3: LGTM!Import path update is correct and consistent.
code/lib/create-storybook/vitest.config.ts (1)
3-3: LGTM!Import path correctly updated to reference the shared configuration.
code/renderers/svelte/vitest.config.ts (1)
3-3: LGTM!Import path correctly updated. The Svelte-specific plugins and test environment configuration are properly preserved.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (40)
code/addons/a11y/vitest.config.ts(1 hunks)code/addons/docs/vitest.config.ts(1 hunks)code/addons/links/vitest.config.ts(1 hunks)code/addons/onboarding/vitest.config.ts(1 hunks)code/addons/pseudo-states/vitest.config.ts(1 hunks)code/addons/themes/vitest.config.ts(1 hunks)code/addons/vitest/vitest.config.ts(1 hunks)code/builders/builder-vite/vitest.config.ts(1 hunks)code/builders/builder-webpack5/vitest.config.ts(1 hunks)code/core/vitest.config.ts(1 hunks)code/frameworks/angular/vitest.config.ts(1 hunks)code/frameworks/ember/vitest.config.ts(1 hunks)code/frameworks/nextjs-vite/vitest.config.ts(1 hunks)code/frameworks/nextjs/vitest.config.ts(1 hunks)code/frameworks/preact-vite/vitest.config.ts(1 hunks)code/frameworks/react-native-web-vite/vitest.config.ts(1 hunks)code/frameworks/react-vite/vitest.config.ts(1 hunks)code/frameworks/react-webpack5/vitest.config.ts(1 hunks)code/frameworks/server-webpack5/vitest.config.ts(1 hunks)code/frameworks/svelte-vite/vitest.config.ts(1 hunks)code/frameworks/sveltekit/vitest.config.ts(1 hunks)code/frameworks/vue3-vite/vitest.config.ts(1 hunks)code/frameworks/web-components-vite/vitest.config.ts(1 hunks)code/lib/cli-sb/vitest.config.ts(1 hunks)code/lib/cli-storybook/vitest.config.ts(1 hunks)code/lib/codemod/vitest.config.ts(1 hunks)code/lib/core-webpack/vitest.config.ts(1 hunks)code/lib/create-storybook/vitest.config.ts(1 hunks)code/lib/csf-plugin/vitest.config.ts(1 hunks)code/presets/server-webpack/vitest.config.ts(1 hunks)code/renderers/html/vitest.config.ts(1 hunks)code/renderers/preact/vitest.config.ts(1 hunks)code/renderers/react/vitest.config.ts(1 hunks)code/renderers/server/vitest.config.ts(1 hunks)code/renderers/svelte/vitest.config.ts(1 hunks)code/renderers/vue3/vitest.config.ts(1 hunks)code/renderers/web-components/vitest.config.ts(1 hunks)code/vitest-storybook.config.mts(1 hunks)code/vitest.config.ts(1 hunks)code/vitest.shared.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-01T15:24:01.060Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32594
File: code/core/src/components/components/Popover/WithPopover.tsx:7-9
Timestamp: 2025-10-01T15:24:01.060Z
Learning: In the Storybook repository, "react-aria-components/patched-dist/*" (e.g., "react-aria-components/patched-dist/Dialog", "react-aria-components/patched-dist/Popover", "react-aria-components/patched-dist/Tooltip") are valid import paths created by a patch applied to the react-aria-components package. These imports should not be flagged as broken or invalid until a maintainer explicitly states they are no longer acceptable.
Applied to files:
code/addons/a11y/vitest.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
- GitHub Check: get-parameters
🔇 Additional comments (34)
code/builders/builder-webpack5/vitest.config.ts (1)
3-7: Import path update aligns with shared Vitest config refactorThe new
vitestCommonConfigimport from../../vitest.sharedis consistent with the repo-wide move offvitest.workspace; no further changes needed here.code/addons/themes/vitest.config.ts (1)
3-7: Shared config import looks correctSwitching
vitestCommonConfigto../../vitest.sharedmatches the new shared Vitest configuration pattern and keeps the rest of the config intact.code/addons/links/vitest.config.ts (1)
3-7: Consistent use ofvitest.sharedfor links addonThe updated
vitestCommonConfigimport from../../vitest.sharedis consistent with other addons and should preserve behavior.code/frameworks/nextjs-vite/vitest.config.ts (1)
3-7: Framework config correctly points to shared Vitest configImporting
vitestCommonConfigfrom../../vitest.sharedkeeps this Next.js Vite config aligned with the global Vitest setup.code/frameworks/react-vite/vitest.config.ts (1)
3-7: React Vite config import change looks goodThe switch to
../../vitest.sharedforvitestCommonConfigis correct and consistent with other framework configs.code/addons/vitest/vitest.config.ts (1)
3-7: Addon Vitest config now uses shared base configUpdating
vitestCommonConfigto come from../../vitest.sharedmatches the rest of the addons and should behave identically.code/vitest-storybook.config.mts (1)
7-24: Storybook Vitest config correctly switched tovitest.sharedUsing
vitestCommonConfigfrom./vitest.sharedkeeps this Storybook-specific setup aligned with the new shared Vitest configuration.code/addons/pseudo-states/vitest.config.ts (1)
3-13: Pseudo-states addon now correctly uses shared Vitest configThe
vitestCommonConfigimport from../../vitest.sharedlooks correct and keeps the existingtest.typecheckoverrides intact.code/frameworks/react-native-web-vite/vitest.config.ts (1)
3-3: Verification confirms the import path update is correct.The script confirms that:
code/vitest.shared.tsproperly exportsvitestCommonConfig- No remaining imports from the deprecated
vitest.workspaceexist in active TypeScript code- The only remaining reference to
vitest.workspaceis in a template file, which is expectedThe change from
vitest.workspacetovitest.sharedis complete and consistent across the codebase.code/addons/onboarding/vitest.config.ts (1)
3-3: LGTM! Clean migration to shared config.The import path update from
vitest.workspacetovitest.sharedis correct and aligns with the migration away from deprecated Vitest workspaces to the new projects-based approach.code/renderers/preact/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.The change properly references the new shared configuration source, consistent with the workspace deprecation migration.
code/frameworks/react-webpack5/vitest.config.ts (1)
3-3: LGTM! Consistent refactor.Import source properly updated to use the shared configuration module.
code/lib/cli-storybook/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.The migration to
vitest.sharedis properly implemented.code/frameworks/vue3-vite/vitest.config.ts (1)
3-3: LGTM! Migration completed correctly.The import source has been properly updated. The usage of Vitest 3.2.4 should fully support the new projects-based configuration.
code/renderers/vue3/vitest.config.ts (1)
5-5: LGTM! Import correctly updated.The shared configuration import is properly updated, and the Vue plugin integration remains unchanged.
code/frameworks/angular/vitest.config.ts (1)
3-3: LGTM! Import path properly updated.The shared config import is correct, and the Angular-specific test configuration (globals and setupFiles) remains properly structured.
code/lib/cli-sb/vitest.config.ts (1)
3-3: All vitest config files correctly updated across the monorepo.Verification confirms:
- 38 files import
vitestCommonConfig(matches the ~40 mentioned in summary)- All imports correctly reference
vitest.shared(no incorrect paths found)vitest.sharedproperly exportsvitestCommonConfig- Changes are consistent across all affected files
The migration is complete. Test suite verification would need to be confirmed during CI/CD pipeline execution.
code/frameworks/ember/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/frameworks/nextjs/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/lib/core-webpack/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/presets/server-webpack/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/frameworks/server-webpack5/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/lib/csf-plugin/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/renderers/html/vitest.config.ts (1)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.code/lib/codemod/vitest.config.ts (2)
3-3: LGTM - Import path updated correctly.The import source change from
vitest.workspacetovitest.sharedaligns with the migration from Vitest's deprecated workspaces to the projects feature. The relative path is correct for this file location.
1-10: Migration successfully verified and complete.All verification checks passed:
- No remaining imports from
vitest.workspacevitestCommonConfigproperly exported fromcode/vitest.shared.ts- Root
vitest.config.tscorrectly configured withprojectsarray containing all workspace paths- Vitest 3.2.x supports the
projectsfeature and deprecates the old workspace configurationThe code changes are consistent with the official Vitest migration pattern.
code/renderers/web-components/vitest.config.ts (1)
3-3: LGTM! Clean import path migration.The import source change from
vitest.workspacetovitest.sharedaligns with the PR's objective to migrate from deprecated workspaces to projects. This pattern is consistently applied across all config files in this PR.code/core/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The change aligns with the repository-wide migration to
vitest.shared.code/frameworks/preact-vite/vitest.config.ts (1)
3-3: LGTM! Consistent with the workspace-to-projects migration.code/frameworks/web-components-vite/vitest.config.ts (1)
3-3: LGTM! Import path migration applied correctly.code/addons/a11y/vitest.config.ts (1)
3-3: LGTM! Import updated to use shared config.code/frameworks/sveltekit/vitest.config.ts (1)
3-3: LGTM! Import path change is correct.code/vitest.shared.ts (2)
3-3: LGTM! Correct transition from workspace to single config.The change from
defineWorkspacetodefineConfigis the key part of migrating away from Vitest's deprecated workspaces feature. The shared configuration export remains compatible with all importing configs.
16-33: Configuration structure looks good.The
vitestCommonConfigexport provides sensible defaults for the monorepo: thread pooling with CI-aware thread counts, test timeouts, and shared setup files.
| projects: [ | ||
| 'vitest-storybook.config.mts', | ||
| 'addons/*/vitest.config.ts', | ||
| 'frameworks/*/vitest.config.ts', | ||
| 'lib/*/vitest.config.ts', | ||
| 'core/vitest.config.ts', | ||
| 'builders/*/vitest.config.ts', | ||
| 'presets/*/vitest.config.ts', | ||
| 'renderers/*/vitest.config.ts', | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
LGTM! Projects setup replaces deprecated workspaces.
The test.projects array correctly establishes the multi-project setup using glob patterns to discover individual configs. This is the standard approach for Vitest's projects feature.
Verify that all intended config files are matched by the glob patterns:
🏁 Script executed:
#!/bin/bash
# Description: Verify all vitest.config.ts files are covered by the projects patterns
echo "=== Checking project patterns coverage ==="
echo ""
# List all vitest config files
echo "All vitest config files in code directory:"
fd -e ts -e mts 'vitest.*config' code/ --type f
echo ""
echo "=== Files that should match project patterns ==="
echo "Pattern: vitest-storybook.config.mts"
fd 'vitest-storybook.config.mts' code/ --type f
echo ""
echo "Pattern: addons/*/vitest.config.ts"
fd 'vitest.config.ts' code/addons/ --max-depth 2 --type f
echo ""
echo "Pattern: frameworks/*/vitest.config.ts"
fd 'vitest.config.ts' code/frameworks/ --max-depth 2 --type f
echo ""
echo "Pattern: lib/*/vitest.config.ts"
fd 'vitest.config.ts' code/lib/ --max-depth 2 --type f
echo ""
echo "Pattern: core/vitest.config.ts"
fd 'vitest.config.ts' code/core/ --max-depth 1 --type f
echo ""
echo "Pattern: builders/*/vitest.config.ts"
fd 'vitest.config.ts' code/builders/ --max-depth 2 --type f
echo ""
echo "Pattern: presets/*/vitest.config.ts"
fd 'vitest.config.ts' code/presets/ --max-depth 2 --type f
echo ""
echo "Pattern: renderers/*/vitest.config.ts"
fd 'vitest.config.ts' code/renderers/ --max-depth 2 --type fLength of output: 3920
Gathering additional information to verify the coverage of named config files.
Add glob pattern for named vitest configs in lib packages
The pattern lib/*/vitest.config.ts does not match vitest.integration.config.ts files, which are valid Vitest configuration files that match the pattern (vite|vitest).*.config.*.
Update the projects array to include named configurations:
'lib/*/vitest.config.ts',
'lib/*/vitest.*.config.ts',
This ensures code/lib/eslint-plugin/vitest.integration.config.ts and similar named configs are recognized as projects.
🤖 Prompt for AI Agents
In code/vitest.config.ts around lines 9 to 18, the projects array only includes
'lib/*/vitest.config.ts' which misses named config files like
vitest.integration.config.ts; add an additional glob entry that matches named
Vitest config patterns (e.g., 'lib/*/vitest.*.config.ts') so both default and
named configs under lib/* are picked up; update the projects array to include
this new pattern alongside the existing one.
📝 WalkthroughWalkthroughThis PR refactors the Vitest configuration system across the codebase by consolidating shared configuration imports. All addon, builder, framework, library, preset, and renderer Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (6)
code/frameworks/nextjs/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.code/frameworks/react-webpack5/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.code/renderers/vue3/vitest.config.ts (1)
5-5: LGTM! Import path correctly updated.code/addons/pseudo-states/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.code/addons/vitest/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.code/lib/csf-plugin/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (40)
code/addons/a11y/vitest.config.ts(1 hunks)code/addons/docs/vitest.config.ts(1 hunks)code/addons/links/vitest.config.ts(1 hunks)code/addons/onboarding/vitest.config.ts(1 hunks)code/addons/pseudo-states/vitest.config.ts(1 hunks)code/addons/themes/vitest.config.ts(1 hunks)code/addons/vitest/vitest.config.ts(1 hunks)code/builders/builder-vite/vitest.config.ts(1 hunks)code/builders/builder-webpack5/vitest.config.ts(1 hunks)code/core/vitest.config.ts(1 hunks)code/frameworks/angular/vitest.config.ts(1 hunks)code/frameworks/ember/vitest.config.ts(1 hunks)code/frameworks/nextjs-vite/vitest.config.ts(1 hunks)code/frameworks/nextjs/vitest.config.ts(1 hunks)code/frameworks/preact-vite/vitest.config.ts(1 hunks)code/frameworks/react-native-web-vite/vitest.config.ts(1 hunks)code/frameworks/react-vite/vitest.config.ts(1 hunks)code/frameworks/react-webpack5/vitest.config.ts(1 hunks)code/frameworks/server-webpack5/vitest.config.ts(1 hunks)code/frameworks/svelte-vite/vitest.config.ts(1 hunks)code/frameworks/sveltekit/vitest.config.ts(1 hunks)code/frameworks/vue3-vite/vitest.config.ts(1 hunks)code/frameworks/web-components-vite/vitest.config.ts(1 hunks)code/lib/cli-sb/vitest.config.ts(1 hunks)code/lib/cli-storybook/vitest.config.ts(1 hunks)code/lib/codemod/vitest.config.ts(1 hunks)code/lib/core-webpack/vitest.config.ts(1 hunks)code/lib/create-storybook/vitest.config.ts(1 hunks)code/lib/csf-plugin/vitest.config.ts(1 hunks)code/presets/server-webpack/vitest.config.ts(1 hunks)code/renderers/html/vitest.config.ts(1 hunks)code/renderers/preact/vitest.config.ts(1 hunks)code/renderers/react/vitest.config.ts(1 hunks)code/renderers/server/vitest.config.ts(1 hunks)code/renderers/svelte/vitest.config.ts(1 hunks)code/renderers/vue3/vitest.config.ts(1 hunks)code/renderers/web-components/vitest.config.ts(1 hunks)code/vitest-storybook.config.mts(1 hunks)code/vitest.config.ts(1 hunks)code/vitest.shared.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
- GitHub Check: get-parameters
🔇 Additional comments (27)
code/renderers/web-components/vitest.config.ts (1)
3-3: Import path updated correctly.code/presets/server-webpack/vitest.config.ts (1)
3-3: Import path updated correctly.code/addons/docs/vitest.config.ts (1)
3-3: Import path updated correctly.code/frameworks/sveltekit/vitest.config.ts (1)
3-3: Import path updated correctly.code/frameworks/vue3-vite/vitest.config.ts (1)
3-3: Import path updated correctly.code/addons/links/vitest.config.ts (1)
3-3: Import path updated correctly.code/lib/cli-sb/vitest.config.ts (1)
3-3: Import path updated correctly.code/frameworks/react-vite/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.The import path change from
vitest.workspacetovitest.sharedis correct and aligns with the migration from deprecated workspaces to projects.code/core/vitest.config.ts (1)
3-3: LGTM! Import path correctly updated.The import path uses
../vitest.shared(one level up) which is correct for thecode/core/location.code/lib/csf-plugin/vitest.config.ts (1)
1-10: Let me gather more context on these references to understand if they're legitimate or if they indicate the migration is incomplete:Let me examine the specific contexts of these references to understand if they're migration code or if they indicate active usage:
No action required - migration verification complete.
Based on the script results:
✅ The workspace configuration was renamed to projects in Vitest 3.2, and this code correctly uses the shared config pattern with
vitest.shared.✅ The
code/vitest.shared.tsfile exists and properly exportsvitestCommonConfig.✅ The old
vitest.workspacefile does not exist in the repository.The references to
vitest.workspacethat appear throughout the codebase are intentional: they're in Storybook's postinstall migration logic and tests that detect old workspace files in user projects—not active imports of the old file. This is expected and correct for backward compatibility.The change to
vitest.config.tsatcode/lib/csf-plugin/is properly implemented using the new shared config approach.code/frameworks/server-webpack5/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration from workspace-based to shared configuration.
code/frameworks/web-components-vite/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration.
code/builders/builder-webpack5/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration.
code/frameworks/preact-vite/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration.
code/lib/core-webpack/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration.
code/addons/onboarding/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration.
code/renderers/svelte/vitest.config.ts (1)
3-3: LGTM! Import path updated correctly.The import source has been updated consistently with the repository-wide migration. The Svelte-specific plugin configuration remains properly integrated with the shared configuration.
code/addons/a11y/vitest.config.ts (1)
3-3: Import change verified and correct.The import path
'../../vitest.shared'properly resolves to the shared configuration file, which exportsvitestCommonConfigusingdefineConfig(). The a11y config correctly merges this shared configuration usingmergeConfig(), following Vitest's recommended pattern for the workspace-to-projects migration.code/lib/cli-storybook/vitest.config.ts (1)
3-3: Import update follows Vitest deprecation—verified and approved.Vitest deprecated the
workspaceoption since v3.2 in favor ofprojects, and this change correctly migrates away from that deprecated pattern. Thecode/vitest.shared.tsfile exists and properly exportsvitestCommonConfigusingdefineConfig, confirming the shared config setup is in place and ready.code/frameworks/nextjs-vite/vitest.config.ts (1)
3-3: Import source switch looks correctUsing
vitestCommonConfigfrom../../vitest.sharedkeeps the existing merge pattern and aligns this framework config with the shared setup; no issues spotted here.code/frameworks/ember/vitest.config.ts (1)
3-3: Consistent shared config importThe Ember Vitest config now pulls
vitestCommonConfigfrom../../vitest.shared, matching the other framework configs. Change looks good.code/renderers/server/vitest.config.ts (1)
3-3: Server renderer config aligned with shared sourceSwitching to
../../vitest.sharedforvitestCommonConfigkeeps this renderer in sync with the new shared Vitest configuration strategy.code/frameworks/svelte-vite/vitest.config.ts (1)
3-3: Shared config import update looks goodThe Svelte/Vite framework config now reuses
vitestCommonConfigfrom../../vitest.shared, consistent with the rest of the repo. No issues here.code/renderers/react/vitest.config.ts (1)
3-11: React renderer now reuses new shared config sourceOnly the
vitestCommonConfigimport source changed; the React-specifictest.setupFilesconfiguration is untouched, so behavior should be preserved while aligning withvitest.shared.code/builders/builder-vite/vitest.config.ts (1)
3-3: Builder Vite config now reuses shared Vitest configThe Vite builder’s tests now consume
vitestCommonConfigfrom../../vitest.shared, matching the new shared configuration pattern across the repo. Looks good.code/vitest.shared.ts (1)
3-33: Shared Vitest config is correct and follows documented patternsThe configuration shape is valid. The
defineConfigfromvitest/configcorrectly acceptstest.pool = 'threads',poolOptions.threads.{minThreads, maxThreads},setupFiles,globals, andenvironmentnested under the test key, and no additional top-level fields are needed. ImportingdefineConfigand exportingvitestCommonConfigfor consumption viamergeConfigin per-package configs is consistent with the documented pattern.code/vitest.config.ts (1)
9-18: No action needed — the configuration is already correctAccording to current Vitest documentation,
projectsis properly defined under thetestconfiguration (i.e.,test.projects), not as a top-level sibling. The code in this PR already follows the documented structure. The suggestion to moveprojectsto the top level is based on an incorrect assumption about Vitest's configuration schema and should be disregarded.Likely an incorrect or invalid review comment.
| import Inspect from 'vite-plugin-inspect'; | ||
|
|
||
| import { vitestCommonConfig } from './vitest.workspace'; | ||
| import { vitestCommonConfig } from './vitest.shared'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Import path updated correctly for Vitest migration.
The import source change from vitest.workspace to vitest.shared aligns with the PR's objective to migrate away from deprecated Vitest workspaces.
Please verify that:
- The
vitest.sharedmodule correctly exportsvitestCommonConfig - All references to
vitest.workspacehave been updated across the codebase - The Vitest workspaces feature is indeed deprecated
🏁 Script executed:
#!/bin/bash
# Verify no remaining references to vitest.workspace in config files
rg -n "vitest\.workspace" --type=ts --type=js
# Verify vitest.shared exports vitestCommonConfig
rg -n "export.*vitestCommonConfig" --type=ts code/vitest.shared.tsLength of output: 1502
🌐 Web query:
Is the workspaces feature deprecated in Vitest? What is the recommended migration path to projects?
💡 Result:
Short answer: Yes — the workspace option (and separate vitest.workspace file) is deprecated since Vitest 3.2 and you should migrate to the test.projects pattern. Replace your workspace file (or workspace setting) by moving its array into the root vitest.config (use test.projects). Example migration shown in the official guide. [1][2]
References:
- Config docs (workspace deprecated; use projects). [1]
- Migration guide showing move from vitest.workspace to test.projects in root vitest.config. [2]
Incomplete Vitest workspace migration — multiple references still need updating.
Verification confirms that while vitest.shared correctly exports vitestCommonConfig and Vitest workspaces are indeed deprecated (since 3.2), the migration is incomplete. The codebase still contains 12+ active references to vitest.workspace that must be updated to complete the deprecation migration:
- scripts/tasks/sandbox-parts.ts:500
- code/lib/create-storybook/src/ink/steps/checks/vitestConfigFiles.tsx:102
- code/lib/create-storybook/src/ink/steps/checks/vitestConfigFiles.test.ts:79, 82, 127, 131
- code/addons/vitest/src/node/vitest-manager.ts:79
- code/addons/vitest/src/postinstall.ts:380, 407
- code/addons/vitest/src/updateVitestFile.test.ts:1059, 1115
These files reference the deprecated workspace pattern and should be updated to use test.projects instead. Complete the migration before this PR can be merged.
Closes #
What I did
Simple refactor to stop using
workspacesand useprojectsinstead, as workspaces is deprecated in Vitest.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake 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/coreteam 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