@pnpm/cli.parse-cli-args 1100.1.4 → 1100.1.6

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 ADDED
@@ -0,0 +1,426 @@
1
+ # @pnpm/parse-cli-args
2
+
3
+ ## 1100.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Options that follow `create`, `exec`, or `test` appearing as a subcommand of another command are now parsed instead of being silently treated as positional parameters. For example, `pnpm team create @org:team --registry <url>` previously ignored the `--registry` option and sent the request to the default registry.
8
+
9
+ ## 1100.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [852d537]
14
+ - @pnpm/error@1100.0.1
15
+ - @pnpm/workspace.root-finder@1100.0.3
16
+
17
+ ## 1100.1.4
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [293921a]
22
+ - @pnpm/workspace.root-finder@1100.0.2
23
+
24
+ ## 1100.1.3
25
+
26
+ ### Patch Changes
27
+
28
+ - 43d5456: Fixed `pnpm --prefix=<dir> install` overwriting the existing `pnpm-workspace.yaml` in `<dir>` with `set this to true or false` placeholders. The renamed `--prefix` option (which maps to `dir`) was not honored when locating the workspace root, so the workspace manifest's `allowBuilds` settings were not loaded into config and got clobbered when ignored builds were auto-populated [#11535](https://github.com/pnpm/pnpm/issues/11535).
29
+
30
+ ## 1100.1.2
31
+
32
+ ### Patch Changes
33
+
34
+ - 81161d5: `--pm-on-fail=ignore` (and other universal options like `--loglevel`, `--reporter`) is now honored when combined with `--help` or `--version`. Previously the CLI argument parser short-circuited those flags before universal options were preserved, so `pnpm audit --pm-on-fail=ignore --help` and `pnpm --pm-on-fail=ignore --version` reported the strict packageManager mismatch instead of running the requested action [#11487](https://github.com/pnpm/pnpm/issues/11487).
35
+
36
+ ## 1100.1.1
37
+
38
+ ### Patch Changes
39
+
40
+ - 184ce26: Fix the package name in README.md.
41
+ - Updated dependencies [184ce26]
42
+ - @pnpm/workspace.root-finder@1100.0.1
43
+
44
+ ## 1100.1.0
45
+
46
+ ### Minor Changes
47
+
48
+ - 9af708a: Add `pnpm with <version|current> <args...>` command. Runs pnpm at a specific version (or the currently active one) for a single invocation, bypassing the project's `packageManager` and `devEngines.packageManager` pins. Uses the same install mechanism as `pnpm self-update`, caching the downloaded pnpm in the global virtual store for reuse.
49
+
50
+ Examples:
51
+
52
+ ```
53
+ pnpm with current install # ignore the pinned version, use the running pnpm
54
+ pnpm with 11.0.0-rc.1 install # install using pnpm 11.0.0-rc.1
55
+ pnpm with next install # install using the "next" dist-tag
56
+ ```
57
+
58
+ Also adds a new `pmOnFail` setting that overrides the `onFail` behavior of `packageManager` and `devEngines.packageManager`. Accepted values: `download`, `error`, `warn`, `ignore`. Can be set via CLI flag, env var, `pnpm-workspace.yaml`, or `.npmrc` — useful when version management is handled by an external tool (asdf, mise, Volta, etc.) and the project wants pnpm itself to skip the check.
59
+
60
+ ```
61
+ pnpm install --pm-on-fail=ignore # direct CLI flag
62
+ pnpm_config_pm_on_fail=ignore pnpm install # env var
63
+ # or in pnpm-workspace.yaml:
64
+ # pmOnFail: ignore
65
+ ```
66
+
67
+ ## 1001.0.0
68
+
69
+ ### Major Changes
70
+
71
+ - 491a84f: This package is now pure ESM.
72
+ - 7d2fd48: Node.js v18, 19, 20, and 21 support discontinued.
73
+ - b51bb42: Support lowercase options in `pnpm add`: `-d`, `-p`, `-o`, `-e` [#9197](https://github.com/pnpm/pnpm/issues/9197).
74
+
75
+ When using `pnpm add` command only:
76
+
77
+ - `-p` is now an alias for `--save-prod` instead of `--parseable`
78
+ - `-d` is now an alias for `--save-dev` instead of `--loglevel=info`
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [491a84f]
83
+ - Updated dependencies [e119c4e]
84
+ - Updated dependencies [7d2fd48]
85
+ - Updated dependencies [831f574]
86
+ - @pnpm/workspace.root-finder@1001.0.0
87
+ - @pnpm/error@1001.0.0
88
+
89
+ ## 1000.1.4
90
+
91
+ ### Patch Changes
92
+
93
+ - @pnpm/error@1000.0.5
94
+ - @pnpm/find-workspace-dir@1000.1.3
95
+
96
+ ## 1000.1.3
97
+
98
+ ### Patch Changes
99
+
100
+ - 7e89138: Fix deprecation warning printed when executing pnpm with Node.js 24 [#9529](https://github.com/pnpm/pnpm/issues/9529).
101
+
102
+ ## 1000.1.2
103
+
104
+ ### Patch Changes
105
+
106
+ - 778ba1e: Fix a regression in which `pnpm dlx pkg --help` doesn't pass `--help` to `pkg` [#9823](https://github.com/pnpm/pnpm/issues/9823).
107
+
108
+ ## 1000.1.1
109
+
110
+ ### Patch Changes
111
+
112
+ - @pnpm/error@1000.0.4
113
+ - @pnpm/find-workspace-dir@1000.1.2
114
+
115
+ ## 1000.1.0
116
+
117
+ ### Minor Changes
118
+
119
+ - 6bcfa69: Allow `dlx` to parse CLI flags and options between the `dlx` command and the command to run or between the `dlx` command and `--` [#9719](https://github.com/pnpm/pnpm/issues/9719).
120
+
121
+ ### Patch Changes
122
+
123
+ - @pnpm/error@1000.0.3
124
+ - @pnpm/find-workspace-dir@1000.1.1
125
+
126
+ ## 1000.0.4
127
+
128
+ ### Patch Changes
129
+
130
+ - Updated dependencies [69f922a]
131
+ - @pnpm/find-workspace-dir@1000.1.0
132
+
133
+ ## 1000.0.3
134
+
135
+ ### Patch Changes
136
+
137
+ - 48b4871: Allow scope registry CLI option without `--config.` prefix such as `--@scope:registry=https://scope.example.com/npm` [#9089](https://github.com/pnpm/pnpm/pull/9089).
138
+
139
+ ## 1000.0.2
140
+
141
+ ### Patch Changes
142
+
143
+ - @pnpm/error@1000.0.2
144
+ - @pnpm/find-workspace-dir@1000.0.2
145
+
146
+ ## 1000.0.1
147
+
148
+ ### Patch Changes
149
+
150
+ - @pnpm/error@1000.0.1
151
+ - @pnpm/find-workspace-dir@1000.0.1
152
+
153
+ ## 8.0.4
154
+
155
+ ### Patch Changes
156
+
157
+ - @pnpm/error@6.0.3
158
+ - @pnpm/find-workspace-dir@7.0.3
159
+
160
+ ## 8.0.3
161
+
162
+ ### Patch Changes
163
+
164
+ - f066efc: All commands should read settings from the `package.json` at the root of the workspace [#8667](https://github.com/pnpm/pnpm/issues/8667).
165
+
166
+ ## 8.0.2
167
+
168
+ ### Patch Changes
169
+
170
+ - @pnpm/error@6.0.2
171
+ - @pnpm/find-workspace-dir@7.0.2
172
+
173
+ ## 8.0.1
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies [a7aef51]
178
+ - @pnpm/error@6.0.1
179
+ - @pnpm/find-workspace-dir@7.0.1
180
+
181
+ ## 8.0.0
182
+
183
+ ### Major Changes
184
+
185
+ - 43cdd87: Node.js v16 support dropped. Use at least Node.js v18.12.
186
+
187
+ ### Patch Changes
188
+
189
+ - Updated dependencies [3ded840]
190
+ - Updated dependencies [43cdd87]
191
+ - @pnpm/error@6.0.0
192
+ - @pnpm/find-workspace-dir@7.0.0
193
+
194
+ ## 7.0.4
195
+
196
+ ### Patch Changes
197
+
198
+ - 1ce2dd13a: Update didyoumean2 to v6.
199
+
200
+ ## 7.0.3
201
+
202
+ ### Patch Changes
203
+
204
+ - 32679f0ad: Don't ignore empty strings in params [#6594](https://github.com/pnpm/pnpm/issues/6594).
205
+
206
+ ## 7.0.2
207
+
208
+ ### Patch Changes
209
+
210
+ - @pnpm/error@5.0.2
211
+ - @pnpm/find-workspace-dir@6.0.2
212
+
213
+ ## 7.0.1
214
+
215
+ ### Patch Changes
216
+
217
+ - @pnpm/error@5.0.1
218
+ - @pnpm/find-workspace-dir@6.0.1
219
+
220
+ ## 7.0.0
221
+
222
+ ### Major Changes
223
+
224
+ - eceaa8b8b: Node.js 14 support dropped.
225
+
226
+ ### Patch Changes
227
+
228
+ - Updated dependencies [eceaa8b8b]
229
+ - @pnpm/find-workspace-dir@6.0.0
230
+ - @pnpm/error@5.0.0
231
+
232
+ ## 6.0.1
233
+
234
+ ### Patch Changes
235
+
236
+ - @pnpm/error@4.0.1
237
+ - @pnpm/find-workspace-dir@5.0.1
238
+
239
+ ## 6.0.0
240
+
241
+ ### Major Changes
242
+
243
+ - f884689e0: Require `@pnpm/logger` v5.
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies [043d988fc]
248
+ - Updated dependencies [f884689e0]
249
+ - @pnpm/error@4.0.0
250
+ - @pnpm/find-workspace-dir@5.0.0
251
+
252
+ ## 5.0.3
253
+
254
+ ### Patch Changes
255
+
256
+ - Updated dependencies [e8a631bf0]
257
+ - @pnpm/error@3.1.0
258
+ - @pnpm/find-workspace-dir@4.0.3
259
+
260
+ ## 5.0.2
261
+
262
+ ### Patch Changes
263
+
264
+ - Updated dependencies [6434a8291]
265
+ - @pnpm/find-workspace-dir@4.0.2
266
+
267
+ ## 5.0.1
268
+
269
+ ### Patch Changes
270
+
271
+ - @pnpm/error@3.0.1
272
+ - @pnpm/find-workspace-dir@4.0.1
273
+
274
+ ## 5.0.0
275
+
276
+ ### Major Changes
277
+
278
+ - c35ac786b: When using `pnpm run <script>`, all command line arguments after the script name are now passed to the script's argv, even `--`. For example, `pnpm run echo --hello -- world` will now pass `--hello -- world` to the `echo` script's argv. Previously flagged arguments (e.g. `--silent`) were interpreted as pnpm arguments unless `--` came before it.
279
+ - 542014839: Node.js 12 is not supported.
280
+
281
+ ### Patch Changes
282
+
283
+ - Updated dependencies [542014839]
284
+ - @pnpm/error@3.0.0
285
+ - @pnpm/find-workspace-dir@4.0.0
286
+
287
+ ## 4.4.1
288
+
289
+ ### Patch Changes
290
+
291
+ - Updated dependencies [70ba51da9]
292
+ - @pnpm/error@2.1.0
293
+ - @pnpm/find-workspace-dir@3.0.2
294
+
295
+ ## 4.4.0
296
+
297
+ ### Minor Changes
298
+
299
+ - 8fe8f5e55: New CLI option: `--ignore-workspace`. When used, pnpm ignores any workspace configuration found in the current or parent directories.
300
+
301
+ ## 4.3.0
302
+
303
+ ### Minor Changes
304
+
305
+ - 06f127503: A new option added: `escapeArgs`. `escapeArgs` is an array of arguments that stop arguments parsing.
306
+ By default, everything after `--` is not parsed as key-value. This option allows to add new keywords to stop parsing.
307
+
308
+ ## 4.2.2
309
+
310
+ ### Patch Changes
311
+
312
+ - 05ed9ea63: Update didyoumean2 to v5.
313
+
314
+ ## 4.2.1
315
+
316
+ ### Patch Changes
317
+
318
+ - 22f841039: The `--help` option should not convert the command to `help` if the command is unknown. So `pnpm eslint -h` is not parsed as `pnpm help eslint`.
319
+
320
+ ## 4.2.0
321
+
322
+ ### Minor Changes
323
+
324
+ - 209c14235: A new property is returned in the result: fallbackCommandUsed. It is true when an unknown command was used, so the fallback command had to be used instead.
325
+
326
+ ## 4.1.1
327
+
328
+ ### Patch Changes
329
+
330
+ - Updated dependencies [6e8cedb79]
331
+ - @pnpm/find-workspace-dir@3.0.1
332
+
333
+ ## 4.1.0
334
+
335
+ ### Minor Changes
336
+
337
+ - dfdf669e6: Add new cli arg --filter-prod. --filter-prod acts the same as --filter, but it omits devDependencies when building dependencies
338
+
339
+ ## 4.0.0
340
+
341
+ ### Major Changes
342
+
343
+ - 97b986fbc: Node.js 10 support is dropped. At least Node.js 12.17 is required for the package to work.
344
+
345
+ ### Patch Changes
346
+
347
+ - Updated dependencies [97b986fbc]
348
+ - @pnpm/error@2.0.0
349
+ - @pnpm/find-workspace-dir@3.0.0
350
+
351
+ ## 3.2.2
352
+
353
+ ### Patch Changes
354
+
355
+ - Updated dependencies [ec37069f2]
356
+ - @pnpm/find-workspace-dir@2.0.0
357
+
358
+ ## 3.2.1
359
+
360
+ ### Patch Changes
361
+
362
+ - Updated dependencies [0c5f1bcc9]
363
+ - @pnpm/error@1.4.0
364
+
365
+ ## 3.2.0
366
+
367
+ ### Minor Changes
368
+
369
+ - 092f8dd83: When --workspace-root is used, the working directory is changed to the root of the workspace.
370
+
371
+ ## 3.1.2
372
+
373
+ ### Patch Changes
374
+
375
+ - 9f5803187: Update nopt to v5.
376
+
377
+ ## 3.1.1
378
+
379
+ ### Patch Changes
380
+
381
+ - Updated dependencies [999f81305]
382
+ - @pnpm/find-workspace-dir@1.0.1
383
+
384
+ ## 3.1.0
385
+
386
+ ### Minor Changes
387
+
388
+ - be0a3db9b: Allow unknown options that are prefixed with "config."
389
+
390
+ ## 3.0.1
391
+
392
+ ### Patch Changes
393
+
394
+ - a2ef8084f: Use the same versions of dependencies across the pnpm monorepo.
395
+
396
+ ## 3.0.0
397
+
398
+ ### Major Changes
399
+
400
+ - 65b4d07ca: move recursive for workspace check to pnpm main
401
+
402
+ ## 2.1.0
403
+
404
+ ### Minor Changes
405
+
406
+ - 09b777f8d: New option added: `fallbackCommand`. If set, this command is added to the beginning of any unknown query.
407
+
408
+ ## 2.0.0
409
+
410
+ ### Major Changes
411
+
412
+ - 561f38955: `unknownOptions` in the result object is a `Map` instead of an `Array`.
413
+
414
+ `unknownOptions` is a map of unknown options to options that are similar to the unknown options.
415
+
416
+ ## 1.1.0
417
+
418
+ ### Minor Changes
419
+
420
+ - 0e8daafe4: The mapping of CLI option shorthands may use arrays of string.
421
+
422
+ ## 1.0.1
423
+
424
+ ### Patch Changes
425
+
426
+ - @pnpm/find-workspace-dir@1.0.1
package/lib/index.js CHANGED
@@ -93,7 +93,12 @@ export async function parseCliArgs(opts, inputArgv) {
93
93
  }
94
94
  function getEscapeArgsWithSpecialCases() {
95
95
  if (!SPECIALLY_ESCAPED_CMDS.has(cmd)) {
96
- return opts.escapeArgs;
96
+ // An escape word only escapes when it is the command itself: nopt
97
+ // stops parsing options at the first occurrence of an escape word
98
+ // anywhere in argv, so escaping under another command would silently
99
+ // turn that command's trailing options into parameters (e.g. the
100
+ // --registry in `pnpm team create @org:x --registry <url>`).
101
+ return opts.escapeArgs?.includes(commandName) ? opts.escapeArgs : undefined;
97
102
  }
98
103
  // We'd like everything after the run script's name to be passed to the
99
104
  // script's argv itself. For example, "pnpm run echo --test" should pass
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/cli.parse-cli-args",
3
- "version": "1100.1.4",
3
+ "version": "1100.1.6",
4
4
  "description": "Parses the CLI args passed to pnpm",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -10,9 +10,9 @@
10
10
  "funding": "https://opencollective.com/pnpm",
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "https://github.com/pnpm/pnpm/tree/main/cli/parse-cli-args"
13
+ "url": "https://github.com/pnpm/pnpm/tree/main/pnpm11/cli/parse-cli-args"
14
14
  },
15
- "homepage": "https://github.com/pnpm/pnpm/tree/main/cli/parse-cli-args#readme",
15
+ "homepage": "https://github.com/pnpm/pnpm/tree/main/pnpm11/cli/parse-cli-args#readme",
16
16
  "bugs": {
17
17
  "url": "https://github.com/pnpm/pnpm/issues"
18
18
  },
@@ -27,15 +27,15 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
+ "@pnpm/error": "1100.0.1",
30
31
  "@pnpm/nopt": "^0.3.1",
31
- "didyoumean2": "^7.0.4",
32
- "@pnpm/workspace.root-finder": "1100.0.2",
33
- "@pnpm/error": "1100.0.0"
32
+ "@pnpm/workspace.root-finder": "1100.0.3",
33
+ "didyoumean2": "^7.0.4"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@jest/globals": "30.4.1",
37
- "tempy": "3.0.0",
38
- "@pnpm/cli.parse-cli-args": "1100.1.4"
37
+ "@pnpm/cli.parse-cli-args": "1100.1.6",
38
+ "tempy": "3.0.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=22.13"