Skip to content

feat: migrate package manager from npm to pnpm - #669

Draft
serendipty01 wants to merge 1 commit into
roostorg:mainfrom
serendipty01:pr-2-pnpm-migration
Draft

feat: migrate package manager from npm to pnpm#669
serendipty01 wants to merge 1 commit into
roostorg:mainfrom
serendipty01:pr-2-pnpm-migration

Conversation

@serendipty01

Copy link
Copy Markdown
Contributor

Summary

Replaces npm with pnpm as the package manager across the monorepo. This is a pure tooling change — no TypeScript source files are modified (those type hygiene fixes landed separately in #668).

What changes:

  • Adds pnpm-workspace.yaml defining the workspace with 6 packages, supply-chain minimum age (7 days), and build dependencies
  • Replaces all per-package package-lock.json files with a single root pnpm-lock.yaml
  • Sets "packageManager": "pnpm@10.22.0" in root package.json; replaces all npm run/npxpnpm run/pnpm exec in scripts
  • Adds explicit phantom deps to server/package.json (@types/pg, jest-snapshot) and new UI deps to client/package.json (@ant-design/icons, @radix-ui/react-dialog, @radix-ui/react-slot)
  • Updates all Dockerfiles to use corepack enable && pnpm install --frozen-lockfile
  • Updates docker-compose.yaml working dirs and volume paths for pnpm workspace layout
  • Updates all GitHub Actions workflows to use pnpm
  • Updates docs/development/local.md and AGENTS.md

Dependencies

Requires #668 to merge first. The type hygiene fixes in #668 (phantom-dep safe-stable-stringify assertions, etc.) must be in main before this PR's pnpm lock file takes effect — pnpm's strict nodeLinker won't hoist those transitive types automatically.

Test plan

  • docker compose run --rm backend pnpm run lint
  • docker compose run --rm backend pnpm run build
  • docker compose run --rm client pnpm run lint
  • docker compose run --rm client pnpm run build
  • docker compose run --rm test
  • docker compose run --rm codegen-check

Related

Closes #224 — this PR plus #668 together replace the original pnpm migration PR.

Copilot AI review requested due to automatic review settings June 2, 2026 16:01
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@serendipty01, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 8 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d3050309-ad1d-417a-b355-141a77bbc983

📥 Commits

Reviewing files that changed from the base of the PR and between edf3f2b and c60f9e1.

⛔ Files ignored due to path filters (8)
  • client/package-lock.json is excluded by !**/package-lock.json
  • db/package-lock.json is excluded by !**/package-lock.json
  • migrator/package-lock.json is excluded by !**/package-lock.json
  • nodejs-instrumentation/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • server/package-lock.json is excluded by !**/package-lock.json
  • types/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • .env.githubci
  • .github/workflows/apply_pr_checks.yaml
  • .github/workflows/publish-db-migrator.yaml
  • .github/workflows/publish-types.yaml
  • .gitignore
  • AGENTS.md
  • Dockerfile
  • client/Dockerfile
  • client/package.json
  • db/Dockerfile
  • docker-compose.yaml
  • docs/development/local.md
  • migrator/package.json
  • package.json
  • pnpm-workspace.yaml
  • scripts/publish-packages.sh
  • server/package.json
  • types/package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR migrates the repo from npm-driven per-package installs to a pnpm workspace layout and updates local tooling + CI + Docker/publish flows accordingly.

Changes:

  • Switches package scripts across workspaces from npm run to pnpm run and adds root workspace orchestration scripts.
  • Introduces pnpm-workspace.yaml and updates Dockerfiles/docker-compose/CI workflows to install with pnpm.
  • Updates developer docs and agent guidance to reflect pnpm workspace workflows and new supply-chain guardrails.

Reviewed changes

Copilot reviewed 17 out of 26 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
types/package.json Use pnpm for prepublishOnly and tests.
server/package.json Use pnpm for scripts; add typings/dev deps to support Postgres + Jest snapshot behavior.
scripts/publish-packages.sh Publish script migrated from npm to pnpm with frozen installs.
pnpm-workspace.yaml Adds workspace package list plus dependency/security-related pnpm configuration.
package.json Declares pnpm as package manager; adds recursive workspace scripts.
migrator/package.json Uses pnpm for prepublish build step.
docs/development/local.md Updates local CI-equivalent commands from npm to pnpm.
docker-compose.yaml Updates services to run pnpm-based lint/build/test/migrations; adjusts working dirs/volumes.
db/Dockerfile Switches db image build to pnpm lockfile-based install/build/prune.
client/package.json Updates scripts to pnpm; adds new UI deps.
client/Dockerfile Switches client image build to workspace-aware pnpm install and build.
Dockerfile Switches server/backend images to pnpm workspace install + new runtime paths.
AGENTS.md Updates architecture/dev commands guidance for pnpm workspace + lockfile and security notes.
.gitignore Ignores local pnpm store dir.
.github/workflows/publish-types.yaml Publishes types package using pnpm with pnpm caching.
.github/workflows/publish-db-migrator.yaml Publishes migrator using pnpm with pnpm caching.
.github/workflows/apply_pr_checks.yaml Runs docker-compose checks using pnpm inside containers.
.env.githubci Sets CI=true for docker-compose bash conditionals.
Files not reviewed (4)
  • db/package-lock.json: Language not supported
  • migrator/package-lock.json: Language not supported
  • nodejs-instrumentation/package-lock.json: Language not supported
  • types/package-lock.json: Language not supported

Comment thread docker-compose.yaml
Comment on lines +25 to +31
command: bash -c 'set -e && corepack enable
&& pnpm install --filter coop-data-migrator --frozen-lockfile --store-dir /tmp/pnpm-store
&& ( [ "$$CI" = "true" ] && ( cd db && NODE_OPTIONS="--loader ts-node/esm" node src/index.ts clean --env staging ) || true )
&& for db in api-server-pg scylla clickhouse; do
( cd db && NODE_OPTIONS="--loader ts-node/esm" node src/index.ts create --db "$$db" --env staging );
( cd db && NODE_OPTIONS="--loader ts-node/esm" node src/index.ts apply --db "$$db" --env staging );
done'
Comment thread docker-compose.yaml
drop_dbs:
image: node:24.14.1-bullseye-slim
command: bash -c 'npm i && npm run db:drop -- --env staging'
command: bash -c 'corepack enable && pnpm install --filter coop-data-migrator --frozen-lockfile --store-dir /tmp/pnpm-store && ( cd db && NODE_OPTIONS="--loader ts-node/esm" node src/index.ts drop --env staging )'
Comment thread pnpm-workspace.yaml
Comment on lines +9 to +17
overrides:
# Force all packages (including transitive deps like @node-saml/passport-saml)
# to use @types/express v5. Mirrors the override in server/package.json that
# worked under npm but is ignored by pnpm (pnpm only reads root overrides).
"@types/express": "^5"
# v6 fixes the interface Matchers<R, T = {}> incompatibility with @types/jest@30.
# v5 used Matchers<R> (one param) which doesn't merge with jest@30's two-param
# signature. v6 is already in the pnpm store (pulled by storybook@9).
"@testing-library/jest-dom": "^6"
Comment thread pnpm-workspace.yaml
# clone-or-copy: use copy-on-write cloning from the pnpm store (fastest on APFS/macOS),
# fall back to copying on Linux CI where CoW may not be available.
# Avoids hardlinks, which can cause confusing behaviour when editing node_modules locally.
packageImportMethod: clone-or-copy
Comment thread pnpm-workspace.yaml
Comment on lines +27 to +29
preferWorkspacePackages: true

ignoredBuiltDependencies:
Comment thread pnpm-workspace.yaml
- protobufjs
- unrs-resolver

onlyBuiltDependencies:
Comment thread pnpm-workspace.yaml

# Refuse to install packages published less than 7 days ago (10080 minutes).
# Mitigates "publish-and-immediately-compromise" supply chain attacks.
minimumReleaseAge: 10080
Comment thread pnpm-workspace.yaml
Comment on lines +54 to +56
blockExoticSubdeps: true

allowBuilds:
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