Skip to content

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

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-1256
Apr 2, 2026
Merged

fix(migration): add vitest to devDependencies for peer dep resolution#1261
graphite-app[bot] merged 1 commit intomainfrom
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


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.

@fengmk2 fengmk2 force-pushed the fix-1256 branch 4 times, most recently from cf88a62 to fe717ea Compare April 1, 2026 14:38
@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
@fengmk2 fengmk2 marked this pull request as ready for review April 2, 2026 01:04
@fengmk2 fengmk2 requested review from branchseer, cpojer and kazupon April 2, 2026 01:05
Copy link
Copy Markdown
Member

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬 This is a bit shaky, but I guess it's good enough.

@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 2, 2026

I will continue to pay attention to similar issues and hope to find a better solution later. 😢

@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Apr 2, 2026

Merge activity

…#1261)

## 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

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

Closes #1256

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the real-node-off-mode branch from 0d4e245 to cb849cd Compare April 2, 2026 05:55
Base automatically changed from real-node-off-mode to main April 2, 2026 06:01
@graphite-app graphite-app bot merged commit 88cb5d3 into main Apr 2, 2026
65 checks passed
@graphite-app graphite-app bot deleted the fix-1256 branch April 2, 2026 06:01
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.

vite-plus/test module identities break vitest type augmentations

2 participants