Skip to content

Migrate to pnpm 11 + set min release age for dependencies #160

Description

@EricAndrechek

Context

The repo currently pins packageManager: pnpm@10.33.0 across all three Node sub-projects (clients/ts, tests/e2e/sdk, docs). pnpm 11 has been out for a while and introduces a stricter policy for build scripts (onlyBuiltDependencies is now mandatory for any package with a postinstall script — previously a warning, now an error: ERR_PNPM_IGNORED_BUILDS). Devs on pnpm 11 see surprising failures when our setup script's defaults don't list esbuild etc.

We should also adopt pnpm's minimumReleaseAge (a.k.a. min-release-age) for supply-chain safety — installs would refuse packages published in the last N days (typical setting: 7–14 days), giving npm/jsr time to surface compromised releases before they land in our lockfile.

Additionally, Node 26 (current homebrew default) crashes Vitest with a V8 heap allocation error during make test-sdk (Abort trap: 6, JS heap OOM in v8::internal::HeapAllocator::AllocateRawSlowPath). The project documents Node 20+ as the minimum but doesn't appear to be compatible with Node 26's V8. Either Vitest / our test setup needs an upgrade, or we should pin Node version in CI / docs / via .nvmrc.

Scope

pnpm 11 migration

  • Bump packageManager to pnpm@11.x in clients/ts/package.json, tests/e2e/sdk/package.json, docs/package.json.
  • Update .github/actions/setup-env (or wherever pnpm is provisioned in CI) to install pnpm 11.
  • Audit every workspace for postinstall scripts and explicitly list them under pnpm.onlyBuiltDependencies per package. At minimum: esbuild (used by tsup/vitest). Likely also sharp, workerd (docs). Also trace electron-winstaller@5.4.0 — pnpm 11 flagged it as an ignored build during local install in clients/ts/ and docs/, but it's NOT in any workspace's pnpm-lock.yaml. Either (a) it's a transitive dep we haven't found (run pnpm why electron-winstaller in each workspace), or (b) pnpm 11 is reporting from the global store across all of a dev's projects (in which case we may need to add it to silence the warning across team machines). Track it down before bumping.
  • Add pnpm.minimumReleaseAge (recommend 7 days) to each package.json — or to a root .npmrc if we adopt one.
  • Re-generate lockfiles under pnpm 11 (pnpm install in each workspace) and commit.
  • Verify make build-sdk, make test-sdk, make test-e2e, make build-docs all green.

Node version compatibility

  • Reproduce the Vitest crash on Node 26: install Node 26 (e.g., brew install node defaults to 26 currently) and run make test-sdk. Expected symptom: V8 heap OOM + Abort trap: 6. Stack trace shows v8::internal::HeapAllocator::AllocateRawSlowPath inside vitest's worker.
  • Decide between two paths:
    • Pin Node version: add .nvmrc (or engines.node constraint in each package.json, or volta config) targeting Node 20 LTS. Update docs/src/content/docs/development.md to mention the pin.
    • Upgrade Vitest to a version compatible with Node 26. Audit dependent libraries (@vitest/coverage-v8 etc.) for Node 26 compat. Update both clients/ts and tests/e2e/sdk (both use vitest).
  • Update .github/actions/setup-env if the Node version target changes (currently node-version: "22").
  • Verify on both pinned and latest-LTS Node that make ci completes end-to-end without crashes.

Why this is its own issue

Decoupled from any feature branch — affects three packages, CI config, lockfile churn, and toolchain version pinning. Doing it in a feature PR would balloon the diff and risk hiding pnpm-related test flakes inside unrelated changes.

Related

  • Surfaced during PR feat(observability): direct-to-cloud OTLP (#97) #136 (otel-direct-to-cloud) when local pnpm 11 install kept failing with ERR_PNPM_IGNORED_BUILDS.
  • Resurfaced + Node 26 issue added during PR chore: claude code native improvements #147 (claude-code-native improvements) when testing the new pre-push gate end-to-end — make ci couldn't complete due to both pnpm 11 strictness AND Node 26 V8 incompatibility, blocking final validation of the new agent gates. The gates themselves are independently unit-tested and verified, but the full push-through-CI flow can't be exercised until this is resolved. Once this lands, PR chore: claude code native improvements #147 should be re-validated without environment patches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsDocumentation, site/, READMEarea/infraCI, build, deploy, Docker, releaseenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions