Skip to content

APP-569: Upgrade pnpm 11 to pnpm 12 - #24989

Open
charliegilman wants to merge 5 commits into
masterfrom
feat/APP-569-pnpm12
Open

charliegilman wants to merge 5 commits into
masterfrom
feat/APP-569-pnpm12

Conversation

@charliegilman

@charliegilman charliegilman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Resolves APP-569.

Summary

 package.json
-  "packageManager": "pnpm@11.10.0+sha512…"
+  "packageManager": "pnpm@12.21.0"

 .github/actions/setup-pnpm/action.yml
-  uses: pnpm/setup@v2.0.2            # cannot install pnpm 12
+  uses: pnpm/setup@v3.2.0

 .github/workflows/publish-vortex-api.yml
-  pnpm/action-setup@v6 + setup-node(node-version, cache) + node-gyp chmod workaround
+  ./.github/actions/setup-pnpm + setup-node(registry-url only)

 packages/exe-version/src/index.test.ts
-  require("node_modules/.pnpm/winapi-bindings@https+++cod_133dce9c…")   # silently skipped when missing
+  createRequire(src/main/package.json)("winapi-bindings")                # fails if missing

-.node-version                         # said 22; nothing read it, Node is pinned by devEngines.runtime
 docs/install-instructions/shared.md   # pnpm 12 note, drop non-existent Node catalog entry
 packages/vortex-api/docs/MIGRATION.md # suggest pnpm@12.21.0 to extension authors
  • The lockfile diff is only pnpm's own pin (packageManagerDependencies). No dependency versions moved. pnpm accepted the existing lockfile without re-resolving, so pnpm 12's one-time rewrite of cyclic peer variants hasn't happened yet. It will show up in whichever PR next re-resolves dependencies.
  • A global pnpm 11.10 from winget switches itself to the pinned 12.21.0, so contributors don't need to upgrade by hand.
  • allowBuilds still matches under pnpm 12. On a clean install, winapi-bindings, loot and drivelist were built from their git tarballs.
  • pnpm 12's new defaults are kept: globalShims on, and hardlink-first package import on Linux.

Evidence

On Windows I ran the steps from .github/actions/package/action.yml (unsigned) on master with pnpm 11.10.0, then on this branch with pnpm 12.21.0, and diffed the outputs.

Output pnpm 11 → pnpm 12
src/main/dist file list, injected workspace packages (files and exports) identical
win-unpacked files, app.asar.unpacked identical
verify-packaged-asar.mjs 0 mismatches in 193 nested packages, both runs
vortex-api: pnpm version (as CI runs it), pack file list, packed package.json identical
vortex-api: pnpm publish --dry-run --access public --tag beta succeeds on both
etc/Dependency Report.md (pnpm list --json) identical
Deployed package.json dependency versions pnpm 11 wrote invalid 2.1.3(electron@45.3.4); pnpm 12 writes 2.1.3. prepare-dist-package.mjs passes both through unchanged
Hoisted node_modules in the deploy (and so app.asar) same 1,134 package versions; for some packages (e.g. chownr, lru-cache, undici, jackspeak) a different version is hoisted to the top
@emnapi/* in the deploy dropped. pnpm 11 deployed them only as dependencies of @rolldown/binding-wasm32-wasi, which is wasm32-only and never installed
assets/bom.json (pnpm sbom) adds our workspace packages; drops native binaries for other platforms; license coverage about the same (807 vs 810 components), so the About page is unchanged

pnpm run verify passes (format, build with lint and typecheck, and 175 test tasks). E2E not run.

Both release pipelines were also run in CI against this branch, and neither published anything:

  • Installer: Nightly Package, dispatched on this branch ran the full .github/actions/package path (unsigned) under pnpm 12.21.0. It ended with checked 193 nested packages, 0 version mismatch(es) and built vortex-setup-1.0.0-nightly.20261119.exe. The output was uploaded only as artifacts.
  • npm: Publish vortex-api, dry run used the new ref input with tag v0.0.0-pnpm12test.0 and dry-run=true. It ran the version bump, a frozen install, the build, and pnpm publish --provenance --access public --tag beta --dry-run, fetched the OIDC token for npm, and ended with Skip publishing @nexusmods/vortex-api@0.0.0-pnpm12test.0 (dry run). Afterwards npm view returns 404 for that version, and the dist-tags are unchanged (latest: 2.11.0, beta: 2.11.0-beta.5).

To make that dry run possible, publish-vortex-api.yml gains an optional ref input that builds a branch instead of the tag. A guard step fails any run that sets ref without dry-run, so a branch can never be published under a release version.

The publish step logs [WARN] Failed to replace env in config: ${NODE_AUTH_TOKEN}. That comes from the .npmrc that setup-node writes; trusted publishing doesn't use the token, and the OIDC exchange went ahead. Linux CI on this PR confirms the hardlinked store and native-module cache paths.

Merge Danger

Door: two-way

Reverting the commits restores pnpm 11. Nothing outside the repo changes.

Blast Radius: tooling

Every CI job and contributor install goes through the new pnpm. The installer is built from a deploy whose hoisted layout differs as described above, and verify-packaged-asar guards against that going wrong. NixOS contributors get pnpm unpinned from nixpkgs, and that pnpm switches itself to the downloaded 12.21.0 binary. I couldn't test that here, so it needs a check from someone on NixOS.

Follow-ups, not in this PR:

  • The shipped copies of the workspace packages keep their development → ./src/*.ts exports. publishConfig.exports is not applied when pnpm deploy injects them. That's the same on pnpm 11, so it isn't a regression.

charliegilman and others added 4 commits November 19, 2026 15:01
Pin pnpm 12.21.0 via pnpm self-update. The lockfile change is only pnpm's
own pin: packageManagerDependencies now records pnpm 12's per-platform
native binaries instead of @pnpm/exe 11. No dependency versions moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pnpm/setup v2 cannot install pnpm 12; v3.2.0 can. publish-vortex-api.yml
had its own pnpm/action-setup + setup-node + node-gyp chmod workaround, so
it now uses the shared setup-pnpm action too and keeps setup-node only to
write the npm registry config for trusted publishing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test hard-coded winapi-bindings' node_modules/.pnpm folder name, which
pnpm 12 hashes differently, so the native cross-check silently skipped.
Resolve it through @vortex/main instead and fail rather than skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
.node-version said 22 while the repo pins Node 24.22.3 through
devEngines.runtime; nothing reads it. Also drop the shared setup docs'
claim of a Node catalog entry that does not exist, and bump the pnpm
version suggested to extension authors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@charliegilman charliegilman self-assigned this Nov 19, 2026
The workflow always built the release tag, so a pnpm upgrade could not
be dry-run before release. An optional ref input builds that branch or
commit instead, and a guard refuses a real publish with it set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@charliegilman
charliegilman marked this pull request as ready for review November 19, 2026 16:51
@charliegilman
charliegilman requested a review from a team as a code owner November 19, 2026 16:51
@charliegilman

Copy link
Copy Markdown
Contributor Author

@Sewer56 could you check this on NixOS if you get a minute please? The repo now pins pnpm@12.21.0, and pnpm 12 is a native binary that pnpm downloads when it switches to the pinned version. The flake still takes pnpm unpinned from nixpkgs master, and I can’t tell whether the downloaded binary runs on NixOS without patching.

On this branch: direnv allow, then pnpm --version (should print 12.21.0) and pnpm install. If it fails, the error and your nixpkgs pnpm version would help us decide between pinning pnpm in the flake or setting pmOnFail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant