fix(create): keep aliased vite in pnpm monorepo website so override stays effective#1728
Merged
Merged
Conversation
…tays effective `vp create vite:monorepo` stripped vite/vitest from apps/website for every package manager. For pnpm this removed the only direct `vite` dependency, so the pnpm-workspace.yaml `overrides.vite: catalog:` entry had no consumer and `vp why vite` resolved to upstream vite instead of @voidzero-dev/vite-plus-core, making the override look ineffective. Skip the strip for pnpm so the workspace override has a direct consumer. npm, yarn, and bun are unaffected: their root overrides/resolutions redirect the transitive/peer vite to @voidzero-dev/vite-plus-core regardless of a direct dep (verified), so they keep dropping the dead-weight keys.
✅ Deploy Preview for viteplus-preview canceled.
|
…ompt The migration prompt told agents to "remove old vite and vitest dependencies" after rewriting imports. On pnpm that direct (aliased) entry is what gives the pnpm-workspace.yaml `overrides.vite: catalog:` a consumer to redirect, so removing it makes `vp why vite` report upstream vite and the override look ineffective. Reword the prompt (in both docs/guide/migrate.md and the CLI-printed copy) to keep the aliased entries on pnpm; other package managers can still drop them once import rewrites are confirmed. Regenerate the two migration snap tests that capture the printed prompt.
Contributor
|
✅ Staging deployment successful! Preview: https://viteplus-staging.void.app/ |
Member
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 16f7d45. Configure here.
cpojer
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In a monorepo created via
vp create vite:monorepowith pnpm, runningvp why vitereported the override as ineffective: it resolvedviteto upstreamvite(a transitive dependency of@voidzero-dev/vite-plus-core) rather than to@voidzero-dev/vite-plus-coreitself.Root cause
PR #1697 added
dropAliasedRuntimeDevDeps, which stripsvite/vitestfromapps/website/package.jsonfor every package manager. For pnpm this removed the only directvitedependency in a fresh workspace, so thepnpm-workspace.yamloverrides.vite: catalog:entry had no consumer to redirect. The onlyviteleft in the tree was vite-plus-core's own internalvite, sovp why viteshowed upstream vite and the override looked ineffective. The single-package app keepsvite: catalog:and resolves correctly.npm / yarn / bun: confirmed not affected (no fix needed)
I verified their override is effective in both single-app and monorepo:
node_modules/viteresolves to@voidzero-dev/vite-plus-core, and<pm> why @voidzero-dev/vite-plus-coreshows it redirecting even vite-plus-test's peervite. Their rootoverrides/resolutionsredirect the transitive/peerviteregardless of a direct dependency. Theirvp why vitedisplay gap is a pre-existing limitation ofnpm explain/yarn why/bun why(they query by resolved package name, not thevitealias key), identical with or without the monorepo strip, so it is out of scope here.Fix
dropAliasedRuntimeDevDepsnow returns early for pnpm, keeping the aliasedvite/vitestso the workspace override has a direct consumer. npm/yarn/bun keep stripping the dead-weight keys.Before / after (
vp why vitein a fresh pnpm monorepo)Before:
After:
Verification
packages/cli/src/create/__tests__/monorepo.spec.ts: failed for pnpm before the fix (vite stripped), now passes 4/4 (pnpm keeps, npm/yarn/bun drop).vp create vite:monorepo+vp why vitenow resolves to@voidzero-dev/vite-plus-core.new-vite-monoreporegenerated (website now keepsvite: catalog:);new-vite-monorepo-bununchanged.test-vp-create.ymlassertion made pnpm-aware: pnpm must keepvite; npm/yarn/bun must dropvite/vitest.Note
Low Risk
Scoped to monorepo scaffold post-processing and documentation; behavior change is intentional and covered by unit, snap, and CI checks.
Overview
pnpm monorepo create no longer strips aliased
vite/vitestfromapps/website/package.json. The logic moves into exporteddropAliasedRuntimeDevDeps, which returns early for pnpm so workspaceoverridesstill have a directviteconsumer (fixing misleadingvp why viteaftervp create vite:monorepo). npm, yarn, and bun still remove those keys after migration.Migration guidance is updated in
docs/guide/migrate.md,vp migratehelp, and snap tests to say: on pnpm, keep migrator-aliasedvite/vitest; on other package managers, remove them after import rewrites.CI (
test-vp-create.yml) now asserts pnpm keepsviteon the website app while other PMs must not. Newmonorepo.spec.tscovers pnpm vs npm/yarn/bun behavior;new-vite-monoreposnap expectsvite: catalog:on the website.Reviewed by Cursor Bugbot for commit 16f7d45. Configure here.