pnpm 11.24.0 → 11.25.0

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,140 @@
1
1
  # pnpm
2
2
 
3
+ ## 11.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added an opt-in proof of concept that lets installs reuse a dependency's build output across machines, by publishing and restoring signed, organization-scoped artifacts through pnpr instead of running the lifecycle scripts locally.
8
+
9
+ Configure it with the new `remoteSideEffectsCache` setting. A workspace names the eligible `organization` and `packages`; everything describing the act of signing — `publish`, `keyId`, `builderId`, `trustedKeys`, `privateKey` and the provenance fields — is refused in `pnpm-workspace.yaml` and read from the global config file or the environment instead.
10
+
11
+ - Added macOS and Windows x64 and arm64 support to remote shared build artifacts [pnpm/pnpm#13771](https://github.com/pnpm/pnpm/issues/13771).
12
+
13
+ - Added the `audit.ignorePrune` setting. When set to `true`, `pnpm audit --fix` removes ignored GHSA entries that no longer appear in the audit report.
14
+
15
+ - Generalized the experimental shared-artifact protocol so candidates and signed payloads identify a discriminated subject. Dependency side effects use package and source-integrity subjects, while workspace tasks use project and task subjects.
16
+
17
+ This changes shared-artifact request bodies and signed payloads. A pnpr server and its clients have to be on matching versions.
18
+
19
+ - `pnpm init` now pins the latest pnpm version, instead of the version of pnpm that ran the command. A project scaffolded by an outdated pnpm therefore no longer inherits that staleness through its own `devEngines.packageManager` / `packageManager` pin [#7490](https://github.com/pnpm/pnpm/issues/7490).
20
+
21
+ The version is read from the `latest` tag on the package-manager registries. When that lookup cannot answer — no network, an unreachable or slow registry, `offline`, or a `latest` that the `minimumReleaseAge` / `trustPolicy` settings reject — `pnpm init` pins the running version as before, and never fails or hangs on the lookup. A `latest` that is older than the running pnpm is never pinned either.
22
+
23
+ - A `scope` set in a project's `pnpm-workspace.yaml` is now ignored, with a warning naming where to set it instead. `pnpm login` records the scope as a `@scope:registry` route in the machine-global `auth.ini`, which outranks `~/.npmrc` in every project — so a repository-committed file could redirect a scope such as `@acme` for all of a user's other projects after one routine login. Use `--scope`, the `PNPM_CONFIG_SCOPE` environment variable, or the global config file instead [#13557](https://github.com/pnpm/pnpm/issues/13557).
24
+
25
+ - Verified remote build artifacts are persisted in the shared store with their signed origin metadata. Later installs reverify the artifact against current trust, policy, platform, and source before reuse, while invalid remote variants are quarantined per channel ([pnpm/pnpm#13771](https://github.com/pnpm/pnpm/issues/13771)).
26
+
27
+ - Persist completed recursive tasks so `--resume-from` skips exactly the work that passed during a matching interrupted or failed `pnpm -r run` / `pnpm -r exec` invocation. When no compatible state exists, pnpm retains its graph-based resume behavior.
28
+
29
+ - Allowed `pnpm update --patches` to refresh registry revisions through a configured pnpr server while retaining locked package versions.
30
+
31
+ - Added explicit registry revision selection with `<version>+rN` and `pnpm update --patches` for refreshing revision artifacts without changing package versions. Registry-backed lockfile policy checks recognize historical revisions, and pnpr now preserves safe revision histories from upstream registries.
32
+
33
+ - Workspace install, rebuild, pack, publish, stage, and lifecycle work now starts as soon as its dependencies finish instead of waiting for an unrelated topological group.
34
+
35
+ - `pnpm stage approve` now approves several staged packages at once. Run it without a stage id to pick from the staged versions interactively, or pass a list of stage ids. The whole batch is approved with a single one-time password, and pnpm asks for a new one only once the registry stops accepting it. Inside a workspace, the selected packages are approved in dependency order, and a package whose workspace dependency could not be approved is skipped instead of being published against a dependency that never reached the registry.
36
+
37
+ - Added per-task concurrency limits to workspace task orchestration. Set `tasks.<name>.concurrency` in `pnpm-workspace.yaml` to limit how many instances of that task may run across workspace projects at once:
38
+
39
+ ```yaml
40
+ tasks:
41
+ build:
42
+ concurrency: 2
43
+ ```
44
+
45
+ - Added support for registry replacement tarballs using standard integrity values, explicit revision fields, registry routing from the `registries` setting, non-redirecting integrity-addressed URLs, canonical safe-integer revision numbers, and pnpr proxying for immutable upstream revision artifacts.
46
+
47
+ - `sideEffectsCache` now declares the whole of how a package's build output is reused — whether one is restored, whether one is saved, and the remote tier that shares it between machines:
48
+
49
+ ```yaml
50
+ sideEffectsCache:
51
+ read: true
52
+ write: true
53
+ remote:
54
+ org: acme
55
+ packages: ['native-addon']
56
+ ```
57
+
58
+ `sideEffectsCache: true`, `sideEffectsCacheReadonly`, `remoteSideEffectsCache`, and its `organization` field all keep working. Where a field is set under both spellings the one above wins; where it is set under only one, it is kept.
59
+
60
+ Two behaviors change, both bringing this CLI in line with what the Rust one already did: `sideEffectsCacheReadonly: true` now blocks writing to the cache, and setting it alongside `sideEffectsCache: false` gives a read-only view rather than switching the cache off entirely. A cache can also be declared write-only now, to populate one the run does not read.
61
+
62
+ - Workspace task orchestration ([pnpm/rfcs#23](https://github.com/pnpm/rfcs/pull/23)). `pnpm -r run` and `pnpm -r exec` now schedule per task instead of in topological chunks: a task starts as soon as the tasks it depends on have finished, so a project no longer waits for unrelated projects that happen to share its chunk.
63
+
64
+ A new `tasks` section in `pnpm-workspace.yaml` declares what a task depends on, using the `^` convention:
65
+
66
+ ```yaml
67
+ tasks:
68
+ build:
69
+ dependsOn: ['^build']
70
+ test:
71
+ dependsOn: ['build']
72
+ lint: {}
73
+ ```
74
+
75
+ `^name` means the named task in each of the project's workspace dependencies; a bare `name` means the task in the same project; an entry with no `dependsOn` declares an empty dependency list. A task with no entry behaves as `dependsOn: ['^<its own name>']`, which is exactly what the previous chunked ordering implied — an unconfigured workspace gets the scheduler improvement and nothing else changes meaning. A project without the script is reported skipped and passes its edges through to its own dependencies, so a scriptless package does not sever a chain.
76
+
77
+ Also part of this change:
78
+
79
+ - A dependency cycle among the tasks of a run is now an error naming the participating tasks (`ERR_PNPM_TASK_CYCLE`) instead of silently running in an arbitrary order. Setting `ignoreWorkspaceCycles: true` downgrades the error to a warning: the cycle's tasks run in an arbitrary order relative to each other.
80
+ - `--resume-from` now skips exactly the transitive dependencies of the anchor package; work unrelated to the anchor still runs.
81
+ - Under `--no-bail`, tasks whose dependencies failed are reported as skipped, not failed, and do not add to the exit code.
82
+ - With `--bail` (the default), the first failure still ends the run at once and nothing new is dispatched — including scripts already queued behind the concurrency limit.
83
+ - `pnpm -r run --dry-run <script>` prints the task graph that would execute without running anything (including skipping the `verifyDepsBeforeRun` check); `--json` emits the tasks and their resolved dependency edges.
84
+ - Output is inherited rather than piped only when at most one script can ever be in flight (`--workspace-concurrency=1`, or the graph forces the scripts to run one after another).
85
+
86
+ ### Patch Changes
87
+
88
+ - An `_auth` entry in the global config file no longer decides which registry packages come from when something else says. A `registry` or `registries` declared in `pnpm-workspace.yaml` or the global config now wins over the route inferred from a stored credential, which still applies where nothing else declares one. The `pnpm_config__auth` environment variable is unchanged: it stays the way to point a CI runner at a mandated proxy, and still overrides what a repository declares.
89
+
90
+ - Prevent installs through a symlinked `node_modules` directory from rewriting the target checkout [pnpm/pnpm#14286](https://github.com/pnpm/pnpm/issues/14286).
91
+
92
+ - Treat empty scripts selected by a regular expression as missing before running dependent tasks.
93
+
94
+ - The options type of the `fetch` command now declares `allowBuilds`, a setting its handler already forwarded to the installer. Type-level only — what `pnpm fetch` does is unchanged.
95
+
96
+ - Filter hidden scripts matched by a regular expression during recursive runs when a visible script also matches.
97
+
98
+ - Fixed automatically switched pnpm versions forcing all descendant pnpm processes to use the same version [pnpm/pnpm#14309](https://github.com/pnpm/pnpm/issues/14309).
99
+
100
+ - Fixed `ERR_PNPM_UNUSED_PATCH` validation during incremental installs [pnpm/pnpm#13692](https://github.com/pnpm/pnpm/issues/13692).
101
+
102
+ - Fixed `pnpm deploy --prod` failing when an excluded dev dependency was also declared as an optional peer dependency [pnpm/pnpm#14302](https://github.com/pnpm/pnpm/issues/14302).
103
+
104
+ - `pnpm update -g` no longer downgrades a global package. `--latest` resolves the `latest` dist-tag, which can point at an older release than the one installed — after `pnpm add -g <pkg>@next`, for instance [#14270](https://github.com/pnpm/pnpm/issues/14270).
105
+
106
+ `pnpm update -g` also no longer changes the pnpm version. pnpm's own global install belongs to `pnpm self-update` [#14270](https://github.com/pnpm/pnpm/issues/14270).
107
+
108
+ - Copying a built package to its other hoisted locations no longer replaces the destination directory. With `nodeLinker: hoisted`, that replacement deleted the dependencies nested inside the destination's `node_modules`, and made concurrent copies of the same build chunk fail with `ERR_PNPM_ENOENT: no such file or directory, rename '.../node_modules/_tmp_...'` [#12880](https://github.com/pnpm/pnpm/issues/12880).
109
+
110
+ - `pnpm update` no longer replaces the specifier a project declares for a dependency that is also listed in `overrides`. A `catalog:` reference stays a `catalog:` reference, and a declared range stays as written, instead of being rewritten to the version the override resolved to [#12115](https://github.com/pnpm/pnpm/issues/12115).
111
+
112
+ - `pnpm update` no longer moves the range a project declares for a dependency that `overrides` also lists, even when the override repeats that range verbatim. Previously the updated `package.json` disagreed with the lockfile, so the next `pnpm install --frozen-lockfile` failed with a specifier mismatch [#14224](https://github.com/pnpm/pnpm/issues/14224).
113
+
114
+ - Make `pnpm add --lockfile-only` skip dependency linking [pnpm/pnpm#14286](https://github.com/pnpm/pnpm/issues/14286).
115
+
116
+ - `--production` is accepted again as an alias of `--prod` on `install`, `fetch`, `prune`, `update`, `list`, `why`, and `sbom`, and the install that `verifyDepsBeforeRun` reproduces is now spelled with `--prod`. `pnpm run` no longer aborts with "unexpected argument '--production' found" after a production-only install [#14147](https://github.com/pnpm/pnpm/issues/14147).
117
+
118
+ - The progress output no longer overwrites the lines above it once it grows taller than the terminal window [#14270](https://github.com/pnpm/pnpm/issues/14270).
119
+
120
+ - Restoring a dependency's build from the remote side-effects cache no longer downloads files the store already holds.
121
+
122
+ - Forward `patchedDependencies` hashes and `packageExtensions` to pnpr so server-side resolution preserves patches and package extensions in the lockfile and installed packages.
123
+
124
+ - Published the workspace task graph and scheduler as `@pnpm/workspace.task-scheduler` so other workspace commands can use the same dependency-aware scheduling as recursive run and exec.
125
+
126
+ - The environment variables for the remote side-effects cache are named for the setting they configure: `PNPM_SIDE_EFFECTS_CACHE_REMOTE_KEY_ID`, `..._BUILDER_ID`, `..._IMAGE_DIGEST`, `..._ARCHITECTURE_BASELINE`, `..._PRIVATE_KEY`, `..._BUILD_ENV`, `..._TRUSTED_KEYS` and `..._PUBLISH`. The `PNPM_REMOTE_SIDE_EFFECTS_CACHE_*` names keep working, and the new one wins when both are set.
127
+
128
+ - A `devEngines.packageManager` range pin on pnpm is now recorded in `pnpm-lock.yaml`'s `packageManagerDependencies` when the running pnpm already satisfies it, using the running version and keeping the range as the recorded specifier. Previously only an exact pin — or a range resolved on the way through a version switch — reached the lockfile, so a range pin written by hand (or by any tool other than `pnpm add` / `pnpm self-update`) left the project without the shared resolution the pin exists to provide.
129
+
130
+ - Fixed recursive `run` cleanup on Windows when a lifecycle script fails while another script's process tree is still running.
131
+
132
+ - The update notification now suggests `pnpm self-update` when `PNPM_HOME` manages the pnpm in use, and the [standalone install script](https://pnpm.io/installation) otherwise — under Corepack, or when another package manager installed pnpm. `pnpm self-update` under Corepack names the standalone install script too.
133
+
134
+ - Enforce `allowBuilds` when a prepared git dependency is reused from the shared store, and use the lockfile's canonical git resolution ID in approval suggestions.
135
+
136
+ - Topologically sorting workspace projects now runs in linear time, fixing installs and lockfile updates that stalled for seconds on workspaces with thousands of projects forming deep dependency chains [#14149](https://github.com/pnpm/pnpm/issues/14149), [#14151](https://github.com/pnpm/pnpm/issues/14151).
137
+
3
138
  ## 11.24.0
4
139
 
5
140
  ### Minor Changes
@@ -1175,6 +1175,15 @@ const parse = (input, options) => {
1175
1175
  consume('/**', 3);
1176
1176
  }
1177
1177
 
1178
+ // A globstar followed only by balanced closing parens is at the logical end of patterns like
1179
+ // `test(/utils/**)` and `test?(/utils/**)`. Treat it as EOS so the trailing `/**` can match its
1180
+ // parent path, except in negated extglobs where that would change the exclusion semantics.
1181
+ const isEnd = eos() || (
1182
+ state.parens > 0
1183
+ && rest === ')'.repeat(state.parens)
1184
+ && !extglobs.some(extglob => extglob.type === 'negate')
1185
+ );
1186
+
1178
1187
  if (prior.type === 'bos' && eos()) {
1179
1188
  prev.type = 'globstar';
1180
1189
  prev.value += value;
@@ -1185,7 +1194,7 @@ const parse = (input, options) => {
1185
1194
  continue;
1186
1195
  }
1187
1196
 
1188
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
1197
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && isEnd) {
1189
1198
  state.output = state.output.slice(0, -(prior.output + prev.output).length);
1190
1199
  prior.output = `(?:${prior.output}`;
1191
1200
 
@@ -50,7 +50,7 @@ const scan = (input, options) => {
50
50
  const opts = options || {};
51
51
 
52
52
  const length = input.length - 1;
53
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
53
+ const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
54
54
  const slashes = [];
55
55
  const tokens = [];
56
56
  const parts = [];
@@ -184,15 +184,21 @@ const scan = (input, options) => {
184
184
  }
185
185
 
186
186
  if (scanToEnd === true) {
187
+ let parens = 0;
188
+
187
189
  while (eos() !== true && (code = advance())) {
188
190
  if (code === CHAR_BACKWARD_SLASH) {
189
191
  backslashes = token.backslashes = true;
190
- code = advance();
192
+ advance();
193
+ continue;
194
+ }
195
+
196
+ if (code === CHAR_LEFT_PARENTHESES) {
197
+ parens++;
191
198
  continue;
192
199
  }
193
200
 
194
- if (code === CHAR_RIGHT_PARENTHESES) {
195
- isGlob = token.isGlob = true;
201
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
196
202
  finished = true;
197
203
  break;
198
204
  }
@@ -257,14 +263,21 @@ const scan = (input, options) => {
257
263
  isGlob = token.isGlob = true;
258
264
 
259
265
  if (scanToEnd === true) {
266
+ let parens = 1;
267
+
260
268
  while (eos() !== true && (code = advance())) {
261
- if (code === CHAR_LEFT_PARENTHESES) {
269
+ if (code === CHAR_BACKWARD_SLASH) {
262
270
  backslashes = token.backslashes = true;
263
- code = advance();
271
+ advance();
264
272
  continue;
265
273
  }
266
274
 
267
- if (code === CHAR_RIGHT_PARENTHESES) {
275
+ if (code === CHAR_LEFT_PARENTHESES) {
276
+ parens++;
277
+ continue;
278
+ }
279
+
280
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
268
281
  finished = true;
269
282
  break;
270
283
  }
@@ -351,7 +364,7 @@ const scan = (input, options) => {
351
364
  let prevIndex;
352
365
 
353
366
  for (let idx = 0; idx < slashes.length; idx++) {
354
- const n = prevIndex ? prevIndex + 1 : start;
367
+ const n = prevIndex !== undefined ? prevIndex + 1 : start;
355
368
  const i = slashes[idx];
356
369
  const value = input.slice(n, i);
357
370
  if (opts.tokens) {
@@ -364,21 +377,20 @@ const scan = (input, options) => {
364
377
  depth(tokens[idx]);
365
378
  state.maxDepth += tokens[idx].depth;
366
379
  }
367
- if (idx !== 0 || value !== '') {
380
+ if (i >= start) {
368
381
  parts.push(value);
382
+ prevIndex = i;
369
383
  }
370
- prevIndex = i;
371
384
  }
372
385
 
373
- if (prevIndex && prevIndex + 1 < input.length) {
374
- const value = input.slice(prevIndex + 1);
375
- parts.push(value);
386
+ const n = prevIndex !== undefined ? prevIndex + 1 : start;
387
+ const value = input.slice(n);
388
+ parts.push(value);
376
389
 
377
- if (opts.tokens) {
378
- tokens[tokens.length - 1].value = value;
379
- depth(tokens[tokens.length - 1]);
380
- state.maxDepth += tokens[tokens.length - 1].depth;
381
- }
390
+ if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
391
+ tokens[tokens.length - 1].value = value;
392
+ depth(tokens[tokens.length - 1]);
393
+ state.maxDepth += tokens[tokens.length - 1].depth;
382
394
  }
383
395
 
384
396
  state.slashes = slashes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "picomatch",
3
3
  "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
4
- "version": "4.0.5",
4
+ "version": "4.0.7",
5
5
  "homepage": "https://github.com/micromatch/picomatch",
6
6
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7
7
  "funding": "https://github.com/sponsors/jonschlinkert",