Skip to content

chore: upgrade pinned package manager to pnpm 11 - #3700

Merged
cixzhang merged 1 commit into
meta:mainfrom
bhamodi:chore/pnpm-11-upgrade
Jul 10, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
bhamodi:chore/pnpm-11-upgrade

Conversation

@bhamodi

@bhamodi bhamodi commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upgrades the pinned package manager from pnpm 10 ([email protected]) to pnpm 11 ([email protected]), per the evaluation in #3683. Migration guide: https://pnpm.io/migration

pnpm 11 changed several things this repo relied on, so this is more than a version bump. Each change below was surfaced by actually running pnpm 11 and is handled here.

Changes

Config migration (pnpm 11 no longer reads these from package.json / .npmrc):

  • package.json: packageManager → [email protected]; removed the pnpm field.
  • pnpm-workspace.yaml: added overrides (moved verbatim from package.json).
  • pnpm-workspace.yaml: replaced onlyBuiltDependencies with pnpm 11's allowBuilds map (esbuild, sharp, @swc/core, @parcel/watcher, core-js, puppeteer → true). pnpm 11 ignores onlyBuiltDependencies and gates build scripts through allowBuilds / pnpm approve-builds.
  • pnpm-workspace.yaml: moved hoisting/linker settings (nodeLinker: hoisted, shamefullyHoist: true, linkWorkspacePackages: true) from .npmrc — pnpm 11 doesn't apply them from .npmrc, which was silently breaking the flat node_modules layout (see below).
  • Docs: pnpm version references in README.md, CONTRIBUTING.md, CLAUDE.md, docs/release.md.

Lockfile regenerated under pnpm 11. Its stricter minimumReleaseAge enforcement (#3669) now runs on every install and rejected 14 too-new entries that had slipped into the pnpm 10 lockfile (e.g. @typescript-eslint/* 8.63.0, caniuse-lite, picomatch 4.0.5). A fresh resolve re-pinned them to their latest ≥7-day-old versions — hence the large lockfile diff with some dependency downgrades. This is the supply-chain policy working as intended.

CI needs no workflow edits (pnpm/action-setup@v6 reads packageManager). Node stays 22+/24, satisfying pnpm 11's Node 22+ requirement.

Why shamefully-hoist had to move (and a phantom-dep note)

With .npmrc's shamefully-hoist no longer applied under pnpm 11, @heroicons/react stopped being hoisted to the root, which broke 5 core test files that import it without declaring it (a pre-existing phantom dependency). Moving the setting to pnpm-workspace.yaml restores the flat layout and fixes it. ⚠️ Reviewers: worth a scan for other phantom deps the flat layout may be masking elsewhere in the monorepo; longer-term those should be declared explicitly.

⚠️ Release / trusted-publishing (needs a maintainer)

docs/release.md pinned pnpm 10.34.1 deliberately: the 10.x line shells out to npm publish for OIDC + provenance and avoided the pnpm 11.0–11.1.2 OIDC 404 regression (fix landed in 11.1.3). 11.10.0 clears that floor, but I could not exercise the publish/OIDC/provenance path. Please dry-run trusted publishing under pnpm 11 before the next release.

Verification

Verified locally with pnpm 11.10.0:

  • pnpm install (offline re-link) succeeds; @heroicons re-hoisted to root.
  • Lockfile passes the minimumReleaseAge supply-chain check.
  • allowBuilds accepted; no ERR_PNPM_IGNORED_BUILDS.
  • core typecheck clean; full core test suite: 182 files, 3822 tests pass.
  • Pre-commit hook (lint-staged + check:sync/check:package-boundaries/check:changesets/check:demo-media) passes under pnpm 11.

Left for CI / a maintainer with a full networked env:

  • Full monorepo build + all package tests (docsite, cli, themes, lab, charts) under pnpm 11
  • Trusted-publishing / OIDC dry-run (see above)
  • Phantom-dependency scan enabled by the hoist change

Migration checklist (#3683)

  • overrides → pnpm-workspace.yaml
  • onlyBuiltDependencies → allowBuilds
  • Hoisting settings .npmrc → pnpm-workspace.yaml
  • packageManager → pnpm 11; docs updated
  • Lockfile regenerated + minimumReleaseAge re-verified under pnpm 11
  • CI reads pin via pnpm/action-setup@v6 (no workflow change)
  • Trusted-publishing/OIDC path verified under pnpm 11

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

@bhamodi is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 8, 2026
Adopt pnpm 11 ([email protected]), per the evaluation in meta#3683.

Config migration (pnpm 11 no longer reads these from package.json / .npmrc):
- Bump `packageManager` to [email protected] (>= 11.1.3, past the 11.0-11.1.2
  OIDC publish regression noted in docs/release.md).
- Move `overrides` from package.json into pnpm-workspace.yaml.
- Replace `onlyBuiltDependencies` with pnpm 11's `allowBuilds` map (esbuild,
  sharp, @swc/core, @parcel/watcher, core-js, puppeteer).
- Move hoisting/linker settings (nodeLinker, shamefullyHoist,
  linkWorkspacePackages) from .npmrc into pnpm-workspace.yaml.

Lockfile regenerated under pnpm 11: its stricter minimumReleaseAge
enforcement (now verified on every install) rejected 14 too-new entries that
had slipped into the pnpm 10 lockfile, so those were re-resolved to their
latest >=7-day-old versions.

Docs: pnpm version references updated in README, CONTRIBUTING, CLAUDE.md, and
docs/release.md.

Verified with pnpm 11.10.0: install + re-hoist, core typecheck, and the full
core test suite (3822 tests) all pass.

Refs meta#3683
@bhamodi
bhamodi force-pushed the chore/pnpm-11-upgrade branch from 1cf773d to 2de0e1b Compare July 8, 2026 23:31
@vercel

vercel Bot commented Jul 10, 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, Comment Jul 10, 2026 4:18am

Request Review

@cixzhang

Copy link
Copy Markdown
Contributor

Hmm let's try it with our canary

@cixzhang
cixzhang merged commit 5ce0259 into meta:main Jul 10, 2026
16 checks passed
cixzhang pushed a commit that referenced this pull request Jul 11, 2026
…UTING (#3750)

pnpm 11 reads nodeLinker / shamefullyHoist / linkWorkspacePackages from
pnpm-workspace.yaml, not .npmrc. #3700 migrated those three settings into
the YAML but left .npmrc in place, so the file has been a no-op since.

Verified by A/B: a directory with only .npmrc surfaces none of the three
keys in `pnpm config list`, while one with only pnpm-workspace.yaml
surfaces all three. Removing .npmrc here leaves nodeLinker: hoisted,
shamefullyHoist: true and linkWorkspacePackages: true intact, and
`pnpm install --frozen-lockfile` is a no-op ("Already up to date").

The file only carried those three keys, so it goes away entirely. It was
also making every `npm` invocation in the repo print three "Unknown
project config" warnings.

Separately, #3700 swept `pnpm@10` -> `pnpm@11` through CONTRIBUTING.md
but the verification snippet spells the version as `10.x.x`, which the
string replace never matched.
@bhamodi
bhamodi deleted the chore/pnpm-11-upgrade branch July 15, 2026 01:47
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Aug 22, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let nine packages import modules they never
declared; all nine are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- case-insensitive filesystem, date-dependent suites -- and CI
reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Aug 24, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let nine packages import modules they never
declared; all nine are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- case-insensitive filesystem, date-dependent suites -- and CI
reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 6, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 6, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

One test read a bin the same way. public-artifact-cli.test.mjs spawns tsx by
absolute path out of the repo root's node_modules/.bin, which only ever held
one because shamefullyHoist published every bin there; tsx is declared by
internal/vibe-tests, so it now spawns that package's own bin. Scripts were
never at risk -- pnpm puts both bin directories on PATH -- and the repo's only
other hardcoded root bin, tsc in cli-api-types-verify.mjs, resolves because
typescript is a root devDependency.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 10, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

One test read a bin the same way. public-artifact-cli.test.mjs spawns tsx by
absolute path out of the repo root's node_modules/.bin, which only ever held
one because shamefullyHoist published every bin there; tsx is declared by
internal/vibe-tests, so it now spawns that package's own bin. Scripts were
never at risk -- pnpm puts both bin directories on PATH -- and the repo's only
other hardcoded root bin, tsc in cli-api-types-verify.mjs, resolves because
typescript is a root devDependency.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 10, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

One test read a bin the same way. public-artifact-cli.test.mjs spawns tsx by
absolute path out of the repo root's node_modules/.bin, which only ever held
one because shamefullyHoist published every bin there; tsx is declared by
internal/vibe-tests, so it now spawns that package's own bin. Scripts were
never at risk -- pnpm puts both bin directories on PATH -- and the repo's only
other hardcoded root bin, tsc in cli-api-types-verify.mjs, resolves because
typescript is a root devDependency.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 11, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

One test read a bin the same way. public-artifact-cli.test.mjs spawns tsx by
absolute path out of the repo root's node_modules/.bin, which only ever held
one because shamefullyHoist published every bin there; tsx is declared by
internal/vibe-tests, so it now spawns that package's own bin. Scripts were
never at risk -- pnpm puts both bin directories on PATH -- and the repo's only
other hardcoded root bin, tsc in cli-api-types-verify.mjs, resolves because
typescript is a root devDependency.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 13, 2026
Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (meta#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (meta#4067) and `@babel/preset-react` (meta#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

One test read a bin the same way. public-artifact-cli.test.mjs spawns tsx by
absolute path out of the repo root's node_modules/.bin, which only ever held
one because shamefullyHoist published every bin there; tsx is declared by
internal/vibe-tests, so it now spawns that package's own bin. Scripts were
never at risk -- pnpm puts both bin directories on PATH -- and the repo's only
other hardcoded root bin, tsc in cli-api-types-verify.mjs, resolves because
typescript is a root devDependency.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.
cixzhang pushed a commit that referenced this pull request Sep 14, 2026
…rts (#5327)

* chore(deps): make node_modules strict, declare what each package imports

Drops `nodeLinker: hoisted` and `shamefullyHoist: true`, both inherited
verbatim from the pre-pnpm-11 .npmrc (#3700). nodeLinker was annotated there
as pnpm's default, which it is not -- the default is `isolated` -- and pairing
it with shamefullyHoist is pnpm/pnpm#6620. shamefullyHoist is
`publicHoistPattern: '*'`, which let eleven packages import modules they never
declared; all eleven are now declared, at the versions the workspace already
resolved. The Babel toolchain and Testing Library move into the catalog, each
having been duplicated across 4-6 packages.

Consolidating them surfaced an incoherent Babel pin: Dependabot had raised
`@babel/cli` (#4067) and `@babel/preset-react` (#3839) to 8.x on their own
while `@babel/core` and `@babel/preset-typescript` stayed on 7.x, and the 8.x
releases peer on `@babel/core: ^8.0.0` -- a set no single core version can
satisfy. All four now sit on ^7.29.7, matching the core that actually runs;
`pnpm peers check` drops from 4 unmet peers to 2 unrelated ones. Moving to
Babel 8 is a migration of its own.

Also fixes a latent `astryx doctor` bug the linker change exposed:
checkPeerDeps resolved peers with `require.resolve(name, {paths: [cwd]})`, but
Node folds NODE_PATH in regardless, so a peer merely reachable from the ambient
environment read as installed and doctor stayed silent about a missing one. It
now walks the project's own node_modules and reads package.json off disk, so
every peer gets range-checked. The existing test caught this unmodified.

One test read a bin the same way. public-artifact-cli.test.mjs spawns tsx by
absolute path out of the repo root's node_modules/.bin, which only ever held
one because shamefullyHoist published every bin there; tsx is declared by
internal/vibe-tests, so it now spawns that package's own bin. Scripts were
never at risk -- pnpm puts both bin directories on PATH -- and the repo's only
other hardcoded root bin, tsc in cli-api-types-verify.mjs, resolves because
typescript is a root devDependency.

Verified on a recreated node_modules: build, test, storybook:build, docsite and
sandbox builds, check:repo, verify-exports, eslint, and every typecheck CI gates
all pass. The local test failures that remain reproduce on main from a clean
worktree -- BSD `cp` has no `--reflink`, and two story titles predate the story
tree's shape rule -- and CI reported none of them.

* chore(changeset): patch @astryxdesign/cli for the doctor peer-resolution fix

The linker change also alters published behavior in `astryx doctor`, so the
fix needs a changeset to reach users in the next release.

* fix(cli): resolve packages through the project's own node_modules chain

Dropping the hoisted layout removes the flat root copy that three
resolutions quietly relied on. Each landed on main after this branch's
previous rebase, so CI met them for the first time here.

- packages/core used @heroicons/react in its Button accessibility
  fixtures without declaring it (#6131). Storybook's typecheck and the
  Button a11y suite could not resolve it.
- build.packed-old-core.test.mjs staged the packed CLI's runtime
  dependencies from the repo root, where only a hoisted node_modules puts
  a package's own dependencies (#5543).
- core-interception's CommonJS probe reached a core through NODE_PATH,
  which is where pnpm's isolated layout exposes every package and where
  Vitest points it. Wrapping that core fails on a require(esm) namespace,
  and the coverage gap it then reported rejected every theme whose
  lineage was unobserved (#5543).

doctor's findInstalledPackage moves to foundation/fs/paths.mjs and is now
the single chain walk all three share. It answers only from the caller's
own node_modules, never from the ambient environment.

* fix(deps): declare what the shadcn registry work reaches for

The shadcn registry (#5973, #6228, #6231) landed against the hoisted layout and
reaches for three things the workspace root only carries when hoisted.

- apps/docsite's generate-data.mjs requires `recharts/package.json` to pin the
  registry's external dependency specs. docsite declares the other three of
  that list; recharts was missing, so `pnpm generate` failed and 14 docsite
  test files could not load.
- generate-shadcn-registry.mjs named `@babel/preset-typescript` as a string.
  Babel resolves a string preset from `cwd`, and the registry-contract job runs
  the script from the repo root. It is now imported, the way the StyleX plugin
  beside it already was, so it resolves through docsite's own node_modules.
- generate-shadcn-registry.test.mjs spawned `node_modules/.bin/shadcn` from the
  repo root, at four call sites. shadcn is a docsite dependency, so its bin
  lives beside that package. The test now walks up from apps/docsite to find it.

* fix(cli): resolve a package through Yarn PnP when there is no chain to walk

Addresses the review on #5327. `findInstalledPackage` walked the node_modules
chain and stopped there, so a Yarn Plug'n'Play project — which has no
node_modules at all — read as missing every Core peer.

It now asks the PnP runtime when the walk comes up empty. PnP resolves from the
project's own dependency graph and ignores NODE_PATH, so the lookup stays
project-local, which is the property the filesystem walk was introduced for.

Verified against a real Yarn 4 PnP project with @astryxdesign/core installed:
declared packages resolve and their versions read off disk, an undeclared one
is still reported missing, and poisoning NODE_PATH changes nothing. That is
strictly better than the previous `require.resolve`, which could confirm a peer
was present under PnP but never read its version, because Core does not export
`./package.json`.

Covers both layouts in paths.test.mjs, including a case pinning that a package
reachable only from NODE_PATH is not accepted.

* fix(deps): cover the shadcn variant work added since the branch base

#6246 landed against the hoisted layout after this branch was last rebased,
and reaches for two things the workspace root only carries when hoisted.

- packages/cli/authoring/shadcn/source-variants.mjs imports `@babel/core`.
  cli declares the runtime package but not its types, so `sync:api-types`
  failed with TS7016 on two lines and took `pnpm build` down with it.
  `@types/babel__core` is now declared beside it, as packages/core already
  does for the same import.
- generate-shadcn-registry.test.mjs gained a fifth call site spawning
  `node_modules/.bin/shadcn` from the repo root. The other four already go
  through shadcnBin(), which walks up from apps/docsite — the package that
  declares shadcn, and so the only place its bin lives. The new one now does
  too, and the suite is back to 24 passing.

* fix(docsite): resolve playground and shadcn dependencies through Node

Two places computed a path into the repo root instead of resolving a package,
which only works when node_modules is hoisted. Node already walks up from the
module doing the asking, so both now let it.

- generate-playground-types.mjs read @heroicons/react and recharts off the
  root. Both degraded in silence — the heroicon loop `continue`d and the
  Recharts builder returned {} — so the playground shipped without the types
  rather than failing. Recharts arrived with #6264 and is covered by
  playground-scope.test.ts, which is how it surfaced; the heroicon path has
  been there since #2535 and nothing asserts on it, so it was quietly
  producing zero variants. Resolving now throws if either is missing.
- generate-shadcn-registry.test.mjs spawned node_modules/.bin/shadcn. shadcn
  does not export ./package.json, but its bin *is* its entry, so resolving
  `shadcn` from apps/docsite and running it through process.execPath needs no
  path assumption and no NODE_PATH.

Net -8 lines in the generator. findInstalledPackage is unchanged: it reads a
consumer project, where there is no module of ours to resolve from and
NODE_PATH must not count as installed.

This branch was successfully deployed

1 active deployment
Preview — 2de0e1b0 Deployed Jul 10, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants