pnpm 12.3.1 → 12.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # pnpm
2
2
 
3
+ ## 12.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed concurrent installs sharing a store occasionally failing with an ENOENT error while importing a package file [#14353](https://github.com/pnpm/pnpm/issues/14353).
8
+
9
+ - Sped up writing the lockfile in large workspaces [#14352](https://github.com/pnpm/pnpm/issues/14352).
10
+
11
+ - Sped up dependency resolution in large workspaces [#14352](https://github.com/pnpm/pnpm/issues/14352).
12
+
13
+ - pnpm now runs through Node.js when it was installed by a tool that skips build scripts, such as Vercel's `packageManager` provisioning, Bun, Deno, or `npm install --ignore-scripts`. Those installs previously failed with `syntax error near unexpected token ')'`. They still cannot run pnpm on Windows. On macOS only a shell can start it [#14346](https://github.com/pnpm/pnpm/issues/14346).
14
+
15
+ ## 12.3.2
16
+
17
+ ### Patch Changes
18
+
19
+ - `pnpm audit --fix update` no longer aborts when a vulnerable package has no safe version inside its declared range [#14508](https://github.com/pnpm/pnpm/issues/14508). The run updates every package it can and lists the rest as remaining.
20
+
21
+ - `pnpm install` no longer reruns root lifecycle scripts when the global virtual store contains an unfinished-build marker in a package slot that the current lockfile does not use [pnpm/pnpm#14485](https://github.com/pnpm/pnpm/issues/14485).
22
+
23
+ - Sped up installs that have no lockfile. pnpm now links packages whose dependency subtree has no peer dependencies into the virtual store while resolution is still running.
24
+
25
+ - `pnpm run` and `pnpm exec` now start without reinstalling on filesystems that keep sub-millisecond mtimes, such as NTFS. Previously, every run on those filesystems reinstalled first [pnpm/pnpm#14486](https://github.com/pnpm/pnpm/issues/14486).
26
+
27
+ - `pnpm import` now keeps the versions recorded in `package-lock.json`, `npm-shrinkwrap.json`, or `yarn.lock` when it generates `pnpm-lock.yaml`. A range in `package.json`, a catalog, or an override still decides which versions are eligible, and the recorded version is preferred among them. The generated lockfile previously could pin newer versions than the source lockfile [#14476](https://github.com/pnpm/pnpm/issues/14476).
28
+
29
+ `pnpm import` in a workspace now imports every workspace project into the shared lockfile. It previously imported only the project in the current directory.
30
+
31
+ `pnpm import` now fails with `ERR_PNPM_LOCKFILE_NOT_FOUND` when none of the three source lockfiles is present. It also fails with `ERR_PNPM_YARN_LOCKFILE_PARSE_FAILED` when it cannot parse `yarn.lock`. It previously generated a lockfile from scratch in both cases.
32
+
33
+ `pnpm import` always resolves locally. It warns when `--pnpr-server` or the `pnpr-server` setting is given and does not use the server.
34
+
35
+ - Sped up installs in large workspaces. Discovering the workspace projects no longer enumerates every matched directory to learn which manifest files it holds [#14352](https://github.com/pnpm/pnpm/issues/14352).
36
+
37
+ - Sped up installs in large workspaces. The resolver and the peer pass allocate less for every dependency edge [#14352](https://github.com/pnpm/pnpm/issues/14352).
38
+
39
+ - `pnpm self-update`, `pnpm with`, and automatic package-manager version switching no longer wait through registry retry delays when a configured registry has no signatures and `registry.npmjs.org` is unavailable [#14483](https://github.com/pnpm/pnpm/issues/14483).
40
+
41
+ - Sped up installs in large workspaces. Saving the lockfile is faster, and the install finishes without waiting for memory cleanup [#14352](https://github.com/pnpm/pnpm/issues/14352).
42
+
43
+ - `pnpm install` now relinks workspace packages when `publishConfig.linkDirectory` changes. Frozen installs report an outdated lockfile until it is regenerated [pnpm/pnpm#14488](https://github.com/pnpm/pnpm/issues/14488).
44
+
45
+ - The pnpm npm wrapper keeps its placeholder shebang-less so pnpm 11 can install pnpm 12 through the version store. Wrapper installs must allow lifecycle scripts to install the native binary [#14502](https://github.com/pnpm/pnpm/issues/14502).
46
+
47
+ - Sped up dependency resolution when there is no lockfile, and for the dependencies a lockfile does not cover.
48
+
49
+ - Sped up installs in large workspaces. Workspace `link:` targets and importer ids are now derived from the paths' suffixes under the workspace root [#14352](https://github.com/pnpm/pnpm/issues/14352).
50
+
51
+ - `pnpm install` now reports "Already up to date" when local tarball dependencies have not changed [#14495](https://github.com/pnpm/pnpm/issues/14495).
52
+
53
+ - `pnpm update` now accepts `--ignore-scripts` and skips lifecycle scripts during the update [pnpm/pnpm#14512](https://github.com/pnpm/pnpm/issues/14512).
54
+
55
+ - Sped up installs that restore a deleted `node_modules` from a warm global virtual store. pnpm no longer re-links packages that are already fully present in the global virtual store [#14510](https://github.com/pnpm/pnpm/issues/14510).
56
+
3
57
  ## 12.3.1
4
58
 
5
59
  ### Patch Changes
package/bin/pnpm.mjs CHANGED
@@ -3,8 +3,8 @@
3
3
  // `./bin/pnpx.mjs` for every pnpm >=11 (see its `config.json`) and loads them
4
4
  // into its own Node.js process, which a native executable cannot be loaded into.
5
5
  //
6
- // The `pnpm` placeholder bin runs it too, when the install script that
7
- // replaces it with the native binary did not run (build scripts blocked). An
6
+ // The `pnpm` placeholder bin runs it too, on Unix, when the install script that
7
+ // replaces it with the native binary did not (build scripts blocked). An
8
8
  // ordinary `npm install -g pnpm` never pays for a Node.js startup:
9
9
  // `package.json#bin` points at the native binary.
10
10
  //
@@ -1,9 +1,9 @@
1
1
  {
2
- "lastValidatedTimestamp": 1788394737104,
2
+ "lastValidatedTimestamp": 1788518270048,
3
3
  "projects": {
4
4
  "/home/runner/_work/pnpm/pnpm/pnpm/npm/pnpm/temp-deploy": {
5
5
  "name": "pacquet",
6
- "version": "12.3.1"
6
+ "version": "12.3.3"
7
7
  }
8
8
  },
9
9
  "pnpmfiles": [],
@@ -28,7 +28,7 @@
28
28
  "@commitlint/prompt-cli": "^21.2.2",
29
29
  "@cyclonedx/cyclonedx-library": "10.2.0",
30
30
  "@eslint/js": "^10.0.1",
31
- "@inquirer/prompts": "^8.7.0",
31
+ "@inquirer/prompts": "^8.7.1",
32
32
  "@jest/globals": "30.4.1",
33
33
  "@npm/types": "^2.1.0",
34
34
  "@openpgp/web-stream-tools": "0.3.1",
@@ -227,7 +227,7 @@
227
227
  "semver-utils": "^1.1.4",
228
228
  "shlex": "^3.0.0",
229
229
  "shx": "^0.4.0",
230
- "socks": "^2.8.9",
230
+ "socks": "^2.8.10",
231
231
  "sort-keys": "^6.0.1",
232
232
  "split-cmd": "^1.1.0",
233
233
  "split2": "^4.2.0",
package/install.js CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  // Preinstall for the pnpm v12 wrapper (shared verbatim by `pnpm` and
3
- // `@pnpm/exe`): replace the placeholder bins with the host's native binary so
4
- // `pnpm` runs directly, no Node startup per call. Package managers write bin
5
- // shims after preinstall, so the shims are made from the binary; where build
6
- // scripts are blocked (`--ignore-scripts`, the pnpm/Bun default) the
7
- // placeholder stays and runs pnpm through Node.js (see the `pnpm` file). npm
8
- // does not re-read the rewritten `bin` during the same install pass, so on a
9
- // global Windows install, postinstall asks it to relink.
3
+ // `@pnpm/exe`): replace the shebang-less placeholder bins with the host's native
4
+ // binary so `pnpm` runs directly, no Node startup per call. The placeholder must
5
+ // stay shebang-less because pnpm 11 records its interpreter before installing
6
+ // the native binary at the same path. npm's global Windows shims still target
7
+ // the extensionless path after the `bin` rewrite, so postinstall asks npm to
8
+ // regenerate them against `pnpm.exe`. When lifecycle scripts are blocked
9
+ // (`--ignore-scripts`, pnpm/Bun default), the placeholder remains and runs pnpm
10
+ // through Node.js wherever a shell reaches it (see the `pnpm` file).
10
11
  //
11
12
  // `pn`/`pnpx`/`pnx` are committed `#!/bin/sh` scripts on Unix (so only `pnpm` is
12
13
  // relinked); on Windows the native binary is hardlinked onto each and
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "./dist/node_modules/node-gyp/gyp/gyp"
10
10
  ]
11
11
  },
12
- "version": "12.3.1",
12
+ "version": "12.3.3",
13
13
  "description": "Fast, disk space efficient package manager",
14
14
  "keywords": [
15
15
  "pnpm",
@@ -46,14 +46,14 @@
46
46
  "THIRD-PARTY-NOTICES.md"
47
47
  ],
48
48
  "optionalDependencies": {
49
- "@pnpm/exe.win32-x64": "12.3.1",
50
- "@pnpm/exe.win32-arm64": "12.3.1",
51
- "@pnpm/exe.darwin-x64": "12.3.1",
52
- "@pnpm/exe.darwin-arm64": "12.3.1",
53
- "@pnpm/exe.linux-x64": "12.3.1",
54
- "@pnpm/exe.linux-arm64": "12.3.1",
55
- "@pnpm/exe.linux-x64-musl": "12.3.1",
56
- "@pnpm/exe.linux-arm64-musl": "12.3.1"
49
+ "@pnpm/exe.win32-x64": "12.3.3",
50
+ "@pnpm/exe.win32-arm64": "12.3.3",
51
+ "@pnpm/exe.darwin-x64": "12.3.3",
52
+ "@pnpm/exe.darwin-arm64": "12.3.3",
53
+ "@pnpm/exe.linux-x64": "12.3.3",
54
+ "@pnpm/exe.linux-arm64": "12.3.3",
55
+ "@pnpm/exe.linux-x64-musl": "12.3.3",
56
+ "@pnpm/exe.linux-arm64-musl": "12.3.3"
57
57
  },
58
58
  "scripts": {
59
59
  "preinstall": "node install.js",
package/pnpm CHANGED
@@ -1,21 +1,38 @@
1
- #!/usr/bin/env node
2
- // pnpm's native binary replaces this file during installation (see
3
- // ./install.js). If this is running, that install script did not — build
4
- // scripts were blocked (pnpm and Bun block them by default) or skipped
5
- // (`--ignore-scripts`) — so pnpm runs through Node.js instead: `bin/pnpm.mjs`
6
- // finds the installed binary, or downloads one, and spawns it.
7
- //
8
- // Package managers write bin shims after preinstall has had its chance to run,
9
- // so a shim made from this file's shebang exists only where the binary never
10
- // arrived. That is also why this file is left in place once it is running: a
11
- // binary put here under such a shim would be run through `node`.
12
- import process from 'node:process'
1
+ # pnpm's native binary replaces this file during installation (see
2
+ # ./install.js). Until then this hands over to ./bin/pnpm.mjs, which finds the
3
+ # installed binary or downloads one and spawns it.
4
+ #
5
+ # Shebang-less on purpose, and therefore an `sh` script: a bin shim generated
6
+ # from a shebang records that interpreter, and pnpm 11 generates the shim before
7
+ # it puts the native binary at this path.
8
+ #
9
+ # Something has to retry this file under a shell, because the kernel answers
10
+ # ENOEXEC for it. A bin shim and a shell both do, and so does glibc's `execvp`.
11
+ # Apple's libc does not, so on macOS a program that spawns this path itself gets
12
+ # ENOEXEC; Windows has neither and cannot reach it at all.
13
+ if ! command -v node > /dev/null 2>&1; then
14
+ echo "pnpm's native binary was not installed, and there is no Node.js to run pnpm without it." >&2
15
+ echo "Reinstall pnpm with build scripts enabled (allow-list pnpm's build under pnpm or Bun, or drop --ignore-scripts)." >&2
16
+ exit 1
17
+ fi
13
18
 
14
- if (process.stderr.isTTY) {
15
- process.stderr.write(
16
- 'pnpm is running through Node.js because the script that installs its native binary was skipped. ' +
17
- 'Reinstall pnpm with its build scripts allowed to run the binary directly.\n'
18
- )
19
- }
19
+ if [ -t 2 ]; then
20
+ echo "pnpm is running through Node.js because the script that installs its native binary was skipped." >&2
21
+ echo "Reinstall pnpm with its build scripts allowed to run the binary directly." >&2
22
+ fi
20
23
 
21
- await import('./bin/pnpm.mjs')
24
+ # $0 is whatever shim or symlink pnpm was launched through; ./bin/pnpm.mjs is
25
+ # found relative to this file. The hop cap matches the kernel's ELOOP limit, so
26
+ # a cycle cannot hang the script.
27
+ self=$0
28
+ hops=0
29
+ while [ -L "$self" ] && [ "$hops" -lt 40 ]; do
30
+ hops=$((hops + 1))
31
+ link=$(readlink "$self")
32
+ case $link in
33
+ /*) self=$link ;;
34
+ *) self=$(dirname "$self")/$link ;;
35
+ esac
36
+ done
37
+
38
+ exec node "$(dirname "$self")/bin/pnpm.mjs" "$@"