Skip to content

Migrate from npm to pnpm workspaces - #82

Open
sleeyax wants to merge 1 commit into
mainfrom
chore/migrate-to-pnpm
Open

Migrate from npm to pnpm workspaces#82
sleeyax wants to merge 1 commit into
mainfrom
chore/migrate-to-pnpm

Conversation

@sleeyax

@sleeyax sleeyax commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Replaces npm workspaces with pnpm, using pnpm's default strict isolated node_modules layout.

What changed

  • pnpm-workspace.yaml replaces the root workspaces array. pnpm 11 gates dependency build scripts behind allowBuilds: esbuild/workerd are allowed for wrangler, ssh2/cpu-features denied since they're optional native speedups for beamup-cli's SSH transport and it falls back to pure JS.
  • Package manifests — internal deps are now workspace:*, and typescript/@types/node/vitest/tsx/cross-env are declared in the packages that actually use them instead of being borrowed from the root via npm's flat hoisting. files: ["dist"] was added to api and addon, and the deprecated prepublish hook became prepublishOnly.
  • Dockerfile — installs with pnpm install --frozen-lockfile --filter "@easynews/addon..." (so the worker's toolchain stays out of the image), then pnpm deploy collects the addon plus its workspace deps into one self-contained directory. The final image is a plain node dist/server.js and needs no package manager at runtime. New .dockerignore too, since there wasn't one and COPY packages/... was dragging in whatever the host had.
  • CIpnpm/action-setup@v4 before setup-node so cache: 'pnpm' can find the binary.
  • Node unified on 24 across engines, the Dockerfile and CI, which previously said 20, 22 and 23 respectively.
  • Drops the stale empty .yalc/ tree (no yalc.lock, no file:/link: deps anywhere) and adds a .prettierignore so pnpm format stops reformatting the lockfile that pnpm rewrites on every install.

Notes

forceLegacyDeploy: true is set in pnpm-workspace.yaml because pnpm deploy otherwise requires injectWorkspacePackages: true, which would replace the workspace symlinks with copies and break live local development against @easynews/api.

Verified

  • Clean pnpm install --frozen-lockfile -> pnpm build -> 20/20 tests pass
  • pnpm start:addon and pnpm start:addon:dev both serve /manifest.json
  • pnpm start:cloudflare-worker:dev bundles the linked addon and serves the manifest
  • docker build --no-cache succeeds; the container serves /manifest.json (167 MB image)
  • pnpm pack on the addon produces a tarball containing dist/
  • pnpm version patch propagates to all four manifests and stages them

Not verified: the actual beamup deploy. beamup is Dokku, which prefers a root Dockerfile over buildpacks, so it should go through the updated Dockerfile — but that only proves out on a real pnpm deploy:beamup.

Replace npm workspaces with pnpm, using the default strict isolated node_modules layout.
Every package now declares the tools its own scripts invoke rather than relying on npm's flat hoisting, and internal dependencies use the workspace protocol.

The Dockerfile builds with `pnpm deploy`, which collects the addon and its workspace dependencies into a single self-contained directory, so the final image no longer needs a package manager at runtime.
`forceLegacyDeploy` is set because the alternative, `injectWorkspacePackages`, would replace the workspace symlinks with copies and break live local development.

Node is unified on 24 across the engines field, the Dockerfile and CI, which previously disagreed.

Also drops the stale empty .yalc directory, adds a .dockerignore, and keeps prettier away from the lockfile.
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