Problem
When migrating a project that uses a pnpm default catalog: for its toolchain, vp migrate handles @vitest/* inconsistently with vitest:
- It injects a browser provider (
@vitest/browser-playwright) into the catalog, but references it as a concrete version in package.json instead of catalog:, leaving that catalog entry unused.
- It aligns a pre-existing
@vitest/* (@vitest/coverage-v8) to the bundled version as a concrete spec and does not move it into the catalog, even though vitest itself is catalog:.
Net effect: vitest is catalog:, but the @vitest/* packages are concrete, and one of them also carries a dead catalog entry.
Reproduction
fengmk2/npmx.dev#27, migrated with vite-plus 0.0.0-commit.fcd4a979bd79b8328dd3318e451fc135242c0e4b.
pnpm-workspace.yaml:
catalog:
vitest: 4.1.9
'@vitest/browser-playwright': 4.1.9 # added by migrate
root package.json:
{
"vitest": "catalog:",
"@vitest/browser-playwright": "4.1.9", // concrete, should be "catalog:"
"@vitest/coverage-v8": "4.1.9" // concrete, not in the catalog
}
The catalog's @vitest/browser-playwright entry is referenced by no package.
Expected
docs/guide/migrate-rules.md states: "When migration injects a provider into a catalog-capable project, it uses the preferred catalog and adds the provider at the bundled Vitest version." So:
- Bug:
@vitest/browser-playwright should be catalog: in package.json (matching the catalog entry the migrate already created), not a concrete spec.
- Consistency: for a catalog-managed toolchain, aligned lockstep
@vitest/* (e.g. @vitest/coverage-v8) arguably belong in the catalog too, referenced via catalog:, rather than a concrete spec that duplicates the version the catalog already tracks for vitest.
Suggested fix
- When injecting a browser provider into a catalog-capable project, write
catalog: in package.json (the catalog entry is already added).
- Consider catalog-izing aligned
@vitest/* lockstep packages when the toolchain is catalog-managed, so vitest and its ecosystem share one source of truth.
Problem
When migrating a project that uses a pnpm default
catalog:for its toolchain,vp migratehandles@vitest/*inconsistently withvitest:@vitest/browser-playwright) into the catalog, but references it as a concrete version in package.json instead ofcatalog:, leaving that catalog entry unused.@vitest/*(@vitest/coverage-v8) to the bundled version as a concrete spec and does not move it into the catalog, even thoughvitestitself iscatalog:.Net effect:
vitestiscatalog:, but the@vitest/*packages are concrete, and one of them also carries a dead catalog entry.Reproduction
fengmk2/npmx.dev#27, migrated with vite-plus
0.0.0-commit.fcd4a979bd79b8328dd3318e451fc135242c0e4b.pnpm-workspace.yaml:root
package.json:{ "vitest": "catalog:", "@vitest/browser-playwright": "4.1.9", // concrete, should be "catalog:" "@vitest/coverage-v8": "4.1.9" // concrete, not in the catalog }The catalog's
@vitest/browser-playwrightentry is referenced by no package.Expected
docs/guide/migrate-rules.mdstates: "When migration injects a provider into a catalog-capable project, it uses the preferred catalog and adds the provider at the bundled Vitest version." So:@vitest/browser-playwrightshould becatalog:in package.json (matching the catalog entry the migrate already created), not a concrete spec.@vitest/*(e.g.@vitest/coverage-v8) arguably belong in the catalog too, referenced viacatalog:, rather than a concrete spec that duplicates the version the catalog already tracks forvitest.Suggested fix
catalog:in package.json (the catalog entry is already added).@vitest/*lockstep packages when the toolchain is catalog-managed, sovitestand its ecosystem share one source of truth.