Skip to content

fix(migration): add vitest to devDependencies for peer dep resolution#1261

Draft
fengmk2 wants to merge 1 commit intoreal-node-off-modefrom
fix-1256
Draft

fix(migration): add vitest to devDependencies for peer dep resolution#1261
fengmk2 wants to merge 1 commit intoreal-node-off-modefrom
fix-1256

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 1, 2026

Summary

  • When migrating projects that have packages with vitest in their name (e.g., vitest-browser-svelte), the migration now adds vitest to devDependencies. Without this, pnpm resolves the real vitest@4.x for peer deps instead of the aliased @voidzero-dev/vite-plus-test, causing third-party type augmentations (like page.render() from vitest-browser-svelte) to target the wrong module and fail type checking.
  • Add vite-plus-vitest-type-aug reproduction project to ecosystem-ci for ongoing regression testing.
  • Add snap test migration-vitest-peer-dep to verify the migration behavior.

Test plan

  • Snap test migration-vitest-peer-dep verifies vitest is added to devDependencies when vitest-browser-svelte is present
  • Ecosystem-ci vite-plus-vitest-type-aug passes vp check --fix locally with 0 type errors

Closes #1256

🤖 Generated with Claude Code

@fengmk2 fengmk2 self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 1, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

When migrating projects that have packages with vitest as a peer
dependency (e.g., vitest-browser-svelte), the migration now ensures
vitest is added to devDependencies. Without this, pnpm resolves the
real vitest@4.x for peer deps instead of the aliased
@voidzero-dev/vite-plus-test, causing third-party type augmentations
(like page.render() from vitest-browser-svelte) to target the wrong
module and fail type checking.

Also add vite-plus-vitest-type-aug reproduction project to ecosystem-ci
for ongoing regression testing, and exclude build scripts from lint type
checking.

Closes #1256
@fengmk2 fengmk2 changed the title fix(test): rewrite bare vitest specifiers in .d.ts files for type augmentation compatibility fix(migration): add vitest to devDependencies for peer dep resolution Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant