Visitar URL original
chore(deps): prune stale pnpm overrides, move workspace pins to the catalog by Han5991 · Pull Request #4101 · meta/astryx · GitHub
Skip to content

chore(deps): prune stale pnpm overrides, move workspace pins to the catalog - #4101

Merged
cixzhang merged 4 commits into
meta:mainfrom
Han5991:chore/prune-pnpm-overrides
Aug 22, 2026
Merged

cixzhang merged 4 commits into
meta:mainfrom
Han5991:chore/prune-pnpm-overrides

Conversation

@Han5991

@Han5991 Han5991 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

The overrides block in pnpm-workspace.yaml had grown to 13 entries accumulated over 6 months (yarn-resolutions leftovers from #2197, security floors from #1796/#2194/#2456/#2837/#3220/#3607, version alignment from #3841). Nothing recorded which of them were still doing anything, making every future dependency upgrade fight an opaque wall of forced resolutions.

Method

Each entry was verified empirically: remove the override, pnpm install --lockfile-only, compare resolved versions, then pnpm audit (baseline with all overrides: 0 vulnerabilities; with all overrides removed: 18 — all attributable to exactly three entries).

Removed (9 entries)

No-ops — the graph resolves to the same (or a floor-satisfying) version without them:

Override Natural resolution Origin
@stylexjs/stylex ^0.19.0 0.19.0 (unchanged) #3841 alignment
tmp >=0.2.6 0.2.7 #2456 CVE, upstream caught up
@babel/core ^7.29.6 7.29.7 #3220
hono ^4.12.25 4.12.27 #3220
read-yaml-file>js-yaml ^3.15.0 3.15.0 #3607, v3 line patched upstream
@changesets/parse>js-yaml >=4.2.0 4.3.0 — satisfies the floor by itself #3607; the override was force-feeding an out-of-range js-yaml 5.2.0 major into a ^4 consumer
picomatch ^4.0.4 + micromatch>picomatch + anymatch>picomatch identical 2.3.2 + 4.0.4 split yarn-resolutions leftovers (#2197)

Dedup-only forces — removal restores each consumer's own declared range (audit-neutral):

  • prettier ^3.9.3 — @changesets/write gets its declared prettier 2.8.8 back (internal formatting only; repo formatting uses the root devDep, now catalog:).
  • minimatch ^9.0.7 — glob@7 returns to its v3-API minimatch 3.1.5 instead of being forced onto v9; glob@13 gets 10.2.5.

Kept (3 live security floors, now documented in-file)

Each remaining entry now records the dependent that pins the vulnerable version and its deletion condition:

Override Blocks Removable when
postcss ^8.5.10 next@15 → 8.4.31 (<8.5.10 advisory) Next raises its postcss
dompurify ^3.4.11 monaco-editor@0.55 → 3.2.7 (16 advisories; strictest patch line is exactly 3.4.11) monaco-editor catches up
esbuild >=0.28.1 tsup@8.5 → 0.27.7 (0.27.3–0.28.0 advisory) tsup raises its esbuild range

Catalog conversion

Workspace-wide pins that the pruned overrides had been enforcing move to the pnpm catalog: next to the existing vite entry, so each has a single bump point: @stylexjs/stylex, @stylexjs/babel-plugin, prettier, esbuild (7 declarations across root, packages/core, packages/build, apps/sandbox, apps/docsite). Peer ranges are deliberately untouched — they are consumer compatibility contracts, not workspace pins. The three security floors above cannot move to the catalog: catalog: only applies where a workspace package declares the dependency directly, and these guard transitive paths inside next/monaco-editor/tsup.

Verification

  • pnpm audit: 0 vulnerabilities before and after.
  • Resolved versions after the change are byte-identical for every pruned no-op; the only graph changes are the two documented dedup splits and js-yaml 5.2.0 → 4.3.0.
  • Full node test project (CLI, build tooling, changesets checks — the consumers of glob/minimatch/js-yaml/prettier): 2129/2129 pass.
  • check:repo (sync, package boundaries, changesets, demo media, executable bits): pass.

Closes #4338

@vercel

vercel Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 20, 2026 2:55pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 20, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@Han5991

Han5991 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (08c99b8) to resolve the pnpm-workspace.yaml conflict. The lockfile was regenerated with pnpm install rather than hand-merged.

How the conflict was resolved

This PR's pruning and catalog move are kept as-is. Every security floor main gained after this branch was cut is preserved, since they postdate the audit in the original commit message:

The pruned entries main did not touch (picomatch trio, minimatch, tmp, @babel/core, hono, and the prettier/@stylexjs/stylex catalog moves) stay pruned.

Overlap with #4402

While verifying, pnpm audit flagged two js-yaml advisories that exist on main today: the '@changesets/parse>js-yaml': '>=4.2.0' floor is unbounded, so it resolves the chain onto js-yaml 5.2.1, inside the vulnerable >=5.0.0 <=5.2.1 range.

#4402 already fixes exactly this by moving both js-yaml chains to 5.2.2 and excluding js-yaml@5.2.2 from minimumReleaseAge. I've adopted that same fix here so this branch does not regress the floor, with one deviation: the ranges are written as ^5.2.2 instead of >=5.2.2. An unbounded >= is what dragged this chain onto a vulnerable major in the first place, and a future js-yaml 6 would repeat it.

If #4402 lands first, this becomes a no-op on those two lines — happy to drop them and rebase instead. Sequencing is up to you.

Verification

  • pnpm audit: 12 → 10 findings. The two js-yaml advisories clear; the remaining 10 (next ×8, @hono/node-server, brace-expansion) are identical to main's baseline, confirmed by auditing a clean worktree at 08c99b8.
  • pnpm changeset status runs clean — no safeLoad error, so read-yaml-file 2.x is fine on js-yaml 5.
  • pnpm check:repo passes; @astryxdesign/build and @astryxdesign/core build (5719 StyleX rules, CSS + UMD emitted).

@Han5991

Han5991 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Lint was failing on the rebase — pushed a fix.

What broke

Pruning minimatch: ^9.0.7 let @eslint/config-array resolve minimatch 10, which calls the named expand export. main's brace-expansion: ^2.1.2 floor (added in #4398, after this branch was cut) pins brace-expansion to 2.x, which only has the default CJS export:

TypeError: (0 , brace_expansion_1.expand) is not a function
    at braceExpand (node_modules/minimatch/dist/commonjs/index.js:157:41)
    at doMatch (node_modules/@eslint/config-array/dist/cjs/index.cjs:422:13)

Why the fix is to drop brace-expansion too, not to keep minimatch

^2.1.2 sits below the declared range of every consumer in the graph — minimatch@10 (via @eslint/config-array) declares ^5.0.5, minimatch@3 (via @babel/cli) declares ^1.1.7. It was a downgrade, not a floor, and it only stayed invisible while the equally stale minimatch force held minimatch on a line that still used the default export.

Unforced, each consumer resolves inside its own range — brace-expansion 5.0.7 and 1.1.16 — and ESLint runs clean. So both entries are pruned rather than one restored.

Verification

  • pnpm lint: 0 errors. (Locally it also reports ~23.5k errors under apps/docsite/public/monaco/ and public/vendor/, but both are gitignored, untracked build artifacts that a fresh CI checkout does not have — the count is identical with minimatch 9 or 10, so it is unrelated noise.)
  • pnpm test: 393 files / 7933 tests pass.
  • pnpm audit: 10 findings, unchanged from the previous push and 2 fewer than main's 12.
  • pnpm check:repo, @astryxdesign/build and @astryxdesign/core builds all pass.

The commit message and the comments in pnpm-workspace.yaml are updated accordingly — the original message described minimatch as a dedup-only force, which was right about the outcome but missed that it was entangled with the brace-expansion floor.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for doing this the careful way — pulling each entry, re-resolving and re-auditing is the right method, and it shows: on your own base the prune takes pnpm audit from 26 findings to 22.

Two of the entries stopped being safe to drop while this sat, though. Main floors brace-expansion at ^2.1.4 and hono at ^4.12.34 now, and this deletes both — putting them back gets you to 17.

You're right that ^2.1.2 downgrades and takes ESLint out with it. The floor belongs on the 5.x line, inside minimatch 10's own ^5.0.5, so nothing else moves:

brace-expansion: ^5.0.9
hono: ^4.12.34

Main's overrides block has changed a lot since July and this won't merge clean regardless — could you merge main and re-run your removal pass on top of it?

[Reviewed by Robohands]

Comment thread pnpm-workspace.yaml Resolved
Comment thread apps/docsite/package.json Resolved
…atalog

Re-verified every override entry by removing it, re-resolving the lockfile, and running pnpm audit. The entries that no longer do anything useful are removed: stylex, tmp, @babel/core, hono, both scoped js-yaml floors and the picomatch trio carried over from yarn resolutions all resolve identically without the override, and prettier and minimatch were dedup-only forces whose removal lets consumers follow their own declared ranges.

brace-expansion ^2.1.2 goes too. It was added in meta#4398 as a security floor, but 2.x sits below the declared range of every consumer in the graph — minimatch@10 (via @eslint/config-array) declares ^5.0.5, minimatch@3 (via @babel/cli) declares ^1.1.7 — so it was a downgrade, not a floor. It stayed invisible only because the equally stale minimatch ^9.0.7 force held minimatch on a line that still used brace-expansion's default CJS export. Dropping minimatch alone lets @eslint/config-array resolve minimatch 10, which calls the named `expand` that 2.x does not have, and ESLint dies with "brace_expansion_1.expand is not a function". Dropping both lets each consumer resolve inside its own range (5.0.7 and 1.1.16) and ESLint runs clean.

The entries that guard live advisories stay, documented with the dependent that pins the vulnerable version and the condition for deleting them: postcss ^8.5.18 (next@15 pins 8.4.31), dompurify ^3.4.12 (monaco-editor@0.55 pins 3.2.7, 16 advisories), esbuild >=0.28.1 (tsup@8.5 resolves 0.27.7), fast-uri ^3.1.4 (meta#4398), sharp ^0.35.3 (meta#4449), and the read-yaml-file 2.x lift.

Both js-yaml chains move to ^5.2.2, adopting the fix in meta#4402 — the previous '>=4.2.0' floor was unbounded and resolved onto js-yaml 5.2.1, inside the vulnerable >=5.0.0 <=5.2.1 range. Written as a caret rather than '>=' so a future js-yaml 6 cannot repeat that. js-yaml@5.2.2 is added to minimumReleaseAgeExclude so the floor can resolve.

Workspace-wide version pins that lived in overrides move to the pnpm catalog alongside vite: @stylexjs/stylex, @stylexjs/babel-plugin, prettier, esbuild. Peer ranges stay untouched — they are consumer contracts, not workspace pins.

pnpm audit goes from 12 findings to 10; the remaining 10 match main's baseline exactly.

� Conflicts:
�	pnpm-workspace.yaml
Per cixzhang's review: floor brace-expansion on the 5.x line (^5.0.9, inside minimatch@10's own ^5.0.5) instead of re-pinning 2.x and forcing minimatch alongside it — minimatch now resolves on its own. Also move @stylexjs/postcss-plugin into the catalog; it was left literal next to the now-catalog stylex/babel-plugin pins and would have silently drifted on the next bump.

Re-verified every remaining override against the current lockfile the same way: drop it, re-resolve, check what actually lands. hono, @changesets/parse>js-yaml, fast-uri, ip-address, and nanoid all resolve to safe versions unforced now, so they're pruned (hono also drops out of minimumReleaseAgeExclude). @hono/node-server and read-yaml-file (+ its js-yaml floor) stay — pnpm audit reports clean without them, but the actual resolved versions without the override are vulnerable (@hono/node-server 1.19.17, read-yaml-file 1.x pulling js-yaml 3.x), which audit's advisory feed doesn't catch.

pnpm install --frozen-lockfile, pnpm audit (0 findings), and eslint all pass on the result.
…rride

@modelcontextprotocol/sdk 1.30.0 widens its @hono/node-server range to '^1.19.9 || ^2.0.5', so the patched 2.x line resolves on its own now — no override needed to hold it there. Verified: @hono/node-server resolves to 2.1.0, hono to 4.13.1, pnpm audit stays clean.

pnpm install --frozen-lockfile and eslint pass on the result.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks — the re-verify is thorough, and dropping @hono/node-server via the SDK bump is better than flooring it. Merging.

Nit: apps/template-viewer/package.json:15 stylex is still literal — it'll drift off the catalog.

[Reviewed by Robohands]

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 22, 2026
@cixzhang
cixzhang merged commit 1b6ec82 into meta:main Aug 22, 2026
21 checks passed

This branch was successfully deployed

1 active deployment
Preview — e6ee2257 Deployed Aug 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm overrides block has 13 accumulated entries with no record of which are still load-bearing

2 participants