Skip to content

chore: upgrade to pnpm 11 via corepack with defense-in-depth workspace#141

Merged
jaredwray merged 3 commits into
mainfrom
claude/upgrade-pnpm-11-bvlU0
May 18, 2026
Merged

chore: upgrade to pnpm 11 via corepack with defense-in-depth workspace#141
jaredwray merged 3 commits into
mainfrom
claude/upgrade-pnpm-11-bvlU0

Conversation

@jaredwray

Copy link
Copy Markdown
Owner

Summary

  • Upgrades the package manager from pnpm 10 to pnpm 11 via corepack
  • Pins packageManager to pnpm@11.1.3 and sets engines.node to ^22.13.0 (pnpm 11 requires Node >= 22.13)
  • Replaces every pnpm/action-setup@v4 step with corepack enable so the version comes from package.json rather than each workflow
  • Bumps the test matrix in tests.yaml from [20, 22, 24] to [22, 24, 26] (Node 20 dropped because pnpm 11 no longer supports it)
  • Applies the agentic defense-in-depth pnpm-workspace baseline from defense-in-depth-nodejs.md §4:
    • minimumReleaseAge: 10080 (7 days, was 2880 = 2 days)
    • minimumReleaseAgeStrict: true (fail closed instead of falling back)
    • minimumReleaseAgeIgnoreMissingTime: false (missing publish-time fails closed)
    • blockExoticSubdeps: true
    • strictDepBuilds: true
    • dangerouslyAllowAllBuilds: false
    • trustPolicy: no-downgrade
  • Migrates onlyBuiltDependencies (array) to allowBuilds (map of name: true) as required by pnpm 11
  • Consolidates pnpm settings (overrides, allowed builds) out of package.json and into pnpm-workspace.yaml, so the security policy lives in one reviewed file

Test plan

  • corepack enable + pnpm install --frozen-lockfile succeeds with pnpm 11.1.3
  • pnpm build succeeds (tsdown target now resolves to node22.13.0 from engines)
  • pnpm test:ci passes — 413 tests, 100% line coverage
  • CI matrix passes on Node 22, 24, 26

Notes

The lockfile changed because:

  • The glob@<=11.1.0 override is now recorded in pnpm-lock.yaml (it was in pnpm-workspace.yaml already but the lockfile was generated before pnpm enforced it).
  • A few transitive deps drop out under pnpm 11's stricter resolution (acorn, buffer-from, @jridgewell/source-map).

Sources:


Generated by Claude Code

- Pin packageManager to pnpm@11.1.3 and set engines.node to ^22.13.0
- Replace pnpm/action-setup with corepack enable across all workflows
- Bump test matrix from [20, 22, 24] to [22, 24, 26]
- Apply agentic defense-in-depth pnpm-workspace settings:
  minimumReleaseAge 10080 (7 days), minimumReleaseAgeStrict,
  minimumReleaseAgeIgnoreMissingTime false, blockExoticSubdeps,
  strictDepBuilds, dangerouslyAllowAllBuilds false, trustPolicy no-downgrade
- Migrate onlyBuiltDependencies to allowBuilds map
- Consolidate pnpm config from package.json into pnpm-workspace.yaml
@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6b4c4fa) to head (8bf7cd1).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #141   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           37        37           
  Lines         1089      1089           
  Branches       222       221    -1     
=========================================
  Hits          1089      1089           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the project's package management and security configurations by specifying Node.js and pnpm versions, strengthening pnpm workspace policies, and removing the terser dependency. Feedback suggests further improving security by adding an override for the vulnerable @ungap/structured-clone package and pruning the allowBuilds list to remove unnecessary script execution permissions for core-js, protobufjs, and unrs-resolver.

Comment thread pnpm-workspace.yaml
vue-demi: true

overrides:
set-cookie-parser: 2.7.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-high high

The pnpm-lock.yaml file (line 1337) indicates that @ungap/structured-clone@1.3.0 is deprecated due to a potential security vulnerability (CWE-502). Since this PR is consolidating security policies and overrides, it is recommended to add an override to ensure a safe version (1.3.1 or higher) is used.

  set-cookie-parser: 2.7.2
  '@ungap/structured-clone': '>=1.3.1'

Comment thread pnpm-workspace.yaml
Comment on lines +9 to +15
allowBuilds:
'@swc/core': true
core-js: true
esbuild: true
protobufjs: true
unrs-resolver: true
vue-demi: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To align with the defense-in-depth strategy of minimizing script execution, consider removing unnecessary packages from the allowBuilds list:

  • core-js: Its postinstall script is primarily for display messages and is not required for functionality.
  • protobufjs: Version 7.x does not have a postinstall script.
  • unrs-resolver: This package is no longer present in the dependency tree (pnpm-lock.yaml).
allowBuilds:
  '@swc/core': true
  esbuild: true
  vue-demi: true

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d93b64edd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/tests.yaml Outdated
Comment on lines 23 to 25
- run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Run Corepack after selecting the job's Node version

corepack enable is executed before actions/setup-node, but Corepack installs shims next to the currently resolved corepack binary; after setup-node switches PATH to the matrix Node, that Node installation may not have the pnpm shim enabled. In this workflow, pnpm can therefore resolve to a shim from the runner’s preinstalled Node (or be missing), which can bypass the intended matrix version or fail entirely when pnpm 11 requires a newer runtime. Move corepack enable to after actions/setup-node (same issue appears in the other updated workflows).

Useful? React with 👍 / 👎.

Comment thread package.json Outdated
"types": "dist/index.d.mts",
"packageManager": "pnpm@11.1.3",
"engines": {
"node": "^22.13.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Widen Node engine range to include supported newer majors

Setting engines.node to ^22.13.0 restricts the package to <23.0.0, which excludes Node 24 and 26 even though the CI matrix explicitly tests those versions. Users with engine-strict enabled (common in CI and some org defaults) will get install failures on newer supported Node majors; use a minimum range like >=22.13.0 if newer majors are intended to be supported.

Useful? React with 👍 / 👎.

claude added 2 commits May 18, 2026 16:42
- Override @ungap/structured-clone to >=1.3.1 (1.3.0 deprecated, CWE-502)
- Prune allowBuilds: drop unrs-resolver (not in tree), set core-js and
  protobufjs to false (postinstalls are informational/no-op)
- Widen engines.node from ^22.13.0 to >=22.13.0 so it matches the
  Node 22/24/26 test matrix and engine-strict consumers
- Move corepack enable after setup-node so shims target the matrix Node
- Drop cache: 'pnpm' since setup-node's pnpm cache needs pnpm available
  before setup-node runs, which conflicts with the new ordering
setup-node v5 added auto package-manager-cache that detects packageManager
from package.json and invokes pnpm during the setup step. Since corepack
runs after setup-node, pnpm isn't on PATH yet and setup-node fails with
"Unable to locate executable file: pnpm". Set package-manager-cache: false
on every setup-node@v5 step to opt out of that auto-detection.
@jaredwray jaredwray merged commit c670734 into main May 18, 2026
9 checks passed
@jaredwray jaredwray deleted the claude/upgrade-pnpm-11-bvlU0 branch May 18, 2026 18:58
@jaredwray jaredwray mentioned this pull request May 18, 2026
4 tasks
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.

2 participants