Skip to content

chore: migrate node backend from npm to pnpm with supply chain hardening#86

Merged
Kabidoye-17 merged 8 commits into
mainfrom
worktree-pnpm-migration
Jul 14, 2026
Merged

chore: migrate node backend from npm to pnpm with supply chain hardening#86
Kabidoye-17 merged 8 commits into
mainfrom
worktree-pnpm-migration

Conversation

@Kabidoye-17

@Kabidoye-17 Kabidoye-17 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Why?

Standardise the node/ backend on pnpm for a stricter, non-hoisted dependency graph (no phantom dependencies) plus supply-chain hardening: install-time build scripts blocked by default, a package-provenance policy, and a minimum-release-age quarantine window. node/ is the only JavaScript project in this repo. Follows the pattern established by the merged frontend-minicom-public migration.

How?

The lockfile was generated with pnpm import from package-lock.json, preserving every resolved version exactly (no drift). packageManager is pinned to pnpm@10.23.0, matching the merged frontend-minicom / frontend-minicom-public reference migrations and the sibling minicom repo. All supply-chain settings live in pnpm-workspace.yaml (not package.json#pnpm, where several are silently inert): minimumReleaseAge (7 days), trustPolicy: no-downgrade, and explicit built-dependency lists. The script/node launchers and README were updated to pnpm.

Decisions

  • sqlite3 build script is allowed to run (onlyBuiltDependencies). It fetches the native binding at install time and the app's Sequelize DB layer is non-functional without it. It's the legitimate TryGhost/node-sqlite3; Socket scores supplyChain 99 / vulnerability 100. Every other build script stays blocked.
  • esbuild stays blocked (ignoredBuiltDependencies) — it ships its real binary via an optional dep, so its own script is a no-op.
  • No corepack, no preinstall guard — this is a public repo used by external interview candidates, so the launchers just run pnpm install. Simplest possible setup; no corepack + pnpm bootstrap, and no enforcement script shipping to consumers.

Generated with Claude Code

Kabidoye-17 and others added 5 commits July 13, 2026 21:49
- Pin pnpm@11.12.0 via packageManager field
- Replace package-lock.json with pnpm-lock.yaml (pnpm import; versions preserved)
- Add pnpm-workspace.yaml supply-chain block: minimumReleaseAge (7d),
  trustPolicy no-downgrade, allowBuilds (sqlite3 allowed, esbuild blocked)
- Bootstrap pnpm via corepack in script/node setup/start wrappers
- Update node/README migration commands to pnpm

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…w syntax, workspace comments

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…download)

Corepack fetches the pinned pnpm from registry.npmjs.org, which the Socket
firewall blocks — pnpm@11.12.0 forced an uncached download that failed on
Intercom machines. 10.23.0 (no integrity hash) matches the merged
frontend-minicom / frontend-minicom-public migrations and is pre-cached in
the standard Intercom dev env, so corepack never hits the network. Also drop
the redundant `corepack prepare --activate` from the bootstrap scripts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Kabidoye-17

Copy link
Copy Markdown
Contributor Author

Local Verification

script/node/setup

Screenshot 2026-07-14 at 11 13 15

script/node/start

Screenshot 2026-07-14 at 11 18 16

Kabidoye-17 and others added 2 commits July 14, 2026 11:19
- Regenerate pnpm-lock.yaml from main's lockfile, capturing morgan ^1.11.0
- package-lock.json stays removed (pnpm migration)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Kabidoye-17 Kabidoye-17 marked this pull request as ready for review July 14, 2026 10:33
Interview candidates are external; require only pnpm, not corepack + pnpm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Kabidoye-17 Kabidoye-17 force-pushed the worktree-pnpm-migration branch from 87b4175 to 3b73960 Compare July 14, 2026 12:30
@Kabidoye-17 Kabidoye-17 merged commit aea57d9 into main Jul 14, 2026
3 checks passed
@Kabidoye-17 Kabidoye-17 deleted the worktree-pnpm-migration branch July 14, 2026 12:53
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.

2 participants