Skip to content

Commit 57d2b71

Browse files
committed
chore: bump pnpm to 11.9.0
- package.json5: packageManager: pnpm@9.15.0 → pnpm@11.9.0 - Dockerfile: 3 references updated (corepack + npm-install fallback) - .github/workflows/publish.yml: corepack reference updated pnpm 11 changes that affect this repo: 1. Postinstall scripts are disabled by default for supply-chain safety. The whitelist lives in `pnpm-workspace.yaml` under the `allowBuilds` key (a map of <pkg>: true). Earlier attempts to put this in `pnpm.onlyBuiltDependencies` (deprecated) and in `.npmrc` (rejected — only scalar settings allowed there) failed; only project-level pnpm-workspace.yaml works. Approved builds: @prisma/client, @prisma/client-runtime-utils, @prisma/engines, esbuild, msw, prisma, sharp, unrs-resolver. 2. .npmrc no longer carries the (incorrect) `allow-builds[…]` entries — that syntax was being silently ignored. Just leaves the scalar settings and a comment pointing at pnpm-workspace.yaml. 3. Dockerfile now copies `pnpm-workspace.yaml` into the build context alongside package.json5/pnpm-lock.yaml/.npmrc so pnpm can read the allowBuilds config during docker build. Verified end-to-end: - `pnpm install` succeeds (was: ERR_PNPM_IGNORED_BUILDS) - `pnpm run build` compiles all routes - Docker image builds (~1.51 GB, down from 1.75 GB on pnpm 9) Note: pnpm run check (oxlint/oxfmt/tsgo) was already broken on main before this change — oxlint complains about a rule `no-unresolved` not being found in plugin `import`. Pre-existing issue, not introduced here. Filed in a separate thread.
1 parent 1791f9c commit 57d2b71

6 files changed

Lines changed: 2358 additions & 2382 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
# same failure mode on runners where /pnpm is root-owned.
9898
run: |
9999
corepack enable
100-
corepack prepare pnpm@9.15.0 --activate
100+
corepack prepare pnpm@11.9.0 --activate
101101
102102
- name: Install dependencies
103103
run: pnpm install --frozen-lockfile

.npmrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@
66
# root-owned and unwritable (e.g. GitHub Actions runners).
77
shamefully-hoist=false
88
strict-peer-dependencies=false
9-
auto-install-peers=true
9+
auto-install-peers=true
10+
11+
# pnpm 10+ blocks postinstall scripts by default for supply-chain
12+
# safety. The whitelist lives in `pnpm-workspace.yaml` under the
13+
# `allowBuilds` key — see that file for the actual list. (`.npmrc` only
14+
# supports scalar settings, and pnpm requires this one to be project-
15+
# level config, so it goes in pnpm-workspace.yaml instead.)

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ FROM node:${NODE_VERSION} AS fetcher
2121

2222
WORKDIR /app
2323

24-
# Pin pnpm 9.15.0. Prefer corepack (it's the official Node way to
24+
# Pin pnpm 11.9.0. Prefer corepack (it's the official Node way to
2525
# provision pnpm) but fall back to `npm install -g` for Node 26+ Alpine
2626
# images where corepack was dropped from the image.
2727
RUN if command -v corepack >/dev/null 2>&1; then \
28-
corepack enable && corepack prepare pnpm@9.15.0 --activate; \
28+
corepack enable && corepack prepare pnpm@11.9.0 --activate; \
2929
else \
30-
npm install -g pnpm@9.15.0; \
30+
npm install -g pnpm@11.9.0; \
3131
fi
3232

33-
COPY package.json5 pnpm-lock.yaml .npmrc ./
33+
COPY package.json5 pnpm-lock.yaml .npmrc pnpm-workspace.yaml ./
3434

3535
# --config.store-dir=/pnpm/store points pnpm at the BuildKit cache mount
3636
# above. Inlining this (rather than committing it to .npmrc) keeps the
@@ -48,9 +48,9 @@ FROM node:${NODE_VERSION} AS builder
4848
WORKDIR /app
4949

5050
RUN if command -v corepack >/dev/null 2>&1; then \
51-
corepack enable && corepack prepare pnpm@9.15.0 --activate; \
51+
corepack enable && corepack prepare pnpm@11.9.0 --activate; \
5252
else \
53-
npm install -g pnpm@9.15.0; \
53+
npm install -g pnpm@11.9.0; \
5454
fi
5555

5656
COPY --from=fetcher /app/node_modules ./node_modules

package.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: "openblog",
33
version: "0.1.0",
44
private: true,
5-
packageManager: "pnpm@9.15.0",
5+
packageManager: "pnpm@11.9.0",
66
scripts: {
77
dev: "next dev -p 4000",
88
build: "next build",

0 commit comments

Comments
 (0)