Skip to content

chore: declare pnpm via devEngines.packageManager - #2008

Merged
dinwwwh merged 1 commit into
middleapi:mainfrom
dinwwwh:claude/pnpm-devengines-config-f85daa
Sep 12, 2026
Merged

dinwwwh merged 1 commit into
middleapi:mainfrom
dinwwwh:claude/pnpm-devengines-config-f85daa

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Sep 11, 2026

Copy link
Copy Markdown
Member

Declares pnpm through devEngines.packageManager (^12.0.0, onFail: download) instead of the exact packageManager field. Any pnpm 12.x can now bootstrap the repo, and pnpm install switches to the version pinned in pnpm-lock.yaml, which stays 12.0.0.

Behavior

  • CI needs no workflow changes: pnpm/action-setup@v6 reads the range from devEngines.
  • pnpm-lock.yaml is unchanged, since pnpm treats the existing 12.0.0 pin as satisfying the range.
  • Commands other than install can run on a newer 12.x. In testing, pnpm runtime set ran as 12.3.4 while pnpm i ran as 12.0.0.
  • Running npm or npx from the repo root now fails with EBADDEVENGINES, because npm enforces devEngines. No script or workflow step in the repo does that.

Testing

  • CI=true pnpm i passes when started from pnpm 12.0.0, 12.3.4 (latest) and 12.4.1, and always installs with the pinned 12.0.0.
  • The CI test job sequence (pnpm runtime set node 22, pnpm runtime set bun 1, then CI=true pnpm i) passes, and the pin survives the runtime edits.
  • sherif and eslint pass.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown
More templates

@orpc/ai-sdk

npm i https://pkg.pr.new/@orpc/ai-sdk@2008

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@2008

@orpc/bun

npm i https://pkg.pr.new/@orpc/bun@2008

@orpc/client

npm i https://pkg.pr.new/@orpc/client@2008

@orpc/cloudflare

npm i https://pkg.pr.new/@orpc/cloudflare@2008

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@2008

@orpc/experimental-effect

npm i https://pkg.pr.new/@orpc/experimental-effect@2008

@orpc/evlog

npm i https://pkg.pr.new/@orpc/evlog@2008

@orpc/hibernation

npm i https://pkg.pr.new/@orpc/hibernation@2008

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@2008

@orpc/experimental-msw

npm i https://pkg.pr.new/@orpc/experimental-msw@2008

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@2008

@orpc/next

npm i https://pkg.pr.new/@orpc/next@2008

@orpc/node

npm i https://pkg.pr.new/@orpc/node@2008

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@2008

@orpc/opentelemetry

npm i https://pkg.pr.new/@orpc/opentelemetry@2008

@orpc/pinia-colada

npm i https://pkg.pr.new/@orpc/pinia-colada@2008

@orpc/pino

npm i https://pkg.pr.new/@orpc/pino@2008

@orpc/publisher

npm i https://pkg.pr.new/@orpc/publisher@2008

@orpc/ratelimit

npm i https://pkg.pr.new/@orpc/ratelimit@2008

@orpc/server

npm i https://pkg.pr.new/@orpc/server@2008

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@2008

@orpc/swr

npm i https://pkg.pr.new/@orpc/swr@2008

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@2008

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@2008

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@2008

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@2008

commit: 471df8b

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 30 untouched benchmarks


Comparing dinwwwh:claude/pnpm-devengines-config-f85daa (471df8b) with main (310d8e3)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (62259c8) during the generation of this report, so 310d8e3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@pullfrog pullfrog Bot 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.

ℹ️ Minor suggestions — one note on onFail: "download" plus a PR-description fixup; the change itself is sound and all CI is green.

Reviewed changes — initial review of this PR: the root package.json swap of the exact packageManager: "pnpm@12.0.0" pin for devEngines.packageManager (^12.0.0, onFail: "download"). I verified the load-bearing claims against the tooling: pnpm/action-setup@v6 reads devEngines.packageManager when the version input is omitted and accepts the range (borne out by the green CI workflow — no workflow changes needed), and pnpm ≥11 re-executes pnpm install with the lockfile-pinned 12.0.0 (pnpm-lock.yaml packageManagerDependencies, unchanged), so installs stay on 12.0.0 regardless of which 12.x bootstraps the repo.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread package.json
"packageManager": {
"name": "pnpm",
"version": "^12.0.0",
"onFail": "download"

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.

onFail: "download" doesn't do what this implies. npm accepts the download token but silently maps it to error (lib/dev-engines.js in npm-install-checks), so npm users get a hard EBADDEVENGINES error at the repo root — npm never downloads pnpm — and pnpm ignores the key entirely, since its download/re-exec behavior comes from its own pmOnFail setting (default download). Suggest dropping the key; the PR description is also overbroad on npx, which re-runs as npm exec and skips the devEngines check (only npm install/npm run fail).

Technical details
# `onFail: "download"` is dead config

## Affected sites
- package.json:10 — `"onFail": "download"` under `devEngines.packageManager`

## Problem
- npm: `download` is a recognized token but is remapped to `error` in `npm-install-checks` `lib/dev-engines.js` (`if (onFail === 'download') onFail = 'error'`), so `npm install`/`npm run` fail with `EBADDEVENGINES`; npm never downloads and re-executes with pnpm. A maintainer explicitly noted the docs PR for `download` reflects nothing npm does.
- pnpm ≥11: reads `devEngines.packageManager.name`/`version`, but the download-and-re-exec behavior is driven by the `pmOnFail` setting (default `download`), not the package.json `onFail` key — so the key is a no-op for pnpm too.
- PR description: "Running `npm` or `npx` from the repo root now fails with `EBADDEVENGINES`" — `npx` maps to `npm exec` (`bin/npx-cli.js`), which does not run the devEngines check.

## Required outcome
- Drop the `onFail` key (npm's default is `error` → EBADDEVENGINES, which is already the observed behavior) or document the intent explicitly, and correct the PR description to attribute EBADDEVENGINES to `npm install`/`npm run` only, not `npx`.

@dinwwwh
dinwwwh merged commit 5c76a6a into middleapi:main Sep 12, 2026
11 checks passed
dinwwwh added a commit that referenced this pull request Sep 12, 2026
Raises the pnpm pin in `devEngines.packageManager` from `^12.0.0` to
`^12.4.1` and records 12.4.1 in `pnpm-lock.yaml`. This unblocks the docs
deploy: Cloudflare Workers Builds launches pnpm through Corepack, which
resolves the range to the newest 12.x on npm (12.4.1 today) and does not
let pnpm switch to the version recorded in the lockfile, so `pnpm
install --frozen-lockfile` failed with
`ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE` while the lockfile
still pinned 12.0.0.

## Behavior

- The lockfile pin matches what Corepack resolves, so the Workers build
installs again.
- The lockfile diff is limited to the `packageManagerDependencies` block
and the `@pnpm/exe.*` platform packages for 12.4.1.
- The range keeps the trade-off from #2008: the next pnpm 12.x release
moves Corepack ahead of the lockfile again, and the pin then needs
another refresh (`pnpm self-update <version>` followed by `pnpm
install`).

## Testing

- `pnpm install --frozen-lockfile` passes with pnpm 12.4.1 launched the
way Corepack launches it (`COREPACK_ROOT` set, `CI=true`, cold policy
cache): the supply-chain check passes and the resolution step is
skipped.
- The same install passes without Corepack, and `eslint package.json`
passes.
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