chore(pnpm): pin pnpm@10.34.5 and move pnpm.* settings to workspace/policy - #1690
Conversation
…olicy
pnpm 11 no longer reads the `pnpm` field in package.json:
[WARN] The "pnpm" field in package.json is no longer read by pnpm.
The following keys were ignored: "pnpm.overrides"
It warns rather than fails, so all four key groups here silently stop applying
while the install still exits 0. The overrides are the whole Graphile v5 stack
resolved as a set — grafast, graphile-build*, @dataplan/* must agree, and the
`graphql: 16.13.0` pin is what keeps a second copy of graphql out of the tree
(two copies produce "Cannot use GraphQLSchema from another module or realm" at
runtime). `@smithy/node-http-handler: <4.5.0` pins away from a bad release.
- overrides / publicHoistPattern / packageExtensions → pnpm-workspace.yaml.
pnpm 10 already honours them there, so this is correct now and
forward-compatible with 11 — no flag day when we upgrade.
- onlyBuiltDependencies → pnpm-policy.yaml `allowBuilds`, regenerated with
`pnpm-policy generate` rather than hand-written, since that key is generated.
- packageManager pinned; workflows moved v2 → v4 and their `version: 10`
dropped. A bare major floats to the newest 10.x at run time, and v2 ignores
packageManager entirely, so CI and local dev could not agree. v4 reads
packageManager when no version input is given — one field for both.
The lockfile is deliberately untouched: `pnpm install --frozen-lockfile`
passes against it with the new config, and its `overrides:` block is
byte-identical, so resolution is unchanged. (A full re-resolve also prunes
~1530 stale package entries; that is real but unrelated, and belongs in its
own change rather than buried here.)
Verified on 10.34.5: install succeeds, `pnpm-policy check` reports the
workspace matches the policy, and the lockfile records all 16 overrides plus a
packageExtensionsChecksum — the pins are in force, not merely present.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6watrJsLurfsr3uhnqibB
Correction: the lockfile is not staleEarlier I noted a full re-resolve prunes ~1530 package entries (−7065 lines) and suggested that was real staleness worth its own PR. That was wrong, and I want to correct it before anyone acts on it. That diff was an artifact of So there is no lockfile cleanup pending, and none should be done: committing that prune would have removed 1,433 legitimate entries. Leaving the lockfile untouched in this PR is correct on its own merits, not just for reviewability. What was genuinely broken:
|
| before | after | |
|---|---|---|
packageManager |
pnpm@11.11.0 |
pnpm@10.34.5 |
storeDir |
store/v11 |
store/v10 |
Purging and reinstalling on 10.34.5 resolves it. Worth knowing for anyone who ran an install here on 11 — they will need rm -rf node_modules once after this merges. The shared store is separate and unaffected, so the reinstall is nearly all hardlinks (29 downloads out of 1433).
Post-cleanup checks on this branch: pnpm exec tsc --version → 5.9.3, and pnpm pnpm-policy check → "pnpm-workspace.yaml matches the policy".
Part of standardising pnpm across the four platform repos. This is the highest-risk of the set — the ignored keys here are the whole Graphile v5 stack.
The bug
pnpm 11 stopped reading the
pnpmfield inpackage.json:It warns, it does not fail — the install exits 0 and all four key groups quietly stop applying:
overridesgraphqlsingle-copy + a@smithypinpublicHoistPattern@jest/test-sequencerhoistpackageExtensionsjest-configonlyBuiltDependencies@launchql/protobufjs,core-js-pureTwo of the overrides are doing load-bearing work:
graphql: 16.13.0— the single-copy guard. Two copies ofgraphqlin one tree produceCannot use GraphQLSchema "[object GraphQLSchema]" from another module or realmat runtime. grafast, graphile-build, graphile-build-pg and@dataplan/*are resolved as a set and break across minors.@smithy/node-http-handler: <4.5.0— a pin away from a known-bad release.Nothing fails at install. It fails on the next re-resolution — a new dep,
pnpm up, or--no-frozen-lockfilein an image build — and surfaces far from the cause.This is not hypothetical: a local install on pnpm 11 in this repo produced a regenerated lockfile with the
overrides:block missing entirely. The versions happened to still be right; the constraint was simply gone.What changed
overrides/publicHoistPattern/packageExtensions→pnpm-workspace.yaml. pnpm 10 already honours them there (constructive-dbruns this on 10.34.5), so it is correct today and forward-compatible with 11 — no flag day when we upgrade.onlyBuiltDependencies→pnpm-policy.yamlallowBuilds, regenerated viapnpm-policy generaterather than hand-edited, since that key is tool-managed.packageManager: pnpm@10.34.5; workflowspnpm/action-setup@v2→v4(7 call sites) and theirversion: 10removed.On that last point: a bare
version: 10floats to the newest 10.x at run time, so CI could move with no commit — and v2 ignorespackageManagerentirely, so local and CI had no way to agree. v4 readspackageManagerwhen noversioninput is given, making it the single source of truth.The lockfile is deliberately untouched
pnpm install --frozen-lockfilepasses against the committed lockfile with the new config, and itsoverrides:block is byte-identical — resolution is unchanged.A full re-resolve additionally prunes ~1530 stale package entries (−7065 lines). That is real, but unrelated to this change and too large to bury in a version pin; worth its own PR.
Verification
The lockfile records all 16 overrides plus a
packageExtensionsChecksum, so the pins are demonstrably in force, not merely present. Both edited workflows validated as parsing YAML.🤖 Generated with Claude Code
https://claude.ai/code/session_01V6watrJsLurfsr3uhnqibB