chore: migrate from npm to pnpm 11.1.x and fix kafka 2.1.0 support - #438
Conversation
- 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)
📝 WalkthroughWalkthroughThis 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. Changespnpm Package Manager Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
- 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>
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>
Summary
workspacesfield inpackage.jsonwithpnpm-workspace.yaml(usesshamefullyHoist: trueto preserve npm-compatible transitive-dep resolution used by some test files)npm runtopnpm runpnpm/action-setup@v6.0.8(pinned to SHA0e279bb) toci.common.ymlandpublish.ymlsetup-nodefrompackage-manager-cache: falsetocache: 'pnpm'npm installwithpnpm install --frozen-lockfile --ignore-scriptsnpm version/npm publish/npm viewto theirpnpmequivalents (publish uses--no-git-checkssince 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.
pnpm-lock.yaml(replacespackage-lock.json, which was already gitignored)npmecosystem natively updatespnpm-lock.yamlTest plan
pnpm install --ignore-scriptssucceeds locally with pnpm 11.1.2pnpm run buildbuilds all 12 packages successfullypnpm run lintpasses for all 12 packagesSummary by CodeRabbit
Release Notes