Skip to content

chore: upgrade pnpm to v12 and migrate CI to pnpm/setup - #386

Merged
panz3r merged 8 commits into
mainfrom
chore/upgrade-pnpm-v12
Sep 9, 2026
Merged

panz3r merged 8 commits into
mainfrom
chore/upgrade-pnpm-v12

Conversation

@panz3r

@panz3r panz3r commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Upgrade the pinned package manager to pnpm v12.4.0 (packageManager in package.json, regenerated pnpm-lock.yaml).
  • Migrate CI off pnpm/action-setup to pnpm/setup per its migration guide, pinned by commit SHA (v2.1.0).
  • Unify pnpm + Node.js setup in build-test.yml into a single pnpm/setup step using its runtime input, replacing the separate actions/setup-node step. Node matrix changed from [lts/-1, lts/*, latest] to [22, lts, latest] (no "previous LTS" alias exists in pnpm/setup; 22 will need a manual bump when Node's LTS rotates).
  • release.yml keeps actions/setup-node alongside pnpm/setup, since its publish job needs registry-url for npm's OIDC trusted-publishing flow.
  • Root-caused and fixed a pnpm 12 regression affecting the google-signin/apple-signin packages. These packages declare react-native/expo-modules-core as optional peer dependencies. CI worked around pnpm-workspace.yaml's autoInstallPeers: false by running a second install step with --config.auto-install-peers=true. Under pnpm 11 this correctly linked the optional peers into each package's own node_modules. Under pnpm 12.4.0, that same CLI override no longer performs the linking step (confirmed even with --force), so tsc failed with Cannot find module 'react-native'. It's tied to the value persisted in pnpm-workspace.yaml, not a one-off CLI flag.
    • Fix: set autoInstallPeers: true directly in pnpm-workspace.yaml (regenerating the lockfile to match), and drop the now-unnecessary --config.auto-install-peers=true overrides and separate "Install peerDependencies" step from all three workflows — a single pnpm i --frozen-lockfile now installs and links everything consistently.
    • This also fully resolves the earlier ERR_PNPM_LOCKFILE_CONFIG_MISMATCH failure on main's release workflow (config and lockfile settings can no longer disagree), making the flag added in an earlier commit on this branch redundant — removed as part of this fix.

Verification

  • Reproduced the google-signin/apple-signin build failure locally under pnpm 12.4.0 (confirmed react-native/expo-modules-core were resolved into the store but never symlinked into the package's node_modules, even with --force).
  • Confirmed the fix locally: fresh pnpm i --frozen-lockfile links both packages' optional peers correctly.
  • Full local build + test suite passes across all packages (lib: 46 tests, google-signin: 24 tests, apple-signin: 25 tests).
  • All CI checks now green on this PR (Build & Test × 3 packages × 3 Node versions, Build × 3 packages, CodeQL, Dependabot CI).

Commits

  1. chore: upgrade pnpm to v12.4.0
  2. ci: migrate from pnpm/action-setup to pnpm/setup
  3. ci: unify pnpm and Node.js setup via pnpm/setup runtime input
  4. fix(ci): pass auto-install-peers config to release build step
  5. fix(ci): persist autoInstallPeers:true instead of per-command overrides

The build step in the release workflow ran plain `pnpm build` while every
other install/build/test step in CI passes --config.auto-install-peers=true.
Since pnpm-workspace.yaml sets autoInstallPeers: false but the preceding
peerDependencies install step overrides it to true only for that command,
pnpm's dependency-consistency check before running the build script saw a
mismatch between the recorded lockfile state and the active config, failing
with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH (see release run 34352974702).
Copilot AI lite review requested due to automatic review settings September 9, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

pnpm-lock.yaml appears to contain two concatenated YAML documents (duplicate ---/sections), which will likely break pnpm lockfile parsing or cause installs to use incorrect data.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR upgrades the repository’s pinned package manager to pnpm 12.4.0 and updates GitHub Actions workflows to use pnpm/setup (including unified Node+pnpm provisioning in the build/test workflow), while also fixing a release-workflow build command mismatch related to auto-install-peers.

Changes:

  • Bump the repo packageManager pin to pnpm@12.4.0 and update the lockfile format to include packageManagerDependencies.
  • Migrate CI from pnpm/action-setup to pnpm/setup, and unify Node + pnpm setup in build-test.yml via runtime.
  • Fix the release workflow build command to include --config.auto-install-peers=true to avoid lockfile config mismatch failures.
File summaries
File Description
pnpm-lock.yaml Updates lockfile for pnpm 12 and adds packageManagerDependencies metadata.
package.json Pins the workspace to pnpm@12.4.0 via packageManager.
.github/workflows/release.yml Switches pnpm setup action and fixes release build command config consistency.
.github/workflows/build-test.yml Migrates to pnpm/setup and unifies Node+pnpm setup using runtime with an updated Node matrix.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pnpm-lock.yaml
@panz3r panz3r self-assigned this Sep 9, 2026
@panz3r panz3r added enhancement New feature or request github_actions Pull requests that update GitHub Actions code labels Sep 9, 2026
The prior --config.auto-install-peers=true CLI overrides worked under pnpm
11, but under pnpm 12.4.0 they no longer cause optional peer dependencies
(react-native, expo-modules-core) to be symlinked into the consuming
package's own node_modules, even with --force. The override only affects
the resolution/download step, not the per-importer linking step, which
pnpm 12 apparently ties to the *persisted* autoInstallPeers setting rather
than a CLI flag applied to one invocation.

Set autoInstallPeers: true directly in pnpm-workspace.yaml (regenerating
pnpm-lock.yaml to match) so a single `pnpm i --frozen-lockfile` installs
and links everything consistently. This also makes the earlier
--config.auto-install-peers=true / separate "Install peerDependencies"
step unnecessary, so both are removed from build-test.yml and release.yml,
along with the now-redundant flag added in the previous commit.

Verified locally: fresh install links react-native/expo-modules-core into
packages/google-signin and packages/apple-signin's node_modules, and all
three packages build and test successfully (46+25+24 tests passing).
Copilot AI review requested due to automatic review settings September 9, 2026 16:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The lockfile appears to be malformed (duplicate YAML documents) and the CI/peer-deps behavior changes conflict with the PR description and intended lockfile-config consistency.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (1)

pnpm-lock.yaml:5

  • pnpm-lock.yaml currently contains two YAML documents (there is a second --- at line ~158 followed by another lockfileVersion and importers block). pnpm lockfiles are expected to be a single coherent document; this looks like an accidental concatenation that is likely to break pnpm install/CI parsing. Please regenerate the lockfile with pnpm 12 (or otherwise merge the packageManagerDependencies section into the main document) so there is only one lockfileVersion/importers tree.
  • Files reviewed: 4/5 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment thread .github/workflows/build-test.yml
Comment thread .github/workflows/build-test.yml
Comment thread .github/workflows/release.yml
Comment thread pnpm-workspace.yaml
true is pnpm's default, so the explicit setting in pnpm-workspace.yaml was
a no-op once it matched the default. pnpm-lock.yaml still records
settings.autoInstallPeers: true (the resolved effective value), confirming
behavior is unchanged.
Copilot AI review requested due to automatic review settings September 9, 2026 16:27
@panz3r

panz3r commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Addressing the review comments from Copilot:

pnpm-lock.yaml "duplicate YAML documents" (pnpm-lock.yaml:5) — this is not corruption. pnpm 12 introduced self-tracking of its own binary via packageManagerDependencies (declared through the legacy packageManager field in package.json), and per pnpm's docs: "its resolution info is written to pnpm-lock.yaml... The lockfile then gains a leading env lockfile document." That's exactly the first ----delimited document here (pnpm's own platform binaries + packageManagerDependencies), followed by the real dependency-graph document. Confirmed this parses and round-trips correctly: pnpm i --frozen-lockfile and a full pnpm -r build && pnpm -r test all pass locally and in CI on every commit in this PR.

Missing --config.auto-install-peers=true in build-test.yml/release.yml build & test steps — this is intentional, not an oversight. As of the last commit (bc59c3a), autoInstallPeers: true is persisted directly (now removed since it's pnpm's default — see latest commit) rather than passed as a one-off CLI override. A single pnpm i --frozen-lockfile now installs and links the optional peer deps (react-native, expo-modules-core) consistently for every subsequent command in the job, so the extra flag on the test/build invocations would be redundant. This is confirmed by the current green CI run across all packages and Node versions.

pnpm-workspace.yaml now sets autoInstallPeers differently than the PR description states — the description was updated after this concern was raised (see the "Root-caused and fixed a pnpm 12 regression" section) to explain exactly why the default changed and why it's required for google-signin/apple-signin to build under pnpm 12. Since true is pnpm's own default, the explicit setting has now been removed entirely in the latest commit, leaving no config divergence to worry about.

All resolved — happy to re-request a Copilot review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The committed pnpm-lock.yaml is structurally invalid (two YAML documents / duplicated sections), which is likely to break deterministic installs in CI and for contributors.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (1)

pnpm-lock.yaml:163

  • pnpm-lock.yaml appears to contain two YAML documents (there is a second --- separator and duplicated top-level sections like lockfileVersion/importers). pnpm expects a single-document lockfile; this structure is likely to break installs or produce non-deterministic behavior. Regenerate the lockfile so it contains exactly one document with a single settings/importers/packages/snapshots set.
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread pnpm-workspace.yaml
Reverts the previous removal. Copilot review correctly flagged that
relying on pnpm's current default is fragile: this PR exists precisely
because a pnpm-version-specific behavior change around autoInstallPeers
broke CI. Declaring it explicitly documents the repo's dependency on
peer auto-install (needed for the optional react-native/expo-modules-core
peers in google-signin/apple-signin) and protects against pnpm changing
its default in a future major version. pnpm-lock.yaml is unchanged since
the resolved value was already true either way.
Copilot AI review requested due to automatic review settings September 9, 2026 16:34
@panz3r

panz3r commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Fair point — re-added autoInstallPeers: true explicitly in the latest commit. Given this PR exists specifically because of a pnpm-version-specific behavior change around this setting, relying on the current upstream default was too fragile. pnpm-lock.yaml is unchanged (the resolved value was already true).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The workflow and workspace config changes are internally consistent (pnpm pin + lockfile + autoInstallPeers + CI install steps) with no issues found in the modified hunks.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 4/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 9, 2026 16:37
@panz3r
panz3r enabled auto-merge (squash) September 9, 2026 16:38
@panz3r
panz3r merged commit 0e328f2 into main Sep 9, 2026
17 checks passed
@panz3r
panz3r deleted the chore/upgrade-pnpm-v12 branch September 9, 2026 16:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The updated pnpm-lock.yaml contains multiple YAML documents / duplicated root keys, which can break pnpm’s lockfile parsing and installs.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (1)

pnpm-lock.yaml:160

  • pnpm-lock.yaml currently contains a second YAML document separator (---) and repeats top-level keys (lockfileVersion, importers, etc.). pnpm lockfiles are expected to be a single YAML document; multiple documents / duplicated root keys can cause the lockfile to be unreadable or only partially parsed, breaking installs in CI and locally. Please regenerate the lockfile with pnpm@12.4.0 and ensure it serializes as a single document with a single root importers section (including the packageManagerDependencies info) and no extra --- separators.
  • Files reviewed: 4/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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

Labels

enhancement New feature or request github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants