Skip to content

chore: migrate from npm to pnpm 11.1.x and fix kafka 2.1.0 support - #438

Merged
kibertoad merged 3 commits into
mainfrom
chore/migrate-to-pnpm
May 18, 2026
Merged

chore: migrate from npm to pnpm 11.1.x and fix kafka 2.1.0 support#438
kibertoad merged 3 commits into
mainfrom
chore/migrate-to-pnpm

Conversation

@kibertoad

@kibertoad kibertoad commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Migrates the monorepo package manager from npm 10.7.0 to pnpm 11.1.2
  • Replaces workspaces field in package.json with pnpm-workspace.yaml (uses shamefullyHoist: true to preserve npm-compatible transitive-dep resolution used by some test files)
  • Converts all package scripts from npm run to pnpm run
  • Updates GitHub Actions:
    • Adds pnpm/action-setup@v6.0.8 (pinned to SHA 0e279bb) to ci.common.yml and publish.yml
    • Switches setup-node from package-manager-cache: false to cache: 'pnpm'
    • Replaces npm install with pnpm install --frozen-lockfile --ignore-scripts
    • Switches npm version/npm publish/npm view to their pnpm equivalents (publish uses --no-git-checks since version bumps are committed after publish)

Note: Kafka 2.1.0 compatibility fixes were included so fix failing CI. Simple pin would have also worked, but it was an easy enough fix.

  • Adds pnpm-lock.yaml (replaces package-lock.json, which was already gitignored)
  • Dependabot config requires no changes — the npm ecosystem natively updates pnpm-lock.yaml

Test plan

  • pnpm install --ignore-scripts succeeds locally with pnpm 11.1.2
  • pnpm run build builds all 12 packages successfully
  • pnpm run lint passes for all 12 packages
  • CI runs green on this PR (build, lint, tests for each package on Node 22.x/24.x)
  • Verify cached pnpm store hits work as expected

Summary by CodeRabbit

Release Notes

  • Chores
    • Migrated package manager from npm to pnpm for improved dependency management
    • Updated all build, test, lint, and publish workflows to use pnpm
    • Updated CI/CD pipelines and workspace configuration for pnpm compatibility

Review Change Stack

- Replace npm with pnpm@11.1.2 as the package manager
- Convert workspaces config to pnpm-workspace.yaml (shamefullyHoist to preserve npm-compatible transitive resolution)
- Update all package scripts (npm run -> pnpm run)
- Update CI/publish workflows to use pnpm/action-setup@v6.0.8 with setup-node cache: 'pnpm'
- Switch publish workflow to pnpm version / pnpm publish (--no-git-checks during release)
@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR migrates the monorepo's package manager from npm to pnpm. The root package.json declares pnpm@11.1.2, removes the workspaces field, and a new pnpm-workspace.yaml configuration file defines the workspace structure. CI and publish workflows are updated to install pnpm via setup actions and invoke all build/test/publish commands with pnpm. All ten package.json files in the packages directory update their scripts to use pnpm instead of npm.

Changes

pnpm Package Manager Migration

Layer / File(s) Summary
Root workspace configuration
pnpm-workspace.yaml, package.json
Root packageManager field updated to pnpm@11.1.2, workspaces field removed from root config, and new pnpm-workspace.yaml declares packages: ['packages/*'] with shamefullyHoist: true for npm-compatible transitive dependency resolution.
CI and publish workflows
.github/workflows/ci.common.yml, .github/workflows/publish.yml
Both workflows add pnpm setup action and configure Node caching for pnpm; all npm install/build/lint/test/publish commands converted to pnpm equivalents, with filter arguments adjusted to match pnpm syntax.
Package script migrations
packages/*/package.json (amqp, core, gcp-pubsub, gcs-payload-store, kafka, metrics, outbox-core, redis-message-deduplication-store, s3-payload-store, schemas, sns, sqs)
All package scripts for build, test:coverage, lint, lint:fix, and prepublishOnly updated from npm to pnpm invocation; coverage flag forwarding adjusted to pass --coverage directly without extra -- argument separators.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 From npm we hop to pnpm with glee,
Shameful hoists keep the workspace decree,
Workflows now prance with filters so fine,
Each package scripts in rhythm align,
A monorepo migration, hop-tastic and clean! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main objective of the PR: migrating the monorepo from npm to pnpm 11.1.x, which is clearly the primary focus of all the changes across workflows and package.json files.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/migrate-to-pnpm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Strip undefined values when forwarding options to Consumer/Producer:
  2.1.0 no longer lets undefined override library defaults (#288), so
  spreading caller options as-is would silently re-apply defaults for
  connection-level fields callers intended to control.
- Guard reconnect() against re-entry. With 2.1.0 timing, the consumer
  stream can emit 'Premature close' while the previous reconnect is
  still tearing the old stream down, which would spawn a second
  parallel reconnect chain.
- isActive/isConnected now check isReconnecting first so the getters
  stay true throughout the reconnect window, including the brief
  interval where the underlying consumer is kClosed but our reference
  hasn't been cleared yet.
- Tests for "fail if kafka is not available" pass retries: 0 because
  2.1.0 wraps the group-coordinator lookup in the standard retry loop,
  pushing the failure past the default 5s test timeout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kibertoad
kibertoad requested a review from CarlosGamero May 17, 2026 14:42
Replaces the local stripUndefined helper with the equivalent already
exported from node-core, removing the duplicate utility.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kibertoad kibertoad changed the title chore: migrate from npm to pnpm 11.1.x chore: migrate from npm to pnpm 11.1.x and fix kafka 2.1.0 support May 17, 2026
@kibertoad
kibertoad merged commit 130fe95 into main May 18, 2026
35 checks passed
@kibertoad
kibertoad deleted the chore/migrate-to-pnpm branch May 18, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants