refactor: replace @voidzero-dev/vite-plus-test with upstream vitest#1588
refactor: replace @voidzero-dev/vite-plus-test with upstream vitest#1588Brooooooklyn wants to merge 138 commits into
Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 365a61de42
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…mat/typo PR #1588 CI failures: - Force-override mode (VP_FORCE_MIGRATE=1, set by test-vp-create.yml and ecosystem-ci) now re-pins any pre-existing vite-plus range to the local tgz path in monorepo workspace packages. Without this, pnpm reads the published vite-plus@0.1.21 metadata to resolve transitive deps including @voidzero-dev/vite-plus-test@0.1.21, which shadowed upstream vitest@4.1.5 at runtime and broke vp create monorepo tests. - typos CI: rename yarn-PnP to yarn Plug'n'Play (Pn→On false positive). - vp check: format packages/cli/build.ts shim-generation block. - Rename __dirname in install-failure-guard.spec.ts to satisfy eslint(no-underscore-dangle).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fafa67971
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec69abaadb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 381b6e2c20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…mat/typo PR #1588 CI failures: - Force-override mode (VP_FORCE_MIGRATE=1, set by test-vp-create.yml and ecosystem-ci) now re-pins any pre-existing vite-plus range to the local tgz path in monorepo workspace packages. Without this, pnpm reads the published vite-plus@0.1.21 metadata to resolve transitive deps including @voidzero-dev/vite-plus-test@0.1.21, which shadowed upstream vitest@4.1.5 at runtime and broke vp create monorepo tests. - typos CI: rename yarn-PnP to yarn Plug'n'Play (Pn→On false positive). - vp check: format packages/cli/build.ts shim-generation block. - Rename __dirname in install-failure-guard.spec.ts to satisfy eslint(no-underscore-dangle).
5c48da8 to
39efcbf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39efcbf239
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fceee5296
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b888329d76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Upstream blockers (still needed after the fixes in this PR)
|
Upstream blockers (updated)After the latest fixes (
|
Final status (after b6b5b8b)The aggressive Rust source-rewrite in 21937c5 (which made Confirmed upstream blockers:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6b5b8b0bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60b7d0f0ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Final status — branch HEAD 3ffb7cdE2E now at expected steady state. The two remaining upstream items:
Everything else (npmx.dev, vinext, vue-mini, frm-stack, varlet, vitepress, reactive-resume, rollipop, dify, etc.) is now green. |
…mat/typo PR #1588 CI failures: - Force-override mode (VP_FORCE_MIGRATE=1, set by test-vp-create.yml and ecosystem-ci) now re-pins any pre-existing vite-plus range to the local tgz path in monorepo workspace packages. Without this, pnpm reads the published vite-plus@0.1.21 metadata to resolve transitive deps including @voidzero-dev/vite-plus-test@0.1.21, which shadowed upstream vitest@4.1.5 at runtime and broke vp create monorepo tests. - typos CI: rename yarn-PnP to yarn Plug'n'Play (Pn→On false positive). - vp check: format packages/cli/build.ts shim-generation block. - Rename __dirname in install-failure-guard.spec.ts to satisfy eslint(no-underscore-dangle).
3ffb7cd to
a0d248e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0d248e65e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a5b2697e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…verride set already-vite-plus: legacy wrapper-override projects are no longer a no-op; `vp migrate` now completes the missing @vitest/* family pins (wrapper kept). partially-installed: catalog/overrides/peerDependencyRules gain the family. Update the already-vite-plus first-command comment to match the new behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ade4885bbb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…t lockfile Two rebase regressions that turned PR CI red on this branch's HEAD: * migrator.ts: `ensureVitePlusBootstrap` called `rewritePnpmWorkspaceYaml` with a single argument. main's PR #1821 added this call site with the pre-widening 1-arg signature; this branch had already grown the function to 3-4 params (pnpm major + build-allowance), so the rebased call no longer type-checked (TS2554), failing `pnpm tsgo` / `vp check` and thus the CLI E2E jobs on linux/mac/windows. Pass an undefined pnpm major so build-script allowance stays skipped on this bootstrap path, matching the behavior it had before the signature grew. * pnpm-lock.yaml: the lockfile was regenerated for the vitest 4.1.9 pin but never deduped, leaving the vendored `vite` importer's `vitest` at 4.1.8. `pnpm dedupe --check` (Lint job) flagged the skew. Ran `pnpm dedupe`; only the vitest family + coverage transitive deps move. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The rebase pulled main's PR #1821 `needsInstall` consolidation into the early-return path (`main`, hasVitePlusDependency branch). main's version handled a failed install with an inline `cancelAndExit` (hard abort) and credited `installSummary.durationMs` unconditionally — dropping this branch's `handleInstallResult` wiring there. The full migration path kept the helper, so only the early-return path regressed, which the install-failure-guard.spec guard test caught (it was masked behind the TS2554 compile error until that was fixed). Route the early-return install back through `handleInstallResult`: a failed install now warns, appends to report.warnings, and flips process.exitCode (matching the full path) instead of being credited as a successful migration. The success path is unchanged — the helper returns durationMs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ed01a584b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Yarn 4 hardened mode (auto-enabled for public-PR installs) quarantines packages younger than `npmMinimalAgeGate`, so a freshly published vitest pin makes `yarn install` fail for projects Vite+ creates/migrates — the four `vp create … (yarn)` CI jobs hit this on the same-day 4.1.9 release. Add `npmPreapprovedPackages: [vitest, '@vitest/*']` to the generated `.yarnrc.yml` (rewriteYarnrcYml, shared by create + migrate) so the Vite+-managed vitest family is exempt from the age gate regardless of release age. The `@vitest/*` glob also covers the optional `@vitest/browser-*` peers that are not in the override set. Guarded by `!doc.has(...)` so it never clobbers a user's existing list. Regenerates the migration-monorepo-yarn4 global snap (only fixture that captures `.yarnrc.yml`). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e50937c06f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…/wrapper migration Addresses the PR review threads and the rollipop/vinext ecosystem-CI failures. - define-config: gate `vite-plus:vitest-resolver` to @vitest/browser's browser Vite server only. The signal is read per-server, per-call from `this.environment.getTopLevelConfig().plugins` (a `vitest:browser*` plugin) — no shared/closure state — so node-mode resolution stays externalized to the bundled runner. Fixes the Yarn dual-copy crash (TypeError reading 'config', rollipop) without regressing browser-mode pinning, incl. the `--browser` CLI flag and node-mode jsdom/happy-dom. - define-config / index: wrap `defineProject` so migrated project configs get the resolver + auto-inline plugins instead of the raw vitest/config helper. - migration: treat `@vitest/browser-playwright` as an opt-in provider (kept and pinned for projects that use it, optional peer) instead of a forced top-level dep; pin direct `vitest` for existing-vite-plus browser projects; reject stale `npm:@voidzero-dev/vite-plus-test` wrapper overrides; recurse alias pruning into nested overrides. - docs/migrate: node-mode needs a single vite-plus install; browser providers (Playwright/WebdriverIO) are opt-in and added by migration when used. - ecosystem-ci: raise vinext integration testTimeout 30s→60s (borderline flake). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-plus-test-with-vitest
…layouts The browser-server gate added to `vite-plus:vitest-resolver` was justified only by the rollipop ecosystem-CI crash. A local reproduction proved that crash is a Yarn hoisting problem, not a resolver problem: rollipop's root `.yarnrc.yml` sets `nmHoistingLimits: workspaces`, so every workspace that gains a direct `vite-plus` dep gets its OWN physical `vitest`/`@vitest/runner` copy and the runner splits across two instances (`TypeError: Cannot read properties of undefined (reading 'config')`). A hard `return null` in the resolver still crashed identically. The unconditional resolver passed every browser AND node ecosystem project on the base run, so revert the gate and fix the actual layouts instead. - define-config: drop the `hasBrowserServerPlugin` gate and restore the unconditional resolver (identical to the PR base). The `defineProject` wrapper that injects the resolver / auto-inline plugins is kept. - migration: when a Yarn `node-modules` repo isolates workspace hoisting via an effective `nmHoistingLimits: workspaces`, set `installConfig.hoistingLimits: "none"` on each workspace the migration adds `vite-plus` to, so the bundled `vitest` family dedupes to the single root copy. The effective limit is resolved across the `.yarnrc.yml` chain at and above the workspace root (Yarn merges the ancestor chain; the closest file that sets the key wins — both verified with Yarn 4.17), so a limit inherited from a parent rc is honoured and a root rc value overrides an ancestor. The `.yarnrc.yml` files are left intact and an explicit per-workspace `installConfig.hoistingLimits` is preserved, never clobbered. Layouts a per-workspace opt-out cannot dedupe — root `dependencies` (verified with Yarn 4.17: `none` opt-out still leaves two copies), or any workspace that pins its own isolating `workspaces`/`dependencies` limit — are left un-rewritten and instead get a migration warning naming the workspace, so the migration never reports success while `vp test` is still split. - migration: for npm projects that use an opt-in browser provider (Playwright/WebdriverIO), inject a direct `vite` devDep (the override target) so npm hoists one top-level `node_modules/vite` the provider's nested `@vitest/mocker` can resolve (else `ERR_MODULE_NOT_FOUND: vite` at browser config load). npm-only; pnpm/Yarn expose the override via symlink/PnP. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34290ff45a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…and gate on node-modules
Harden the Yarn workspace-hoisting auto-fix so it reacts to the EFFECTIVE
`nmHoistingLimits`/`nodeLinker` Yarn would apply, not just the value literally
present in the workspace-root `.yarnrc.yml`. All rules verified against Yarn
4.17 `yarn config get`.
- Resolve each key across Yarn's precedence: the `YARN_*` env var, then the
`.yarnrc.yml` chain from the workspace root up to the filesystem root (closest
dir wins), then the home `~/.yarnrc.yml`, then Yarn's default. The home rc
matters for repos OUTSIDE $HOME (devcontainers/Codespaces mount the repo under
/workspaces while $HOME is /home/<user>); for in-$HOME repos the ancestor walk
already passes through $HOME.
- Gate the whole auto-fix/warn on the effective `nodeLinker` being
`node-modules`. `nmHoistingLimits` only splits physical copies under that
linker; under Plug'n'Play (Yarn's default when `nodeLinker` is unset)
resolution is virtual, so writing `installConfig.hoistingLimits: none` there
would be a spurious mutation that weakens isolation if the repo later switches
linkers. rollipop sets `nodeLinker: node-modules`, so its auto-fix is
unaffected.
Scope boundaries (documented in-code), both with a conservative no-op failure
mode — never a spurious mutation, no worse than having no hoisting handling:
- rc values are read VERBATIM; Yarn's `${VAR}`/`${VAR:-default}` interpolation is
not evaluated. An interpolated `nmHoistingLimits`/`nodeLinker` simply won't match
the literal comparison, so the fix does nothing for it.
- `YARN_RC_FILENAME` is not honoured. The migrator only ever WRITES `.yarnrc.yml`
(`rewriteYarnrcYml`/catalog writers, pre-existing), so reading a renamed rc would
be partial and inconsistent; full support is a separate, larger change.
Tests: cover env precedence (both directions), PnP skip, ancestor-rc inheritance,
home-rc-outside-$HOME, and the closest-rc-wins override. The hoisting describe
clears `HOME`/`YARN_NODE_LINKER`/`YARN_NM_HOISTING_LIMITS` in setup so an ambient
env can't override fixture `.yarnrc.yml` values (hermetic regardless of the runner
environment).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ses USERPROFILE) The new "home ~/.yarnrc.yml for a repo OUTSIDE $HOME" test only set `process.env.HOME`, which redirects `os.homedir()` on POSIX but NOT on Windows (Node reads `USERPROFILE` there). On windows-latest the home-rc read fell through to the real profile, the node-modules gate did not fire, and the test failed. Set both `HOME` and `USERPROFILE` in the hoisting describe's env isolation and in that test so `os.homedir()` is redirected on every platform. Production code is unaffected — it already uses `os.homedir()`, which is correct (and matches Yarn) on Windows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3920c8030f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The pnpm v10 `allowBuilds` writers only ADDED an edgedriver/geckodriver key when ABSENT, so a re-migration never updated a stale entry a prior run wrote. Two inline-review findings fall out of that, fixed in BOTH sinks (package.json `pnpm` field and pnpm-workspace.yaml) with one three-way rule per driver: - WebdriverIO present (`shouldAllow`): write `true` unconditionally, overwriting a stale `false` from an earlier WebdriverIO-less migration. Otherwise a re-run after adding WebdriverIO keeps the driver postinstall blocked and browser tests break. - driver is a DIRECT dependency (user's own Selenium setup): leave the key ABSENT so pnpm honours the user's approval/prompt — remove only a stale `false`, and PRESERVE an existing `true` (the user's recorded postinstall approval, which deleting would silently revoke). - otherwise: write `false` only when absent — default-deny the untrusted postinstall without clobbering an entry the user (or a prior run) set on purpose. The YAML sink reads effective values via `allowBuilds.toJS(doc)` so anchor/alias denials (`&a false` / `*a`) resolve the same as plain scalars, matching the package.json sink. `<<` merge keys are not resolved (no tooling emits them); such a denial is conservatively left in place rather than wrongly removed. Tests: re-migration flip false->true (YAML + package.json), stale-denial removal for a newly-direct driver, true-approval preservation (both sinks), and alias-backed false removal. The existing idempotent second-run test still passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 711dcd9d5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ge at runtime
Trim VITE_PLUS_OVERRIDE_PACKAGES to { vite, vitest }. vitest@4.1.9 declares
the 7 in-tree @vitest/* siblings (expect/runner/snapshot/spy/utils/mocker/
pretty-format) as exact 4.1.9 deps, so a single `vitest` override already
cascades one consistent version to the whole tree — overriding each indirect
dep is redundant. Coverage providers (@vitest/coverage-v8 / -istanbul) are
user-owned peer deps: vite-plus no longer adds, pins, or overrides them.
Instead inject a `vite-plus:coverage-version-guard` Vitest plugin that, via
the configureVitest hook, fail-fasts when an installed coverage provider's
version skews from the bundled vitest. Vitest itself only warns on a skew and
then runs mixed versions, silently producing unreliable coverage. Provider
resolution mirrors Vitest's own anchors (project root, then bundled vitest),
the guard runs once per shared runner instance (coverage is global), and also
wraps enableCoverage() for the late programmatic-enable path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bdd4d986d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n the rig
The ecosystem rig force-installs the locally built vitest (4.1.9), but many
ecosystem projects pin an older `@vitest/coverage-*` in their lockfile (e.g.
vue-mini → @vitest/coverage-istanbul@4.1.2). With coverage no longer in the
shipped override map, the forced runner skewed from the project's pinned
provider and the new runtime guard aborted `vp test --coverage` — an incoherent
runner+provider combo no real install would have.
Pin the coverage providers in the rig's VP_OVERRIDE_PACKAGES so the E2E coverage
step runs against a consistent runner+provider pair, exactly as a user who
followed the guard's advice would. The shipped default (constants.ts) stays
{ vite, vitest } — coverage remains user-owned in the product.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23c264af39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ates Vite+ pins `vitest` to an exact, sometimes freshly published version and its in-tree @vitest/* siblings install transitively at that version. A project with a "minimum release age" gate (pnpm `minimumReleaseAge` / Yarn hardened mode's `npmMinimalAgeGate`) would quarantine the just-published pin and break `vp install`. - pnpm `rewritePnpmWorkspaceYaml`: add the vitest family to `minimumReleaseAgeExclude` (only when the gate is already present, alongside the existing vite-plus/@voidzero-dev/ox* entries; merge+dedup). - Yarn `rewriteYarnrcYml`: MERGE the family into `npmPreapprovedPackages` instead of skipping when the key already exists — a repo that preapproves its own private packages previously lost the vitest preapproval entirely. Factor the exempt patterns into VITEST_AGE_GATE_EXEMPT_PACKAGES. The `@vitest/*` glob also covers the optional `@vitest/browser-*` peers and lets the coverage provider version the guard asks for through the gate; it pins/manages nothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The automatic migration manages `vitest` in VITE_PLUS_OVERRIDE_PACKAGES, but the manual-migration examples only overrode `vite`. Without pinning `vitest`, a dependency or workspace package can resolve a different Vitest than the bundled runner `vp test` uses, splitting Vitest's internals (mocks/expect/runner state). Add the `vitest` override to the npm/bun, pnpm, and yarn examples and explain why, referencing `vp --version` for the bundled version. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The build copies the root README into the published package; regenerate it so the manual-migration `vitest` override addition is reflected and the "no unexpected file changes after build" CI check passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d21d56de88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
edgedriver/geckodriver reach a project's dependency tree solely through the opt-in webdriverio Vitest browser provider, which is an OPTIONAL peer of both vite-plus and vitest (peerDependenciesMeta.optional). pnpm's autoInstallPeers never installs an optional peer, so a non-webdriverio project never installs those drivers — the `allowBuilds.<driver>: false` default-deny the migrator wrote for every pnpm v10 project was inert config. Make the migrator hands-off: when the project does not use webdriverio it now writes nothing to allowBuilds and leaves any user-authored entry (their own build-script trust decision) untouched. The webdriverio-present path still writes `true` — load-bearing, since those drivers really install and their postinstall must run, and it still overwrites a stale `false` when webdriverio is added later. This also drops the stale-`false` cleanup that, with the default-deny gone, could delete a user's intentional `false` and could orphan a YAML anchor/alias on deletion (crashing serialization). The now-unused directDriverDeps collection/threading (collectDirectDriverDeps, collectWorkspaceDirectDriverDeps, hasOwnDriverPostinstallDependency) is removed. 64 migration snaps drop the inert allowBuilds block; the one webdriverio fixture keeps `true`. 220 migrator + 718 vite-plus src tests pass; vp check clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 59aa22c. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59aa22c856
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tability #3 (migrator): a monorepo root injects vite-plus before rewritePackageJson, so existingVitePlus is truthy and a root with a vitest-adjacent dep (e.g. vitest-browser-svelte, whose vitest peer is non-optional) never got a direct vitest pin — unresolvable under pnpm strict / Yarn PnP. Fold isVitestAdjacent into needDirectVitest so the pin is added independent of vite-plus presence. Flip the stale "stays undefined" test, add a genuine-normalize-pass test, and add a migration-monorepo-root-vitest-adjacent fixture. #1 (snap masking): replaceUnstableOutput only masked @/slash/whitespace-prefixed semver, so JSON "vitest": "4.1.9" (bun catalog, devDeps) churned on every daily bump while YAML vitest: 4.1.9 was already masked. Mask vitest-family JSON pins to <semver>, but only major >= 4 (the migrator-supported range) so unsupported pre-4 echoes like "vitest": "3.2.4" stay visible to prove a refused migration left package.json untouched. Exclude @vitest/coverage-* (user-owned peers vite-plus never pins; define-config.ts guards their exact version). #2 (upgrade-deps): the daily bump rewrote VITEST_VERSION, the catalog, and the vp-create workflow but left README.md's hardcoded manual-migration vitest pins stale. Add updateReadmeVitestPins (root + cli mirror), asserting exactly 2 JSON + 1 YAML pins per file so a reworded section fails loudly like the other updaters. #4 (upgrade.md): document that after upgrading vite-plus users must re-pin vitest to the bundled version (vp --version) or rerun vp migrate, and where the pin lives per package manager (incl. the package.json pnpm.overrides case). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Summary
Deletes the bundled
@voidzero-dev/vite-plus-testwrapper and consumes upstreamvitest@4.1.5(plus@vitest/browser*) directly. The vite redirection role that drove the wrapper is now handled cleanly by package-manager overrides (vite→@voidzero-dev/vite-plus-core), so the bundle was dead weight that lagged upstream releases.Public API contract preserved:
vite-plus/test*IS the public test API — existing user code (import { vi } from 'vite-plus/test', etc.) is NEVER rewritten.vitestor@vitest/*separately; they come in transitively as direct deps ofvite-plus.vp migrateon an upstream-vitest project still forward-migratesvitest,vitest/*,@vitest/browser*, declare-module specifiers, and/// <reference types>directives to thevite-plus/test*surface (one-time transition).Notable changes:
packages/cli/build.ts:syncTestPackageExportsauto-generates./test/*shims from upstreamvitest's exports map, plus./test/<provider>and./test/browser/providers/<short>shims projected from each@vitest/browser-*package's exports.packages/cli/package.json: adds@vitest/browser,@vitest/browser-playwright,@vitest/browser-preview,@vitest/browser-webdriverioas direct catalog deps pinned to4.1.5.crates/vite_global_cli/src/commands/version.rs: vitest ToolSpec points at thevitestpackage directly.packages/cli/src/resolve-test.ts: resolvesvitest/package.jsonand readsbin.vitestsovp testinvokes upstream vitest.packages/cli/src/utils/constants.ts: dropsvitestfromVITE_PLUS_OVERRIDE_PACKAGES; onlyviteremains a managed key.packages/cli/src/migration/migrator.ts:isVitestAdjacentflag that flipsneedVitePlus = truefor projects with packages likevitest-browser-svelteeven when there's no vite/oxlint/tsdown to migrate.pruneLegacyWrapperAliases/pruneYamlMapLegacyWrapperAliasessweeps that rewrite stalevitest: npm:@voidzero-dev/vite-plus-test@*aliases to^4.1.5(so existingcatalog:refs keep resolving) and drop other stale wrapper-targeted keys.packages/cli/src/migration/bin.ts: adds ahandleInstallResulthelper so failed reinstalls warn the user, append toreport.warnings, and flipprocess.exitCodeinstead of being silently reported as success.User-visible behavior changes
vp test -hand live test runs now show vitest's native banner (vitest/<semver>,RUN v<semver> <cwd>) instead of the wrapper-rebranded output (vp test/<semver>,RUN <cwd>). This is the tradeoff for delegating directly to upstream vitest without a wrapper layer.Test plan
cargo test -p vite_migration --lib: 167 tests passpnpm exec vitest run(packages/cli): 374 tests passpnpm bootstrap-clisucceedspnpm -F vite-plus snap-test-global+snap-test-local: all fixtures regenerated; diffs only reflect expected behavior (forward import rewrites,@vitest/browser*removed from user devDeps,playwright/webdriveriopreserved as peers, stalevite-plus-testcatalog aliases normalized to^4.1.5).vp teston a fixture usingimport { vi } from 'vite-plus/test';vi.mock(...). See "Follow-up" below.vp migrateon a fresh upstream-vitest project.pnpm installclean: zero@voidzero-dev/vite-plus-testreferences in the lockfile, browser-provider packages installed transitively viavite-plus.Follow-up
🤖 Generated with Claude Code
Note
Medium Risk
Touches release/publish paths, daily dep bumps, and CI override behavior for all package managers (especially Bun peer resolution). Public migration guidance and version reporting change, but the
vite-plus/test*import surface stays the same.Overview
Removes
@voidzero-dev/vite-plus-testfrom release, pkg.pr.new, and CI pack flows, and stops bumpingpackages/testinupgrade-depsand prepare-release. Vitest is now tracked as upstreamvitestwith catalog@vitest/*entries kept on the same exact version.Dependency automation rewrites
VITEST_VERSION,test-vp-createoverride pins, and README manual-migrationvitestliterals (exact semver instead ofnpm:@voidzero-dev/vite-plus-test@latest).pnpm-workspace.yamlmatching switches from the oldvitest-devalias to a plainvitest:catalog line.CI packaging pins
core/clito0.0.0for stable tgz names, drops the test package tarball, and addsrepack-vite-tgzso Bun smoke/e2e can satisfy Vitest’speer vitevia a masqueradedvite-7.99.0.tgz.vp createtests overridevitest/@vitest/*by version instead of a local test tgz.User-facing docs and CLI: README explains pinning bundled Vitest for a single copy with
vp test.vp --versionresolves Vitest from thevitestpackage. Migration file walking adds.cjs/.ctsfor reverserequire('vite-plus/test/...')rewrites.Reviewed by Cursor Bugbot for commit 9b59731. Bugbot is set up for automated code reviews on this repo. Configure here.