chore: upgrade pnpm 9 → 11 with supply-chain protection#235
chore: upgrade pnpm 9 → 11 with supply-chain protection#235cameronapak wants to merge 4 commits into
Conversation
- Upgrade pnpm 9.0.0 → 11.1.1 (packageManager, engines, corepack) - Add minimumReleaseAge: 4320 (3-day cooldown) to pnpm-workspace.yaml - Move overrides from package.json → pnpm-workspace.yaml (pnpm 11 requirement) - Add @internal/eslint-config and eslint-plugin-storybook as root devDeps - Add allowBuilds for esbuild, @parcel/watcher, msw - Remove version pins from CI workflows (reads from packageManager field) - Update AGENTS.md with pnpm 11 refs and supply-chain docs
|
- Bump node-version from 20 → 22 in ci.yml and storybook.yml (pnpm 11 requires Node >= 22.13) - Bump engines.node from >=20 → >=22 in package.json - Remove minimumReleaseAgeExclude — workspace packages bypass the gate inherently - Update AGENTS.md Node requirement references
|
Hey @jhampton, Can I get your feedback on this PR? Mainly around the idea of it. I just want to make sure that with the rise of supply chain attacks, that we are protected on our repos. So I just want to share this with you and let me know so that I can hear your feedback (any feedback) |
The recent news of seeing more and more supply-chain attacks via npm has caused me to want to make sure we're as secure as can be. That's what this PR does.
Summary
minimumReleaseAge: 4320(3-day cooldown) to mitigate supply-chain attacks on new package versionspackage.json→pnpm-workspace.yaml(pnpm 11 breaking change — overrides in package.json no longer enforce for auto-installed peers)pnpm/action-setup@v4now reads frompackageManagerfield (single source of truth)Changes
package.jsonpackageManager: "pnpm@11.1.1",engines.pnpm: ">=11.0.0", removedpnpm.overrides, added@internal/eslint-config+eslint-plugin-storybookas root devDepspnpm-workspace.yamlminimumReleaseAge,overrides,allowBuilds.github/workflows/ci.ymlversion: 9.0.0pins.github/workflows/release.ymlversion: 9.0.0pin.github/workflows/storybook.ymlversion: 9.0.0pinAGENTS.mdpnpm 11 breaking changes handled
pnpm-workspace.yaml(notpackage.json) to enforce for auto-installed peersallowBuildsapproval (esbuild, @parcel/watcher, msw)@internal/eslint-configandeslint-plugin-storybookmust be root devDependenciesminimumReleaseAgeblocks packages published < 3 days ago; override with--forceif needed urgentlyVerification
pnpm lint— all 7 packages passpnpm typecheck— all 6 packages passpnpm test— 88 tests pass (core: 288, hooks: 261, ui: 88)Greptile Summary
This PR upgrades pnpm from 9.0.0 to 11.1.1 and adds supply-chain protection (
minimumReleaseAge: 4320) to block packages published within the last 3 days, while handling all required pnpm 11 breaking changes.pnpm.overridesfrompackage.jsontopnpm-workspace.yamlso they apply to auto-installed peers, and addsallowBuildsfor the three packages (esbuild,@parcel/watcher, msw) that need native build scripts.version: 9.0.0pins from all CI workflows sopnpm/action-setup@v4reads the single source of truth from thepackageManagerfield (now with SHA-512 integrity hash).engines.nodeto>=22.0.0, matching pnpm 11's runtime requirement.Confidence Score: 5/5
Safe to merge — this is a well-scoped tooling upgrade with all pnpm 11 breaking changes explicitly handled.
All three workflow files correctly delegate pnpm version resolution to the packageManager field, overrides are properly migrated to pnpm-workspace.yaml, allowBuilds covers the packages that need build scripts, and the minimumReleaseAge supply-chain guard is correctly configured. The only nit is that engines.node could be tightened to match what pnpm 11 actually requires, as documented in AGENTS.md.
package.json — engines.node could be tightened from >=22.0.0 to >=22.13.0 to match the runtime requirement documented in AGENTS.md.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Developer or CI pushes code] --> B[pnpm action-setup v4] B --> |reads packageManager field| C[pnpm 11.1.1 installed] C --> D{pnpm install} D --> |package published less than 3 days ago| E[Blocked by minimumReleaseAge] D --> |package published 3 or more days ago| F[Install proceeds] D --> |workspace packages| F F --> G{allowBuilds check} G --> |esbuild, parcel-watcher, msw| H[Build scripts allowed] G --> |all other packages| I[Build scripts blocked] H --> J[overrides applied from pnpm-workspace.yaml] I --> J J --> |react 19.1.2 and vite 5.4.21 plus| K[Dependency tree resolved]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[Developer or CI pushes code] --> B[pnpm action-setup v4] B --> |reads packageManager field| C[pnpm 11.1.1 installed] C --> D{pnpm install} D --> |package published less than 3 days ago| E[Blocked by minimumReleaseAge] D --> |package published 3 or more days ago| F[Install proceeds] D --> |workspace packages| F F --> G{allowBuilds check} G --> |esbuild, parcel-watcher, msw| H[Build scripts allowed] G --> |all other packages| I[Build scripts blocked] H --> J[overrides applied from pnpm-workspace.yaml] I --> J J --> |react 19.1.2 and vite 5.4.21 plus| K[Dependency tree resolved]Comments Outside Diff (1)
pnpm-lock.yaml, line 194-195 (link)@swc/coreno longer resolved as atsuppeerAcross every package (
root,packages/core,packages/hooks,packages/ui),tsup@8.5.0previously resolved with@swc/core@1.13.5as a satisfied peer; after this upgrade it resolves without it. This means tsup will now use esbuild as its transformer instead of SWC. If any package'stsup.config.tsexplicitly sets esbuildOptions or SWC-specific options, behaviour changes silently. The test suite passing is reassuring, but it's worth confirming notsup.configreferencesexperimentalDtsor similar options that behaved differently under SWC.Prompt To Fix With AI
Reviews (4): Last reviewed commit: "Merge branch 'main' into chore/pnpm-11-u..." | Re-trigger Greptile