Skip to content

fix(docker): pin pnpm to a major in the generated Dockerfile - #61

Merged
joris-sevenlab merged 1 commit into
mainfrom
fix/pin-pnpm-in-dockerfile
Oct 7, 2026
Merged

joris-sevenlab merged 1 commit into
mainfrom
fix/pin-pnpm-in-dockerfile

Conversation

@JoeyHoutenbos

@JoeyHoutenbos JoeyHoutenbos commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

The generated Dockerfile installs pnpm unpinned (npm install -g pnpm), so an image build gets whatever is latest at that moment. On one of our projects that turned into pnpm 12.9.1, which failed pnpm install --frozen-lockfile with ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE (it wanted to record devEngines.packageManager in the lockfile). Every deploy of that project broke until it dropped devEngines. A new pnpm major can do the same to any project, with no change on its side.

  • PNPM_PIN_MAJOR in core/constants/package-manager.ts: the major of PNPM_PIN, the version this repo tests against.
  • pmInstallGlobalCommands('pnpm') now emits npm install -g pnpm@12. Patches still arrive; a new major arrives only with a PNPM_PIN bump. bun is unchanged.
  • shared:docker 1.2.0 → 1.2.1, so battlestack pull brings the pinned Dockerfile to existing projects.

Not in this PR, as a separate decision: the CI template (pm-template.ts) pins pnpm/action-setup to version: 10, below PNPM_MIN (11.3.0) and a different major than the Dockerfile. Moving it to PNPM_PIN_MAJOR gives one pnpm everywhere, but it changes CI behaviour for every project and for the plugins that copy version: 10.

Checked: pnpm tsc, pnpm test (991 passed, 1 skipped), pnpm bump:check origin/main.

The Dockerfile installed pnpm with a bare `npm install -g pnpm`, so every
image build took whatever was latest. pnpm 12.9.1 then failed
`pnpm install --frozen-lockfile` with
ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE on a project whose
package.json declared devEngines.packageManager, a lockfile the
previous release accepted. Every deploy of that project broke at once,
with no change of its own.

It now installs pnpm@<major of PNPM_PIN>, so 12 today: patches still
arrive, a new major waits for a PNPM_PIN bump that the test suite has
been run against. bun stays unpinned.

shared:docker 1.2.1.
@JoeyHoutenbos
JoeyHoutenbos force-pushed the fix/pin-pnpm-in-dockerfile branch from b6accff to 361ead2 Compare October 5, 2026 16:01
@joris-sevenlab
joris-sevenlab merged commit a9895e3 into main Oct 7, 2026
6 checks passed
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