pnpm 11.24.0 → 11.26.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 +203 -0
- package/README.md +11 -15
- package/dist/node_modules/picomatch/lib/parse.js +10 -1
- package/dist/node_modules/picomatch/lib/scan.js +30 -18
- package/dist/node_modules/picomatch/package.json +1 -1
- package/dist/pnpm.mjs +16262 -10975
- package/dist/worker.js +761 -650
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,208 @@
|
|
|
1
1
|
# pnpm
|
|
2
2
|
|
|
3
|
+
## 11.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Catalogs can now resolve workspace dependencies through the `workspace:` protocol.
|
|
8
|
+
|
|
9
|
+
- `pnpm remove` and `pnpm update` now accept `--trust-lockfile`, `--no-trust-lockfile`, `--trust-policy`, `--trust-policy-exclude`, and `--trust-policy-ignore-after`. `pnpm remove` checks the whole lockfile against the active policies unless `--trust-lockfile` is set.
|
|
10
|
+
|
|
11
|
+
- Added `pnpm change check` for CI validation of package versions against the `versioning.epics` bands and `versioning.fixed` groups in `pnpm-workspace.yaml`.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Fetch and tarball errors and retry logs now hide URL credentials, query strings, and fragments that could expose secrets.
|
|
16
|
+
|
|
17
|
+
- Fixed a race during config dependency updates that could redirect a lockfile write through a symlink [#14322](https://github.com/pnpm/pnpm/issues/14322).
|
|
18
|
+
|
|
19
|
+
- `pnpm add --allow-build=!<pkg>` now correctly denies builds, including in global installs. `pnpm approve-builds <pkg>` and `pnpm approve-builds !<pkg>` now save decisions even when the package is not awaiting approval, with a warning [#14067](https://github.com/pnpm/pnpm/issues/14067).
|
|
20
|
+
|
|
21
|
+
- Fixed `pnpm audit --fix` failing without a value or when followed by another flag. `pnpm audit --fix=override` now respects `saveExact` and `savePrefix` when writing overrides [#13261](https://github.com/pnpm/pnpm/issues/13261), [#11523](https://github.com/pnpm/pnpm/issues/11523).
|
|
22
|
+
|
|
23
|
+
- `pnpm audit` now excludes ignored advisories from vulnerability totals and severity counts, and reports them separately [#14535](https://github.com/pnpm/pnpm/issues/14535).
|
|
24
|
+
|
|
25
|
+
- `pnpm deploy` no longer requires `injectWorkspacePackages`. If a workspace dependency's peer has multiple possible versions, deployment reports `ERR_PNPM_DEPLOY_AMBIGUOUS_PEER` with the conflicting versions. Pin the peer with `overrides` to deploy without injection [#9386](https://github.com/pnpm/pnpm/issues/9386).
|
|
26
|
+
|
|
27
|
+
- 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).
|
|
28
|
+
|
|
29
|
+
- Fixed installation failures when a linked local dependency provides a peer dependency also provided by an ancestor, including with `pnpm deploy --legacy`.
|
|
30
|
+
|
|
31
|
+
- `pnpm install --node-linker=hoisted` no longer downloads skipped optional dependencies when `node_modules` already exists [#14139](https://github.com/pnpm/pnpm/issues/14139).
|
|
32
|
+
|
|
33
|
+
- Fixed `pnpm install` rejecting a symlinked lockfile when config dependencies are unchanged. Updates to config dependencies also preserve lockfiles with a byte order mark. Writes through symlinked lockfiles remain blocked [#14372](https://github.com/pnpm/pnpm/issues/14372).
|
|
34
|
+
|
|
35
|
+
- `pnpm install` now relinks workspace packages when `publishConfig.linkDirectory` changes. Frozen installs require the lockfile to be regenerated [#14488](https://github.com/pnpm/pnpm/issues/14488).
|
|
36
|
+
|
|
37
|
+
- Auto-installed optional peers now satisfy their declared range even when the workspace root uses a version outside that range [#13867](https://github.com/pnpm/pnpm/issues/13867).
|
|
38
|
+
|
|
39
|
+
- Fixed global virtual store paths for dependency cycles to consistently account for the runtime engine when dependencies have allowed builds [#14341](https://github.com/pnpm/pnpm/issues/14341).
|
|
40
|
+
|
|
41
|
+
- Standalone installations now preserve the bundled `node-gyp` files needed to build native dependencies.
|
|
42
|
+
|
|
43
|
+
- Downloaded runtimes are now available to dependency lifecycle scripts during installation.
|
|
44
|
+
|
|
45
|
+
- Node.js downloads from `nodeDownloadMirrors` now use URL-scoped npm credentials, including bearer tokens, basic auth, and `tokenHelper` [#14334](https://github.com/pnpm/pnpm/issues/14334).
|
|
46
|
+
|
|
47
|
+
- Fixed `globalDir` and `globalBinDir` handling in global configuration and environment variables, including `~/` expansion. This fixes `pnpm add -g` failing after `pnpm config set -g global-bin-dir` [#14336](https://github.com/pnpm/pnpm/issues/14336).
|
|
48
|
+
|
|
49
|
+
- The JavaScript pnpm can again switch to the project's pinned pnpm version on hosts without a matching native binary. If the requested version requires an unavailable native binary, the error now identifies the unsupported host [#13622](https://github.com/pnpm/pnpm/issues/13622).
|
|
50
|
+
|
|
51
|
+
- Global `pnpm config` commands now skip project package manager version switching, allowing authentication to be configured before downloading the pinned version [#14463](https://github.com/pnpm/pnpm/issues/14463).
|
|
52
|
+
|
|
53
|
+
- `pnpm self-update`, `pnpm with`, and automatic version switching no longer wait through registry retries when a configured registry has no signatures and `registry.npmjs.org` is unavailable [#14483](https://github.com/pnpm/pnpm/issues/14483).
|
|
54
|
+
|
|
55
|
+
- Fixed argument forwarding on Windows with `shellEmulator` enabled. Trailing backslashes, line breaks, and literal shell expressions are preserved [#14548](https://github.com/pnpm/pnpm/issues/14548).
|
|
56
|
+
|
|
57
|
+
- Relative `scriptShell` paths now resolve from the workspace root. Bare command names such as `bash` still use `PATH` [#14422](https://github.com/pnpm/pnpm/issues/14422).
|
|
58
|
+
|
|
59
|
+
- `pnpm import` now preserves the project-local lockfile when `lockfileDir` points elsewhere and restores the destination lockfile on failure. Branch lockfile imports leave the shared lockfile unchanged [#14563](https://github.com/pnpm/pnpm/issues/14563).
|
|
60
|
+
|
|
61
|
+
- `catalogMode` and `--save-catalog` no longer move local paths, tarballs, or `workspace:<path>` specifiers into catalogs [#14437](https://github.com/pnpm/pnpm/issues/14437).
|
|
62
|
+
|
|
63
|
+
- `--side-effects-cache`, `--no-side-effects-cache`, and `PNPM_CONFIG_SIDE_EFFECTS_CACHE` now toggle only the local cache, preserving any remote cache configured in `sideEffectsCache`.
|
|
64
|
+
|
|
65
|
+
- `pnpm unpublish` now handles registry two-factor authentication challenges through web authentication or a one-time password prompt [#14464](https://github.com/pnpm/pnpm/issues/14464).
|
|
66
|
+
|
|
67
|
+
- `pnpm outdated` and `pnpm update` now follow GitHub Actions references using self-repository syntax, such as `uses: $/.github/actions/setup`.
|
|
68
|
+
|
|
69
|
+
- `pnpm remove` now accepts `--unsafe-perm`.
|
|
70
|
+
|
|
71
|
+
## 11.25.0
|
|
72
|
+
|
|
73
|
+
### Minor Changes
|
|
74
|
+
|
|
75
|
+
- 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.
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
- Added macOS and Windows x64 and arm64 support to remote shared build artifacts [pnpm/pnpm#13771](https://github.com/pnpm/pnpm/issues/13771).
|
|
80
|
+
|
|
81
|
+
- Added the `audit.ignorePrune` setting. When set to `true`, `pnpm audit --fix` removes ignored GHSA entries that no longer appear in the audit report.
|
|
82
|
+
|
|
83
|
+
- 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.
|
|
84
|
+
|
|
85
|
+
This changes shared-artifact request bodies and signed payloads. A pnpr server and its clients have to be on matching versions.
|
|
86
|
+
|
|
87
|
+
- `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).
|
|
88
|
+
|
|
89
|
+
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.
|
|
90
|
+
|
|
91
|
+
- 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).
|
|
92
|
+
|
|
93
|
+
- 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)).
|
|
94
|
+
|
|
95
|
+
- 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.
|
|
96
|
+
|
|
97
|
+
- Allowed `pnpm update --patches` to refresh registry revisions through a configured pnpr server while retaining locked package versions.
|
|
98
|
+
|
|
99
|
+
- 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.
|
|
100
|
+
|
|
101
|
+
- 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.
|
|
102
|
+
|
|
103
|
+
- `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.
|
|
104
|
+
|
|
105
|
+
- 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:
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
tasks:
|
|
109
|
+
build:
|
|
110
|
+
concurrency: 2
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- 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.
|
|
114
|
+
|
|
115
|
+
- `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:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
sideEffectsCache:
|
|
119
|
+
read: true
|
|
120
|
+
write: true
|
|
121
|
+
remote:
|
|
122
|
+
org: acme
|
|
123
|
+
packages: ['native-addon']
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`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.
|
|
127
|
+
|
|
128
|
+
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.
|
|
129
|
+
|
|
130
|
+
- 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.
|
|
131
|
+
|
|
132
|
+
A new `tasks` section in `pnpm-workspace.yaml` declares what a task depends on, using the `^` convention:
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
tasks:
|
|
136
|
+
build:
|
|
137
|
+
dependsOn: ['^build']
|
|
138
|
+
test:
|
|
139
|
+
dependsOn: ['build']
|
|
140
|
+
lint: {}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`^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.
|
|
144
|
+
|
|
145
|
+
Also part of this change:
|
|
146
|
+
|
|
147
|
+
- 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.
|
|
148
|
+
- `--resume-from` now skips exactly the transitive dependencies of the anchor package; work unrelated to the anchor still runs.
|
|
149
|
+
- Under `--no-bail`, tasks whose dependencies failed are reported as skipped, not failed, and do not add to the exit code.
|
|
150
|
+
- 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.
|
|
151
|
+
- `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.
|
|
152
|
+
- 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).
|
|
153
|
+
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- 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.
|
|
157
|
+
|
|
158
|
+
- Prevent installs through a symlinked `node_modules` directory from rewriting the target checkout [pnpm/pnpm#14286](https://github.com/pnpm/pnpm/issues/14286).
|
|
159
|
+
|
|
160
|
+
- Treat empty scripts selected by a regular expression as missing before running dependent tasks.
|
|
161
|
+
|
|
162
|
+
- 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.
|
|
163
|
+
|
|
164
|
+
- Filter hidden scripts matched by a regular expression during recursive runs when a visible script also matches.
|
|
165
|
+
|
|
166
|
+
- 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).
|
|
167
|
+
|
|
168
|
+
- Fixed `ERR_PNPM_UNUSED_PATCH` validation during incremental installs [pnpm/pnpm#13692](https://github.com/pnpm/pnpm/issues/13692).
|
|
169
|
+
|
|
170
|
+
- 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).
|
|
171
|
+
|
|
172
|
+
- `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).
|
|
173
|
+
|
|
174
|
+
`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).
|
|
175
|
+
|
|
176
|
+
- 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).
|
|
177
|
+
|
|
178
|
+
- `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).
|
|
179
|
+
|
|
180
|
+
- `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).
|
|
181
|
+
|
|
182
|
+
- Make `pnpm add --lockfile-only` skip dependency linking [pnpm/pnpm#14286](https://github.com/pnpm/pnpm/issues/14286).
|
|
183
|
+
|
|
184
|
+
- `--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).
|
|
185
|
+
|
|
186
|
+
- 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).
|
|
187
|
+
|
|
188
|
+
- Restoring a dependency's build from the remote side-effects cache no longer downloads files the store already holds.
|
|
189
|
+
|
|
190
|
+
- Forward `patchedDependencies` hashes and `packageExtensions` to pnpr so server-side resolution preserves patches and package extensions in the lockfile and installed packages.
|
|
191
|
+
|
|
192
|
+
- 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.
|
|
193
|
+
|
|
194
|
+
- 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.
|
|
195
|
+
|
|
196
|
+
- 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.
|
|
197
|
+
|
|
198
|
+
- Fixed recursive `run` cleanup on Windows when a lifecycle script fails while another script's process tree is still running.
|
|
199
|
+
|
|
200
|
+
- 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.
|
|
201
|
+
|
|
202
|
+
- 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.
|
|
203
|
+
|
|
204
|
+
- 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).
|
|
205
|
+
|
|
3
206
|
## 11.24.0
|
|
4
207
|
|
|
5
208
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -52,11 +52,16 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
52
52
|
</a>
|
|
53
53
|
</td>
|
|
54
54
|
<td align="center" valign="middle">
|
|
55
|
-
<a href="https://notion.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
55
|
+
<a href="https://notion.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/notion.svg" width="80" alt="Notion"></a>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td align="center" valign="middle">
|
|
60
|
+
<a href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
56
61
|
<picture>
|
|
57
|
-
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/
|
|
58
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/
|
|
59
|
-
<img src="https://pnpm.io/img/users/
|
|
62
|
+
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/coderabbit.svg" />
|
|
63
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/coderabbit_light.svg" />
|
|
64
|
+
<img src="https://pnpm.io/img/users/coderabbit.svg" width="220" alt="CodeRabbit" />
|
|
60
65
|
</picture>
|
|
61
66
|
</a>
|
|
62
67
|
</td>
|
|
@@ -101,15 +106,6 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
101
106
|
</picture>
|
|
102
107
|
</a>
|
|
103
108
|
</td>
|
|
104
|
-
<td align="center" valign="middle">
|
|
105
|
-
<a href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
106
|
-
<picture>
|
|
107
|
-
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/coderabbit.svg" />
|
|
108
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/coderabbit_light.svg" />
|
|
109
|
-
<img src="https://pnpm.io/img/users/coderabbit.svg" width="220" alt="CodeRabbit" />
|
|
110
|
-
</picture>
|
|
111
|
-
</a>
|
|
112
|
-
</td>
|
|
113
109
|
<td align="center" valign="middle">
|
|
114
110
|
<a href="https://stackblitz.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
115
111
|
<picture>
|
|
@@ -119,8 +115,6 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
119
115
|
</picture>
|
|
120
116
|
</a>
|
|
121
117
|
</td>
|
|
122
|
-
</tr>
|
|
123
|
-
<tr>
|
|
124
118
|
<td align="center" valign="middle">
|
|
125
119
|
<a href="https://workleap.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
126
120
|
<picture>
|
|
@@ -130,6 +124,8 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
130
124
|
</picture>
|
|
131
125
|
</a>
|
|
132
126
|
</td>
|
|
127
|
+
</tr>
|
|
128
|
+
<tr>
|
|
133
129
|
<td align="center" valign="middle">
|
|
134
130
|
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
135
131
|
<picture>
|
|
@@ -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 &&
|
|
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
|
-
|
|
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 ===
|
|
269
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
262
270
|
backslashes = token.backslashes = true;
|
|
263
|
-
|
|
271
|
+
advance();
|
|
264
272
|
continue;
|
|
265
273
|
}
|
|
266
274
|
|
|
267
|
-
if (code ===
|
|
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 (
|
|
380
|
+
if (i >= start) {
|
|
368
381
|
parts.push(value);
|
|
382
|
+
prevIndex = i;
|
|
369
383
|
}
|
|
370
|
-
prevIndex = i;
|
|
371
384
|
}
|
|
372
385
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
386
|
+
const n = prevIndex !== undefined ? prevIndex + 1 : start;
|
|
387
|
+
const value = input.slice(n);
|
|
388
|
+
parts.push(value);
|
|
376
389
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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.
|
|
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",
|