Skip to content

build: switch to pnpm for development - #488

Merged
romgrk merged 3 commits into
masterfrom
switch-to-pnpm
Jul 4, 2026
Merged

build: switch to pnpm for development#488
romgrk merged 3 commits into
masterfrom
switch-to-pnpm

Conversation

@romgrk

@romgrk romgrk commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Switches the development package manager from npm to pnpm. Consumers are unaffected: the package still publishes to npm, and the install script still goes through npx node-pre-gyp install --fallback-to-build under whatever package manager the end user runs.

Changes

  • Lockfile: package-lock.jsonpnpm-lock.yaml, converted with pnpm import so resolved versions are preserved.
  • Overrides: the npm overrides block moves to pnpm-workspace.yaml as parent>child selectors. Note that pnpm 11 no longer reads settings from the pnpm field in package.json, so the file is used purely as a settings carrier (this is still a single-package repo, no workspaces).
  • Build scripts: aws-sdk's postinstall is denied via allowBuilds — it's only require()d by node-pre-gyp when publishing prebuilts, which still resolves fine under pnpm since aws-sdk is a direct devDependency at the root of node_modules.
  • CI: each job installs pnpm with npm i -g pnpm@11 (the npm shim also works inside the MSYS2 shell), and npm install --build-from-source becomes npm_config_build_from_source=true pnpm install because pnpm rejects unknown CLI flags. ci.sh now calls pnpm test / pnpm run build:test-fixtures.
  • Docs: dev-facing instructions updated. Consumer-facing npm install node-gtk docs, the create-app scaffold output, and the release checklist's npm version/npm publish (registry commands, PM-agnostic) intentionally stay npm.

Verification

Local (Linux, Node 26.4.0): pnpm install fetches the S3 prebuilt and runs the root install script; overrides verified applied (aws-sdk>uuid resolves to 11.1.1); full test suite: 100 passing, 1 failing — the failure (tests/require.js, system libpeas typelibs requiring GIRepository 3.0) reproduces identically on npm-based master, i.e. pre-existing/environmental, not a regression.

🤖 Generated with Claude Code

romgrk and others added 3 commits July 4, 2026 19:22
Replace npm with pnpm as the development package manager:

- package-lock.json -> pnpm-lock.yaml (converted with `pnpm import`,
  so resolved versions are preserved)
- npm `overrides` -> `overrides` in pnpm-workspace.yaml (pnpm 11 no
  longer reads settings from the package.json `pnpm` field); the
  nested npm form maps to `parent>child` selectors
- aws-sdk's postinstall is not needed (it is only require()d by
  node-pre-gyp when publishing prebuilts), so it is denied via
  `allowBuilds` rather than approved
- CI installs pnpm via `npm i -g pnpm@11` (works in the MSYS2 shell
  too) and passes --build-from-source as the
  npm_config_build_from_source env var, since pnpm rejects unknown
  CLI flags
- dev docs updated; consumer-facing `npm install node-gtk` docs and
  the create-app scaffold stay npm, since those run on user machines

Consumers are unaffected: the package still publishes to npm and the
install script still goes through npx node-pre-gyp.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The first CI run silently tested the stale v4.1.1 S3 prebuilt: unlike
npm, pnpm does not forward inherited npm_config_* env vars (or unknown
CLI flags) to lifecycle scripts, so npm_config_build_from_source=true
never reached node-pre-gyp and the install script downloaded the
prebuilt. That surfaced as conversion__gvalue_autobox.js failing on
every job, since the merge ref includes #487 but the prebuilt predates
it.

Skip the install script entirely and run the source build as an
explicit step instead:

    pnpm install --ignore-scripts
    pnpm run build:full        # node-pre-gyp rebuild

Verified locally: against the downloaded prebuilt the autobox test
reproduces CI's failure; after `pnpm run build:full` it passes and the
suite is green (101 passing, plus the known environmental require.js
failure that also occurs on master).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@romgrk
romgrk merged commit f4763a3 into master Jul 4, 2026
9 checks passed
@romgrk
romgrk deleted the switch-to-pnpm branch July 4, 2026 23:44
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.

1 participant