@bleedingdev/modern-js-utils 3.9.3-ultramodern.6 → 3.9.3-ultramodern.8
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/dist/compiled/address/provenance.json +1 -1
- package/dist/compiled/browserslist/index.js +7 -7
- package/dist/compiled/browserslist/provenance.json +1 -1
- package/dist/compiled/chalk/provenance.json +1 -1
- package/dist/compiled/chokidar/index.d.mts +18 -9
- package/dist/compiled/chokidar/index.d.ts +18 -9
- package/dist/compiled/chokidar/index.js +194 -171
- package/dist/compiled/chokidar/index.mjs +94 -71
- package/dist/compiled/chokidar/provenance.json +2 -2
- package/dist/compiled/commander/provenance.json +1 -1
- package/dist/compiled/debug/provenance.json +1 -1
- package/dist/compiled/dotenv-expand/LICENSE +11 -7
- package/dist/compiled/dotenv-expand/declaration-licenses/dotenv-expand/LICENSE +11 -7
- package/dist/compiled/dotenv-expand/index.js +5545 -61
- package/dist/compiled/dotenv-expand/licenses-cjs.txt +12 -7
- package/dist/compiled/dotenv-expand/package.json +1 -1
- package/dist/compiled/dotenv-expand/provenance.json +7 -7
- package/dist/compiled/execa/index.d.mts +67 -33
- package/dist/compiled/execa/index.d.ts +67 -33
- package/dist/compiled/execa/index.js +1848 -1369
- package/dist/compiled/execa/index.mjs +1851 -1372
- package/dist/compiled/execa/package.json +1 -1
- package/dist/compiled/execa/provenance.json +3 -3
- package/dist/compiled/filesize/index.js +26 -25
- package/dist/compiled/filesize/index.js.LICENSE.txt +1 -1
- package/dist/compiled/filesize/index.mjs +25 -24
- package/dist/compiled/filesize/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/filesize/package.json +1 -1
- package/dist/compiled/filesize/provenance.json +4 -4
- package/dist/compiled/fs-extra/provenance.json +1 -1
- package/dist/compiled/glob/provenance.json +3 -3
- package/dist/compiled/globby/index.js +431 -139
- package/dist/compiled/globby/index.mjs +576 -284
- package/dist/compiled/globby/provenance.json +1 -1
- package/dist/compiled/gzip-size/provenance.json +1 -1
- package/dist/compiled/import-lazy/provenance.json +1 -1
- package/dist/compiled/inquirer/index.d.mts +10 -0
- package/dist/compiled/inquirer/index.d.ts +10 -0
- package/dist/compiled/inquirer/index.js +112 -96
- package/dist/compiled/inquirer/index.mjs +98 -82
- package/dist/compiled/inquirer/licenses-cjs.txt +26 -0
- package/dist/compiled/inquirer/licenses-esm.txt +26 -0
- package/dist/compiled/inquirer/package.json +1 -1
- package/dist/compiled/inquirer/provenance.json +18 -18
- package/dist/compiled/js-yaml/index.js +258 -208
- package/dist/compiled/js-yaml/index.js.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/index.mjs +328 -278
- package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/package.json +1 -1
- package/dist/compiled/js-yaml/provenance.json +4 -4
- package/dist/compiled/json5/provenance.json +1 -1
- package/dist/compiled/lodash/common/function.d.ts +2 -2
- package/dist/compiled/lodash/provenance.json +2 -2
- package/dist/compiled/mime-types/provenance.json +1 -1
- package/dist/compiled/minimist/provenance.json +1 -1
- package/dist/compiled/nanoid/index.d.mts +3 -3
- package/dist/compiled/nanoid/index.d.ts +3 -3
- package/dist/compiled/nanoid/index.js +10 -10
- package/dist/compiled/nanoid/index.mjs +10 -10
- package/dist/compiled/nanoid/package.json +1 -1
- package/dist/compiled/nanoid/provenance.json +4 -4
- package/dist/compiled/ora/index.js +310 -286
- package/dist/compiled/ora/index.mjs +651 -627
- package/dist/compiled/ora/provenance.json +1 -1
- package/dist/compiled/pkg-up/provenance.json +1 -1
- package/dist/compiled/semver/provenance.json +1 -1
- package/dist/compiled/signale/provenance.json +1 -1
- package/dist/compiled/slash/provenance.json +1 -1
- package/dist/compiled/strip-ansi/index.js +1 -1
- package/dist/compiled/strip-ansi/index.mjs +3 -3
- package/dist/compiled/strip-ansi/provenance.json +1 -1
- package/dist/compiled/tsconfig-paths/provenance.json +1 -1
- package/dist/compiled/upath/provenance.json +1 -1
- package/dist/compiled/url-join/index.js +56 -29
- package/dist/compiled/url-join/index.mjs +57 -30
- package/dist/compiled/url-join/package.json +1 -1
- package/dist/compiled/url-join/provenance.json +4 -4
- package/dist/types/cli/commands.d.ts +1 -1
- package/dist/types/compiled.d.ts +7 -7
- package/package.json +8 -8
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
dotenv-expand
|
|
2
|
-
BSD-
|
|
2
|
+
BSD-3-Clause
|
|
3
|
+
BSD 3-Clause License
|
|
4
|
+
|
|
3
5
|
Copyright (c) 2016, Scott Motte
|
|
4
|
-
All rights reserved.
|
|
5
6
|
|
|
6
7
|
Redistribution and use in source and binary forms, with or without
|
|
7
8
|
modification, are permitted provided that the following conditions are met:
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
11
|
+
list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
and/or other materials provided with the distribution.
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
18
|
+
contributors may be used to endorse or promote products derived from
|
|
19
|
+
this software without specific prior written permission.
|
|
15
20
|
|
|
16
21
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
22
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"dotenv-expand","author":"motdotla","version":"
|
|
1
|
+
{"name":"dotenv-expand","author":"motdotla","version":"1000.0.0","funding":"https://dotenvx.com","license":"BSD-3-Clause","types":"index.d.ts"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotenv-expand",
|
|
3
3
|
"sourceName": "dotenv-expand",
|
|
4
|
-
"version": "
|
|
5
|
-
"entrySha256": "
|
|
6
|
-
"license": "BSD-
|
|
4
|
+
"version": "1000.0.0",
|
|
5
|
+
"entrySha256": "332a3969578532906a92863856031fc6c2eaa60be9a31906cb8662f8526071d8",
|
|
6
|
+
"license": "BSD-3-Clause",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "git+https://github.com/dotenvx/dotenv-expand.git"
|
|
10
10
|
},
|
|
11
11
|
"producer": "scripts/prebundle",
|
|
12
12
|
"ncc": "0.45.0",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"declarationSources": [
|
|
15
15
|
{
|
|
16
16
|
"name": "dotenv-expand",
|
|
17
|
-
"version": "
|
|
18
|
-
"license": "BSD-
|
|
17
|
+
"version": "1000.0.0",
|
|
18
|
+
"license": "BSD-3-Clause"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
|
-
"lockfileSha256": "
|
|
21
|
+
"lockfileSha256": "581051621a0801558eea756bc6ec0f69d769c47dae2513e61f5cf51555720121"
|
|
22
22
|
}
|
|
@@ -428,26 +428,30 @@ type IpcMethods<
|
|
|
428
428
|
getEachMessage: undefined;
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
-
// Whether IPC is enabled, based on the `ipc`, `ipcInput` and `gracefulCancel` options
|
|
431
|
+
// Whether IPC is enabled, based on the `ipc`, `node`, `ipcInput` and `gracefulCancel` options
|
|
432
432
|
type HasIpc<OptionsType extends Options> = HasIpcOption<
|
|
433
433
|
OptionsType['ipc'],
|
|
434
|
+
'node' extends keyof OptionsType ? OptionsType['node'] : undefined,
|
|
434
435
|
'ipcInput' extends keyof OptionsType ? OptionsType['ipcInput'] : undefined,
|
|
435
436
|
'gracefulCancel' extends keyof OptionsType ? OptionsType['gracefulCancel'] : undefined
|
|
436
437
|
>;
|
|
437
438
|
|
|
438
439
|
type HasIpcOption<
|
|
439
440
|
IpcOption extends Options['ipc'],
|
|
441
|
+
NodeOption extends Options['node'],
|
|
440
442
|
IpcInputOption extends Options['ipcInput'],
|
|
441
443
|
GracefulCancelOption extends Options['gracefulCancel'],
|
|
442
444
|
> = IpcOption extends true
|
|
443
445
|
? true
|
|
444
446
|
: IpcOption extends false
|
|
445
447
|
? false
|
|
446
|
-
:
|
|
447
|
-
?
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
: NodeOption extends true
|
|
449
|
+
? true
|
|
450
|
+
: IpcInputOption extends undefined
|
|
451
|
+
? GracefulCancelOption extends true
|
|
452
|
+
? true
|
|
453
|
+
: false
|
|
454
|
+
: true;
|
|
451
455
|
|
|
452
456
|
type FileDescriptorOption = `fd${number}`;
|
|
453
457
|
|
|
@@ -781,11 +785,16 @@ type AllLinesFd<OptionsType extends CommonOptions> =
|
|
|
781
785
|
FdSpecificOption<OptionsType['lines'], '1'> extends true ? '1' : '2';
|
|
782
786
|
|
|
783
787
|
// `result.stdio`
|
|
784
|
-
type ResultStdioArray<
|
|
785
|
-
|
|
788
|
+
type ResultStdioArray<
|
|
789
|
+
IsSync extends boolean,
|
|
790
|
+
OptionsType extends CommonOptions,
|
|
791
|
+
> = [
|
|
792
|
+
...MapResultStdio<StdioOptionNormalizedArray<OptionsType>, OptionsType>,
|
|
793
|
+
...ResultIpcStdio<IsSync, OptionsType>,
|
|
794
|
+
];
|
|
786
795
|
|
|
787
796
|
type MapResultStdio<
|
|
788
|
-
StdioOptionsArrayType,
|
|
797
|
+
StdioOptionsArrayType extends readonly unknown[],
|
|
789
798
|
OptionsType extends CommonOptions,
|
|
790
799
|
> = {
|
|
791
800
|
-readonly [FdNumber in keyof StdioOptionsArrayType]: ResultStdioNotAll<
|
|
@@ -794,6 +803,16 @@ type MapResultStdio<
|
|
|
794
803
|
>
|
|
795
804
|
};
|
|
796
805
|
|
|
806
|
+
// With the `ipc` option, the subprocess' IPC channel adds one last file descriptor, which has no output. Synchronous methods do not support IPC.
|
|
807
|
+
type ResultIpcStdio<
|
|
808
|
+
IsSync extends boolean,
|
|
809
|
+
OptionsType extends CommonOptions,
|
|
810
|
+
> = IsSync extends true
|
|
811
|
+
? []
|
|
812
|
+
: HasIpc<StricterOptions<OptionsType, Options>> extends true
|
|
813
|
+
? [undefined]
|
|
814
|
+
: [];
|
|
815
|
+
|
|
797
816
|
// `result.ipcOutput`
|
|
798
817
|
// This is empty unless the `ipc` option is `true`.
|
|
799
818
|
// Also, this is empty if the `buffer` option is `false`.
|
|
@@ -845,7 +864,7 @@ declare abstract class CommonResult<
|
|
|
845
864
|
|
|
846
865
|
This requires the `all` option to be `true`.
|
|
847
866
|
|
|
848
|
-
This is `undefined` if both `stdout` and `stderr` options are set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false
|
|
867
|
+
This is `undefined` if both `stdout` and `stderr` options are set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false` for both.
|
|
849
868
|
|
|
850
869
|
This is an array if the `lines` option is `true`, or if either the `stdout` or `stderr` option is a transform in object mode.
|
|
851
870
|
*/
|
|
@@ -856,9 +875,11 @@ declare abstract class CommonResult<
|
|
|
856
875
|
|
|
857
876
|
Items are `undefined` when their corresponding `stdio` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
858
877
|
|
|
878
|
+
With the `ipc` option, the last item is the subprocess' IPC channel, which is always `undefined`.
|
|
879
|
+
|
|
859
880
|
Items are arrays when their corresponding `stdio` option is a transform in object mode.
|
|
860
881
|
*/
|
|
861
|
-
stdio: ResultStdioArray<OptionsType>;
|
|
882
|
+
stdio: ResultStdioArray<IsSync, OptionsType>;
|
|
862
883
|
|
|
863
884
|
/**
|
|
864
885
|
All the messages sent by the subprocess to the current process.
|
|
@@ -872,7 +893,7 @@ declare abstract class CommonResult<
|
|
|
872
893
|
|
|
873
894
|
This array is initially empty and is populated each time the `subprocess.pipe()` method resolves.
|
|
874
895
|
*/
|
|
875
|
-
pipedFrom: Unless<IsSync, Result
|
|
896
|
+
pipedFrom: Unless<IsSync, Array<Result | ExecaError>, []>;
|
|
876
897
|
|
|
877
898
|
/**
|
|
878
899
|
The file and arguments that were run.
|
|
@@ -881,6 +902,8 @@ declare abstract class CommonResult<
|
|
|
881
902
|
|
|
882
903
|
/**
|
|
883
904
|
Same as `command` but escaped.
|
|
905
|
+
|
|
906
|
+
With the `shell` option, the command is not quoted, since the shell interprets it.
|
|
884
907
|
*/
|
|
885
908
|
escapedCommand: string;
|
|
886
909
|
|
|
@@ -1037,7 +1060,7 @@ type GenericVerboseObject = {
|
|
|
1037
1060
|
- `'output'`: one line from `result.stdout` or `result.stderr`
|
|
1038
1061
|
- `'ipc'`: one IPC message from `result.ipcOutput`
|
|
1039
1062
|
- `'error'`: the `error.shortMessage`
|
|
1040
|
-
- `'duration'`: the `result.durationMs`
|
|
1063
|
+
- `'duration'`: the `result.durationMs`, formatted as `(done in 29ms)`
|
|
1041
1064
|
*/
|
|
1042
1065
|
message: string;
|
|
1043
1066
|
|
|
@@ -1061,7 +1084,7 @@ type GenericVerboseObject = {
|
|
|
1061
1084
|
timestamp: Date;
|
|
1062
1085
|
|
|
1063
1086
|
/**
|
|
1064
|
-
Whether
|
|
1087
|
+
Whether this subprocess is the destination of another subprocess' `pipe()` method. This is `true` when it was spawned using the template string or array syntax of `pipe()`, `false` otherwise.
|
|
1065
1088
|
*/
|
|
1066
1089
|
piped: boolean;
|
|
1067
1090
|
};
|
|
@@ -1178,13 +1201,13 @@ type CommonOptions<
|
|
|
1178
1201
|
|
|
1179
1202
|
Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
|
|
1180
1203
|
|
|
1181
|
-
@default
|
|
1204
|
+
@default {}
|
|
1182
1205
|
*/
|
|
1183
1206
|
readonly env?: Readonly<Partial<Record<string, string>>>;
|
|
1184
1207
|
|
|
1185
1208
|
/**
|
|
1186
1209
|
If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
|
|
1187
|
-
If `false`, only the `env` option is used, not `process.env`.
|
|
1210
|
+
If `false`, only the `env` option is used, not `process.env`. However, when `env` has no `PATH`, the `preferLocal` and `node` options still add their directories to `process.env.PATH`.
|
|
1188
1211
|
|
|
1189
1212
|
@default true
|
|
1190
1213
|
*/
|
|
@@ -1258,6 +1281,8 @@ type CommonOptions<
|
|
|
1258
1281
|
|
|
1259
1282
|
The output is available with `result.stdout`, `result.stderr` and `result.stdio`.
|
|
1260
1283
|
|
|
1284
|
+
String input passed with the `input` or `stdin` option is always encoded with UTF-8, whatever this option is. With a text encoding, `stdin` transforms also decode their input with UTF-8.
|
|
1285
|
+
|
|
1261
1286
|
@default 'utf8'
|
|
1262
1287
|
*/
|
|
1263
1288
|
readonly encoding?: Encoding;
|
|
@@ -1289,6 +1314,8 @@ type CommonOptions<
|
|
|
1289
1314
|
|
|
1290
1315
|
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
1291
1316
|
|
|
1317
|
+
With synchronous methods, this cannot be enforced per file descriptor while the subprocess runs, since `spawnSync()` only accepts a single value, which limits the total output of all file descriptors. The `maxBuffer.stdout` value is used for it. The other file descriptors' own values are enforced from the output, once the subprocess ended, and cannot be higher than `maxBuffer.stdout`. Also, with synchronous methods, this is measured in bytes instead of characters or lines, for the same reason.
|
|
1318
|
+
|
|
1292
1319
|
When reached, `error.isMaxBuffer` becomes `true`.
|
|
1293
1320
|
|
|
1294
1321
|
@default 100_000_000
|
|
@@ -1348,7 +1375,7 @@ type CommonOptions<
|
|
|
1348
1375
|
readonly reject?: boolean;
|
|
1349
1376
|
|
|
1350
1377
|
/**
|
|
1351
|
-
If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds.
|
|
1378
|
+
If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds. It must be a non-negative integer, up to `2147483647` (about 24.8 days).
|
|
1352
1379
|
|
|
1353
1380
|
On timeout, `error.timedOut` becomes `true`.
|
|
1354
1381
|
|
|
@@ -1397,7 +1424,7 @@ type CommonOptions<
|
|
|
1397
1424
|
readonly gracefulCancel?: Unless<IsSync, boolean>;
|
|
1398
1425
|
|
|
1399
1426
|
/**
|
|
1400
|
-
If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).
|
|
1427
|
+
If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL). The delay must be a non-negative integer, up to `2147483647` milliseconds (about 24.8 days). When `true`, the default `5000` is used. When `false`, the subprocess is not forcefully exited.
|
|
1401
1428
|
|
|
1402
1429
|
When this happens, `error.isForcefullyTerminated` becomes `true`.
|
|
1403
1430
|
|
|
@@ -1435,7 +1462,7 @@ type CommonOptions<
|
|
|
1435
1462
|
|
|
1436
1463
|
On Unix, this spawns the subprocess in its own [process group](https://en.wikipedia.org/wiki/Process_group). On Windows, this uses [`taskkill`](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill).
|
|
1437
1464
|
|
|
1438
|
-
This is best-effort: descendant processes that create their own process group or session are not terminated.
|
|
1465
|
+
This is best-effort: descendant processes that create their own process group or session are not terminated. Also, on Windows, descendants are not terminated once the subprocess exited, since its PID might then belong to an unrelated process.
|
|
1439
1466
|
|
|
1440
1467
|
@default false
|
|
1441
1468
|
*/
|
|
@@ -1675,16 +1702,18 @@ type InputOutputStream<IsInput extends boolean> = IsInput extends true
|
|
|
1675
1702
|
// `subprocess.stdio`
|
|
1676
1703
|
type SubprocessStdioArray<OptionsType extends Options> = MapStdioStreams<StdioOptionNormalizedArray<OptionsType>, OptionsType>;
|
|
1677
1704
|
|
|
1678
|
-
//
|
|
1705
|
+
// File descriptors beyond `stderr` are only present when the `stdio` option is an array with more items.
|
|
1706
|
+
// The subprocess' IPC channel, if any, is set as the last file descriptor by Node.js itself.
|
|
1707
|
+
// Since any `Subprocess` can be passed where the default one is expected, the list is kept open-ended.
|
|
1679
1708
|
type MapStdioStreams<
|
|
1680
|
-
StdioOptionsArrayType,
|
|
1709
|
+
StdioOptionsArrayType extends readonly unknown[],
|
|
1681
1710
|
OptionsType extends Options,
|
|
1682
1711
|
> = [
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1712
|
+
...{
|
|
1713
|
+
-readonly [FdNumber in keyof StdioOptionsArrayType]: SubprocessStdioStream<FdNumber extends string ? FdNumber : string, OptionsType>
|
|
1714
|
+
},
|
|
1715
|
+
...(HasIpc<OptionsType> extends true ? [null] : []),
|
|
1716
|
+
...Array<Readable | Writable | null>,
|
|
1688
1717
|
];
|
|
1689
1718
|
|
|
1690
1719
|
// `subprocess.all`
|
|
@@ -1710,7 +1739,7 @@ type SubprocessResultMethods<OptionsType extends Options = Options> = {
|
|
|
1710
1739
|
|
|
1711
1740
|
This requires the `all` option to be `true`.
|
|
1712
1741
|
|
|
1713
|
-
This is `undefined` if `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer
|
|
1742
|
+
This is `undefined` if both `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`.
|
|
1714
1743
|
*/
|
|
1715
1744
|
all: SubprocessAll<OptionsType>;
|
|
1716
1745
|
|
|
@@ -1757,21 +1786,23 @@ type ExecaCustomSubprocess<OptionsType extends Options> =
|
|
|
1757
1786
|
/**
|
|
1758
1787
|
The subprocess [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)) as a stream.
|
|
1759
1788
|
|
|
1760
|
-
This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer
|
|
1789
|
+
This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.
|
|
1761
1790
|
*/
|
|
1762
1791
|
stdout: SubprocessStdioStream<'1', OptionsType>;
|
|
1763
1792
|
|
|
1764
1793
|
/**
|
|
1765
1794
|
The subprocess [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) as a stream.
|
|
1766
1795
|
|
|
1767
|
-
This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer
|
|
1796
|
+
This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.
|
|
1768
1797
|
*/
|
|
1769
1798
|
stderr: SubprocessStdioStream<'2', OptionsType>;
|
|
1770
1799
|
|
|
1771
1800
|
/**
|
|
1772
1801
|
The subprocess `stdin`, `stdout`, `stderr` and other files descriptors as an array of streams.
|
|
1773
1802
|
|
|
1774
|
-
Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer
|
|
1803
|
+
Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer`.
|
|
1804
|
+
|
|
1805
|
+
With the `ipc` option, the last item is the subprocess' IPC channel, which is always `null`.
|
|
1775
1806
|
*/
|
|
1776
1807
|
stdio: SubprocessStdioArray<OptionsType>;
|
|
1777
1808
|
|
|
@@ -2435,17 +2466,20 @@ type ExecaNodeBind<OptionsType extends Options> =
|
|
|
2435
2466
|
// `execaNode`command`` template syntax
|
|
2436
2467
|
type ExecaNodeTemplate<OptionsType extends Options> =
|
|
2437
2468
|
(...templateString: TemplateString)
|
|
2438
|
-
=> ResultPromise<OptionsType
|
|
2469
|
+
=> ResultPromise<NodeOptions<OptionsType>>;
|
|
2439
2470
|
|
|
2440
2471
|
// `execaNode('script', ['argument'], {})` array syntax
|
|
2441
2472
|
type ExecaNodeArrayLong<OptionsType extends Options> =
|
|
2442
2473
|
<NewOptionsType extends Options = {}>(scriptPath: string | URL, arguments?: readonly string[], options?: NewOptionsType)
|
|
2443
|
-
=> ResultPromise<OptionsType & NewOptionsType
|
|
2474
|
+
=> ResultPromise<NodeOptions<OptionsType & NewOptionsType>>;
|
|
2444
2475
|
|
|
2445
2476
|
// `execaNode('script', {})` array syntax
|
|
2446
2477
|
type ExecaNodeArrayShort<OptionsType extends Options> =
|
|
2447
2478
|
<NewOptionsType extends Options = {}>(scriptPath: string | URL, options?: NewOptionsType)
|
|
2448
|
-
=> ResultPromise<OptionsType & NewOptionsType
|
|
2479
|
+
=> ResultPromise<NodeOptions<OptionsType & NewOptionsType>>;
|
|
2480
|
+
|
|
2481
|
+
// `execaNode()` always uses the `node` option, which also enables the `ipc` option by default
|
|
2482
|
+
type NodeOptions<OptionsType extends Options> = OptionsType & {readonly node: true};
|
|
2449
2483
|
|
|
2450
2484
|
export { $, ExecaError, ExecaSyncError, execa, execaNode, execaSync, getCancelSignal, getEachMessage, getOneMessage, parseCommandString, sendMessage };
|
|
2451
2485
|
export type { ExecaMethod, ExecaNodeMethod, ExecaScriptMethod, ExecaScriptSyncMethod, ExecaSyncMethod, Message, Options, Result, ResultPromise, StdinOption, StdinSyncOption, StdoutStderrOption, StdoutStderrSyncOption, Subprocess, SyncOptions, SyncResult, SyncVerboseObject, TemplateExpression, VerboseObject };
|
|
@@ -428,26 +428,30 @@ type IpcMethods<
|
|
|
428
428
|
getEachMessage: undefined;
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
-
// Whether IPC is enabled, based on the `ipc`, `ipcInput` and `gracefulCancel` options
|
|
431
|
+
// Whether IPC is enabled, based on the `ipc`, `node`, `ipcInput` and `gracefulCancel` options
|
|
432
432
|
type HasIpc<OptionsType extends Options> = HasIpcOption<
|
|
433
433
|
OptionsType['ipc'],
|
|
434
|
+
'node' extends keyof OptionsType ? OptionsType['node'] : undefined,
|
|
434
435
|
'ipcInput' extends keyof OptionsType ? OptionsType['ipcInput'] : undefined,
|
|
435
436
|
'gracefulCancel' extends keyof OptionsType ? OptionsType['gracefulCancel'] : undefined
|
|
436
437
|
>;
|
|
437
438
|
|
|
438
439
|
type HasIpcOption<
|
|
439
440
|
IpcOption extends Options['ipc'],
|
|
441
|
+
NodeOption extends Options['node'],
|
|
440
442
|
IpcInputOption extends Options['ipcInput'],
|
|
441
443
|
GracefulCancelOption extends Options['gracefulCancel'],
|
|
442
444
|
> = IpcOption extends true
|
|
443
445
|
? true
|
|
444
446
|
: IpcOption extends false
|
|
445
447
|
? false
|
|
446
|
-
:
|
|
447
|
-
?
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
: NodeOption extends true
|
|
449
|
+
? true
|
|
450
|
+
: IpcInputOption extends undefined
|
|
451
|
+
? GracefulCancelOption extends true
|
|
452
|
+
? true
|
|
453
|
+
: false
|
|
454
|
+
: true;
|
|
451
455
|
|
|
452
456
|
type FileDescriptorOption = `fd${number}`;
|
|
453
457
|
|
|
@@ -781,11 +785,16 @@ type AllLinesFd<OptionsType extends CommonOptions> =
|
|
|
781
785
|
FdSpecificOption<OptionsType['lines'], '1'> extends true ? '1' : '2';
|
|
782
786
|
|
|
783
787
|
// `result.stdio`
|
|
784
|
-
type ResultStdioArray<
|
|
785
|
-
|
|
788
|
+
type ResultStdioArray<
|
|
789
|
+
IsSync extends boolean,
|
|
790
|
+
OptionsType extends CommonOptions,
|
|
791
|
+
> = [
|
|
792
|
+
...MapResultStdio<StdioOptionNormalizedArray<OptionsType>, OptionsType>,
|
|
793
|
+
...ResultIpcStdio<IsSync, OptionsType>,
|
|
794
|
+
];
|
|
786
795
|
|
|
787
796
|
type MapResultStdio<
|
|
788
|
-
StdioOptionsArrayType,
|
|
797
|
+
StdioOptionsArrayType extends readonly unknown[],
|
|
789
798
|
OptionsType extends CommonOptions,
|
|
790
799
|
> = {
|
|
791
800
|
-readonly [FdNumber in keyof StdioOptionsArrayType]: ResultStdioNotAll<
|
|
@@ -794,6 +803,16 @@ type MapResultStdio<
|
|
|
794
803
|
>
|
|
795
804
|
};
|
|
796
805
|
|
|
806
|
+
// With the `ipc` option, the subprocess' IPC channel adds one last file descriptor, which has no output. Synchronous methods do not support IPC.
|
|
807
|
+
type ResultIpcStdio<
|
|
808
|
+
IsSync extends boolean,
|
|
809
|
+
OptionsType extends CommonOptions,
|
|
810
|
+
> = IsSync extends true
|
|
811
|
+
? []
|
|
812
|
+
: HasIpc<StricterOptions<OptionsType, Options>> extends true
|
|
813
|
+
? [undefined]
|
|
814
|
+
: [];
|
|
815
|
+
|
|
797
816
|
// `result.ipcOutput`
|
|
798
817
|
// This is empty unless the `ipc` option is `true`.
|
|
799
818
|
// Also, this is empty if the `buffer` option is `false`.
|
|
@@ -845,7 +864,7 @@ declare abstract class CommonResult<
|
|
|
845
864
|
|
|
846
865
|
This requires the `all` option to be `true`.
|
|
847
866
|
|
|
848
|
-
This is `undefined` if both `stdout` and `stderr` options are set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false
|
|
867
|
+
This is `undefined` if both `stdout` and `stderr` options are set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false` for both.
|
|
849
868
|
|
|
850
869
|
This is an array if the `lines` option is `true`, or if either the `stdout` or `stderr` option is a transform in object mode.
|
|
851
870
|
*/
|
|
@@ -856,9 +875,11 @@ declare abstract class CommonResult<
|
|
|
856
875
|
|
|
857
876
|
Items are `undefined` when their corresponding `stdio` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
858
877
|
|
|
878
|
+
With the `ipc` option, the last item is the subprocess' IPC channel, which is always `undefined`.
|
|
879
|
+
|
|
859
880
|
Items are arrays when their corresponding `stdio` option is a transform in object mode.
|
|
860
881
|
*/
|
|
861
|
-
stdio: ResultStdioArray<OptionsType>;
|
|
882
|
+
stdio: ResultStdioArray<IsSync, OptionsType>;
|
|
862
883
|
|
|
863
884
|
/**
|
|
864
885
|
All the messages sent by the subprocess to the current process.
|
|
@@ -872,7 +893,7 @@ declare abstract class CommonResult<
|
|
|
872
893
|
|
|
873
894
|
This array is initially empty and is populated each time the `subprocess.pipe()` method resolves.
|
|
874
895
|
*/
|
|
875
|
-
pipedFrom: Unless<IsSync, Result
|
|
896
|
+
pipedFrom: Unless<IsSync, Array<Result | ExecaError>, []>;
|
|
876
897
|
|
|
877
898
|
/**
|
|
878
899
|
The file and arguments that were run.
|
|
@@ -881,6 +902,8 @@ declare abstract class CommonResult<
|
|
|
881
902
|
|
|
882
903
|
/**
|
|
883
904
|
Same as `command` but escaped.
|
|
905
|
+
|
|
906
|
+
With the `shell` option, the command is not quoted, since the shell interprets it.
|
|
884
907
|
*/
|
|
885
908
|
escapedCommand: string;
|
|
886
909
|
|
|
@@ -1037,7 +1060,7 @@ type GenericVerboseObject = {
|
|
|
1037
1060
|
- `'output'`: one line from `result.stdout` or `result.stderr`
|
|
1038
1061
|
- `'ipc'`: one IPC message from `result.ipcOutput`
|
|
1039
1062
|
- `'error'`: the `error.shortMessage`
|
|
1040
|
-
- `'duration'`: the `result.durationMs`
|
|
1063
|
+
- `'duration'`: the `result.durationMs`, formatted as `(done in 29ms)`
|
|
1041
1064
|
*/
|
|
1042
1065
|
message: string;
|
|
1043
1066
|
|
|
@@ -1061,7 +1084,7 @@ type GenericVerboseObject = {
|
|
|
1061
1084
|
timestamp: Date;
|
|
1062
1085
|
|
|
1063
1086
|
/**
|
|
1064
|
-
Whether
|
|
1087
|
+
Whether this subprocess is the destination of another subprocess' `pipe()` method. This is `true` when it was spawned using the template string or array syntax of `pipe()`, `false` otherwise.
|
|
1065
1088
|
*/
|
|
1066
1089
|
piped: boolean;
|
|
1067
1090
|
};
|
|
@@ -1178,13 +1201,13 @@ type CommonOptions<
|
|
|
1178
1201
|
|
|
1179
1202
|
Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
|
|
1180
1203
|
|
|
1181
|
-
@default
|
|
1204
|
+
@default {}
|
|
1182
1205
|
*/
|
|
1183
1206
|
readonly env?: Readonly<Partial<Record<string, string>>>;
|
|
1184
1207
|
|
|
1185
1208
|
/**
|
|
1186
1209
|
If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
|
|
1187
|
-
If `false`, only the `env` option is used, not `process.env`.
|
|
1210
|
+
If `false`, only the `env` option is used, not `process.env`. However, when `env` has no `PATH`, the `preferLocal` and `node` options still add their directories to `process.env.PATH`.
|
|
1188
1211
|
|
|
1189
1212
|
@default true
|
|
1190
1213
|
*/
|
|
@@ -1258,6 +1281,8 @@ type CommonOptions<
|
|
|
1258
1281
|
|
|
1259
1282
|
The output is available with `result.stdout`, `result.stderr` and `result.stdio`.
|
|
1260
1283
|
|
|
1284
|
+
String input passed with the `input` or `stdin` option is always encoded with UTF-8, whatever this option is. With a text encoding, `stdin` transforms also decode their input with UTF-8.
|
|
1285
|
+
|
|
1261
1286
|
@default 'utf8'
|
|
1262
1287
|
*/
|
|
1263
1288
|
readonly encoding?: Encoding;
|
|
@@ -1289,6 +1314,8 @@ type CommonOptions<
|
|
|
1289
1314
|
|
|
1290
1315
|
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
1291
1316
|
|
|
1317
|
+
With synchronous methods, this cannot be enforced per file descriptor while the subprocess runs, since `spawnSync()` only accepts a single value, which limits the total output of all file descriptors. The `maxBuffer.stdout` value is used for it. The other file descriptors' own values are enforced from the output, once the subprocess ended, and cannot be higher than `maxBuffer.stdout`. Also, with synchronous methods, this is measured in bytes instead of characters or lines, for the same reason.
|
|
1318
|
+
|
|
1292
1319
|
When reached, `error.isMaxBuffer` becomes `true`.
|
|
1293
1320
|
|
|
1294
1321
|
@default 100_000_000
|
|
@@ -1348,7 +1375,7 @@ type CommonOptions<
|
|
|
1348
1375
|
readonly reject?: boolean;
|
|
1349
1376
|
|
|
1350
1377
|
/**
|
|
1351
|
-
If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds.
|
|
1378
|
+
If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds. It must be a non-negative integer, up to `2147483647` (about 24.8 days).
|
|
1352
1379
|
|
|
1353
1380
|
On timeout, `error.timedOut` becomes `true`.
|
|
1354
1381
|
|
|
@@ -1397,7 +1424,7 @@ type CommonOptions<
|
|
|
1397
1424
|
readonly gracefulCancel?: Unless<IsSync, boolean>;
|
|
1398
1425
|
|
|
1399
1426
|
/**
|
|
1400
|
-
If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).
|
|
1427
|
+
If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL). The delay must be a non-negative integer, up to `2147483647` milliseconds (about 24.8 days). When `true`, the default `5000` is used. When `false`, the subprocess is not forcefully exited.
|
|
1401
1428
|
|
|
1402
1429
|
When this happens, `error.isForcefullyTerminated` becomes `true`.
|
|
1403
1430
|
|
|
@@ -1435,7 +1462,7 @@ type CommonOptions<
|
|
|
1435
1462
|
|
|
1436
1463
|
On Unix, this spawns the subprocess in its own [process group](https://en.wikipedia.org/wiki/Process_group). On Windows, this uses [`taskkill`](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill).
|
|
1437
1464
|
|
|
1438
|
-
This is best-effort: descendant processes that create their own process group or session are not terminated.
|
|
1465
|
+
This is best-effort: descendant processes that create their own process group or session are not terminated. Also, on Windows, descendants are not terminated once the subprocess exited, since its PID might then belong to an unrelated process.
|
|
1439
1466
|
|
|
1440
1467
|
@default false
|
|
1441
1468
|
*/
|
|
@@ -1675,16 +1702,18 @@ type InputOutputStream<IsInput extends boolean> = IsInput extends true
|
|
|
1675
1702
|
// `subprocess.stdio`
|
|
1676
1703
|
type SubprocessStdioArray<OptionsType extends Options> = MapStdioStreams<StdioOptionNormalizedArray<OptionsType>, OptionsType>;
|
|
1677
1704
|
|
|
1678
|
-
//
|
|
1705
|
+
// File descriptors beyond `stderr` are only present when the `stdio` option is an array with more items.
|
|
1706
|
+
// The subprocess' IPC channel, if any, is set as the last file descriptor by Node.js itself.
|
|
1707
|
+
// Since any `Subprocess` can be passed where the default one is expected, the list is kept open-ended.
|
|
1679
1708
|
type MapStdioStreams<
|
|
1680
|
-
StdioOptionsArrayType,
|
|
1709
|
+
StdioOptionsArrayType extends readonly unknown[],
|
|
1681
1710
|
OptionsType extends Options,
|
|
1682
1711
|
> = [
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1712
|
+
...{
|
|
1713
|
+
-readonly [FdNumber in keyof StdioOptionsArrayType]: SubprocessStdioStream<FdNumber extends string ? FdNumber : string, OptionsType>
|
|
1714
|
+
},
|
|
1715
|
+
...(HasIpc<OptionsType> extends true ? [null] : []),
|
|
1716
|
+
...Array<Readable | Writable | null>,
|
|
1688
1717
|
];
|
|
1689
1718
|
|
|
1690
1719
|
// `subprocess.all`
|
|
@@ -1710,7 +1739,7 @@ type SubprocessResultMethods<OptionsType extends Options = Options> = {
|
|
|
1710
1739
|
|
|
1711
1740
|
This requires the `all` option to be `true`.
|
|
1712
1741
|
|
|
1713
|
-
This is `undefined` if `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer
|
|
1742
|
+
This is `undefined` if both `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`.
|
|
1714
1743
|
*/
|
|
1715
1744
|
all: SubprocessAll<OptionsType>;
|
|
1716
1745
|
|
|
@@ -1757,21 +1786,23 @@ type ExecaCustomSubprocess<OptionsType extends Options> =
|
|
|
1757
1786
|
/**
|
|
1758
1787
|
The subprocess [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)) as a stream.
|
|
1759
1788
|
|
|
1760
|
-
This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer
|
|
1789
|
+
This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.
|
|
1761
1790
|
*/
|
|
1762
1791
|
stdout: SubprocessStdioStream<'1', OptionsType>;
|
|
1763
1792
|
|
|
1764
1793
|
/**
|
|
1765
1794
|
The subprocess [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) as a stream.
|
|
1766
1795
|
|
|
1767
|
-
This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer
|
|
1796
|
+
This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.
|
|
1768
1797
|
*/
|
|
1769
1798
|
stderr: SubprocessStdioStream<'2', OptionsType>;
|
|
1770
1799
|
|
|
1771
1800
|
/**
|
|
1772
1801
|
The subprocess `stdin`, `stdout`, `stderr` and other files descriptors as an array of streams.
|
|
1773
1802
|
|
|
1774
|
-
Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer
|
|
1803
|
+
Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer`.
|
|
1804
|
+
|
|
1805
|
+
With the `ipc` option, the last item is the subprocess' IPC channel, which is always `null`.
|
|
1775
1806
|
*/
|
|
1776
1807
|
stdio: SubprocessStdioArray<OptionsType>;
|
|
1777
1808
|
|
|
@@ -2435,17 +2466,20 @@ type ExecaNodeBind<OptionsType extends Options> =
|
|
|
2435
2466
|
// `execaNode`command`` template syntax
|
|
2436
2467
|
type ExecaNodeTemplate<OptionsType extends Options> =
|
|
2437
2468
|
(...templateString: TemplateString)
|
|
2438
|
-
=> ResultPromise<OptionsType
|
|
2469
|
+
=> ResultPromise<NodeOptions<OptionsType>>;
|
|
2439
2470
|
|
|
2440
2471
|
// `execaNode('script', ['argument'], {})` array syntax
|
|
2441
2472
|
type ExecaNodeArrayLong<OptionsType extends Options> =
|
|
2442
2473
|
<NewOptionsType extends Options = {}>(scriptPath: string | URL, arguments?: readonly string[], options?: NewOptionsType)
|
|
2443
|
-
=> ResultPromise<OptionsType & NewOptionsType
|
|
2474
|
+
=> ResultPromise<NodeOptions<OptionsType & NewOptionsType>>;
|
|
2444
2475
|
|
|
2445
2476
|
// `execaNode('script', {})` array syntax
|
|
2446
2477
|
type ExecaNodeArrayShort<OptionsType extends Options> =
|
|
2447
2478
|
<NewOptionsType extends Options = {}>(scriptPath: string | URL, options?: NewOptionsType)
|
|
2448
|
-
=> ResultPromise<OptionsType & NewOptionsType
|
|
2479
|
+
=> ResultPromise<NodeOptions<OptionsType & NewOptionsType>>;
|
|
2480
|
+
|
|
2481
|
+
// `execaNode()` always uses the `node` option, which also enables the `ipc` option by default
|
|
2482
|
+
type NodeOptions<OptionsType extends Options> = OptionsType & {readonly node: true};
|
|
2449
2483
|
|
|
2450
2484
|
export { $, ExecaError, ExecaSyncError, execa, execaNode, execaSync, getCancelSignal, getEachMessage, getOneMessage, parseCommandString, sendMessage };
|
|
2451
2485
|
export type { ExecaMethod, ExecaNodeMethod, ExecaScriptMethod, ExecaScriptSyncMethod, ExecaSyncMethod, Message, Options, Result, ResultPromise, StdinOption, StdinSyncOption, StdoutStderrOption, StdoutStderrSyncOption, Subprocess, SyncOptions, SyncResult, SyncVerboseObject, TemplateExpression, VerboseObject };
|