chore: migrate from npm workspaces to pnpm#381
Open
kraenhansen wants to merge 1 commit into
Open
Conversation
Motivation: pnpm's recursive runner (`pnpm -r run`) is fail-fast by default and runs in topological (dependency-graph) order, so the root `bootstrap` and `prerelease` no longer need the non-fail-fast `npm run <s> --workspaces` pattern that buried the real root cause under cascading failures. Workspace + package manager: - Replace the root `workspaces` array with pnpm-workspace.yaml - Add `packageManager: pnpm@10.33.0` and switch devEngines to pnpm ^10 - Allow only esbuild's build script via onlyBuiltDependencies (pnpm 10 blocks dependency lifecycle scripts by default); no shamefully-hoist needed - Replace package-lock.json with pnpm-lock.yaml; keep node_modules isolated Internal deps -> workspace:* protocol (cmake-rn, ferric, gyp-to-cmake, host, node-addon-examples, node-tests, ferric-example, test-app). Add explicit `weak-node-api` edges to node-addon-examples and node-tests so the topological bootstrap sequences weak-node-api (which builds the xcframework/.so they link) before its consumers. Phantom dependencies surfaced by pnpm's isolated node_modules (npm hoisting had masked these): - host: add `@types/babel__core` (used by src/node/babel-plugin/plugin.ts) - host: add `weak-node-api` as a devDependency (used by scripts/generate-injector.mts; previously only a peerDependency) Scripts: - bootstrap: `tsc --build && pnpm -r run bootstrap` (fail-fast, topological) - prerelease/release: make the build explicit instead of relying on npm's implicit prerelease hook (pnpm disables pre/post scripts by default) - test: `pnpm --filter ... run test` - depcheck/run-in-published: replace `npm query .workspace` with `pnpm ls -r` - Pin prettier to 3.6.2: 3.7+ is incompatible with @prettier/plugin-oxc@0.0.4 (regenerating any lockfile floated it to 3.9.5 and crashed the plugin) CI: port check.yml and release.yml to pnpm (pnpm/action-setup, cache: pnpm, `pnpm install --frozen-lockfile`, `--filter`, `pnpm exec`). The ephemeral, non-workspace macOS test app keeps its own `npm install` in scripts/init-macos-test-app.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnwodAoNbqPec77191HVXn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation: pnpm's recursive runner (
pnpm -r run) is fail-fast by defaultand runs in topological (dependency-graph) order, so the root
bootstrapand
prereleaseno longer need the non-fail-fastnpm run <s> --workspacespattern that buried the real root cause under cascading failures.
Workspace + package manager:
workspacesarray with pnpm-workspace.yamlpackageManager: pnpm@10.33.0and switch devEngines to pnpm ^10dependency lifecycle scripts by default); no shamefully-hoist needed
Internal deps -> workspace:* protocol (cmake-rn, ferric, gyp-to-cmake, host,
node-addon-examples, node-tests, ferric-example, test-app). Add explicit
weak-node-apiedges to node-addon-examples and node-tests so the topologicalbootstrap sequences weak-node-api (which builds the xcframework/.so they link)
before its consumers.
Phantom dependencies surfaced by pnpm's isolated node_modules (npm hoisting
had masked these):
@types/babel__core(used by src/node/babel-plugin/plugin.ts)weak-node-apias a devDependency (used byscripts/generate-injector.mts; previously only a peerDependency)
Scripts:
tsc --build && pnpm -r run bootstrap(fail-fast, topological)implicit prerelease hook (pnpm disables pre/post scripts by default)
pnpm --filter ... run testnpm query .workspacewithpnpm ls -r(regenerating any lockfile floated it to 3.9.5 and crashed the plugin)
CI: port check.yml and release.yml to pnpm (pnpm/action-setup, cache: pnpm,
pnpm install --frozen-lockfile,--filter,pnpm exec). The ephemeral,non-workspace macOS test app keeps its own
npm installinscripts/init-macos-test-app.ts.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01DnwodAoNbqPec77191HVXn