Skip to content

chore: switch from npm to pnpm (0.2.4)#16

Merged
Joshkop merged 1 commit into
mainfrom
chore/switch-to-pnpm
May 20, 2026
Merged

chore: switch from npm to pnpm (0.2.4)#16
Joshkop merged 1 commit into
mainfrom
chore/switch-to-pnpm

Conversation

@Joshkop
Copy link
Copy Markdown
Owner

@Joshkop Joshkop commented May 20, 2026

Why

Recent npm supply-chain incidents motivate moving to pnpm for:

  • Content-addressable store (deps shared across projects, can't be silently shadowed)
  • Stricter dependency isolation (no implicit transitive access)
  • Smaller install footprint and faster CI

What changes

Area Before After
Root deps npm install + package-lock.json pnpm install + pnpm-lock.yaml
scripts/ deps npm install + scripts/package-lock.json pnpm install + scripts/pnpm-lock.yaml
CI workflow npm ci, npm test, npm run build pnpm/action-setup@v4pnpm install --frozen-lockfilepnpm test / pnpm run build
Plugin postinstall cd scripts && npm install cd scripts && corepack pnpm install --prod --frozen-lockfile
packageManager field absent "pnpm@10.9.0" in both package.json files

End-users don't need pnpm globally installed: Corepack (bundled with Node ≥ 16.13) auto-resolves the version declared in packageManager.

What doesn't change

  • Emitted spans, attributes, hook behavior, plugin runtime — zero behavior diff.
  • User-facing install flow (/plugin install ...) is unchanged; just the underlying dep manager swaps.

Test Plan

Local (green):

  • pnpm install clean at root + scripts/
  • pnpm run ci — typecheck + 415/415 vitest tests + smoke all pass

Post-merge:

  • CI green on this PR (validates the new GitHub Actions setup)
  • Release workflow tags v0.2.4
  • /plugin update on a real machine → postinstall runs corepack pnpm install successfully

Follow-up

PR #15 (streamGenAiSpans for Conversations view) is held until this lands, then rebased on top of pnpm-based main. The two changes touch the same lockfile space and shouldn't share a PR.

🤖 Generated with Claude Code

Motivated by recent npm supply-chain incidents; pnpm's content-addressable
store and stricter dependency isolation reduce blast radius.

Changes:
- Root + scripts/ now use pnpm-lock.yaml (replaces package-lock.json).
- `packageManager: "pnpm@10.9.0"` added to both package.json files so
  Corepack auto-resolves the right pnpm version. Node >= 16.13 ships
  Corepack, so users don't need pnpm globally installed.
- .github/workflows/ci.yml uses pnpm/action-setup@v4 + setup-node with
  cache: "pnpm", then `pnpm install --frozen-lockfile` + `pnpm run` for
  build/test/smoke.
- Plugin `postinstall` uses `corepack pnpm install --prod
  --frozen-lockfile` so end-users installing via Claude Code's
  /plugin install get a deterministic pnpm-backed dep tree.
- README + AGENTS.md + src/AGENTS.md updated to reference pnpm.

No runtime behavior change: spans, hooks, and plugin attributes are
unchanged. Build/distribution-system migration only.

Local verification: pnpm run ci passes (415/415 tests + tsc + smoke).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Joshkop Joshkop merged commit 8e9a3f9 into main May 20, 2026
1 check passed
Joshkop added a commit that referenced this pull request May 20, 2026
The Conversations view stayed empty even after 0.2.2 added
gen_ai.conversation.id to every span. Root cause: Sentry's Conversations
data pipeline only ingests gen_ai.* spans when the SDK's
streamGenAiSpans option is enabled, and that option was added in
@sentry/node 10.53.0 (we were on 9.47.1).

- Bump @sentry/node from ^9.0.0 to ^10.53.1 (root + scripts/).
- Add streamGenAiSpans: true to Sentry.init.
- Version bump to 0.2.5 in all three files per release-version-files
  memory.

Rebased onto pnpm-based main (0.2.4 already shipped via #16).

Verified: pnpm run ci passes (typecheck + 415/415 vitest + smoke).

Ref: getsentry/sentry-javascript#20785

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Joshkop added a commit that referenced this pull request May 20, 2026
The Conversations view stayed empty even after 0.2.2 added
gen_ai.conversation.id to every span. Root cause: Sentry's Conversations
data pipeline only ingests gen_ai.* spans when the SDK's
streamGenAiSpans option is enabled, and that option was added in
@sentry/node 10.53.0 (we were on 9.47.1).

- Bump @sentry/node from ^9.0.0 to ^10.53.1 (root + scripts/).
- Add streamGenAiSpans: true to Sentry.init.
- Version bump to 0.2.5 in all three files per release-version-files
  memory.

Rebased onto pnpm-based main (0.2.4 already shipped via #16).

Verified: pnpm run ci passes (typecheck + 415/415 vitest + smoke).

Ref: getsentry/sentry-javascript#20785

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Joshkop Joshkop deleted the chore/switch-to-pnpm branch May 21, 2026 14:27
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