Repository navigation
Description
Describe the bug
A pnpm workspace with minimumReleaseAge: 0 has pnpm's release-age gate turned off: nothing is held back, so there is nothing to exempt. vp migrate still adds the ten Vite+ exemptions to minimumReleaseAgeExclude, so the file ends up stating both that nothing is held back and which packages are exempt from it.
Deleting the list does not stick. The next vp migrate reports the project as needing an update ("Updated . to Vite+ 1.8.0 … Package manager settings configured") and writes the same ten lines back. The project is never treated as already on Vite+ until it accepts them.
Both places check whether the key exists, not what it says:
rewritePnpmWorkspaceYaml(packages/cli/src/migration/migrator/catalog.ts):if (doc.has('minimumReleaseAge'))pnpmWorkspaceMinimumReleaseAgeExemptionsPending(same file):doc.minimumReleaseAge === undefined
I intend to submit a PR that treats 0 (any value ≤ 0) as no gate in both places, with tests next to the existing ones in migrator.spec.ts.
A related point I left out of that PR: an absent key is not "no gate" on pnpm ≥ 11. There minimumReleaseAge defaults to 1440, as the comment in crates/vp_cli_snapshots/tests/cli_snapshots/main.rs notes. So a pnpm 11+ workspace without the key has the gate on but gets no exemptions. Fixing that needs the pnpm version in the pending check, which is a larger change, so I'm leaving that one to you.
Reproduction
Steps below (three small files, no repository needed).
Steps to reproduce
-
In an empty directory:
package.json{ "name": "age-gate-off", "private": true, "type": "module", "packageManager": "pnpm@12.23.0", "scripts": { "build": "vite build" }, "devDependencies": { "vite": "^8.3.8" } }pnpm-workspace.yamlminimumReleaseAge: 0
vite.config.tsexport default {};
-
git init && git add -A && git commit -m init -
vp migrate --no-interactive --no-agent --no-editor --no-hookspnpm-workspace.yamlis now:minimumReleaseAge: 0 catalog: vite: npm:@voidzero-dev/vite-plus-core@8.3.8001 vite-plus: 1.8.0 overrides: vite@*: 'catalog:' minimumReleaseAgeExclude: - vite-plus - '@voidzero-dev/*' - oxlint - '@oxlint/*' - tsrs - '@tsrs/*' - oxfmt - '@oxfmt/*' - vitest - '@vitest/*'
-
Delete the
minimumReleaseAgeExcludelist, commit, and run the samevp migrateagain. It prints "Updated . to Vite+ 1.8.0 … Package manager settings configured" and the list is back.
I ran both migrations with VP_SKIP_INSTALL=1 to skip the install; the workspace file is written either way.
System Info
# The global CLI is not installed here, so there is no `vp env current`.
$ vp --version
vp v1.8.0
Local vite-plus:
vite-plus v1.8.0
Tools:
vite v8.3.8
rolldown v1.2.19
vitest v5.1.1
oxfmt v0.79.0
oxlint v1.94.0
tsrs v7.1.0-beta.tsrs4
tsdown v0.23.4
Node 26.13.1, pnpm 12.23.0, Windows 11Used Package Manager
pnpm
Logs
$ vp migrate --no-interactive --no-agent --no-editor --no-hooks
◇ Migrated . to Vite+ 1.8.0
• Node 26.13.1 pnpm 12.23.0
# after deleting minimumReleaseAgeExclude:
$ vp migrate --no-interactive --no-agent --no-editor --no-hooks
◇ Updated . to Vite+ 1.8.0
• Node 26.13.1 pnpm 12.23.0
• Dependencies:
vite → 8.3.8
• Package manager settings configuredAI disclosure: I found and wrote this with Claude Code (model: Claude Opus 5.5, claude-opus-5-5; its reasoning effort level is not shown to me). I ran the reproduction above with vite-plus 1.8.0.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Target date
Start date
Activity
voidzero-bot commentedon Nov 29, 2026
minimumReleaseAge: 0, and it is cosmetically annoying rather than breaking: the extraminimumReleaseAgeExcludelist is inert while the gate is off, and simply leaving the list in place restores the normal "already using Vite+" fast exit.Both the writer (
rewritePnpmWorkspaceYaml) and the pending check (pnpmWorkspaceMinimumReleaseAgeExemptionsPending) inpackages/cli/src/migration/migrator/catalog.tsgate onminimumReleaseAgekey presence rather than its value, so0— which pnpm (and Vite+'s own installer override incrates/vp_setup/src/install.rs) treats as a disabled gate — is misread as an enabled one. That makes the writer add the ten Vite+ exemptions to a gate that holds nothing back, and makes the pending check treat their absence as a pending change, so everyvp migratere-adds a deleted list and the project never converges to the fast exit. The code's own comment ("no gate -> nothing to exempt") states the opposite intent, and a control withminimumReleaseAge: 1440confirms the value is the discriminator while enabled gates keep working.I found a potential fix for this issue. It adds a single shared
pnpmAgeGateEnabledpredicate used by both sites (absent/null and ≤ 0 → no gate, > 0 → gate), plus four regression tests next to the existing age-gate coverage that fail without the change and pass with it; the reporter's deferred pnpm ≥ 11 absent-key default (1440) is intentionally left untouched.Full Triage Report
Triage Report — Issue #3601
Result: REPRODUCED
Issue summary
vp migrateon a pnpm workspace that turns pnpm's release-age gate off withminimumReleaseAge: 0still writes the ten Vite+ exemptions intominimumReleaseAgeExclude, even though nothing is held back and there is nothing to exempt. Deleting the list does not stick: the nextvp migratereports "Package manager settings configured" and writes the same ten lines back, so the project is never treated as already on Vite+ until it accepts them.Expected: with
minimumReleaseAgeset to0(or any value ≤ 0) the gate is off; the migrator should neither writeminimumReleaseAgeExcludenor treat its absence as a pending package-manager-settings change.Actual: the exemptions are written on first migration and re-written on every subsequent migration after manual deletion.
Environment
main@ 5cf0b72 (localpackages/clidist built from this checkout;packages/cliversion 1.8.0, same as the report)vpv1.8.0 at/home/runner/.vite-plus/bin/vplocal-npm-registry.ts --pack -- env VP_SKIP_INSTALL=1 vp migrate --no-interactive --no-agent --no-editor --no-hooks) so the migration ran against the checkout's ownvite-plusbuild./tmp/vite-plus-triage/gh-3601/reproReproduction steps and output
Project created per the report (
package.jsonwithvite ^8.3.8,pnpm-workspace.yamlcontaining onlyminimumReleaseAge: 0,vite.config.tswithexport default {};),git init+ commit.1. First migration (gate off,
minimumReleaseAge: 0)Exit code 0. Output:
Resulting
pnpm-workspace.yaml(matches the report verbatim, including the inconsistent combination of an off gate plus exemptions):2. Delete
minimumReleaseAgeExclude, commit, re-run same commandExit code 0. Output:
The ten-line
minimumReleaseAgeExcludelist is written back verbatim.Controls
List kept in place, re-run migrate → quiet:
This project is already using Vite+! Happy coding!(exit 0), no file changes. The pending check does settle once the list is present, so the re-write is triggered specifically by the list's absence, not by a generic "always rewrites pnpm-workspace.yaml" failure.Gate actually on (
minimumReleaseAge: 1440), exclude list deleted, re-run migrate → "Package manager settings configured" and the list is re-added. That re-add is correct behavior for an enabled gate, confirming the discriminating factor is the gate's value (0), not the deletion workflow or environment.Observations (no fix proposed in this step)
mainstill contains both existence-only checks named in the report, inpackages/cli/src/migration/migrator/catalog.ts: the writer (~line 498)if (doc.has('minimumReleaseAge'))and the pending check (~line 1413)doc.minimumReleaseAge === undefined.0is treated as an enabled gate in both the writer and the pending check, which explains both the initial write and the repeated re-write.minimumReleaseAgekey on pnpm ≥ 11 (where the gate defaults to 1440, so absence means "gate on") was not tested here; the reported trigger (0) alone reproduces fully.main; this is not an already-fixed issue.Diagnosis
Affected code
All in
packages/cli/src/migration/migrator/catalog.ts(migration layer, JS CLI — not the Rust global CLI):Writer —
rewritePnpmWorkspaceYaml(line 346), theminimumReleaseAgeExcludeblock at lines 496–510:Pending check —
pnpmWorkspaceMinimumReleaseAgeExemptionsPending(lines 1397–1419), line 1413:PNPM_MINIMUM_RELEASE_AGE_EXCLUDES(lines 91–102, ten patterns) is shared by both, so the two checks cannot drift — but they share the same wrong predicate.Incorrect logic
Both sites treat key presence as gate enabled. In pnpm, a numeric
minimumReleaseAgeof0means the release-age gate is disabled (nothing is quarantined), yet the YAML key exists. WithminimumReleaseAge: 0:doc.has(...)guard and appends the ten Vite+ exemptions, producing the self-contradictory file observed in the reproduction.doc.minimumReleaseAge === undefinedonly when the key is absent; with the value0(a YAML scalar that deserializes to the number0, notundefined), it evaluates the exemption comparison, finds the list missing, and reports the workspace as pending.Why it causes the observed behavior
The pending check is consulted in the "already using Vite+" fast-exit path (
packages/cli/src/migration/migrator/vite-plus-bootstrap.ts, lines ~826 and ~1218). Returningtruemakes an otherwise-current project take the full re-migration path, which callsrewritePnpmWorkspaceYaml(vite-plus-bootstrap.ts lines ~1062 and ~1237), whose presence-only guard then re-writes the deleted list. Hence the exact cycle reproduced: delete → "Updated . to Vite+ 1.8.0 … Package manager settings configured" → list restored; keep → "already using Vite+". The control withminimumReleaseAge: 1440shows the same re-add, which there is correct, proving the value — not the workflow — is the discriminator.Suggested fix approach
Introduce a single shared predicate,
pnpmAgeGateEnabled(value: unknown): boolean, that parses the YAML scalar (numeric or numeric-string) and returnsfalsefor values ≤ 0,truefor values > 0, andfalsefor an absent/null value. Use it in place ofdoc.has('minimumReleaseAge')in the writer and in place of thedoc.minimumReleaseAge === undefinedguard in the pending check.Edge cases
minimumReleaseAge: 0keeps a stale exemption list; pnpm ignoresminimumReleaseAgeExcludewhen the gate is off, so the fix leaves it in place rather than deleting user-editable entries.minimumReleaseAgeto 1440 (see the comment incrates/vp_cli_snapshots/tests/cli_snapshots/main.rs~line 877). Fixing that requires the pnpm major version in the pending check: the writer already receivespnpmMajorVersion/pnpmVersion, butpnpmWorkspaceMinimumReleaseAgeExemptionsPending(projectPath)takes only a path; its callers invite-plus-bootstrap.tsdo havedetectedPackageManagerVersion/workspaceInfo.downloadPackageManager.versionon hand, so a version-aware default is feasible without changing unrelated behavior for pnpm 9/10. Out of scope for the ≤ 0 fix.Regression evidence
Existing adjacent tests that must keep passing: "exempts the vitest family from a pnpm minimumReleaseAge gate" (
1440, migrator.spec.ts:4583), "does not add minimumReleaseAgeExclude when the pnpm age gate is absent" (migrator.spec.ts:4620), and "treats a pnpm workspace missing the minimumReleaseAge exemptions as pending" (migrator.spec.ts:4861). None cover the value0, which is exactly the gap.Confidence: high
The failing logic is proven by code inspection and matches the observed reproduction exactly.
Verification
Claim
minimumReleaseAge: 0(gate disabled),vp migratewrites the ten Vite+ exemptions intominimumReleaseAgeExclude, and re-adds the list on every subsequent migration after manual deletion, so the project never reaches the "already using Vite+" fast exit.0(or any value ≤ 0) means nothing is held back, so no exemptions should be written and their absence should not be treated as pending.Intent research
The code's own comment states the expected behavior.
pnpmWorkspaceMinimumReleaseAgeExemptionsPendingis documented (catalog.ts:1397–1403) as: "Gated onminimumReleaseAgebeing present, mirroring the writer (no gate -> nothing to exempt)." The intent is "gate off → no exemptions"; the implementation replaces "gate" with "key presence", which is not equivalent once the value can be0.Vite+ itself treats
0as "gate disabled" elsewhere.crates/vp_setup/src/install.rs:179–184(write_release_age_overrides) writesminimum-release-age=0into a local.npmrcexplicitly to bypass pnpm's release-age gate, with a test asserting it (install.rs:1549–1552). The snapshot runner does the same (crates/vp_cli_snapshots/tests/cli_snapshots/main.rs:877–884) by exportingPNPM_CONFIG_MINIMUM_RELEASE_AGE=0. Within this repository's own semantics,minimumReleaseAge: 0is an off gate, and the migrator's presence-only check contradicts it.Existing tests document the intent for an off gate.
migrator.spec.ts:4620("does not add minimumReleaseAgeExclude when the pnpm age gate is absent") pins down that an off gate must not produce an exclude list. The0case is the same intent with the key present; no test or comment anywhere suggests0should behave differently from an absent key.History: both guards come from commit
327d23a4a(PR feat(migrate): upgrade existing Vite+ projects across versions #1891, 2026-07-02), which introduced the exemptions and the "mirroring" pending check together. Follow-upa9b17ec40(chore(lint): adopt the Cloudflare Oxlint preset #3562, 2026-11-24) only hardened YAML shape handling. Nothing in either commit or PR body discusses the value0; the presence check looks like an unnoticed shortcut. No intentional change chose this behavior.Prior discussions:
gh searchforminimumReleaseAgefinds no issue or PR asserting that exemptions should be written when the gate is disabled. The closest prior issue,vp upgradefails whenminimumReleaseAgeis configured #1260, was fixed by overriding the gate withminimum-release-age=0— again treating0as "off".Documentation: no docs in
docs/guide/,docs/config/,README.md, orrfcs/mentionminimumReleaseAge, so no documented behavior is contradicted.Verdict
Bug — high confidence. The behavior contradicts the code's own comment, the existing absent-gate test intent, and the repository-wide convention that
minimumReleaseAge: 0disables the gate. The presence-only guards were never an intentional decision to treat0as an enabled gate.Fix
Changed files
packages/cli/src/migration/migrator/catalog.ts— the fix.packages/cli/src/migration/__tests__/migrator.spec.ts— regression tests.Rationale
Both the writer and the pending check used key presence as a proxy for an enabled gate. Added one shared predicate,
pnpmAgeGateEnabled(value), used by both sites so they cannot drift:absent / null → no gate;
0or any negative value (numeric or numeric-string) → pnpm disables the gate (Vite+'s own installer writesminimum-release-age=0for exactly this purpose);a finite value > 0 → gate enabled;
non-numeric garbage → not treated as an enabled gate.
Writer:
if (doc.has('minimumReleaseAge'))→if (pnpmAgeGateEnabled(doc.get('minimumReleaseAge')))(doc.getunwraps the YAML scalar, so0arrives as the number0).Pending check:
doc.minimumReleaseAge === undefined→!pnpmAgeGateEnabled(doc.minimumReleaseAge); comments updated to state the real rule.The deferred absent-key-on-pnpm-≥ 11 default (1440) is intentionally NOT addressed: it needs the pnpm version plumbed into the pending check and was explicitly left to maintainers by the reporter.
Regression tests
In
migrator.spec.ts, beside the existing age-gate coverage:it.each([0, '0', -60]), "does not add minimumReleaseAgeExclude when the pnpm age gate is disabled by minimumReleaseAge: %s") — mirrors the existing absent-key test; asserts nominimumReleaseAgeExcludeis introduced for a disabled gate (covers the string form too).minimumReleaseAge: 0:detectVitePlusBootstrapPendingisfalsebefore and afterensureVitePlusBootstrap, and no list is ever written.Confirmed test-first: with
catalog.tsstashed, all 4 new cases fail (expected [ Array(10) ] to be undefined,expected true to be false); with the fix, all pass. A first draft of the pending test used a barevite: 'catalog:'override, whichoverridesSatisfyVitePlusdeliberately treats as unsatisfied for pnpm-ranged sinks — fixed the fixture to'vite@*': 'catalog:'so the exemption check is the only variable.Validation
pnpm vitest run packages/cli/src/migration/__tests__/migrator.spec.ts→ 429 passed (includes the 4 new cases).pnpm vitest run packages/cli/src/migration/→ onlyvitest-v5.spec.ts/vitest-v5-lockfile.spec.tsfail; identical failure set on the stashed (clean) tree, i.e. pre-existing environment failures.pnpm -F vite-plus build-ts→ rebuilt the localpackages/clidist.minimumReleaseAge: 0→ nominimumReleaseAgeExcludewritten;minimumReleaseAge: 1440→ exemptions still written, preserving correct behavior for an enabled gate.cargo build -p vp_global_clithencargo test -p vp_cli_snapshots -- migration_oxlint→ 39 passed, no snapshot diffs (these fixtures runvp migrateon workspaces withminimumReleaseAge: 0).vp check→ format pass; the 105 lint/type errors are all indocs/.vitepress/*and identical on the clean tree — pre-existing, none in the changed files.Skipped checks, with reasons
pnpm test:unit/just test: the migration suite is fully covered above; the remaining suites are untouched by this change and the job budget does not allow a full run.just snapshot-test: only migrate-touched fixtures were reviewed; the three fixtures whose input carriesminimumReleaseAge: 0(migration_oxlint_*) were run and pass.core_*fixtures that mentionminimumReleaseAge: 0usevp install, not the migrator.Alternatives considered
This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
I've opened a pull request with this fix: #3602