-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,17 @@ export default defineConfig({ | |
| NODE_ENV: 'test', | ||
| }, | ||
|
|
||
| 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', | ||
| ], | ||
|
Comment on lines
+9
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainLGTM! Projects setup replaces deprecated workspaces. The 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 Update the projects array to include named configurations: This ensures 🤖 Prompt for AI Agents |
||
|
|
||
| coverage: { | ||
| all: false, | ||
| provider: 'istanbul', | ||
|
|
||
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.workspacetovitest.sharedaligns with the PR's objective to migrate away from deprecated Vitest workspaces.Please verify that:
vitest.sharedmodule correctly exportsvitestCommonConfigvitest.workspacehave been updated across the codebase🏁 Script executed:
Length of output: 1502
🌐 Web query:
💡 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:
Incomplete Vitest workspace migration — multiple references still need updating.
Verification confirms that while
vitest.sharedcorrectly exportsvitestCommonConfigand Vitest workspaces are indeed deprecated (since 3.2), the migration is incomplete. The codebase still contains 12+ active references tovitest.workspacethat must be updated to complete the deprecation migration:These files reference the deprecated workspace pattern and should be updated to use
test.projectsinstead. Complete the migration before this PR can be merged.