Skip to content

Commit dc75fe4

Browse files
SamTV12345SamTV12345
andauthored
chore: update to pnpm v12 (#8232)
* chore: update to pnpm v12 * chore: use new flag * chore: use ./local_plugins --------- Co-authored-by: SamTV12345 <noreply@samtv.fyi>
1 parent 8c7341e commit dc75fe4

11 files changed

Lines changed: 194 additions & 35 deletions

File tree

‎.github/workflows/docker.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
# Regression test for #7718. Reproduces the production
120120
# docker-compose layout reported in that issue: a named volume
121121
# mounted on src/plugin_packages with no TTY allocated. Under
122-
# the previous `CMD ["pnpm", "run", "prod"]`, pnpm 11's
122+
# the previous `CMD ["pnpm", "run", "prod"]`, pnpm's
123123
# runDepsStatusCheck spuriously decided node_modules was out of
124124
# sync at boot and tried to wipe + reinstall, aborting with
125125
# ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY before the HTTP

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
cache-dependency-path: etherpad/pnpm-lock.yaml
7070
- name: Install dependencies ether.github.com
7171
# ether.github.com depends on sharp (Next.js image pipeline), whose
72-
# install script must run to fetch the platform binary. pnpm 11
72+
# install script must run to fetch the platform binary. pnpm
7373
# turned ignored-builds into an error; allow all builds for this
7474
# external repo since we don't control its pnpm-workspace.yaml.
7575
run: pnpm install --frozen-lockfile --config.dangerously-allow-all-builds=true

‎Dockerfile‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
# docker build --build-arg BUILD_ENV=copy .
88
ARG BUILD_ENV=git
99

10-
# NOTE: this intentionally lags the "packageManager" pin in package.json. pnpm
11-
# 11.1.x enforces the minimum-release-age supply-chain policy during install,
12-
# which the frozen-lockfile Docker build can't satisfy, so the image stays on
13-
# 11.0.x. The version gap is made harmless by pnpm_config_pm_on_fail=ignore in
14-
# the build stage below — see ether/etherpad#7911.
15-
ARG PnpmVersion=11.0.6
10+
# NOTE: this tracks the "packageManager" pin in package.json. pnpm's
11+
# minimum-release-age supply-chain policy (enforced during install) is satisfied
12+
# by the `minimumReleaseAgeExclude` list in pnpm-workspace.yaml, so the image no
13+
# longer needs to lag the pin the way it did during the pnpm 11.1.x era — see
14+
# ether/etherpad#7911.
15+
ARG PnpmVersion=12.4.2
1616

1717
FROM node:24-alpine AS adminbuild
1818
# Install pnpm directly via npm (rather than via corepack) so the same
@@ -33,15 +33,13 @@ RUN pnpm run build:ui
3333
FROM node:24-alpine AS build
3434
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad"
3535

36-
# The image's pnpm intentionally lags the "packageManager" pin (see the ARG
37-
# note above). pnpm would otherwise try to self-provision the pinned version on
38-
# invocation — including the informational `pnpm --version` probe Etherpad runs
39-
# at startup — which fails closed with no network and breaks air-gapped boots
40-
# (ether/etherpad#7911). pm_on_fail=ignore makes pnpm use the installed version
41-
# instead. Inherited by the development and production runtime stages, so it
42-
# also covers the updater's pnpm-on-PATH check and ad-hoc `pnpm` in an exec
43-
# shell. It does not change which pnpm runs the build-time install (still the
44-
# installed 11.0.x), so the frozen-lockfile build is unaffected.
36+
# The image's pnpm matches the "packageManager" pin (see the ARG note above),
37+
# so pnpm does not self-provision on invocation. pm_on_fail=ignore is kept as
38+
# belt-and-suspenders: if the pin and the image ever drift again, pnpm falls
39+
# back to the installed version instead of downloading the pinned build — which
40+
# fails closed with no network and breaks air-gapped boots (ether/etherpad#7911).
41+
# Inherited by the development and production runtime stages, so it also covers
42+
# the updater's pnpm-on-PATH check and ad-hoc `pnpm` in an exec shell.
4543
ENV pnpm_config_pm_on_fail=ignore
4644

4745
# Set these arguments when building the image from behind a proxy
@@ -202,7 +200,7 @@ ENV ETHERPAD_PRODUCTION=true
202200
# needed at runtime. Overwrite it with a production-only version so
203201
# pnpm install doesn't warn about missing workspace directories.
204202
# Preserve the build-script policy from the source workspace file so
205-
# pnpm 11 doesn't error out with ERR_PNPM_IGNORED_BUILDS for transitive
203+
# pnpm doesn't error out with ERR_PNPM_IGNORED_BUILDS for transitive
206204
# postinstalls (e.g. @scarf/scarf via swagger-ui-dist).
207205
RUN printf 'packages:\n - src\n - bin\nonlyBuiltDependencies:\n - esbuild\nignoredBuiltDependencies:\n - "@scarf/scarf"\nstrictDepBuilds: false\n' > pnpm-workspace.yaml
208206

@@ -239,7 +237,7 @@ HEALTHCHECK --interval=5s --timeout=3s \
239237
CMD wget -qO- http://127.0.0.1:9001/health | grep -E "pass|ok|up" > /dev/null || exit 1
240238

241239
EXPOSE 9001
242-
# Run node directly instead of via `pnpm run prod`. pnpm 11's
240+
# Run node directly instead of via `pnpm run prod`. pnpm's
243241
# `runDepsStatusCheck` fires before every `pnpm run …` and spuriously
244242
# decides node_modules is out of sync on first start under the named-
245243
# volume layout used by docker-compose (mounting src/plugin_packages).

‎bin/installLocalPlugins.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ if [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then
3939
plugin=$(trim "$plugin")
4040
if [ -d "local_plugins/${plugin}" ]; then
4141
echo "Installing plugin: '${plugin}'"
42-
pnpm install -w ${PNPM_OPTIONS:-} "local_plugins/${plugin}/"
42+
# The `./` prefix is required: without it pnpm treats `local_plugins/<pkg>`
43+
# as a scoped package name (or git URL) rather than a local directory.
44+
pnpm install -w ${PNPM_OPTIONS:-} "./local_plugins/${plugin}/"
4345
else
4446
( echo "Error. Directory 'local_plugins/${plugin}' for local plugin " \
4547
"'${plugin}' missing" >&2 )

‎bin/release.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ try {
204204
run('git pull --ff-only', {cwd: '../ether.github.com/'});
205205
console.log('Committing documentation...');
206206
run(`cp -R out/doc/ ../ether.github.com/public/doc/v'${newVersion}'`);
207-
// pnpm 11 refuses `pnpm version` on a dirty tree (the doc copy above
207+
// pnpm refuses `pnpm version` on a dirty tree (the doc copy above
208208
// dirties it) even with --no-git-tag-version, so write the bump with jq —
209209
// same pattern used for the etherpad package.json files at the top of
210210
// this script. The git add+commit below picks up both the bump and the

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
},
4444
"engines": {
4545
"node": ">=24.0.0",
46-
"pnpm": ">=11.1.2"
46+
"pnpm": ">=12.0.0"
4747
},
48-
"packageManager": "pnpm@11.10.0",
48+
"packageManager": "pnpm@12.4.2",
4949
"repository": {
5050
"type": "git",
5151
"url": "https://github.com/ether/etherpad.git"

‎packaging/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Built artefacts land in `./dist/`.
1919

2020
## Building locally
2121

22-
Prereqs: Node 24 (current LTS; matches `engines.node` floor), pnpm 11.1.2+, nfpm.
22+
Prereqs: Node 24 (current LTS; matches `engines.node` floor), pnpm 12+, nfpm.
2323

2424
```sh
2525
pnpm install --frozen-lockfile

‎pnpm-lock.yaml‎

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎snap/snapcraft.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ parts:
115115
"${CRAFT_PART_INSTALL}/opt/node/bin/npm" install \
116116
--prefix "${CRAFT_PART_INSTALL}/opt/node" -g corepack@latest
117117
corepack enable --install-directory "${CRAFT_PART_INSTALL}/opt/node/bin"
118-
corepack prepare pnpm@11.0.6 --activate
118+
corepack prepare pnpm@12.4.2 --activate
119119
120120
# -- 3. Copy source into install dir and build.
121121
APP_DIR="${CRAFT_PART_INSTALL}/opt/etherpad"

‎src/static/js/pluginfw/installer.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ const wrapTaskCb = (cb: Function | null) => taskQueue.wrap(cb);
5353
const migratePluginsFromNodeModules = async () => {
5454
logger.info('start migration of plugins in node_modules');
5555
// Notes:
56-
// * Do not pass `--prod` otherwise `npm ls` will fail if there is no `package.json`.
57-
// * The `--no-production` flag is required (or the `NODE_ENV` environment variable must be
58-
// unset or set to `development`) because otherwise `npm ls` will not mention any packages
56+
// * Do not pass `--prod` otherwise `pnpm ls` will fail if there is no `package.json`.
57+
// * The `--no-prod` flag is required (or the `NODE_ENV` environment variable must be
58+
// unset or set to `development`) because otherwise `pnpm ls` will not mention any packages
5959
// that are not included in `package.json` (which is expected to not exist).
60-
const cmd = ['pnpm', 'ls', '--long', '--json', '--depth=0', '--no-production'];
60+
// (pnpm 12 renamed `--no-production` to `--no-prod`.)
61+
const cmd = ['pnpm', 'ls', '--long', '--json', '--depth=0', '--no-prod'];
6162
const [{dependencies = {}}] = JSON.parse(await runCmd(cmd,
6263
{stdio: [null, 'string']}));
6364

0 commit comments

Comments
 (0)