Repository navigation
chore(deps): move to pnpm 11 and put pnpm config where v11 reads it - #2411
Conversation
pnpm 11 stops reading the `pnpm` field of `package.json` (pnpm/pnpm#10086), which is where all 22 transitive security floors lived. It does not error on finding one -- it warns and continues with the setting absent -- so a silent migration would have dropped every GHSA remediation from ADR-1474 onward while leaving the build green. The Node 24 devcontainer already ships pnpm 11.17, so that warning was printing on every command. Moves `overrides` and `allowBuilds` into `pnpm-workspace.yaml`, verified in two stages to isolate the variable: first the config move alone under pnpm 10.33 (which reads both locations) confirmed `--frozen-lockfile` passes with the lockfile untouched, then the version bump. Both stages leave `pnpm-lock.yaml` byte-identical, all 22 overrides intact, and resolution unchanged. `allowBuilds` denies `@vscode/vsce-sign` and `keytar` explicitly rather than leaving them undeclared: `strictDepBuilds` now defaults to true, so an undeclared postinstall is an install error. Both were already skipped. Leaves `minimumReleaseAge` at pnpm's 1-day default rather than raising it to match the 7-day Dependabot cooldown, as #2401 proposed. The two have different scopes -- the cooldown delays PRs for declared deps, this verifies all 1479 lockfile entries including transitive ones. At 7 days the current lockfile is already non-compliant (`[email protected]` + 13 bindings and `[email protected]` come in under vite and are five days old), so every install including CI would fail until the window passed. Refs #2401
The dangerous part of the v11 move is not the code, it is the documentation. ADR-1474 and the ~10 security ADRs citing it spell the remediation procedure out by filename -- "root `package.json` の `pnpm.overrides`" -- and `.claude/rules/dependabot.md` repeats it. That rule loads automatically during Dependabot triage, the exact task that maintains those 22 floors. Left alone, the next triage raises a floor in a file pnpm no longer reads, sees a green build, and ships the unpatched dependency. Adds a "where the overrides live" section to the rule with a pointer that past ADRs are historical, and a guard asserting no `package.json` carries a `pnpm` field again -- pnpm only warns, so without one CI has nowhere to fail. The guard also rejects the ten settings v11 removed and requires a pnpm 11 pin, since below 11 the field is still honoured and the assertion would be enforcing a shape the toolchain does not need. Refs #2401
Also repoints two ADR `assumptions:` entries at `pnpm-workspace.yaml`. They grepped `package.json` for an override and would otherwise assert a floor that had moved -- the same vacuous-guard trap the ADR describes. Refs #2401
…epBuilds `cloudflare/wrangler-action` runs its own `pnpm add wrangler@4` at deploy time, which pulls `workerd` and its postinstall. Under pnpm 10 that build was skipped with a warning and the deploy worked; pnpm 11 defaults `strictDepBuilds` to true, so the same skip is now `ERR_PNPM_IGNORED_BUILDS` and the step fails. Declared `false` to match what was already happening rather than `true`, which would newly execute a build no deploy has ever needed. Local installs cannot surface this: `workerd` is not in our lockfile, it only exists inside the action's transient install. Four workflows use the action (preview / deploy / nest-deploy / spike-preview) and only preview runs on PRs, so the other three would have broken after merge. Refs #2401
# Conflicts: # docs/adr/effective.md # docs/adr/graph.md
|
Merged The 1-day policy fired for real during the merge, which is worth recording since it is the first live test of the setting this PR chose: #2407 published adr-tools 0.0.11 and adopted it in karasu about an hour later — a completely normal first-party workflow that the age check has no way to distinguish from a suspicious one. Resolved with Worth being explicit that this is a deliberate narrowing of a security control, not a workaround to get CI green. The alternative was holding the PR until tomorrow 14:20 UTC, which would only defer the same collision to the next adr-tools release. All checks green after the merge, including the Cloudflare preview deploy that the |
main moved the security floors out of the root package.json `pnpm.overrides` and into pnpm-workspace.yaml's `overrides:` (#2411 / ADR-2401) — pnpm 11 does not read the `pnpm` field at all. So the half of this branch's fix that lived in package.json had lost its home: taking it forward verbatim would have left a `pnpm` field pnpm 11 silently ignores. Resolved by taking main's package.json wholesale and re-applying the floor raise where the floors now live: pnpm-workspace.yaml `dompurify: ^3.4.12` -> `^3.4.13`. The direct declaration in packages/app merged cleanly and is unchanged. Re-ran the install under pnpm 11.20.0. The lock still resolves every dompurify to 3.4.13 with no 3.4.12 entry, and the diff against main is only the three dompurify lines. build and test pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Two independent collisions with main. The generated ADR artifacts (effective.md, graph.md, graph/build.md) conflicted because adr-tools 0.0.11 dropped the ADR counts from their headers (#2407) while this branch had regenerated them with the counts still in. Took main's files and re-ran `pnpm adr:regenerate` rather than hand-resolving generated output. The real one was silent: main relocated the security floors to pnpm-workspace.yaml (#2411 / ADR-2401) and added a rules section saying so, explicitly warning that older security ADRs point at the dead location. The section this branch adds pointed at exactly that dead location, and git merged the two without a conflict. Retargeted the reachable state and the grep to pnpm-workspace.yaml, and added the lock check as step 4. ADR-2404 gets the same treatment: assumptions now grep pnpm-workspace.yaml (the old `grep: package.json :: "dompurify"` would fail now that the pnpm field is gone), and a note records that the fix moved location mid-flight, since leaving it in package.json would have made pnpm 11 ignore it silently. adr:validate 315/0 errors; check-assumptions both ADR-2404 entries pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Purpose
Closes #2401
Summary
Moves the workspace to pnpm 11.20.0 and relocates pnpm's configuration to
pnpm-workspace.yaml, where v11 actually reads it. The lockfile comes out byte-identical and all 22 transitive security floors resolve to the same versions.The migration's real hazard is that pnpm warns rather than errors when it finds the now-ignored
pnpmfield, so a careless version bump would have dropped every GHSA remediation since ADR-1474 while leaving CI green.Changes
overridesandallowBuilds→pnpm-workspace.yaml. pnpm 11 stops readingpackage.json#pnpm(pnpm#10086);onlyBuiltDependenciesis removed in favour ofallowBuilds.packageManager→[email protected], andpnpm/action-setup→ v6.0.10 across all 19 usages.allowBuildsdenies@vscode/vsce-signandkeytarexplicitly.strictDepBuildsnow defaults to true, so an undeclared postinstall is an install error; both were already being skipped, sofalsepreserves behaviour.minimumReleaseAgestays at pnpm's 1-day default — see below..claude/rules/dependabot.mdgains a "where the overrides live" section, and ADR-1474's operating rule gets a relocation note.scripts/ci/pnpm-config-location.test.tsasserts nopackage.jsoncarries apnpmfield again, no removed v11 setting is in use, and the pin is a pnpm 11.assumptions:repointed at the new file.Corrections to the issue's plan
The 7-day
minimumReleaseAgeI proposed in #2401 breaks the build. Setting10080makespnpm installfail today:Those are in
main's committed lockfile already — not a fresh resolution. The issue framed the setting as "the same policy as the Dependabot cooldown, in a different file", and that was wrong. The cooldown delays PRs Dependabot raises for declared dependencies;minimumReleaseAgeverifies all 1479 lockfile entries on every install, transitive ones nobody chose included. rolldown ships often and arrives under vite. Matching the number turns a supply-chain preference into a time-dependent build gate that would break CI for days at a stretch. One day still covers the attack this defends against.The codemod was not used.
codemod run pnpm-v10-to-v11needs interactive TTY approval (Failed to get user input: The input device is not a TTY), and what it asks approval for is running code fetched at runtime fromapp.codemod.comvianode -e. Letting remotely-fetched code rewrite 22 supply-chain pins, in a change whose whole purpose is preserving them, is the wrong trade when the surface is small enough to migrate by hand and read in full.How the override move was verified
Two stages, to separate "the config moved" from "pnpm changed":
pnpm install --frozen-lockfilepasses,pnpm-lock.yamluntouched.End state: lockfile byte-identical,
overrides:block identical at 22 entries,[email protected]and[email protected]still resolved. Full suite green (3308 + 1227 + 582 + 493 + 344 + 272 + 67 + …),pnpm run build, vscode build, and a CLI smoke test all pass.One test failure surfaced and was not a pnpm 11 regression:
karasu-vscode's webview tests fail in a fresh clone because@karasu-tools/i18n's export map pointsimportat./dist/index.js, which is gitignored and only exists after a build. Building i18n fixes it, and it would reproduce identically on pnpm 10. Rootpnpm run testnot being hermetic in a fresh clone is pre-existing; flagging it rather than fixing it here.Preview URL
N/A — no app-facing change.
Scope filter (new-feature PRs only)
Dependency & license impact
Every resolved version is unchanged; only the package manager and the location of its config moved.
Manual Verification Checklist
pnpm install(first install after this lands purgesnode_modules— the store moves to v11/SQLite; non-interactive shells needCI=true)pnpm publishnative, so pnpm's version now governs the Trusted Publishing floor instead of the npm CLI's (ADR-2397 / ADR-9020)TPL impact
The guard was verified to fail before being trusted: reinstating a
pnpm.overridesblock inpackage.jsonbreaks it.Related Docs
docs/adr/2401-pnpm-11-migration.md(new).claude/rules/dependabot.md— new "override はどこにあるか" sectiondocs/adr/1474-*.md— relocation note on the operating ruleCONTRIBUTING.md— prerequisite now pnpm 11+