@cmflow/cli 3.4.0-beta.9 → 3.4.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/dist/bin/cm.mjs +13854 -6410
- package/dist/bin/cmrelease.mjs +12656 -5912
- package/dist/common-Dk_Pm7J8.mjs +4 -0
- package/dist/common-Dk_Pm7J8.mjs.map +1 -0
- package/dist/{compile-packages-Cd19TaUb.mjs → compile-packages-CPkDuiiR.mjs} +4 -2
- package/dist/compile-packages-CPkDuiiR.mjs.map +1 -0
- package/dist/docker-CwPUDL7v.mjs +42 -0
- package/dist/docker-CwPUDL7v.mjs.map +1 -0
- package/dist/{docker-clean-tags-C8fsKmA7.mjs → docker-clean-tags-4Z1VHhE4.mjs} +4 -2
- package/dist/{docker-clean-tags-C8fsKmA7.mjs.map → docker-clean-tags-4Z1VHhE4.mjs.map} +1 -1
- package/dist/{docker-publish-CwInm1oK.mjs → docker-publish-BFuDmUA1.mjs} +4 -2
- package/dist/{docker-publish-CwInm1oK.mjs.map → docker-publish-BFuDmUA1.mjs.map} +1 -1
- package/dist/find-packages-C6Y7bRd0.mjs +45 -0
- package/dist/find-packages-C6Y7bRd0.mjs.map +1 -0
- package/dist/get-config-DvDR_kk5.mjs +44 -0
- package/dist/get-config-DvDR_kk5.mjs.map +1 -0
- package/dist/{index-MmHuVKDa.d.mts → index-B7dZdFg6.d.mts} +2 -1
- package/dist/index.d.mts +1640 -474
- package/dist/index.mjs +26 -20
- package/dist/index.mjs.map +1 -1
- package/dist/{npm-BKRyPuCX.mjs → npm-CN1gb9zd.mjs} +4 -2
- package/dist/npm-CN1gb9zd.mjs.map +1 -0
- package/dist/{rolldown-runtime-Csi-cuKc.mjs → rolldown-runtime-DQqWX4ve.mjs} +2 -0
- package/dist/semantic/core/analyze-commits.d.mts +2 -1
- package/dist/semantic/core/analyze-commits.mjs +3 -1
- package/dist/semantic/core/analyze-commits.mjs.map +1 -1
- package/dist/semantic/core/conditional.d.mts +2 -1
- package/dist/semantic/core/conditional.mjs +3 -1
- package/dist/semantic/core/conditional.mjs.map +1 -1
- package/dist/semantic/core/exit.d.mts +2 -1
- package/dist/semantic/core/exit.mjs +3 -1
- package/dist/semantic/core/exit.mjs.map +1 -1
- package/dist/semantic/core/prepare/artifacts.d.mts +2 -1
- package/dist/semantic/core/prepare/artifacts.mjs +3 -1
- package/dist/semantic/core/prepare/artifacts.mjs.map +1 -1
- package/dist/semantic/core/prepare/bump-version.d.mts +2 -1
- package/dist/semantic/core/prepare/bump-version.mjs +3 -1
- package/dist/semantic/core/prepare/bump-version.mjs.map +1 -1
- package/dist/semantic/core/prepare/commit.d.mts +2 -1
- package/dist/semantic/core/prepare/commit.mjs +3 -1
- package/dist/semantic/core/prepare/commit.mjs.map +1 -1
- package/dist/semantic/core/prepare/release-info.d.mts +2 -1
- package/dist/semantic/core/prepare/release-info.mjs +2 -0
- package/dist/semantic/core/prepare/release-info.mjs.map +1 -1
- package/dist/semantic/core/publish-packages.d.mts +2 -1
- package/dist/semantic/core/publish-packages.mjs +3 -1
- package/dist/semantic/core/publish-packages.mjs.map +1 -1
- package/dist/semantic/core/push-release.d.mts +2 -1
- package/dist/semantic/core/push-release.mjs +3 -1
- package/dist/semantic/core/push-release.mjs.map +1 -1
- package/dist/semantic/core/run.d.mts +2 -1
- package/dist/semantic/core/run.mjs +3 -1
- package/dist/semantic/core/run.mjs.map +1 -1
- package/dist/semantic/core/sync-repository.d.mts +2 -1
- package/dist/semantic/core/sync-repository.mjs +3 -1
- package/dist/semantic/core/sync-repository.mjs.map +1 -1
- package/dist/semantic/core/verify-conditions.d.mts +2 -1
- package/dist/semantic/core/verify-conditions.mjs +3 -1
- package/dist/semantic/core/verify-conditions.mjs.map +1 -1
- package/dist/semantic/core/verify-release.d.mts +2 -1
- package/dist/semantic/core/verify-release.mjs +3 -1
- package/dist/semantic/core/verify-release.mjs.map +1 -1
- package/dist/semantic/docker/publish.d.mts +2 -1
- package/dist/semantic/docker/publish.mjs +3 -1
- package/dist/semantic/docker/publish.mjs.map +1 -1
- package/dist/semantic/docker/success.d.mts +2 -1
- package/dist/semantic/docker/success.mjs +3 -1
- package/dist/semantic/docker/success.mjs.map +1 -1
- package/dist/{semver-Bgw8dAW8.mjs → semver-BEj6Vrs4.mjs} +4 -2
- package/dist/{semver-Bgw8dAW8.mjs.map → semver-BEj6Vrs4.mjs.map} +1 -1
- package/dist/{source-CHDdP5eQ.mjs → source-DKfioGh_.mjs} +4 -2
- package/dist/{source-CHDdP5eQ.mjs.map → source-DKfioGh_.mjs.map} +1 -1
- package/dist/write-package-D5eHzQug.mjs +10 -0
- package/dist/write-package-D5eHzQug.mjs.map +1 -0
- package/dist/{write-packages-CdhvWsMw.mjs → write-packages-BuxaZvCH.mjs} +5 -3
- package/dist/write-packages-BuxaZvCH.mjs.map +1 -0
- package/package.json +14 -18
- package/dist/common-DvEL7rzl.mjs +0 -2
- package/dist/common-DvEL7rzl.mjs.map +0 -1
- package/dist/compile-packages-Cd19TaUb.mjs.map +0 -1
- package/dist/docker-nm7ubWPx.mjs +0 -34
- package/dist/docker-nm7ubWPx.mjs.map +0 -1
- package/dist/find-packages-CCoDSkVV.mjs +0 -42
- package/dist/find-packages-CCoDSkVV.mjs.map +0 -1
- package/dist/get-config-D9xSS1Lq.mjs +0 -9
- package/dist/get-config-D9xSS1Lq.mjs.map +0 -1
- package/dist/npm-BKRyPuCX.mjs.map +0 -1
- package/dist/write-package-z7IDmENp.mjs +0 -8
- package/dist/write-package-z7IDmENp.mjs.map +0 -1
- package/dist/write-packages-CdhvWsMw.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
|
|
1
2
|
/// <reference path="operators/index.d.ts" />
|
|
2
3
|
/// <reference path="testing/index.d.ts" />
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Readable,
|
|
7
|
-
import { NextRelease, Options
|
|
4
|
+
import { a as SemanticContext, c as getConfig, i as CmContext, l as PackageJson, n as CommandConstructor, o as CliConfig, r as ICommand, s as getCI, t as CmTask } from "./index-B7dZdFg6.mjs";
|
|
5
|
+
import { ChildProcess } from "node:child_process";
|
|
6
|
+
import { SignalConstants } from "node:os";
|
|
7
|
+
import { Duplex, Readable, Writable } from "node:stream";
|
|
8
|
+
import { NextRelease, Options } from "semantic-release";
|
|
9
|
+
import { ReadableStream, ReadableWritablePair, TransformStream, WritableStream } from "node:stream/web";
|
|
8
10
|
//#region ../../node_modules/commander/typings/index.d.ts
|
|
9
11
|
// Type definitions for commander
|
|
10
12
|
// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
|
|
11
|
-
// Using method rather than property for method-signature-style, to document method overloads separately. Allow either.
|
|
12
|
-
/* eslint-disable @typescript-eslint/method-signature-style */
|
|
13
13
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
14
|
// This is a trick to encourage editor to suggest the known literals while still
|
|
15
15
|
// allowing any BaseType value.
|
|
@@ -44,6 +44,7 @@ declare class Argument {
|
|
|
44
44
|
variadic: boolean;
|
|
45
45
|
defaultValue?: any;
|
|
46
46
|
defaultValueDescription?: string;
|
|
47
|
+
parseArg?: <T>(value: string, previous: T) => T;
|
|
47
48
|
argChoices?: string[];
|
|
48
49
|
/**
|
|
49
50
|
* Initialize a new command argument with the given name and description.
|
|
@@ -93,6 +94,7 @@ declare class Option {
|
|
|
93
94
|
parseArg?: <T>(value: string, previous: T) => T;
|
|
94
95
|
hidden: boolean;
|
|
95
96
|
argChoices?: string[];
|
|
97
|
+
helpGroupHeading?: string;
|
|
96
98
|
constructor(flags: string, description?: string);
|
|
97
99
|
/**
|
|
98
100
|
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
@@ -160,9 +162,13 @@ declare class Option {
|
|
|
160
162
|
name(): string;
|
|
161
163
|
/**
|
|
162
164
|
* Return option name, in a camelcase format that can be used
|
|
163
|
-
* as
|
|
165
|
+
* as an object attribute key.
|
|
164
166
|
*/
|
|
165
167
|
attributeName(): string;
|
|
168
|
+
/**
|
|
169
|
+
* Set the help group heading.
|
|
170
|
+
*/
|
|
171
|
+
helpGroup(heading: string): this;
|
|
166
172
|
/**
|
|
167
173
|
* Return whether a boolean option.
|
|
168
174
|
*
|
|
@@ -173,10 +179,22 @@ declare class Option {
|
|
|
173
179
|
declare class Help {
|
|
174
180
|
/** output helpWidth, long lines are wrapped to fit */
|
|
175
181
|
helpWidth?: number;
|
|
182
|
+
minWidthToWrap: number;
|
|
176
183
|
sortSubcommands: boolean;
|
|
177
184
|
sortOptions: boolean;
|
|
178
185
|
showGlobalOptions: boolean;
|
|
179
186
|
constructor();
|
|
187
|
+
/*
|
|
188
|
+
* prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
|
|
189
|
+
* and just before calling `formatHelp()`.
|
|
190
|
+
*
|
|
191
|
+
* Commander just uses the helpWidth and the others are provided for subclasses.
|
|
192
|
+
*/
|
|
193
|
+
prepareContext(contextOptions: {
|
|
194
|
+
error?: boolean;
|
|
195
|
+
helpWidth?: number;
|
|
196
|
+
outputHasColors?: boolean;
|
|
197
|
+
}): void;
|
|
180
198
|
/** Get the command term to show in the list of subcommands. */
|
|
181
199
|
subcommandTerm(cmd: Command): string;
|
|
182
200
|
/** Get the command summary to show in the list of subcommands. */
|
|
@@ -209,13 +227,54 @@ declare class Help {
|
|
|
209
227
|
longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
|
|
210
228
|
/** Get the longest argument term length. */
|
|
211
229
|
longestArgumentTermLength(cmd: Command, helper: Help): number;
|
|
230
|
+
/** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */
|
|
231
|
+
displayWidth(str: string): number;
|
|
232
|
+
/** Style the titles. Called with 'Usage:', 'Options:', etc. */
|
|
233
|
+
styleTitle(title: string): string;
|
|
234
|
+
/** Usage: <str> */
|
|
235
|
+
styleUsage(str: string): string;
|
|
236
|
+
/** Style for command name in usage string. */
|
|
237
|
+
styleCommandText(str: string): string;
|
|
238
|
+
styleCommandDescription(str: string): string;
|
|
239
|
+
styleOptionDescription(str: string): string;
|
|
240
|
+
styleSubcommandDescription(str: string): string;
|
|
241
|
+
styleArgumentDescription(str: string): string;
|
|
242
|
+
/** Base style used by descriptions. */
|
|
243
|
+
styleDescriptionText(str: string): string;
|
|
244
|
+
styleOptionTerm(str: string): string;
|
|
245
|
+
styleSubcommandTerm(str: string): string;
|
|
246
|
+
styleArgumentTerm(str: string): string;
|
|
247
|
+
/** Base style used in terms and usage for options. */
|
|
248
|
+
styleOptionText(str: string): string;
|
|
249
|
+
/** Base style used in terms and usage for subcommands. */
|
|
250
|
+
styleSubcommandText(str: string): string;
|
|
251
|
+
/** Base style used in terms and usage for arguments. */
|
|
252
|
+
styleArgumentText(str: string): string;
|
|
212
253
|
/** Calculate the pad width from the maximum term length. */
|
|
213
254
|
padWidth(cmd: Command, helper: Help): number;
|
|
214
255
|
/**
|
|
215
|
-
* Wrap
|
|
216
|
-
*
|
|
256
|
+
* Wrap a string at whitespace, preserving existing line breaks.
|
|
257
|
+
* Wrapping is skipped if the width is less than `minWidthToWrap`.
|
|
258
|
+
*/
|
|
259
|
+
boxWrap(str: string, width: number): string;
|
|
260
|
+
/** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */
|
|
261
|
+
preformatted(str: string): boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
|
|
264
|
+
*
|
|
265
|
+
* So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
|
|
266
|
+
* TTT DDD DDDD
|
|
267
|
+
* DD DDD
|
|
268
|
+
*/
|
|
269
|
+
formatItem(term: string, termWidth: number, description: string, helper: Help): string;
|
|
270
|
+
/**
|
|
271
|
+
* Format a list of items, given a heading and an array of formatted items.
|
|
272
|
+
*/
|
|
273
|
+
formatItemList(heading: string, items: string[], helper: Help): string[];
|
|
274
|
+
/**
|
|
275
|
+
* Group items by their help group heading.
|
|
217
276
|
*/
|
|
218
|
-
|
|
277
|
+
groupItems<T extends Command | Option>(unsortedItems: T[], visibleItems: T[], getGroup: (item: T) => string): Map<string, T[]>;
|
|
219
278
|
/** Generate the built-in help text. */
|
|
220
279
|
formatHelp(cmd: Command, helper: Help): string;
|
|
221
280
|
}
|
|
@@ -235,9 +294,12 @@ interface AddHelpTextContext {
|
|
|
235
294
|
interface OutputConfiguration {
|
|
236
295
|
writeOut?(str: string): void;
|
|
237
296
|
writeErr?(str: string): void;
|
|
297
|
+
outputError?(str: string, write: (str: string) => void): void;
|
|
238
298
|
getOutHelpWidth?(): number;
|
|
239
299
|
getErrHelpWidth?(): number;
|
|
240
|
-
|
|
300
|
+
getOutHasColors?(): boolean;
|
|
301
|
+
getErrHasColors?(): boolean;
|
|
302
|
+
stripColor?(str: string): string;
|
|
241
303
|
}
|
|
242
304
|
type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
|
|
243
305
|
type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
|
|
@@ -341,7 +403,7 @@ declare class Command {
|
|
|
341
403
|
*
|
|
342
404
|
* @returns `this` command for chaining
|
|
343
405
|
*/
|
|
344
|
-
argument<T>(flags: string, description: string,
|
|
406
|
+
argument<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
345
407
|
argument(name: string, description?: string, defaultValue?: unknown): this;
|
|
346
408
|
/**
|
|
347
409
|
* Define argument syntax for command, adding a prepared argument.
|
|
@@ -455,7 +517,7 @@ declare class Command {
|
|
|
455
517
|
*
|
|
456
518
|
* @returns `this` command for chaining
|
|
457
519
|
*/
|
|
458
|
-
action(fn: (...args: any[]) => void | Promise<void>): this;
|
|
520
|
+
action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;
|
|
459
521
|
/**
|
|
460
522
|
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
461
523
|
*
|
|
@@ -469,7 +531,7 @@ declare class Command {
|
|
|
469
531
|
* ```js
|
|
470
532
|
* program
|
|
471
533
|
* .option('-p, --pepper', 'add pepper')
|
|
472
|
-
* .option('
|
|
534
|
+
* .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
|
473
535
|
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
|
474
536
|
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
|
475
537
|
* ```
|
|
@@ -618,10 +680,26 @@ declare class Command {
|
|
|
618
680
|
* @returns Promise
|
|
619
681
|
*/
|
|
620
682
|
parseAsync(argv?: readonly string[], parseOptions?: ParseOptions): Promise<this>;
|
|
683
|
+
/**
|
|
684
|
+
* Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
|
|
685
|
+
* Not usually called directly, but available for subclasses to save their custom state.
|
|
686
|
+
*
|
|
687
|
+
* This is called in a lazy way. Only commands used in parsing chain will have state saved.
|
|
688
|
+
*/
|
|
689
|
+
saveStateBeforeParse(): void;
|
|
690
|
+
/**
|
|
691
|
+
* Restore state before parse for calls after the first.
|
|
692
|
+
* Not usually called directly, but available for subclasses to save their custom state.
|
|
693
|
+
*
|
|
694
|
+
* This is called in a lazy way. Only commands used in parsing chain will have state restored.
|
|
695
|
+
*/
|
|
696
|
+
restoreStateBeforeParse(): void;
|
|
621
697
|
/**
|
|
622
698
|
* Parse options from `argv` removing known options,
|
|
623
699
|
* and return argv split into operands and unknown arguments.
|
|
624
700
|
*
|
|
701
|
+
* Side effects: modifies command by storing options. Does not reset state if called again.
|
|
702
|
+
*
|
|
625
703
|
* argv => operands, unknown
|
|
626
704
|
* --known kkk op => [op], []
|
|
627
705
|
* op --known kkk => [op], []
|
|
@@ -705,13 +783,13 @@ declare class Command {
|
|
|
705
783
|
name(): string;
|
|
706
784
|
/**
|
|
707
785
|
* Set the name of the command from script filename, such as process.argv[1],
|
|
708
|
-
* or
|
|
786
|
+
* or import.meta.filename.
|
|
709
787
|
*
|
|
710
788
|
* (Used internally and public although not documented in README.)
|
|
711
789
|
*
|
|
712
790
|
* @example
|
|
713
791
|
* ```ts
|
|
714
|
-
* program.nameFromFilename(
|
|
792
|
+
* program.nameFromFilename(import.meta.filename);
|
|
715
793
|
* ```
|
|
716
794
|
*
|
|
717
795
|
* @returns `this` command for chaining
|
|
@@ -722,7 +800,7 @@ declare class Command {
|
|
|
722
800
|
*
|
|
723
801
|
* @example
|
|
724
802
|
* ```ts
|
|
725
|
-
* program.executableDir(
|
|
803
|
+
* program.executableDir(import.meta.dirname);
|
|
726
804
|
* // or
|
|
727
805
|
* program.executableDir('subcommands');
|
|
728
806
|
* ```
|
|
@@ -734,6 +812,50 @@ declare class Command {
|
|
|
734
812
|
* Get the executable search directory.
|
|
735
813
|
*/
|
|
736
814
|
executableDir(): string | null;
|
|
815
|
+
/**
|
|
816
|
+
* Set the help group heading for this subcommand in parent command's help.
|
|
817
|
+
*
|
|
818
|
+
* @returns `this` command for chaining
|
|
819
|
+
*/
|
|
820
|
+
helpGroup(heading: string): this;
|
|
821
|
+
/**
|
|
822
|
+
* Get the help group heading for this subcommand in parent command's help.
|
|
823
|
+
*/
|
|
824
|
+
helpGroup(): string;
|
|
825
|
+
/**
|
|
826
|
+
* Set the default help group heading for subcommands added to this command.
|
|
827
|
+
* (This does not override a group set directly on the subcommand using .helpGroup().)
|
|
828
|
+
*
|
|
829
|
+
* @example
|
|
830
|
+
* program.commandsGroup('Development Commands:);
|
|
831
|
+
* program.command('watch')...
|
|
832
|
+
* program.command('lint')...
|
|
833
|
+
* ...
|
|
834
|
+
*
|
|
835
|
+
* @returns `this` command for chaining
|
|
836
|
+
*/
|
|
837
|
+
commandsGroup(heading: string): this;
|
|
838
|
+
/**
|
|
839
|
+
* Get the default help group heading for subcommands added to this command.
|
|
840
|
+
*/
|
|
841
|
+
commandsGroup(): string;
|
|
842
|
+
/**
|
|
843
|
+
* Set the default help group heading for options added to this command.
|
|
844
|
+
* (This does not override a group set directly on the option using .helpGroup().)
|
|
845
|
+
*
|
|
846
|
+
* @example
|
|
847
|
+
* program
|
|
848
|
+
* .optionsGroup('Development Options:')
|
|
849
|
+
* .option('-d, --debug', 'output extra debugging')
|
|
850
|
+
* .option('-p, --profile', 'output profiling information')
|
|
851
|
+
*
|
|
852
|
+
* @returns `this` command for chaining
|
|
853
|
+
*/
|
|
854
|
+
optionsGroup(heading: string): this;
|
|
855
|
+
/**
|
|
856
|
+
* Get the default help group heading for options added to this command.
|
|
857
|
+
*/
|
|
858
|
+
optionsGroup(): string;
|
|
737
859
|
/**
|
|
738
860
|
* Output help information for this command.
|
|
739
861
|
*
|
|
@@ -742,7 +864,7 @@ declare class Command {
|
|
|
742
864
|
*/
|
|
743
865
|
outputHelp(context?: HelpContext): void;
|
|
744
866
|
/** @deprecated since v7 */
|
|
745
|
-
outputHelp(cb
|
|
867
|
+
outputHelp(cb: (str: string) => string): void;
|
|
746
868
|
/**
|
|
747
869
|
* Return command help documentation.
|
|
748
870
|
*/
|
|
@@ -765,7 +887,7 @@ declare class Command {
|
|
|
765
887
|
*/
|
|
766
888
|
help(context?: HelpContext): never;
|
|
767
889
|
/** @deprecated since v7 */
|
|
768
|
-
help(cb
|
|
890
|
+
help(cb: (str: string) => string): never;
|
|
769
891
|
/**
|
|
770
892
|
* Add additional text to be displayed with the built-in help.
|
|
771
893
|
*
|
|
@@ -867,12 +989,9 @@ declare class Rebase extends Fetch implements ICommand {
|
|
|
867
989
|
* method, which will attach a child Subscription to the current Subscription.
|
|
868
990
|
* When a Subscription is unsubscribed, all its children (and its grandchildren)
|
|
869
991
|
* will be unsubscribed as well.
|
|
870
|
-
*
|
|
871
|
-
* @class Subscription
|
|
872
992
|
*/
|
|
873
993
|
declare class Subscription implements SubscriptionLike {
|
|
874
994
|
private initialTeardown?;
|
|
875
|
-
/** @nocollapse */
|
|
876
995
|
static EMPTY: Subscription;
|
|
877
996
|
/**
|
|
878
997
|
* A flag to indicate whether this Subscription has already been unsubscribed.
|
|
@@ -893,7 +1012,6 @@ declare class Subscription implements SubscriptionLike {
|
|
|
893
1012
|
* Disposes the resources held by the subscription. May, for instance, cancel
|
|
894
1013
|
* an ongoing Observable execution or cancel any other type of work that
|
|
895
1014
|
* started when the Subscription was created.
|
|
896
|
-
* @return {void}
|
|
897
1015
|
*/
|
|
898
1016
|
unsubscribe(): void;
|
|
899
1017
|
/**
|
|
@@ -1030,8 +1148,6 @@ interface Observer<T> {
|
|
|
1030
1148
|
* a Subscriber, in order to provide Subscription-like capabilities such as
|
|
1031
1149
|
* `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
|
|
1032
1150
|
* implementing operators, but it is rarely used as a public API.
|
|
1033
|
-
*
|
|
1034
|
-
* @class Subscriber<T>
|
|
1035
1151
|
*/
|
|
1036
1152
|
declare class Subscriber<T> extends Subscription implements Observer<T> {
|
|
1037
1153
|
/**
|
|
@@ -1044,7 +1160,6 @@ declare class Subscriber<T> extends Subscription implements Observer<T> {
|
|
|
1044
1160
|
* Observer.
|
|
1045
1161
|
* @return A Subscriber wrapping the (partially defined)
|
|
1046
1162
|
* Observer represented by the given arguments.
|
|
1047
|
-
* @nocollapse
|
|
1048
1163
|
* @deprecated Do not use. Will be removed in v8. There is no replacement for this
|
|
1049
1164
|
* method, and there is no reason to be creating instances of `Subscriber` directly.
|
|
1050
1165
|
* If you have a specific use case, please file an issue.
|
|
@@ -1063,23 +1178,20 @@ declare class Subscriber<T> extends Subscription implements Observer<T> {
|
|
|
1063
1178
|
* The {@link Observer} callback to receive notifications of type `next` from
|
|
1064
1179
|
* the Observable, with a value. The Observable may call this method 0 or more
|
|
1065
1180
|
* times.
|
|
1066
|
-
* @param
|
|
1067
|
-
* @return {void}
|
|
1181
|
+
* @param value The `next` value.
|
|
1068
1182
|
*/
|
|
1069
|
-
next(value
|
|
1183
|
+
next(value: T): void;
|
|
1070
1184
|
/**
|
|
1071
1185
|
* The {@link Observer} callback to receive notifications of type `error` from
|
|
1072
1186
|
* the Observable, with an attached `Error`. Notifies the Observer that
|
|
1073
1187
|
* the Observable has experienced an error condition.
|
|
1074
|
-
* @param
|
|
1075
|
-
* @return {void}
|
|
1188
|
+
* @param err The `error` exception.
|
|
1076
1189
|
*/
|
|
1077
1190
|
error(err?: any): void;
|
|
1078
1191
|
/**
|
|
1079
1192
|
* The {@link Observer} callback to receive a valueless notification of type
|
|
1080
1193
|
* `complete` from the Observable. Notifies the Observer that the Observable
|
|
1081
1194
|
* has finished sending push-based notifications.
|
|
1082
|
-
* @return {void}
|
|
1083
1195
|
*/
|
|
1084
1196
|
complete(): void;
|
|
1085
1197
|
unsubscribe(): void;
|
|
@@ -1100,8 +1212,6 @@ interface Operator<T, R> {
|
|
|
1100
1212
|
/**
|
|
1101
1213
|
* A representation of any set of values over any amount of time. This is the most basic building block
|
|
1102
1214
|
* of RxJS.
|
|
1103
|
-
*
|
|
1104
|
-
* @class Observable<T>
|
|
1105
1215
|
*/
|
|
1106
1216
|
declare class Observable<T> implements Subscribable<T> {
|
|
1107
1217
|
/**
|
|
@@ -1113,8 +1223,7 @@ declare class Observable<T> implements Subscribable<T> {
|
|
|
1113
1223
|
*/
|
|
1114
1224
|
operator: Operator<any, T> | undefined;
|
|
1115
1225
|
/**
|
|
1116
|
-
* @
|
|
1117
|
-
* @param {Function} subscribe the function that is called when the Observable is
|
|
1226
|
+
* @param subscribe The function that is called when the Observable is
|
|
1118
1227
|
* initially subscribed to. This function is given a Subscriber, to which new values
|
|
1119
1228
|
* can be `next`ed, or an `error` method can be called to raise an error, or
|
|
1120
1229
|
* `complete` can be called to notify of a successful completion.
|
|
@@ -1122,20 +1231,16 @@ declare class Observable<T> implements Subscribable<T> {
|
|
|
1122
1231
|
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
|
|
1123
1232
|
/**
|
|
1124
1233
|
* Creates a new Observable by calling the Observable constructor
|
|
1125
|
-
* @
|
|
1126
|
-
* @
|
|
1127
|
-
* @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
|
|
1128
|
-
* @return {Observable} a new observable
|
|
1129
|
-
* @nocollapse
|
|
1234
|
+
* @param subscribe the subscriber function to be passed to the Observable constructor
|
|
1235
|
+
* @return A new observable.
|
|
1130
1236
|
* @deprecated Use `new Observable()` instead. Will be removed in v8.
|
|
1131
1237
|
*/
|
|
1132
1238
|
static create: (...args: any[]) => any;
|
|
1133
1239
|
/**
|
|
1134
1240
|
* Creates a new Observable, with this Observable instance as the source, and the passed
|
|
1135
1241
|
* operator defined as the new observable's operator.
|
|
1136
|
-
* @method lift
|
|
1137
1242
|
* @param operator the operator defining the operation to take on the observable
|
|
1138
|
-
* @return
|
|
1243
|
+
* @return A new observable with the Operator applied.
|
|
1139
1244
|
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1140
1245
|
* If you have implemented an operator using `lift`, it is recommended that you create an
|
|
1141
1246
|
* operator by simply returning `new Observable()` directly. See "Creating new operators from
|
|
@@ -1185,9 +1290,9 @@ declare class Observable<T> implements Subscribable<T> {
|
|
|
1185
1290
|
* // 'Total: 6'
|
|
1186
1291
|
* ```
|
|
1187
1292
|
*
|
|
1188
|
-
* @param next
|
|
1189
|
-
* @return
|
|
1190
|
-
*
|
|
1293
|
+
* @param next A handler for each value emitted by the observable.
|
|
1294
|
+
* @return A promise that either resolves on observable completion or
|
|
1295
|
+
* rejects with the handled error.
|
|
1191
1296
|
*/
|
|
1192
1297
|
forEach(next: (value: T) => void): Promise<void>;
|
|
1193
1298
|
/**
|
|
@@ -1331,474 +1436,1567 @@ declare namespace index_d_exports {
|
|
|
1331
1436
|
//#region src/commands/release.d.ts
|
|
1332
1437
|
declare function release(options?: {}): void;
|
|
1333
1438
|
//#endregion
|
|
1334
|
-
//#region ../../node_modules/execa/
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1439
|
+
//#region ../../node_modules/execa/types/utils.d.ts
|
|
1440
|
+
type Not<Value extends boolean> = Value extends true ? false : true;
|
|
1441
|
+
type And<First extends boolean, Second extends boolean> = First extends true ? Second : false;
|
|
1442
|
+
type Unless<Condition extends boolean, ThenValue, ElseValue = never> = Condition extends true ? ElseValue : ThenValue;
|
|
1443
|
+
type AndUnless<Condition extends boolean, ThenValue, ElseValue = unknown> = Condition extends true ? ElseValue : ThenValue;
|
|
1444
|
+
// Whether any of T's union element is the same as one of U's union element.
|
|
1445
|
+
// `&` does not work here.
|
|
1446
|
+
type Intersects<T, U> = true extends (T extends U ? true : false) ? true : false;
|
|
1447
|
+
//#endregion
|
|
1448
|
+
//#region ../../node_modules/execa/types/transform/normalize.d.ts
|
|
1449
|
+
// `options.std*: Generator`
|
|
1450
|
+
// The `chunk` argument's type is based on the transform's mode:
|
|
1451
|
+
// - `binary: true` or binary `encoding`, with `objectMode: true` -> `unknown` for stdin, `Uint8Array` for stdout/stderr
|
|
1452
|
+
// - `binary: true` or binary `encoding` -> `Uint8Array`
|
|
1453
|
+
// - `objectMode: true` -> `unknown` for stdin, `string` for stdout/stderr
|
|
1454
|
+
// - otherwise -> `string`
|
|
1455
|
+
// The return type is kept as `unknown` since a transform can always yield either a `string` or an `Uint8Array`.
|
|
1456
|
+
// See https://github.com/sindresorhus/execa/issues/694
|
|
1457
|
+
type GeneratorTransform<IsSync extends boolean, Chunk = string> = (chunk: Chunk) => Unless<IsSync, AsyncGenerator<unknown, void, void>> | Generator<unknown, void, void>;
|
|
1458
|
+
type GeneratorTransformReturn<IsSync extends boolean> = ReturnType<GeneratorTransform<IsSync>>;
|
|
1459
|
+
type GeneratorFinal<IsSync extends boolean> = () => Unless<IsSync, AsyncGenerator<unknown, void, void>> | Generator<unknown, void, void>;
|
|
1460
|
+
type TransformCommon = {
|
|
1461
|
+
/**
|
|
1462
|
+
If `true`, allow `transformOptions.transform` and `transformOptions.final` to return any type, not just `string` or `Uint8Array`.
|
|
1463
|
+
*/
|
|
1464
|
+
readonly objectMode?: boolean;
|
|
1465
|
+
};
|
|
1466
|
+
// A `GeneratorTransformFull` shape whose `transform` narrows the `chunk` argument to `Chunk`.
|
|
1467
|
+
// The mode-independent documentation lives here.
|
|
1468
|
+
type GeneratorTransformBase<IsSync extends boolean, Chunk> = TransformCommon & {
|
|
1469
|
+
/**
|
|
1470
|
+
Map or filter the input or output of the subprocess.
|
|
1471
|
+
*/
|
|
1472
|
+
readonly transform: GeneratorTransform<IsSync, Chunk>;
|
|
1473
|
+
/**
|
|
1474
|
+
Create additional lines after the last one.
|
|
1475
|
+
*/
|
|
1476
|
+
readonly final?: GeneratorFinal<IsSync>;
|
|
1477
|
+
/**
|
|
1478
|
+
If `true`, iterate over arbitrary chunks of `Uint8Array`s instead of line `string`s.
|
|
1479
|
+
*/
|
|
1480
|
+
readonly binary?: boolean;
|
|
1481
|
+
/**
|
|
1482
|
+
If `true`, keep newlines in each `line` argument. Also, this allows multiple `yield`s to produce a single line.
|
|
1483
|
+
*/
|
|
1484
|
+
readonly preserveNewlines?: boolean;
|
|
1485
|
+
};
|
|
1486
|
+
// For stdout/stderr, this literal option pair accepts explicitly typed `Uint8Array` callbacks, matching runtime binary chunks, while still allowing stdin-style `unknown` object-mode callbacks.
|
|
1487
|
+
type GeneratorTransformBinaryObjectMode<IsSync extends boolean, ObjectModeChunk> = ObjectModeChunk extends string ? Omit<GeneratorTransformBase<IsSync, unknown>, 'transform' | 'objectMode' | 'binary'> & {
|
|
1488
|
+
/**
|
|
1489
|
+
Map or filter the input or output of the subprocess.
|
|
1352
1490
|
*/
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1491
|
+
transform(chunk: Uint8Array): GeneratorTransformReturn<IsSync>;
|
|
1492
|
+
// eslint-disable-next-line @typescript-eslint/unified-signatures -- Combining these as `unknown | Uint8Array` would collapse to `unknown` and reject explicitly typed `Uint8Array` callbacks.
|
|
1493
|
+
transform(chunk: unknown): GeneratorTransformReturn<IsSync>;
|
|
1494
|
+
readonly objectMode: true;
|
|
1495
|
+
readonly binary: true;
|
|
1496
|
+
} : GeneratorTransformBase<IsSync, unknown> & {
|
|
1497
|
+
readonly objectMode: true;
|
|
1498
|
+
readonly binary: true;
|
|
1499
|
+
};
|
|
1500
|
+
/**
|
|
1501
|
+
A transform or an array of transforms can be passed to the `stdin`, `stdout`, `stderr` or `stdio` option.
|
|
1502
|
+
|
|
1503
|
+
A transform is either a generator function or a plain object with the following members.
|
|
1504
|
+
*/
|
|
1505
|
+
type GeneratorTransformFull<IsSync extends boolean, ObjectModeChunk = unknown, TransformChunk = string> =
|
|
1506
|
+
// Non-literal `binary` or `objectMode` values are accepted at runtime, but their mode is unknown at compile time.
|
|
1507
|
+
(GeneratorTransformBase<IsSync, unknown> & {
|
|
1508
|
+
readonly objectMode?: boolean;
|
|
1509
|
+
readonly binary?: boolean;
|
|
1510
|
+
}) |
|
|
1511
|
+
// `binary: true` without `objectMode` -> the `chunk` argument is an `Uint8Array`.
|
|
1512
|
+
(GeneratorTransformBase<IsSync, Uint8Array> & {
|
|
1513
|
+
readonly objectMode?: false;
|
|
1514
|
+
readonly binary: true;
|
|
1515
|
+
}) |
|
|
1516
|
+
// `binary: true` with `objectMode` -> the `chunk` argument is `unknown` for stdin, `Uint8Array` for stdout/stderr.
|
|
1517
|
+
GeneratorTransformBinaryObjectMode<IsSync, ObjectModeChunk> |
|
|
1518
|
+
// `binary: false` without `objectMode` -> the `chunk` argument depends on the subprocess encoding.
|
|
1519
|
+
(GeneratorTransformBase<IsSync, TransformChunk> & {
|
|
1520
|
+
readonly objectMode?: false;
|
|
1521
|
+
readonly binary?: false;
|
|
1522
|
+
}) |
|
|
1523
|
+
// `objectMode: true` with `binary: false` -> the `chunk` argument depends on the stdio direction.
|
|
1524
|
+
(GeneratorTransformBase<IsSync, ObjectModeChunk> & {
|
|
1525
|
+
readonly objectMode: true;
|
|
1526
|
+
readonly binary?: false;
|
|
1527
|
+
});
|
|
1528
|
+
// `options.std*: Duplex`
|
|
1529
|
+
type DuplexTransform = TransformCommon & {
|
|
1530
|
+
readonly transform: Duplex;
|
|
1531
|
+
};
|
|
1532
|
+
// `options.std*: TransformStream`
|
|
1533
|
+
type WebTransform = TransformCommon & {
|
|
1534
|
+
readonly transform: TransformStream;
|
|
1535
|
+
};
|
|
1536
|
+
//#endregion
|
|
1537
|
+
//#region ../../node_modules/execa/types/stdio/type.d.ts
|
|
1538
|
+
type IsStandardStream<FdNumber extends string> = FdNumber extends keyof StandardStreams ? true : false;
|
|
1539
|
+
type StandardStreams = readonly ['stdin', 'stdout', 'stderr'];
|
|
1540
|
+
// When `options.stdin|stdout|stderr|stdio` is set to one of those values, no stream is created
|
|
1541
|
+
type NoStreamStdioOption<FdNumber extends string> = 'ignore' | 'inherit' | number | Readable | Writable | Unless<IsStandardStream<FdNumber>, undefined> | readonly [NoStreamStdioOption<FdNumber>] | {
|
|
1542
|
+
readonly value: 'inherit' | number;
|
|
1543
|
+
readonly input?: boolean;
|
|
1544
|
+
};
|
|
1545
|
+
// `options.stdio` when it is not an array
|
|
1546
|
+
type SimpleStdioOption<IsSync extends boolean, IsExtra extends boolean, IsArray extends boolean> = undefined | 'pipe' | Unless<And<And<Not<IsSync>, IsArray>, IsExtra>, 'inherit'> | Unless<IsArray, 'ignore'> | Unless<IsSync, 'overlapped'>;
|
|
1547
|
+
// The `{value, input}` object form wraps a direction-ambiguous value and sets its direction explicitly.
|
|
1548
|
+
type AmbiguousStdioOption<IsSync extends boolean, IsExtra extends boolean, IsArray extends boolean, ObjectModeChunk = unknown, TransformChunk = string> = {
|
|
1549
|
+
readonly value: AmbiguousStdioValue<IsSync, IsArray, ObjectModeChunk, TransformChunk>;
|
|
1550
|
+
readonly input?: Unless<And<IsSync, IsExtra>, boolean> | false;
|
|
1551
|
+
};
|
|
1552
|
+
// Values whose direction is ambiguous on additional file descriptors, so they default to output unless `input` is set.
|
|
1553
|
+
// This excludes values with a fixed direction (readable/writable streams, iterables, standard file descriptors).
|
|
1554
|
+
type AmbiguousStdioValue<IsSync extends boolean, IsArray extends boolean, ObjectModeChunk, TransformChunk> = 'pipe' | 'inherit' | Unless<IsSync, 'overlapped'> | URL | GeneratorTransform<IsSync, TransformChunk> | GeneratorTransformFull<IsSync, ObjectModeChunk, TransformChunk> | Unless<And<Not<IsSync>, IsArray>, 3 | 4 | 5 | 6 | 7 | 8 | 9> | Unless<IsSync, DuplexTransform | WebTransform | TransformStream> | {
|
|
1555
|
+
readonly file: string;
|
|
1556
|
+
readonly append?: boolean;
|
|
1557
|
+
};
|
|
1558
|
+
// Values available in both `options.stdin|stdio` and `options.stdout|stderr|stdio`
|
|
1559
|
+
type CommonStdioOption<IsSync extends boolean, IsExtra extends boolean, IsArray extends boolean, ObjectModeChunk = unknown, TransformChunk = string> =
|
|
1560
|
+
// TypeScript cannot contextually type inline full generator transform objects through this broad stdio union because the union also includes `{transform: Duplex | TransformStream}` wrapper objects. Users should annotate `chunk` when assigning an inline object directly to `StdinOption`, `StdoutStderrOption`, `Options['stdout']`, etc. Keep `GeneratorTransformFull` mode branches narrow, but do not add a broad full-object fallback here to try to recover contextual typing.
|
|
1561
|
+
SimpleStdioOption<IsSync, IsExtra, IsArray> | URL | GeneratorTransform<IsSync, TransformChunk> | GeneratorTransformFull<IsSync, ObjectModeChunk, TransformChunk> | Unless<And<Not<IsSync>, IsArray>, 3 | 4 | 5 | 6 | 7 | 8 | 9> | Unless<IsSync, DuplexTransform | WebTransform | TransformStream> | AmbiguousStdioOption<IsSync, IsExtra, IsArray, ObjectModeChunk, TransformChunk> | {
|
|
1562
|
+
readonly file: string;
|
|
1563
|
+
readonly append?: boolean;
|
|
1564
|
+
};
|
|
1565
|
+
// Synchronous iterables excluding strings, Uint8Arrays and Arrays
|
|
1566
|
+
type IterableObject<IsArray extends boolean> = Iterable<unknown> & object & AndUnless<IsArray, {
|
|
1567
|
+
readonly lastIndexOf?: never;
|
|
1568
|
+
}> & {
|
|
1569
|
+
readonly BYTES_PER_ELEMENT?: never;
|
|
1570
|
+
};
|
|
1571
|
+
// `process.stdin|stdout|stderr` are `Duplex` with a `fd` property.
|
|
1572
|
+
// This ensures they can only be passed to `stdin`/`stdout`/`stderr`, based on their direction.
|
|
1573
|
+
type ProcessStdinFd = {
|
|
1574
|
+
readonly fd?: 0;
|
|
1575
|
+
};
|
|
1576
|
+
type ProcessStdoutStderrFd = {
|
|
1577
|
+
readonly fd?: 1 | 2;
|
|
1578
|
+
};
|
|
1579
|
+
// Values available only in `options.stdin|stdio`
|
|
1580
|
+
type InputStdioOption<IsSync extends boolean = boolean, IsExtra extends boolean = boolean, IsArray extends boolean = boolean> = 0 | Unless<And<IsSync, IsExtra>, Uint8Array | IterableObject<IsArray>> | Unless<And<IsSync, IsArray>, Readable & ProcessStdinFd> | Unless<IsSync, (AsyncIterable<unknown> & ProcessStdinFd) | ReadableStream>;
|
|
1581
|
+
// Values available only in `options.stdout|stderr|stdio`
|
|
1582
|
+
type OutputStdioOption<IsSync extends boolean, IsArray extends boolean> = 1 | 2 | Unless<And<IsSync, IsArray>, Writable & ProcessStdoutStderrFd> | Unless<IsSync, WritableStream>;
|
|
1583
|
+
// `options.stdin` array items
|
|
1584
|
+
type StdinSingleOption<IsSync extends boolean, IsExtra extends boolean, IsArray extends boolean, TransformChunk = string> = CommonStdioOption<IsSync, IsExtra, IsArray, unknown, TransformChunk> | InputStdioOption<IsSync, IsExtra, IsArray>;
|
|
1585
|
+
// `options.stdin`
|
|
1586
|
+
type StdinOptionCommon<IsSync extends boolean = boolean, IsExtra extends boolean = boolean, TransformChunk = string> = TransformChunk extends unknown ? StdinSingleOption<IsSync, IsExtra, false, TransformChunk> | ReadonlyArray<StdinSingleOption<IsSync, IsExtra, true, TransformChunk>> : never;
|
|
1587
|
+
// `options.stdout|stderr` array items
|
|
1588
|
+
type StdoutStderrSingleOption<IsSync extends boolean, IsExtra extends boolean, IsArray extends boolean, TransformChunk = string> = CommonStdioOption<IsSync, IsExtra, IsArray, TransformChunk, TransformChunk> | OutputStdioOption<IsSync, IsArray>;
|
|
1589
|
+
// `options.stdout|stderr`
|
|
1590
|
+
// In `objectMode`, the `chunk` argument of every array item is typed as `string`, even though only the first transform in the pipeline receives subprocess lines. The array index cannot be used to infer the pipeline position, since non-transform items are filtered out and transforms are reordered at runtime.
|
|
1591
|
+
type StdoutStderrOptionCommon<IsSync extends boolean = boolean, IsExtra extends boolean = boolean, TransformChunk = string> = TransformChunk extends unknown ? StdoutStderrSingleOption<IsSync, IsExtra, false, TransformChunk> | ReadonlyArray<StdoutStderrSingleOption<IsSync, IsExtra, true, TransformChunk>> : never;
|
|
1592
|
+
// `options.stdio[3+]`
|
|
1593
|
+
type StdioExtraOptionCommon<IsSync extends boolean, TransformChunk = string> = StdinOptionCommon<IsSync, true, TransformChunk> | StdoutStderrOptionCommon<IsSync, true, TransformChunk>;
|
|
1594
|
+
// `options.stdin|stdout|stderr|stdio` array items
|
|
1595
|
+
type StdioSingleOption<IsSync extends boolean = boolean, IsExtra extends boolean = boolean, IsArray extends boolean = boolean, TransformChunk = string> = StdinSingleOption<IsSync, IsExtra, IsArray, TransformChunk> | StdoutStderrSingleOption<IsSync, IsExtra, IsArray, TransformChunk>;
|
|
1596
|
+
// Get `options.stdin|stdout|stderr|stdio` items if it is an array, else keep as is
|
|
1597
|
+
type StdioSingleOptionItems<StdioOptionType> = StdioOptionType extends readonly StdioSingleOption[] ? StdioOptionType[number] : StdioOptionType;
|
|
1598
|
+
// `options.stdin|stdout|stderr|stdio`
|
|
1599
|
+
type StdioOptionCommon<IsSync extends boolean = boolean, TransformChunk = string> = StdinOptionCommon<IsSync, boolean, TransformChunk> | StdoutStderrOptionCommon<IsSync, boolean, TransformChunk>;
|
|
1600
|
+
// `options.stdio` when it is an array
|
|
1601
|
+
type StdioOptionsArray<IsSync extends boolean = boolean, TransformChunk = string> = readonly [StdinOptionCommon<IsSync, false, TransformChunk>, StdoutStderrOptionCommon<IsSync, false, TransformChunk>, StdoutStderrOptionCommon<IsSync, false, TransformChunk>, ...ReadonlyArray<StdioExtraOptionCommon<IsSync, TransformChunk>>];
|
|
1602
|
+
// `options.stdio`
|
|
1603
|
+
type StdioOptionsProperty<IsSync extends boolean = boolean, TransformChunk = string> = TransformChunk extends unknown ? SimpleStdioOption<IsSync, false, false> | StdioOptionsArray<IsSync, TransformChunk> : never;
|
|
1604
|
+
//#endregion
|
|
1605
|
+
//#region ../../node_modules/execa/types/ipc.d.ts
|
|
1606
|
+
// Message when the `serialization` option is `'advanced'`
|
|
1607
|
+
type AdvancedMessage = string | number | boolean | null | object;
|
|
1608
|
+
// Message when the `serialization` option is `'json'`
|
|
1609
|
+
type JsonMessage = string | number | boolean | null | readonly JsonMessage[] | {
|
|
1610
|
+
readonly [key: string | number]: JsonMessage;
|
|
1611
|
+
};
|
|
1612
|
+
/**
|
|
1613
|
+
Type of messages exchanged between a process and its subprocess using `sendMessage()`, `getOneMessage()` and `getEachMessage()`.
|
|
1356
1614
|
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1615
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1616
|
+
*/
|
|
1617
|
+
type Message<Serialization extends Options$1['serialization'] = Options$1['serialization']> = Serialization extends 'json' ? JsonMessage : AdvancedMessage;
|
|
1618
|
+
/**
|
|
1619
|
+
Options to `sendMessage()` and `subprocess.sendMessage()`
|
|
1620
|
+
*/
|
|
1621
|
+
type SendMessageOptions = {
|
|
1622
|
+
/**
|
|
1623
|
+
Throw when the other process is not receiving or listening to messages.
|
|
1362
1624
|
|
|
1363
|
-
|
|
1625
|
+
@default false
|
|
1626
|
+
*/
|
|
1627
|
+
readonly strict?: boolean;
|
|
1628
|
+
};
|
|
1629
|
+
/**
|
|
1630
|
+
Options to `getOneMessage()` and `subprocess.getOneMessage()`
|
|
1631
|
+
*/
|
|
1632
|
+
type GetOneMessageOptions<Serialization extends Options$1['serialization']> = {
|
|
1633
|
+
/**
|
|
1634
|
+
Ignore any `message` that returns `false`.
|
|
1635
|
+
*/
|
|
1636
|
+
readonly filter?: (message: Message<Serialization>) => boolean;
|
|
1637
|
+
/**
|
|
1638
|
+
Keep the subprocess alive while `getOneMessage()` is waiting.
|
|
1364
1639
|
|
|
1365
|
-
|
|
1640
|
+
@default true
|
|
1641
|
+
*/
|
|
1642
|
+
readonly reference?: boolean;
|
|
1643
|
+
};
|
|
1644
|
+
/**
|
|
1645
|
+
Options to `getEachMessage()` and `subprocess.getEachMessage()`
|
|
1646
|
+
*/
|
|
1647
|
+
type GetEachMessageOptions = {
|
|
1648
|
+
/**
|
|
1649
|
+
Keep the subprocess alive while `getEachMessage()` is waiting.
|
|
1366
1650
|
|
|
1367
|
-
|
|
1651
|
+
@default true
|
|
1652
|
+
*/
|
|
1653
|
+
readonly reference?: boolean;
|
|
1654
|
+
};
|
|
1655
|
+
// IPC methods in the subprocess
|
|
1656
|
+
type IpcMethods<IpcEnabled extends boolean, Serialization extends Options$1['serialization']> = IpcEnabled extends true ? {
|
|
1657
|
+
/**
|
|
1658
|
+
Send a `message` to the subprocess.
|
|
1368
1659
|
|
|
1369
|
-
|
|
1660
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1370
1661
|
*/
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
If the spawned process fails, `error.stdout`, `error.stderr`, and `error.all` will contain the buffered data.
|
|
1662
|
+
sendMessage(message: Message<Serialization>, sendMessageOptions?: SendMessageOptions): Promise<void>;
|
|
1663
|
+
/**
|
|
1664
|
+
Receive a single `message` from the subprocess.
|
|
1376
1665
|
|
|
1377
|
-
|
|
1666
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1378
1667
|
*/
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1668
|
+
getOneMessage(getOneMessageOptions?: GetOneMessageOptions<Serialization>): Promise<Message<Serialization>>;
|
|
1669
|
+
/**
|
|
1670
|
+
Iterate over each `message` from the subprocess.
|
|
1382
1671
|
|
|
1383
|
-
|
|
1672
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1384
1673
|
*/
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1674
|
+
getEachMessage(getEachMessageOptions?: GetEachMessageOptions): AsyncIterableIterator<Message<Serialization>>;
|
|
1675
|
+
} :
|
|
1676
|
+
// Those methods only work if the `ipc` option is `true`.
|
|
1677
|
+
// At runtime, they are actually defined, in order to provide with a nice error message.
|
|
1678
|
+
// At type check time, they are typed as `undefined` to prevent calling them.
|
|
1679
|
+
{
|
|
1680
|
+
sendMessage: undefined;
|
|
1681
|
+
getOneMessage: undefined;
|
|
1682
|
+
getEachMessage: undefined;
|
|
1683
|
+
};
|
|
1684
|
+
// Whether IPC is enabled, based on the `ipc`, `ipcInput` and `gracefulCancel` options
|
|
1685
|
+
type HasIpc<OptionsType extends Options$1> = HasIpcOption<OptionsType['ipc'], 'ipcInput' extends keyof OptionsType ? OptionsType['ipcInput'] : undefined, 'gracefulCancel' extends keyof OptionsType ? OptionsType['gracefulCancel'] : undefined>;
|
|
1686
|
+
type HasIpcOption<IpcOption extends Options$1['ipc'], IpcInputOption extends Options$1['ipcInput'], GracefulCancelOption extends Options$1['gracefulCancel']> = IpcOption extends true ? true : IpcOption extends false ? false : IpcInputOption extends undefined ? GracefulCancelOption extends true ? true : false : true;
|
|
1687
|
+
//#endregion
|
|
1688
|
+
//#region ../../node_modules/execa/types/arguments/fd-options.d.ts
|
|
1689
|
+
type FileDescriptorOption = `fd${number}`;
|
|
1690
|
+
// `from` option of `subprocess.readable|duplex|iterable|pipe()`
|
|
1691
|
+
// Also used by fd-specific options
|
|
1692
|
+
type FromOption = 'stdout' | 'stderr' | 'all' | FileDescriptorOption;
|
|
1693
|
+
// `to` option of `subprocess.writable|duplex|pipe()`
|
|
1694
|
+
type ToOption = 'stdin' | FileDescriptorOption;
|
|
1695
|
+
//#endregion
|
|
1696
|
+
//#region ../../node_modules/execa/types/arguments/specific.d.ts
|
|
1697
|
+
// Options which can be fd-specific like `{verbose: {stdout: 'none', stderr: 'full'}}`
|
|
1698
|
+
type FdGenericOption<OptionType> = OptionType | GenericOptionObject<OptionType>;
|
|
1699
|
+
type GenericOptionObject<OptionType> = Readonly<Partial<Record<GenericFromOption, OptionType>>>;
|
|
1700
|
+
type GenericFromOption = FromOption | 'ipc';
|
|
1701
|
+
// Retrieve fd-specific option's value
|
|
1702
|
+
type FdSpecificOption<GenericOption extends FdGenericOption<unknown>, FdNumber extends string> = GenericOption extends GenericOptionObject<unknown> ? FdSpecificObjectOption<GenericOption, FdNumber> : GenericOption;
|
|
1703
|
+
type FdSpecificObjectOption<GenericOption extends GenericOptionObject<unknown>, FdNumber extends string> = keyof GenericOption extends GenericFromOption ? FdNumberToFromOption<FdNumber, keyof GenericOption> extends never ? undefined : GenericOption[FdNumberToFromOption<FdNumber, keyof GenericOption>] : GenericOption;
|
|
1704
|
+
type FdNumberToFromOption<FdNumber extends string, GenericOptionKeys extends GenericFromOption> = FdNumber extends 'ipc' ? 'ipc' extends GenericOptionKeys ? 'ipc' : never : FdNumber extends '1' ? 'stdout' extends GenericOptionKeys ? 'stdout' : 'fd1' extends GenericOptionKeys ? 'fd1' : 'all' extends GenericOptionKeys ? 'all' : never : FdNumber extends '2' ? 'stderr' extends GenericOptionKeys ? 'stderr' : 'fd2' extends GenericOptionKeys ? 'fd2' : 'all' extends GenericOptionKeys ? 'all' : never : `fd${FdNumber}` extends GenericOptionKeys ? `fd${FdNumber}` : never;
|
|
1705
|
+
//#endregion
|
|
1706
|
+
//#region ../../node_modules/execa/types/return/final-error.d.ts
|
|
1707
|
+
// `result.*` defined only on failure, i.e. on `error.*`
|
|
1708
|
+
type ErrorProperties = 'name' | 'message' | 'stack' | 'cause' | 'shortMessage' | 'originalMessage' | 'code';
|
|
1709
|
+
//#endregion
|
|
1710
|
+
//#region ../../node_modules/execa/types/stdio/array.d.ts
|
|
1711
|
+
// `options.stdio`, normalized as an array
|
|
1712
|
+
type StdioOptionNormalizedArray<OptionsType extends CommonOptions> = StdioOptionNormalized<OptionsType['stdio']>;
|
|
1713
|
+
type StdioOptionNormalized<StdioOption extends CommonOptions['stdio']> = StdioOption extends StdioOptionsArray ? StdioOption : StdioOption extends StdinOptionCommon ? StdioOption extends StdoutStderrOptionCommon ? readonly [StdioOption, StdioOption, StdioOption] : DefaultStdioOption : DefaultStdioOption;
|
|
1714
|
+
// `options.stdio` default value
|
|
1715
|
+
type DefaultStdioOption = readonly ['pipe', 'pipe', 'pipe'];
|
|
1716
|
+
//#endregion
|
|
1717
|
+
//#region ../../node_modules/execa/types/stdio/option.d.ts
|
|
1718
|
+
// `options.stdin|stdout|stderr|stdio` for a given file descriptor
|
|
1719
|
+
type FdStdioOption<FdNumber extends string, OptionsType extends CommonOptions> = FdStdioOptionProperty<FdNumber, OptionsType>;
|
|
1720
|
+
type FdStdioOptionProperty<FdNumber extends string, OptionsType extends CommonOptions> = string extends FdNumber ? StdioOptionCommon : FdNumber extends keyof StandardStreams ? StandardStreams[FdNumber] extends keyof OptionsType ? OptionsType[StandardStreams[FdNumber]] extends undefined ? FdStdioArrayOption<FdNumber, OptionsType> : OptionsType[StandardStreams[FdNumber]] : FdStdioArrayOption<FdNumber, OptionsType> : FdStdioArrayOption<FdNumber, OptionsType>;
|
|
1721
|
+
// `options.stdio[FdNumber]`, excluding `options.stdin|stdout|stderr`
|
|
1722
|
+
type FdStdioArrayOption<FdNumber extends string, OptionsType extends CommonOptions> = FdStdioArrayOptionProperty<FdNumber, StdioOptionNormalizedArray<OptionsType>>;
|
|
1723
|
+
type FdStdioArrayOptionProperty<FdNumber extends string, StdioOptionsType> = string extends FdNumber ? StdioOptionCommon | undefined : StdioOptionsType extends StdioOptionsArray ? FdNumber extends keyof StdioOptionsType ? StdioOptionsType[FdNumber] : StdioOptionNormalizedArray<CommonOptions> extends StdioOptionsType ? StdioOptionsType[number] : undefined : undefined;
|
|
1724
|
+
//#endregion
|
|
1725
|
+
//#region ../../node_modules/execa/types/transform/object-mode.d.ts
|
|
1726
|
+
// Whether a file descriptor is in object mode
|
|
1727
|
+
// I.e. whether `result.stdout|stderr|stdio|all` is an array of `unknown` due to `objectMode: true`
|
|
1728
|
+
type IsObjectFd<FdNumber extends string, OptionsType extends CommonOptions> = IsObjectStdioOption<FdStdioOption<FdNumber, OptionsType>>;
|
|
1729
|
+
type IsObjectStdioOption<StdioOptionType> = IsObjectStdioSingleOption<StdioSingleOptionItems<StdioOptionType>>;
|
|
1730
|
+
type IsObjectStdioSingleOption<StdioSingleOptionType> = StdioSingleOptionType extends TransformCommon ? BooleanObjectMode<StdioSingleOptionType['objectMode']> : StdioSingleOptionType extends DuplexTransform ? StdioSingleOptionType['transform']['readableObjectMode'] : false;
|
|
1731
|
+
type BooleanObjectMode<ObjectModeOption extends boolean | undefined> = ObjectModeOption extends true ? true : false;
|
|
1732
|
+
//#endregion
|
|
1733
|
+
//#region ../../node_modules/execa/types/stdio/direction.d.ts
|
|
1734
|
+
type AnyAmbiguousStdioOption = AmbiguousStdioOption<boolean, false, boolean>;
|
|
1735
|
+
type InputAmbiguousStdioOption = AnyAmbiguousStdioOption & {
|
|
1736
|
+
readonly input: true;
|
|
1737
|
+
};
|
|
1738
|
+
type AmbiguousStdioInputValue<StdioOptionType> = StdioOptionType extends AnyAmbiguousStdioOption ? AmbiguousStdioInputProperty<StdioOptionType> : never;
|
|
1739
|
+
type AmbiguousStdioInputProperty<StdioOptionType> = 'input' extends keyof StdioOptionType ? StdioOptionType extends {
|
|
1740
|
+
readonly input?: infer Input;
|
|
1741
|
+
} ? Input : never : never;
|
|
1742
|
+
// Whether `result.stdio[FdNumber]` is an input stream
|
|
1743
|
+
type IsInputFd<FdNumber extends string, OptionsType extends CommonOptions> = FdNumber extends '0' ? true : IsInputFdOption<FdNumber, StdioSingleOptionItems<FdStdioArrayOption<FdNumber, OptionsType>>>;
|
|
1744
|
+
type IsInputFdOption<FdNumber extends string, StdioOptionType> = Intersects<StdioOptionType, FdNumber extends '1' | '2' ? InputStdioOption : InputStdioOption | InputAmbiguousStdioOption> extends true ? true : FdNumber extends '1' | '2' ? false : true extends AmbiguousStdioInputValue<StdioOptionType> ? boolean : false;
|
|
1745
|
+
//#endregion
|
|
1746
|
+
//#region ../../node_modules/execa/types/return/ignore.d.ts
|
|
1747
|
+
// Whether `result.stdin|stdout|stderr|all|stdio[*]` is `undefined`
|
|
1748
|
+
type IgnoresResultOutput<FdNumber extends string, OptionsType extends CommonOptions> = FdSpecificOption<OptionsType['buffer'], FdNumber> extends false ? true : IgnoresResultOutputDirection<IsInputFd<FdNumber, OptionsType>, FdNumber, OptionsType>;
|
|
1749
|
+
type IgnoresResultOutputDirection<IsInput extends boolean, FdNumber extends string, OptionsType extends CommonOptions> = IsInput extends true ? true : IgnoresSubprocessOutput<FdNumber, OptionsType>;
|
|
1750
|
+
// Whether `subprocess.stdout|stderr|all` is `undefined|null`
|
|
1751
|
+
type IgnoresSubprocessOutput<FdNumber extends string, OptionsType extends CommonOptions> = IgnoresOutput<FdNumber, FdStdioOption<FdNumber, OptionsType>>;
|
|
1752
|
+
type IgnoresOutput<FdNumber extends string, StdioOptionType> = StdioOptionType extends NoStreamStdioOption<FdNumber> ? true : false;
|
|
1753
|
+
//#endregion
|
|
1754
|
+
//#region ../../node_modules/execa/types/arguments/encoding-option.d.ts
|
|
1755
|
+
type DefaultEncodingOption = 'utf8';
|
|
1756
|
+
type TextEncodingOption = DefaultEncodingOption | 'utf16le';
|
|
1757
|
+
type BufferEncodingOption = 'buffer';
|
|
1758
|
+
type BinaryEncodingOption = BufferEncodingOption | 'hex' | 'base64' | 'base64url' | 'latin1' | 'ascii';
|
|
1759
|
+
// `options.encoding`
|
|
1760
|
+
type EncodingOption = TextEncodingOption | BinaryEncodingOption | undefined;
|
|
1761
|
+
//#endregion
|
|
1762
|
+
//#region ../../node_modules/execa/types/return/result-stdout.d.ts
|
|
1763
|
+
// `result.stdout|stderr|stdio`
|
|
1764
|
+
type ResultStdioNotAll<FdNumber extends string, OptionsType extends CommonOptions> = ResultStdio<FdNumber, FdNumber, FdNumber, OptionsType>;
|
|
1765
|
+
// `result.stdout|stderr|stdio|all`
|
|
1766
|
+
type ResultStdio<MainFdNumber extends string, ObjectFdNumber extends string, LinesFdNumber extends string, OptionsType extends CommonOptions> = ResultStdioProperty<ObjectFdNumber, LinesFdNumber, IgnoresResultOutput<MainFdNumber, OptionsType>, OptionsType>;
|
|
1767
|
+
type ResultStdioProperty<ObjectFdNumber extends string, LinesFdNumber extends string, StreamOutputIgnored, OptionsType extends CommonOptions> = StreamOutputIgnored extends true ? undefined : ResultStdioItem<IsObjectFd<ObjectFdNumber, OptionsType>, FdSpecificOption<OptionsType['lines'], LinesFdNumber>, OptionsType['encoding']>;
|
|
1768
|
+
type ResultStdioItem<IsObjectResult, LinesOption extends boolean | undefined, Encoding extends CommonOptions['encoding']> = IsObjectResult extends true ? unknown[] : Encoding extends BufferEncodingOption ? Uint8Array : LinesOption extends true ? Encoding extends BinaryEncodingOption ? string : string[] : string;
|
|
1769
|
+
//#endregion
|
|
1770
|
+
//#region ../../node_modules/execa/types/return/result-all.d.ts
|
|
1771
|
+
// `result.all`
|
|
1772
|
+
type ResultAll<OptionsType extends CommonOptions> = ResultAllProperty<OptionsType['all'], OptionsType>;
|
|
1773
|
+
type ResultAllProperty<AllOption extends CommonOptions['all'], OptionsType extends CommonOptions> = AllOption extends true ? ResultStdio<AllMainFd<OptionsType>, AllObjectFd<OptionsType>, AllLinesFd<OptionsType>, OptionsType> : undefined;
|
|
1774
|
+
type AllMainFd<OptionsType extends CommonOptions> = IgnoresResultOutput<'1', OptionsType> extends true ? '2' : '1';
|
|
1775
|
+
type AllObjectFd<OptionsType extends CommonOptions> = IsObjectFd<'1', OptionsType> extends true ? '1' : '2';
|
|
1776
|
+
type AllLinesFd<OptionsType extends CommonOptions> = FdSpecificOption<OptionsType['lines'], '1'> extends true ? '1' : '2';
|
|
1777
|
+
//#endregion
|
|
1778
|
+
//#region ../../node_modules/execa/types/return/result-stdio.d.ts
|
|
1779
|
+
// `result.stdio`
|
|
1780
|
+
type ResultStdioArray<OptionsType extends CommonOptions> = MapResultStdio<StdioOptionNormalizedArray<OptionsType>, OptionsType>;
|
|
1781
|
+
type MapResultStdio<StdioOptionsArrayType, OptionsType extends CommonOptions> = { -readonly [FdNumber in keyof StdioOptionsArrayType]: ResultStdioNotAll<FdNumber extends string ? FdNumber : string, OptionsType>; };
|
|
1782
|
+
//#endregion
|
|
1783
|
+
//#region ../../node_modules/execa/types/return/result-ipc.d.ts
|
|
1784
|
+
// `result.ipcOutput`
|
|
1785
|
+
// This is empty unless the `ipc` option is `true`.
|
|
1786
|
+
// Also, this is empty if the `buffer` option is `false`.
|
|
1787
|
+
type ResultIpcOutput<IsSync, OptionsType extends CommonOptions> = IsSync extends true ? [] : ResultIpcAsync<FdSpecificOption<OptionsType['buffer'], 'ipc'>, HasIpc<StricterOptions<OptionsType, Options$1>>, OptionsType['serialization']>;
|
|
1788
|
+
type ResultIpcAsync<BufferOption extends boolean | undefined, IpcEnabled extends boolean, SerializationOption extends CommonOptions['serialization']> = BufferOption extends false ? [] : IpcEnabled extends true ? Array<Message<SerializationOption>> : [];
|
|
1789
|
+
//#endregion
|
|
1790
|
+
//#region ../../node_modules/execa/types/return/result.d.ts
|
|
1791
|
+
declare abstract class CommonResult<IsSync extends boolean, OptionsType extends CommonOptions> {
|
|
1792
|
+
/**
|
|
1793
|
+
The output of the subprocess on [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)).
|
|
1388
1794
|
|
|
1389
|
-
|
|
1390
|
-
*/
|
|
1391
|
-
readonly stdout?: StdioOption;
|
|
1392
|
-
/**
|
|
1393
|
-
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
|
1795
|
+
This is `undefined` if the `stdout` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
1394
1796
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1797
|
+
This is an array if the `lines` option is `true`, or if the `stdout` option is a transform in object mode.
|
|
1798
|
+
*/
|
|
1799
|
+
stdout: ResultStdioNotAll<'1', OptionsType>;
|
|
1800
|
+
/**
|
|
1801
|
+
The output of the subprocess on [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)).
|
|
1400
1802
|
|
|
1401
|
-
|
|
1402
|
-
*/
|
|
1403
|
-
readonly reject?: boolean;
|
|
1404
|
-
/**
|
|
1405
|
-
Add an `.all` property on the promise and the resolved value. The property contains the output of the process with `stdout` and `stderr` interleaved.
|
|
1803
|
+
This is `undefined` if the `stderr` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
1406
1804
|
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1805
|
+
This is an array if the `lines` option is `true`, or if the `stderr` option is a transform in object mode.
|
|
1806
|
+
*/
|
|
1807
|
+
stderr: ResultStdioNotAll<'2', OptionsType>;
|
|
1808
|
+
/**
|
|
1809
|
+
The output of the subprocess with `result.stdout` and `result.stderr` interleaved.
|
|
1412
1810
|
|
|
1413
|
-
|
|
1414
|
-
*/
|
|
1415
|
-
readonly stripFinalNewline?: boolean;
|
|
1416
|
-
/**
|
|
1417
|
-
Set to `false` if you don't want to extend the environment variables when providing the `env` property.
|
|
1811
|
+
This requires the `all` option to be `true`.
|
|
1418
1812
|
|
|
1419
|
-
|
|
1420
|
-
*/
|
|
1421
|
-
readonly extendEnv?: boolean;
|
|
1422
|
-
/**
|
|
1423
|
-
Current working directory of the child process.
|
|
1813
|
+
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`.
|
|
1424
1814
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1815
|
+
This is an array if the `lines` option is `true`, or if either the `stdout` or `stderr` option is a transform in object mode.
|
|
1816
|
+
*/
|
|
1817
|
+
all: ResultAll<OptionsType>;
|
|
1818
|
+
/**
|
|
1819
|
+
The output of the subprocess on `stdin`, `stdout`, `stderr` and other file descriptors.
|
|
1430
1820
|
|
|
1431
|
-
|
|
1432
|
-
*/
|
|
1433
|
-
readonly env?: NodeJS.ProcessEnv;
|
|
1434
|
-
/**
|
|
1435
|
-
Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified.
|
|
1436
|
-
*/
|
|
1437
|
-
readonly argv0?: string;
|
|
1438
|
-
/**
|
|
1439
|
-
Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.
|
|
1821
|
+
Items are `undefined` when their corresponding `stdio` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
1440
1822
|
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
- `json`: Uses `JSON.stringify()` and `JSON.parse()`.
|
|
1447
|
-
- `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)
|
|
1823
|
+
Items are arrays when their corresponding `stdio` option is a transform in object mode.
|
|
1824
|
+
*/
|
|
1825
|
+
stdio: ResultStdioArray<OptionsType>;
|
|
1826
|
+
/**
|
|
1827
|
+
All the messages sent by the subprocess to the current process.
|
|
1448
1828
|
|
|
1449
|
-
|
|
1829
|
+
This is empty unless the `ipc` option is `true`. Also, this is empty if the `buffer` option is `false`.
|
|
1830
|
+
*/
|
|
1831
|
+
ipcOutput: ResultIpcOutput<IsSync, OptionsType>;
|
|
1832
|
+
/**
|
|
1833
|
+
Results of the other subprocesses that were piped into this subprocess.
|
|
1450
1834
|
|
|
1451
|
-
|
|
1835
|
+
This array is initially empty and is populated each time the `subprocess.pipe()` method resolves.
|
|
1836
|
+
*/
|
|
1837
|
+
pipedFrom: Unless<IsSync, Result[], []>;
|
|
1838
|
+
/**
|
|
1839
|
+
The file and arguments that were run.
|
|
1840
|
+
*/
|
|
1841
|
+
command: string;
|
|
1842
|
+
/**
|
|
1843
|
+
Same as `command` but escaped.
|
|
1844
|
+
*/
|
|
1845
|
+
escapedCommand: string;
|
|
1846
|
+
/**
|
|
1847
|
+
The current directory in which the command was run.
|
|
1848
|
+
*/
|
|
1849
|
+
cwd: string;
|
|
1850
|
+
/**
|
|
1851
|
+
Duration of the subprocess, in milliseconds.
|
|
1852
|
+
*/
|
|
1853
|
+
durationMs: number;
|
|
1854
|
+
/**
|
|
1855
|
+
Whether the subprocess failed to run.
|
|
1452
1856
|
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1857
|
+
When this is `true`, the result is an `ExecaError` instance with additional error-related properties.
|
|
1858
|
+
*/
|
|
1859
|
+
failed: boolean;
|
|
1860
|
+
/**
|
|
1861
|
+
Whether the subprocess timed out due to the `timeout` option.
|
|
1862
|
+
*/
|
|
1863
|
+
timedOut: boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
Whether the subprocess was canceled using the `cancelSignal` option.
|
|
1866
|
+
*/
|
|
1867
|
+
isCanceled: boolean;
|
|
1868
|
+
/**
|
|
1869
|
+
Whether the subprocess was canceled using both the `cancelSignal` and the `gracefulCancel` options.
|
|
1870
|
+
*/
|
|
1871
|
+
isGracefullyCanceled: boolean;
|
|
1872
|
+
/**
|
|
1873
|
+
Whether the subprocess failed because its output was larger than the `maxBuffer` option.
|
|
1874
|
+
*/
|
|
1875
|
+
isMaxBuffer: boolean;
|
|
1876
|
+
/**
|
|
1877
|
+
Whether the subprocess was terminated by a signal (like `SIGTERM`) sent by either:
|
|
1878
|
+
- The current process.
|
|
1879
|
+
- Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).
|
|
1880
|
+
*/
|
|
1881
|
+
isTerminated: boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
Whether the subprocess was terminated by the `SIGKILL` signal sent by the `forceKillAfterDelay` option.
|
|
1884
|
+
*/
|
|
1885
|
+
isForcefullyTerminated: boolean;
|
|
1886
|
+
/**
|
|
1887
|
+
The numeric [exit code](https://en.wikipedia.org/wiki/Exit_status) of the subprocess that was run.
|
|
1458
1888
|
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
Sets the group identity of the process.
|
|
1468
|
-
*/
|
|
1469
|
-
readonly gid?: number;
|
|
1470
|
-
/**
|
|
1471
|
-
If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.
|
|
1889
|
+
This is `undefined` when the subprocess could not be spawned or was terminated by a signal.
|
|
1890
|
+
*/
|
|
1891
|
+
exitCode?: number;
|
|
1892
|
+
/**
|
|
1893
|
+
The name of the signal (like `SIGTERM`) that terminated the subprocess, sent by either:
|
|
1894
|
+
- The current process.
|
|
1895
|
+
- Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).
|
|
1472
1896
|
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1897
|
+
If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`.
|
|
1898
|
+
*/
|
|
1899
|
+
signal?: keyof SignalConstants;
|
|
1900
|
+
/**
|
|
1901
|
+
A human-friendly description of the signal that was used to terminate the subprocess.
|
|
1477
1902
|
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1903
|
+
If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.
|
|
1904
|
+
*/
|
|
1905
|
+
signalDescription?: string;
|
|
1906
|
+
/**
|
|
1907
|
+
Error message when the subprocess failed to run.
|
|
1908
|
+
*/
|
|
1909
|
+
message?: string;
|
|
1910
|
+
/**
|
|
1911
|
+
This is the same as `error.message` except it does not include the subprocess output.
|
|
1912
|
+
*/
|
|
1913
|
+
shortMessage?: string;
|
|
1914
|
+
/**
|
|
1915
|
+
Original error message. This is the same as `error.message` excluding the subprocess output and some additional information added by Execa.
|
|
1483
1916
|
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1917
|
+
This exists only in specific instances, such as during a timeout.
|
|
1918
|
+
*/
|
|
1919
|
+
originalMessage?: string;
|
|
1920
|
+
/**
|
|
1921
|
+
Underlying error, if there is one. For example, this is set by `subprocess.kill(error)`.
|
|
1489
1922
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1923
|
+
This is usually an `Error` instance.
|
|
1924
|
+
*/
|
|
1925
|
+
cause?: unknown;
|
|
1926
|
+
/**
|
|
1927
|
+
Node.js-specific [error code](https://nodejs.org/api/errors.html#errorcode), when available.
|
|
1928
|
+
*/
|
|
1929
|
+
code?: string;
|
|
1930
|
+
// We cannot `extend Error` because `message` must be optional. So we copy its types here.
|
|
1931
|
+
readonly name?: Error['name'];
|
|
1932
|
+
stack?: Error['stack'];
|
|
1933
|
+
}
|
|
1934
|
+
type SuccessResult<IsSync extends boolean = boolean, OptionsType extends CommonOptions = CommonOptions> = InstanceType<typeof CommonResult<IsSync, OptionsType>> & OmitErrorIfReject<OptionsType['reject']>;
|
|
1935
|
+
type OmitErrorIfReject<RejectOption extends CommonOptions['reject']> = Record<ErrorProperties, RejectOption extends false ? unknown : never>;
|
|
1936
|
+
/**
|
|
1937
|
+
Result of a subprocess successful execution.
|
|
1495
1938
|
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1939
|
+
When the subprocess fails, it is rejected with an `ExecaError` instead.
|
|
1940
|
+
*/
|
|
1941
|
+
type Result<OptionsType extends Options$1 = Options$1> = SuccessResult<false, OptionsType>;
|
|
1942
|
+
/**
|
|
1943
|
+
Result of a subprocess successful execution.
|
|
1501
1944
|
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1945
|
+
When the subprocess fails, it is rejected with an `ExecaError` instead.
|
|
1946
|
+
*/
|
|
1947
|
+
type SyncResult<OptionsType extends SyncOptions = SyncOptions> = SuccessResult<true, OptionsType>;
|
|
1948
|
+
//#endregion
|
|
1949
|
+
//#region ../../node_modules/execa/types/verbose.d.ts
|
|
1950
|
+
type VerboseOption = FdGenericOption<'none' | 'short' | 'full' | VerboseFunction>;
|
|
1951
|
+
type VerboseFunction = (verboseLine: string, verboseObject: MinimalVerboseObject) => string | void;
|
|
1952
|
+
type GenericVerboseObject = {
|
|
1953
|
+
/**
|
|
1954
|
+
Event type. This can be:
|
|
1955
|
+
- `'command'`: subprocess start
|
|
1956
|
+
- `'output'`: `stdout`/`stderr` output
|
|
1957
|
+
- `'ipc'`: IPC output
|
|
1958
|
+
- `'error'`: subprocess failure
|
|
1959
|
+
- `'duration'`: subprocess success or failure
|
|
1960
|
+
*/
|
|
1961
|
+
type: 'command' | 'output' | 'ipc' | 'error' | 'duration';
|
|
1962
|
+
/**
|
|
1963
|
+
Depending on `verboseObject.type`, this is:
|
|
1964
|
+
- `'command'`: the `result.escapedCommand`
|
|
1965
|
+
- `'output'`: one line from `result.stdout` or `result.stderr`
|
|
1966
|
+
- `'ipc'`: one IPC message from `result.ipcOutput`
|
|
1967
|
+
- `'error'`: the `error.shortMessage`
|
|
1968
|
+
- `'duration'`: the `result.durationMs`
|
|
1969
|
+
*/
|
|
1970
|
+
message: string;
|
|
1971
|
+
/**
|
|
1972
|
+
The file and arguments that were run. This is the same as `result.escapedCommand`.
|
|
1973
|
+
*/
|
|
1974
|
+
escapedCommand: string;
|
|
1975
|
+
/**
|
|
1976
|
+
Serial number identifying the subprocess within the current process. It is incremented from `'0'`.
|
|
1507
1977
|
|
|
1508
|
-
|
|
1509
|
-
*/
|
|
1510
|
-
readonly windowsVerbatimArguments?: boolean;
|
|
1511
|
-
/**
|
|
1512
|
-
On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.
|
|
1978
|
+
This is helpful when multiple subprocesses are running at the same time.
|
|
1513
1979
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1980
|
+
This is similar to a [PID](https://en.wikipedia.org/wiki/Process_identifier) except it has no maximum limit, which means it never repeats. Also, it is usually shorter.
|
|
1981
|
+
*/
|
|
1982
|
+
commandId: string;
|
|
1983
|
+
/**
|
|
1984
|
+
Event date/time.
|
|
1985
|
+
*/
|
|
1986
|
+
timestamp: Date;
|
|
1987
|
+
/**
|
|
1988
|
+
Whether another subprocess is piped into this subprocess. This is `false` when `result.pipedFrom` is empty.
|
|
1989
|
+
*/
|
|
1990
|
+
piped: boolean;
|
|
1991
|
+
};
|
|
1992
|
+
type MinimalVerboseObject = GenericVerboseObject & {
|
|
1993
|
+
// We cannot use the `CommonOptions` type because it would make this type recursive
|
|
1994
|
+
options: object;
|
|
1995
|
+
result?: never;
|
|
1996
|
+
};
|
|
1997
|
+
//#endregion
|
|
1998
|
+
//#region ../../node_modules/execa/types/arguments/options.d.ts
|
|
1999
|
+
type ChunkForEncoding<Encoding extends EncodingOption> = Encoding extends BinaryEncodingOption ? Uint8Array : string;
|
|
2000
|
+
type CommonOptions<IsSync extends boolean = boolean, Encoding extends EncodingOption = EncodingOption> = {
|
|
2001
|
+
/**
|
|
2002
|
+
Prefer locally installed binaries when looking for a binary to execute.
|
|
1533
2003
|
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
2004
|
+
@default `true` with `$`, `false` otherwise
|
|
2005
|
+
*/
|
|
2006
|
+
readonly preferLocal?: boolean;
|
|
2007
|
+
/**
|
|
2008
|
+
Preferred path to find locally installed binaries, when using the `preferLocal` option.
|
|
1539
2009
|
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
/**
|
|
1546
|
-
The file and arguments that were run, for logging purposes.
|
|
2010
|
+
@default `cwd` option
|
|
2011
|
+
*/
|
|
2012
|
+
readonly localDir?: string | URL;
|
|
2013
|
+
/**
|
|
2014
|
+
If `true`, runs with Node.js. The first argument must be a Node.js file.
|
|
1547
2015
|
|
|
1548
|
-
|
|
1549
|
-
*/
|
|
1550
|
-
command: string;
|
|
1551
|
-
/**
|
|
1552
|
-
Same as `command` but escaped.
|
|
2016
|
+
The subprocess inherits the current Node.js [CLI flags](https://nodejs.org/api/cli.html#options) and version. This can be overridden using the `nodeOptions` and `nodePath` options.
|
|
1553
2017
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
The numeric exit code of the process that was run.
|
|
1560
|
-
*/
|
|
1561
|
-
exitCode: number;
|
|
1562
|
-
/**
|
|
1563
|
-
The output of the process on stdout.
|
|
1564
|
-
*/
|
|
1565
|
-
stdout: StdoutStderrType;
|
|
1566
|
-
/**
|
|
1567
|
-
The output of the process on stderr.
|
|
1568
|
-
*/
|
|
1569
|
-
stderr: StdoutStderrType;
|
|
1570
|
-
/**
|
|
1571
|
-
Whether the process failed to run.
|
|
1572
|
-
*/
|
|
1573
|
-
failed: boolean;
|
|
1574
|
-
/**
|
|
1575
|
-
Whether the process timed out.
|
|
1576
|
-
*/
|
|
1577
|
-
timedOut: boolean;
|
|
1578
|
-
/**
|
|
1579
|
-
Whether the process was killed.
|
|
1580
|
-
*/
|
|
1581
|
-
killed: boolean;
|
|
1582
|
-
/**
|
|
1583
|
-
The name of the signal that was used to terminate the process. For example, `SIGFPE`.
|
|
2018
|
+
@default `true` with `execaNode()`, `false` otherwise
|
|
2019
|
+
*/
|
|
2020
|
+
readonly node?: boolean;
|
|
2021
|
+
/**
|
|
2022
|
+
List of [CLI flags](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.
|
|
1584
2023
|
|
|
1585
|
-
|
|
1586
|
-
*/
|
|
1587
|
-
signal?: string;
|
|
1588
|
-
/**
|
|
1589
|
-
A human-friendly description of the signal that was used to terminate the process. For example, `Floating point arithmetic error`.
|
|
2024
|
+
Requires the `node` option to be `true`.
|
|
1590
2025
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
}
|
|
1595
|
-
interface ExecaSyncReturnValue<StdoutErrorType = string> extends ExecaReturnBase<StdoutErrorType> {}
|
|
2026
|
+
@default [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv) (current Node.js CLI flags)
|
|
2027
|
+
*/
|
|
2028
|
+
readonly nodeOptions?: readonly string[];
|
|
1596
2029
|
/**
|
|
1597
|
-
|
|
2030
|
+
Path to the Node.js executable.
|
|
2031
|
+
|
|
2032
|
+
Requires the `node` option to be `true`.
|
|
1598
2033
|
|
|
1599
|
-
|
|
1600
|
-
- its exit code is not `0`
|
|
1601
|
-
- it was killed with a signal
|
|
1602
|
-
- timing out
|
|
1603
|
-
- being canceled
|
|
1604
|
-
- there's not enough memory or there are already too many child processes
|
|
2034
|
+
@default [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath) (current Node.js executable)
|
|
1605
2035
|
*/
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
2036
|
+
readonly nodePath?: string | URL;
|
|
2037
|
+
/**
|
|
2038
|
+
If `true`, runs the command inside of a [shell](https://en.wikipedia.org/wiki/Shell_(computing)).
|
|
1609
2039
|
|
|
1610
|
-
|
|
1611
|
-
- the `all` option is `false` (default value)
|
|
1612
|
-
- `execa.sync()` was used
|
|
1613
|
-
*/
|
|
1614
|
-
all?: StdoutErrorType;
|
|
1615
|
-
/**
|
|
1616
|
-
Whether the process was canceled.
|
|
1617
|
-
*/
|
|
1618
|
-
isCanceled: boolean;
|
|
1619
|
-
}
|
|
1620
|
-
interface ExecaSyncError<StdoutErrorType = string> extends Error, ExecaReturnBase<StdoutErrorType> {
|
|
1621
|
-
/**
|
|
1622
|
-
Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.
|
|
2040
|
+
Uses [`/bin/sh`](https://en.wikipedia.org/wiki/Unix_shell) on UNIX and [`cmd.exe`](https://en.wikipedia.org/wiki/Cmd.exe) on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.
|
|
1623
2041
|
|
|
1624
|
-
|
|
1625
|
-
*/
|
|
1626
|
-
message: string;
|
|
1627
|
-
/**
|
|
1628
|
-
This is the same as the `message` property except it does not include the child process stdout/stderr.
|
|
1629
|
-
*/
|
|
1630
|
-
shortMessage: string;
|
|
1631
|
-
/**
|
|
1632
|
-
Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.
|
|
2042
|
+
We recommend against using this option.
|
|
1633
2043
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
/**
|
|
1640
|
-
The output of the process with `stdout` and `stderr` interleaved.
|
|
2044
|
+
@default false
|
|
2045
|
+
*/
|
|
2046
|
+
readonly shell?: boolean | string | URL;
|
|
2047
|
+
/**
|
|
2048
|
+
Current [working directory](https://en.wikipedia.org/wiki/Working_directory) of the subprocess.
|
|
1641
2049
|
|
|
1642
|
-
|
|
1643
|
-
- the `all` option is `false` (default value)
|
|
1644
|
-
- `execa.sync()` was used
|
|
1645
|
-
*/
|
|
1646
|
-
all?: StdoutErrorType;
|
|
1647
|
-
/**
|
|
1648
|
-
Whether the process was canceled.
|
|
1649
|
-
*/
|
|
1650
|
-
isCanceled: boolean;
|
|
1651
|
-
}
|
|
1652
|
-
interface KillOptions {
|
|
1653
|
-
/**
|
|
1654
|
-
Milliseconds to wait for the child process to terminate before sending `SIGKILL`.
|
|
2050
|
+
This is also used to resolve the `nodePath` option when it is a relative path.
|
|
1655
2051
|
|
|
1656
|
-
|
|
2052
|
+
@default process.cwd()
|
|
2053
|
+
*/
|
|
2054
|
+
readonly cwd?: string | URL;
|
|
2055
|
+
/**
|
|
2056
|
+
[Environment variables](https://en.wikipedia.org/wiki/Environment_variable).
|
|
1657
2057
|
|
|
1658
|
-
|
|
1659
|
-
*/
|
|
1660
|
-
forceKillAfterTimeout?: number | false;
|
|
1661
|
-
}
|
|
1662
|
-
interface ExecaChildPromise<StdoutErrorType> {
|
|
1663
|
-
/**
|
|
1664
|
-
Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
|
|
2058
|
+
Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
|
|
1665
2059
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
*/
|
|
1670
|
-
all?: Readable;
|
|
1671
|
-
catch<ResultType = never>(onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
|
|
1672
|
-
/**
|
|
1673
|
-
Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
|
|
1674
|
-
*/
|
|
1675
|
-
kill(signal?: string, options?: KillOptions): void;
|
|
1676
|
-
/**
|
|
1677
|
-
Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
|
|
1678
|
-
*/
|
|
1679
|
-
cancel(): void;
|
|
1680
|
-
}
|
|
1681
|
-
type ExecaChildProcess<StdoutErrorType = string> = ChildProcess & ExecaChildPromise<StdoutErrorType> & Promise<ExecaReturnValue<StdoutErrorType>>;
|
|
1682
|
-
}
|
|
1683
|
-
declare const execa: {
|
|
2060
|
+
@default [process.env](https://nodejs.org/api/process.html#processenv)
|
|
2061
|
+
*/
|
|
2062
|
+
readonly env?: Readonly<Partial<Record<string, string>>>;
|
|
1684
2063
|
/**
|
|
1685
|
-
|
|
2064
|
+
If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
|
|
2065
|
+
If `false`, only the `env` option is used, not `process.env`.
|
|
1686
2066
|
|
|
1687
|
-
|
|
2067
|
+
@default true
|
|
2068
|
+
*/
|
|
2069
|
+
readonly extendEnv?: boolean;
|
|
2070
|
+
/**
|
|
2071
|
+
Write some input to the subprocess' [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)).
|
|
1688
2072
|
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
2073
|
+
See also the `inputFile` and `stdin` options.
|
|
2074
|
+
*/
|
|
2075
|
+
readonly input?: string | Uint8Array | Readable;
|
|
2076
|
+
/**
|
|
2077
|
+
Use a file as input to the subprocess' [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)).
|
|
1692
2078
|
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
2079
|
+
See also the `input` and `stdin` options.
|
|
2080
|
+
*/
|
|
2081
|
+
readonly inputFile?: string | URL;
|
|
2082
|
+
/**
|
|
2083
|
+
How to setup the subprocess' [standard input](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)). This can be `'pipe'`, `'overlapped'`, `'ignore`, `'inherit'`, a file descriptor integer, a Node.js `Readable` stream, a web `ReadableStream`, a `{ file: 'path' }` object, a file URL, an `Iterable`, an `AsyncIterable`, an `Uint8Array`, a generator function, a `Duplex` or a web `TransformStream`.
|
|
1696
2084
|
|
|
1697
|
-
|
|
1698
|
-
const {stdout} = await execa('echo', ['unicorns']);
|
|
1699
|
-
console.log(stdout);
|
|
1700
|
-
//=> 'unicorns'
|
|
2085
|
+
This can be an array of values such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.
|
|
1701
2086
|
|
|
1702
|
-
|
|
2087
|
+
@default `'inherit'` with `$`, `'pipe'` otherwise
|
|
2088
|
+
*/
|
|
2089
|
+
readonly stdin?: StdinOptionCommon<IsSync, boolean, ChunkForEncoding<Encoding>>;
|
|
2090
|
+
/**
|
|
2091
|
+
How to setup the subprocess' [standard output](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)). This can be `'pipe'`, `'overlapped'`, `'ignore`, `'inherit'`, a file descriptor integer, a Node.js `Writable` stream, a web `WritableStream`, a `{ file: 'path' }` object, a file URL, a generator function, a `Duplex` or a web `TransformStream`.
|
|
1703
2092
|
|
|
1704
|
-
|
|
2093
|
+
This can be an array of values such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.
|
|
1705
2094
|
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
2095
|
+
@default 'pipe'
|
|
2096
|
+
*/
|
|
2097
|
+
readonly stdout?: StdoutStderrOptionCommon<IsSync, boolean, ChunkForEncoding<Encoding>>;
|
|
2098
|
+
/**
|
|
2099
|
+
How to setup the subprocess' [standard error](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)). This can be `'pipe'`, `'overlapped'`, `'ignore`, `'inherit'`, a file descriptor integer, a Node.js `Writable` stream, a web `WritableStream`, a `{ file: 'path' }` object, a file URL, a generator function, a `Duplex` or a web `TransformStream`.
|
|
1709
2100
|
|
|
1710
|
-
|
|
1711
|
-
await subprocess;
|
|
1712
|
-
} catch (error) {
|
|
1713
|
-
console.log(subprocess.killed); // true
|
|
1714
|
-
console.log(error.isCanceled); // true
|
|
1715
|
-
}
|
|
1716
|
-
})();
|
|
2101
|
+
This can be an array of values such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.
|
|
1717
2102
|
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
2103
|
+
@default 'pipe'
|
|
2104
|
+
*/
|
|
2105
|
+
readonly stderr?: StdoutStderrOptionCommon<IsSync, boolean, ChunkForEncoding<Encoding>>;
|
|
2106
|
+
/**
|
|
2107
|
+
Like the `stdin`, `stdout` and `stderr` options but for all [file descriptors](https://en.wikipedia.org/wiki/File_descriptor) at once. For example, `{stdio: ['ignore', 'pipe', 'pipe']}` is the same as `{stdin: 'ignore', stdout: 'pipe', stderr: 'pipe'}`.
|
|
2108
|
+
|
|
2109
|
+
A single string can be used as a shortcut.
|
|
2110
|
+
|
|
2111
|
+
The array can have more than 3 items, to create additional file descriptors beyond `stdin`/`stdout`/`stderr`.
|
|
2112
|
+
|
|
2113
|
+
@default 'pipe'
|
|
2114
|
+
*/
|
|
2115
|
+
readonly stdio?: StdioOptionsProperty<IsSync, ChunkForEncoding<Encoding>>;
|
|
2116
|
+
/**
|
|
2117
|
+
Add a `subprocess.all` stream and a `result.all` property. They contain the combined/interleaved output of the subprocess' `stdout` and `stderr`.
|
|
2118
|
+
|
|
2119
|
+
@default false
|
|
1721
2120
|
*/
|
|
1722
|
-
|
|
1723
|
-
(file: string, arguments?: readonly string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
1724
|
-
(file: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
1725
|
-
(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
2121
|
+
readonly all?: boolean;
|
|
1726
2122
|
/**
|
|
1727
|
-
|
|
2123
|
+
If the subprocess outputs text, specifies its character encoding, either [`'utf8'`](https://en.wikipedia.org/wiki/UTF-8) or [`'utf16le'`](https://en.wikipedia.org/wiki/UTF-16).
|
|
1728
2124
|
|
|
1729
|
-
|
|
2125
|
+
If it outputs binary data instead, this should be either:
|
|
2126
|
+
- `'buffer'`: returns the binary output as an `Uint8Array`.
|
|
2127
|
+
- [`'hex'`](https://en.wikipedia.org/wiki/Hexadecimal), [`'base64'`](https://en.wikipedia.org/wiki/Base64), [`'base64url'`](https://en.wikipedia.org/wiki/Base64#RFC_4648), [`'latin1'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings) or [`'ascii'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings): encodes the binary output as a string.
|
|
1730
2128
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
@
|
|
2129
|
+
The output is available with `result.stdout`, `result.stderr` and `result.stdio`.
|
|
2130
|
+
|
|
2131
|
+
@default 'utf8'
|
|
1734
2132
|
*/
|
|
1735
|
-
|
|
1736
|
-
sync(file: string, arguments?: readonly string[], options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
|
1737
|
-
sync(file: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
|
1738
|
-
sync(file: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
|
2133
|
+
readonly encoding?: Encoding;
|
|
1739
2134
|
/**
|
|
1740
|
-
|
|
2135
|
+
Set `result.stdout`, `result.stderr`, `result.all` and `result.stdio` as arrays of strings, splitting the subprocess' output into lines.
|
|
2136
|
+
|
|
2137
|
+
This cannot be used if the `encoding` option is binary.
|
|
2138
|
+
|
|
2139
|
+
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
1741
2140
|
|
|
1742
|
-
|
|
2141
|
+
@default false
|
|
2142
|
+
*/
|
|
2143
|
+
readonly lines?: FdGenericOption<boolean>;
|
|
2144
|
+
/**
|
|
2145
|
+
Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.
|
|
1743
2146
|
|
|
1744
|
-
|
|
2147
|
+
If the `lines` option is true, this applies to each output line instead.
|
|
2148
|
+
|
|
2149
|
+
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
2150
|
+
|
|
2151
|
+
@default true
|
|
2152
|
+
*/
|
|
2153
|
+
readonly stripFinalNewline?: FdGenericOption<boolean>;
|
|
2154
|
+
/**
|
|
2155
|
+
Largest amount of data allowed on `stdout`, `stderr` and `stdio`.
|
|
1745
2156
|
|
|
1746
|
-
|
|
1747
|
-
|
|
2157
|
+
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
2158
|
+
|
|
2159
|
+
When reached, `error.isMaxBuffer` becomes `true`.
|
|
2160
|
+
|
|
2161
|
+
@default 100_000_000
|
|
2162
|
+
*/
|
|
2163
|
+
readonly maxBuffer?: FdGenericOption<number>;
|
|
2164
|
+
/**
|
|
2165
|
+
When `buffer` is `false`, the `result.stdout`, `result.stderr`, `result.all` and `result.stdio` properties are not set.
|
|
2166
|
+
|
|
2167
|
+
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
2168
|
+
|
|
2169
|
+
@default true
|
|
2170
|
+
*/
|
|
2171
|
+
readonly buffer?: FdGenericOption<boolean>;
|
|
2172
|
+
/**
|
|
2173
|
+
Enables exchanging messages with the subprocess using `subprocess.sendMessage(message)`, `subprocess.getOneMessage()` and `subprocess.getEachMessage()`.
|
|
2174
|
+
|
|
2175
|
+
The subprocess must be a Node.js file.
|
|
2176
|
+
|
|
2177
|
+
@default `true` if the `node`, `ipcInput` or `gracefulCancel` option is set, `false` otherwise
|
|
2178
|
+
*/
|
|
2179
|
+
readonly ipc?: Unless<IsSync, boolean>;
|
|
2180
|
+
/**
|
|
2181
|
+
Specify the kind of serialization used for sending messages between subprocesses when using the `ipc` option.
|
|
2182
|
+
|
|
2183
|
+
@default 'advanced'
|
|
2184
|
+
*/
|
|
2185
|
+
readonly serialization?: Unless<IsSync, 'json' | 'advanced'>;
|
|
2186
|
+
/**
|
|
2187
|
+
Sends an IPC message when the subprocess starts.
|
|
2188
|
+
|
|
2189
|
+
The subprocess must be a Node.js file. The value's type depends on the `serialization` option.
|
|
2190
|
+
*/
|
|
2191
|
+
readonly ipcInput?: Unless<IsSync, Message>;
|
|
2192
|
+
/**
|
|
2193
|
+
If `verbose` is `'short'`, prints the command on [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)): its file, arguments, duration and (if it failed) error message.
|
|
2194
|
+
|
|
2195
|
+
If `verbose` is `'full'` or a function, the command's [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)), `stderr` and IPC messages are also printed.
|
|
2196
|
+
|
|
2197
|
+
A function can be passed to customize logging.
|
|
2198
|
+
|
|
2199
|
+
By default, this applies to both `stdout` and `stderr`, but different values can also be passed.
|
|
2200
|
+
|
|
2201
|
+
@default 'none'
|
|
2202
|
+
*/
|
|
2203
|
+
readonly verbose?: VerboseOption;
|
|
2204
|
+
/**
|
|
2205
|
+
Setting this to `false` resolves the result's promise with the error instead of rejecting it.
|
|
2206
|
+
|
|
2207
|
+
@default true
|
|
2208
|
+
*/
|
|
2209
|
+
readonly reject?: boolean;
|
|
2210
|
+
/**
|
|
2211
|
+
If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds.
|
|
2212
|
+
|
|
2213
|
+
On timeout, `error.timedOut` becomes `true`.
|
|
2214
|
+
|
|
2215
|
+
@default 0
|
|
2216
|
+
*/
|
|
2217
|
+
readonly timeout?: number;
|
|
2218
|
+
/**
|
|
2219
|
+
When the `cancelSignal` is [aborted](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort), terminate the subprocess using a `SIGTERM` signal.
|
|
2220
|
+
|
|
2221
|
+
When aborted, `error.isCanceled` becomes `true`.
|
|
1748
2222
|
|
|
1749
2223
|
@example
|
|
1750
2224
|
```
|
|
1751
|
-
import
|
|
2225
|
+
import {execaNode} from 'execa';
|
|
2226
|
+
|
|
2227
|
+
const controller = new AbortController();
|
|
2228
|
+
const cancelSignal = controller.signal;
|
|
2229
|
+
|
|
2230
|
+
setTimeout(() => {
|
|
2231
|
+
controller.abort();
|
|
2232
|
+
}, 5000);
|
|
2233
|
+
|
|
2234
|
+
try {
|
|
2235
|
+
await execaNode({cancelSignal})`build.js`;
|
|
2236
|
+
} catch (error) {
|
|
2237
|
+
if (error.isCanceled) {
|
|
2238
|
+
console.error('Canceled by cancelSignal.');
|
|
2239
|
+
}
|
|
1752
2240
|
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
console.log(stdout);
|
|
1756
|
-
//=> 'unicorns'
|
|
1757
|
-
})();
|
|
2241
|
+
throw error;
|
|
2242
|
+
}
|
|
1758
2243
|
```
|
|
1759
2244
|
*/
|
|
1760
|
-
|
|
1761
|
-
|
|
2245
|
+
readonly cancelSignal?: Unless<IsSync, AbortSignal>;
|
|
2246
|
+
/**
|
|
2247
|
+
When the `cancelSignal` option is [aborted](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort), do not send any `SIGTERM`. Instead, abort the [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) returned by `getCancelSignal()`. The subprocess should use it to terminate gracefully.
|
|
2248
|
+
|
|
2249
|
+
The subprocess must be a Node.js file.
|
|
2250
|
+
|
|
2251
|
+
When aborted, `error.isGracefullyCanceled` becomes `true`.
|
|
2252
|
+
|
|
2253
|
+
@default false
|
|
2254
|
+
*/
|
|
2255
|
+
readonly gracefulCancel?: Unless<IsSync, boolean>;
|
|
2256
|
+
/**
|
|
2257
|
+
If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).
|
|
2258
|
+
|
|
2259
|
+
When this happens, `error.isForcefullyTerminated` becomes `true`.
|
|
2260
|
+
|
|
2261
|
+
@default 5000
|
|
2262
|
+
*/
|
|
2263
|
+
readonly forceKillAfterDelay?: Unless<IsSync, number | boolean>;
|
|
2264
|
+
/**
|
|
2265
|
+
Default [signal](https://en.wikipedia.org/wiki/Signal_(IPC)) used to terminate the subprocess.
|
|
2266
|
+
|
|
2267
|
+
This can be either a name (like `'SIGTERM'`) or a number (like `9`).
|
|
2268
|
+
|
|
2269
|
+
@default 'SIGTERM'
|
|
2270
|
+
*/
|
|
2271
|
+
readonly killSignal?: keyof SignalConstants | number;
|
|
2272
|
+
/**
|
|
2273
|
+
Run the subprocess independently from the current process.
|
|
2274
|
+
|
|
2275
|
+
@default false
|
|
2276
|
+
*/
|
|
2277
|
+
readonly detached?: Unless<IsSync, boolean>;
|
|
2278
|
+
/**
|
|
2279
|
+
Kill the subprocess when the current process exits.
|
|
2280
|
+
|
|
2281
|
+
@default true
|
|
2282
|
+
*/
|
|
2283
|
+
readonly cleanup?: Unless<IsSync, boolean>;
|
|
2284
|
+
/**
|
|
2285
|
+
When the subprocess is terminated by Execa, also terminate all of its descendant processes, instead of only the subprocess itself.
|
|
2286
|
+
|
|
2287
|
+
This is useful when the subprocess spawns its own processes, such as when using the `shell` option.
|
|
2288
|
+
|
|
2289
|
+
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).
|
|
2290
|
+
|
|
2291
|
+
This is best-effort: descendant processes that create their own process group or session are not terminated.
|
|
2292
|
+
|
|
2293
|
+
@default false
|
|
2294
|
+
*/
|
|
2295
|
+
readonly killDescendants?: Unless<IsSync, boolean>;
|
|
2296
|
+
/**
|
|
2297
|
+
Sets the [user identifier](https://en.wikipedia.org/wiki/User_identifier) of the subprocess.
|
|
2298
|
+
|
|
2299
|
+
@default current user identifier
|
|
2300
|
+
*/
|
|
2301
|
+
readonly uid?: number;
|
|
1762
2302
|
/**
|
|
1763
|
-
|
|
2303
|
+
Sets the [group identifier](https://en.wikipedia.org/wiki/Group_identifier) of the subprocess.
|
|
1764
2304
|
|
|
1765
|
-
@
|
|
1766
|
-
@returns A result `Object` with `stdout` and `stderr` properties.
|
|
2305
|
+
@default current group identifier
|
|
1767
2306
|
*/
|
|
1768
|
-
|
|
1769
|
-
commandSync(command: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
|
2307
|
+
readonly gid?: number;
|
|
1770
2308
|
/**
|
|
1771
|
-
|
|
2309
|
+
Value of [`argv[0]`](https://nodejs.org/api/process.html#processargv0) sent to the subprocess.
|
|
1772
2310
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
2311
|
+
@default file being executed
|
|
2312
|
+
*/
|
|
2313
|
+
readonly argv0?: string;
|
|
2314
|
+
/**
|
|
2315
|
+
On Windows, do not create a new console window.
|
|
1777
2316
|
|
|
1778
|
-
@
|
|
1779
|
-
@param arguments - Arguments to pass to `scriptPath` on execution.
|
|
1780
|
-
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
|
2317
|
+
@default true
|
|
1781
2318
|
*/
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
2319
|
+
readonly windowsHide?: boolean;
|
|
2320
|
+
/**
|
|
2321
|
+
If `false`, escapes the command arguments on Windows.
|
|
2322
|
+
|
|
2323
|
+
@default `true` if the `shell` option is `true`, `false` otherwise
|
|
2324
|
+
*/
|
|
2325
|
+
readonly windowsVerbatimArguments?: boolean;
|
|
1786
2326
|
};
|
|
2327
|
+
/**
|
|
2328
|
+
Subprocess options.
|
|
2329
|
+
|
|
2330
|
+
Some options are related to the subprocess output: `verbose`, `lines`, `stripFinalNewline`, `buffer`, `maxBuffer`. By default, those options apply to all file descriptors (`stdout`, `stderr`, etc.). A plain object can be passed instead to apply them to only `stdout`, `stderr`, `all` (both stdout and stderr), `ipc`, `fd3`, etc.
|
|
2331
|
+
|
|
2332
|
+
@example
|
|
2333
|
+
|
|
2334
|
+
```
|
|
2335
|
+
// Same value for stdout and stderr
|
|
2336
|
+
await execa({verbose: 'full'})`npm run build`;
|
|
2337
|
+
|
|
2338
|
+
// Different values for stdout and stderr
|
|
2339
|
+
await execa({verbose: {stdout: 'none', stderr: 'full'}})`npm run build`;
|
|
2340
|
+
```
|
|
2341
|
+
*/
|
|
2342
|
+
type TextOptions<IsSync extends boolean> = CommonOptions<IsSync, TextEncodingOption | undefined>;
|
|
2343
|
+
type BinaryOptions<IsSync extends boolean> = Omit<CommonOptions<IsSync, BinaryEncodingOption>, 'encoding'> & {
|
|
2344
|
+
readonly encoding: BinaryEncodingOption;
|
|
2345
|
+
};
|
|
2346
|
+
type Options$1 = TextOptions<false> | BinaryOptions<false>;
|
|
2347
|
+
/**
|
|
2348
|
+
Subprocess options, with synchronous methods.
|
|
2349
|
+
|
|
2350
|
+
Some options are related to the subprocess output: `verbose`, `lines`, `stripFinalNewline`, `buffer`, `maxBuffer`. By default, those options apply to all file descriptors (`stdout`, `stderr`, etc.). A plain object can be passed instead to apply them to only `stdout`, `stderr`, `all` (both stdout and stderr), `ipc`, `fd3`, etc.
|
|
2351
|
+
|
|
2352
|
+
@example
|
|
2353
|
+
|
|
2354
|
+
```
|
|
2355
|
+
// Same value for stdout and stderr
|
|
2356
|
+
execaSync({verbose: 'full'})`npm run build`;
|
|
2357
|
+
|
|
2358
|
+
// Different values for stdout and stderr
|
|
2359
|
+
execaSync({verbose: {stdout: 'none', stderr: 'full'}})`npm run build`;
|
|
2360
|
+
```
|
|
2361
|
+
*/
|
|
2362
|
+
type SyncOptions = TextOptions<true> | BinaryOptions<true>;
|
|
2363
|
+
type StricterOptions<WideOptions extends CommonOptions, StrictOptions extends CommonOptions> = WideOptions extends StrictOptions ? WideOptions : StrictOptions;
|
|
2364
|
+
//#endregion
|
|
2365
|
+
//#region ../../node_modules/execa/types/methods/template.d.ts
|
|
2366
|
+
type TemplateExpressionItem = string | number | Result | SyncResult;
|
|
2367
|
+
/**
|
|
2368
|
+
Value allowed inside `${...}` when using the template string syntax.
|
|
2369
|
+
*/
|
|
2370
|
+
type TemplateExpression = TemplateExpressionItem | readonly TemplateExpressionItem[];
|
|
2371
|
+
// `...${...}...` template syntax
|
|
2372
|
+
type TemplateString = readonly [TemplateStringsArray, ...readonly TemplateExpression[]];
|
|
2373
|
+
//#endregion
|
|
2374
|
+
//#region ../../node_modules/execa/types/pipe.d.ts
|
|
2375
|
+
// `subprocess.pipe()` options
|
|
2376
|
+
type PipeOptions = {
|
|
2377
|
+
/**
|
|
2378
|
+
Which stream to pipe from the source subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.
|
|
2379
|
+
|
|
2380
|
+
`"all"` pipes both `stdout` and `stderr`. This requires the `all` option to be `true`.
|
|
2381
|
+
*/
|
|
2382
|
+
readonly from?: FromOption;
|
|
2383
|
+
/**
|
|
2384
|
+
Which stream to pipe to the destination subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.
|
|
2385
|
+
*/
|
|
2386
|
+
readonly to?: ToOption;
|
|
2387
|
+
/**
|
|
2388
|
+
Unpipe the subprocess when the signal aborts.
|
|
2389
|
+
*/
|
|
2390
|
+
readonly unpipeSignal?: AbortSignal;
|
|
2391
|
+
};
|
|
2392
|
+
// Methods forwarded from the destination subprocess to the return value of `subprocess.pipe()`, so its output can be iterated, converted to a stream, or used for IPC.
|
|
2393
|
+
type PipeResultMethods<OptionsType extends Options$1> = SubprocessResultMethods<OptionsType> & IpcMethods<HasIpc<OptionsType>, OptionsType['serialization']>;
|
|
2394
|
+
// Same as `PipeResultMethods`, but when the destination is another `execa()` call, so its own option types are kept.
|
|
2395
|
+
// The base `Options` is only used to compute the property names, which do not depend on the specific options.
|
|
2396
|
+
type PipeResultMethodsFrom<Destination extends ResultPromise> = Pick<Destination, keyof PipeResultMethods<Options$1>>;
|
|
2397
|
+
// `subprocess.pipe()`
|
|
2398
|
+
type PipableSubprocess = {
|
|
2399
|
+
/**
|
|
2400
|
+
[Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the subprocess' `stdout` to a second Execa subprocess' `stdin`. This resolves with that second subprocess' result. If either subprocess is rejected, this is rejected with that subprocess' error instead.
|
|
2401
|
+
|
|
2402
|
+
This follows the same syntax as `execa(file, arguments?, options?)` except both regular options and pipe-specific options can be specified.
|
|
2403
|
+
|
|
2404
|
+
Like a subprocess, the return value can be [iterated](https://github.com/sindresorhus/execa/blob/main/docs/lines.md#progressive-splitting), [converted to a stream](https://github.com/sindresorhus/execa/blob/main/docs/streams.md#converting-a-subprocess-to-a-stream), or used for [IPC](https://github.com/sindresorhus/execa/blob/main/docs/ipc.md) with the destination subprocess.
|
|
2405
|
+
*/
|
|
2406
|
+
pipe<OptionsType extends Options$1 & PipeOptions = {}>(file: string | URL, arguments?: readonly string[], options?: OptionsType): Promise<Result<OptionsType>> & PipableSubprocess & PipeResultMethods<OptionsType>;
|
|
2407
|
+
pipe<OptionsType extends Options$1 & PipeOptions = {}>(file: string | URL, options?: OptionsType): Promise<Result<OptionsType>> & PipableSubprocess & PipeResultMethods<OptionsType>;
|
|
2408
|
+
/**
|
|
2409
|
+
Like `subprocess.pipe(file, arguments?, options?)` but using a `command` template string instead. This follows the same syntax as `$`.
|
|
2410
|
+
*/
|
|
2411
|
+
pipe(templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[]): Promise<Result<{}>> & PipableSubprocess & PipeResultMethods<{}>;
|
|
2412
|
+
pipe<OptionsType extends Options$1 & PipeOptions = {}>(options: OptionsType): (templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[]) => Promise<Result<OptionsType>> & PipableSubprocess & PipeResultMethods<OptionsType>;
|
|
2413
|
+
/**
|
|
2414
|
+
Like `subprocess.pipe(file, arguments?, options?)` but using the return value of another `execa()` call instead.
|
|
2415
|
+
*/
|
|
2416
|
+
pipe<Destination extends ResultPromise>(destination: Destination, options?: PipeOptions): Promise<Awaited<Destination>> & PipableSubprocess & PipeResultMethodsFrom<Destination>;
|
|
2417
|
+
};
|
|
2418
|
+
//#endregion
|
|
2419
|
+
//#region ../../node_modules/execa/types/convert.d.ts
|
|
2420
|
+
// `subprocess.readable|duplex|iterable()` options
|
|
2421
|
+
type ReadableOptions = {
|
|
2422
|
+
/**
|
|
2423
|
+
Which stream to read from the subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.
|
|
2424
|
+
|
|
2425
|
+
`"all"` reads both `stdout` and `stderr`. This requires the `all` option to be `true`.
|
|
2426
|
+
|
|
2427
|
+
@default 'stdout'
|
|
2428
|
+
*/
|
|
2429
|
+
readonly from?: FromOption;
|
|
2430
|
+
/**
|
|
2431
|
+
If `false`, iterates over lines. Each line is a string.
|
|
2432
|
+
|
|
2433
|
+
If `true`, iterates over arbitrary chunks of data. Each line is an [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (with `subprocess.iterable()`) or a [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer) (with `subprocess.readable()`/`subprocess.duplex()`).
|
|
2434
|
+
|
|
2435
|
+
This is always `true` when the `encoding` option is binary.
|
|
2436
|
+
|
|
2437
|
+
@default `false` with `subprocess.iterable()`, `true` otherwise
|
|
2438
|
+
*/
|
|
2439
|
+
readonly binary?: boolean;
|
|
2440
|
+
/**
|
|
2441
|
+
If both this option and the `binary` option is `false`, [newlines](https://en.wikipedia.org/wiki/Newline) are stripped from each line.
|
|
2442
|
+
|
|
2443
|
+
@default `false` with `subprocess.iterable()`, `true` otherwise
|
|
2444
|
+
*/
|
|
2445
|
+
readonly preserveNewlines?: boolean;
|
|
2446
|
+
};
|
|
2447
|
+
// `subprocess.writable|duplex()` options
|
|
2448
|
+
type WritableOptions = {
|
|
2449
|
+
/**
|
|
2450
|
+
Which stream to write to the subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.
|
|
2451
|
+
|
|
2452
|
+
@default 'stdin'
|
|
2453
|
+
*/
|
|
2454
|
+
readonly to?: ToOption;
|
|
2455
|
+
};
|
|
2456
|
+
// `subprocess.duplex()` options
|
|
2457
|
+
type DuplexOptions = ReadableOptions & WritableOptions;
|
|
2458
|
+
// `subprocess.iterable()` return value
|
|
2459
|
+
type SubprocessAsyncIterable<BinaryOption extends boolean | undefined, EncodingOption extends Options$1['encoding']> = AsyncIterableIterator<EncodingOption extends BinaryEncodingOption ? Uint8Array : BinaryOption extends true ? Uint8Array : string>;
|
|
2460
|
+
//#endregion
|
|
2461
|
+
//#region ../../node_modules/execa/types/subprocess/stdout.d.ts
|
|
2462
|
+
// `subprocess.stdin|stdout|stderr|stdio`
|
|
2463
|
+
type SubprocessStdioStream<FdNumber extends string, OptionsType extends Options$1> = SubprocessStream<FdNumber, IgnoresSubprocessOutput<FdNumber, OptionsType>, OptionsType>;
|
|
2464
|
+
type SubprocessStream<FdNumber extends string, StreamResultIgnored, OptionsType extends Options$1> = StreamResultIgnored extends true ? null : InputOutputStream<IsInputFd<FdNumber, OptionsType>>;
|
|
2465
|
+
type InputOutputStream<IsInput extends boolean> = IsInput extends true ? Writable : Readable;
|
|
2466
|
+
//#endregion
|
|
2467
|
+
//#region ../../node_modules/execa/types/subprocess/stdio.d.ts
|
|
2468
|
+
// `subprocess.stdio`
|
|
2469
|
+
type SubprocessStdioArray<OptionsType extends Options$1> = MapStdioStreams<StdioOptionNormalizedArray<OptionsType>, OptionsType>;
|
|
2470
|
+
// We cannot use mapped types because it must be compatible with Node.js `ChildProcess["stdio"]` which uses a tuple with exactly 5 items
|
|
2471
|
+
type MapStdioStreams<StdioOptionsArrayType, OptionsType extends Options$1> = [SubprocessStdioStream<'0', OptionsType>, SubprocessStdioStream<'1', OptionsType>, SubprocessStdioStream<'2', OptionsType>, '3' extends keyof StdioOptionsArrayType ? SubprocessStdioStream<'3', OptionsType> : never, '4' extends keyof StdioOptionsArrayType ? SubprocessStdioStream<'4', OptionsType> : never];
|
|
2472
|
+
//#endregion
|
|
2473
|
+
//#region ../../node_modules/execa/types/subprocess/all.d.ts
|
|
2474
|
+
// `subprocess.all`
|
|
2475
|
+
type SubprocessAll<OptionsType extends Options$1> = AllStream<AllIgnored<OptionsType['all'], OptionsType>>;
|
|
2476
|
+
type AllStream<IsIgnored> = IsIgnored extends true ? undefined : Readable;
|
|
2477
|
+
type AllIgnored<AllOption, OptionsType extends Options$1> = AllOption extends true ? IgnoresSubprocessOutput<'1', OptionsType> extends true ? IgnoresSubprocessOutput<'2', OptionsType> : false : true;
|
|
2478
|
+
//#endregion
|
|
2479
|
+
//#region ../../node_modules/execa/types/subprocess/subprocess.d.ts
|
|
2480
|
+
// Read-side iteration, stream conversion and `all` methods.
|
|
2481
|
+
// These are shared between a subprocess and the return value of `subprocess.pipe()`, which forwards them from its destination subprocess.
|
|
2482
|
+
// `writable()`, `duplex()`, `writableStream()` and `transformStream()` are not included: they write to `stdin`, which the pipe already feeds from its source.
|
|
2483
|
+
type SubprocessResultMethods<OptionsType extends Options$1 = Options$1> = {
|
|
2484
|
+
/**
|
|
2485
|
+
Stream combining/interleaving `subprocess.stdout` and `subprocess.stderr`.
|
|
2486
|
+
|
|
2487
|
+
This requires the `all` option to be `true`.
|
|
2488
|
+
|
|
2489
|
+
This is `undefined` if `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
2490
|
+
*/
|
|
2491
|
+
all: SubprocessAll<OptionsType>;
|
|
2492
|
+
/**
|
|
2493
|
+
Subprocesses are [async iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator). They iterate over each output line.
|
|
2494
|
+
*/
|
|
2495
|
+
[Symbol.asyncIterator](): SubprocessAsyncIterable<undefined, OptionsType['encoding']>;
|
|
2496
|
+
/**
|
|
2497
|
+
Same as `subprocess[Symbol.asyncIterator]` except options can be provided.
|
|
2498
|
+
*/
|
|
2499
|
+
iterable<IterableOptions extends ReadableOptions = {}>(readableOptions?: IterableOptions): SubprocessAsyncIterable<IterableOptions['binary'], OptionsType['encoding']>;
|
|
2500
|
+
/**
|
|
2501
|
+
Converts the subprocess to a readable stream.
|
|
2502
|
+
*/
|
|
2503
|
+
readable(readableOptions?: ReadableOptions): Readable;
|
|
2504
|
+
/**
|
|
2505
|
+
Converts the subprocess to a readable [web stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
|
|
2506
|
+
*/
|
|
2507
|
+
readableStream(readableOptions?: ReadableOptions): ReadableStream;
|
|
2508
|
+
};
|
|
2509
|
+
type ExecaCustomSubprocess<OptionsType extends Options$1> = IpcMethods<HasIpc<OptionsType>, OptionsType['serialization']> & PipableSubprocess & SubprocessResultMethods<OptionsType> & {
|
|
2510
|
+
/**
|
|
2511
|
+
Process identifier ([PID](https://en.wikipedia.org/wiki/Process_identifier)).
|
|
2512
|
+
|
|
2513
|
+
This is `undefined` if the subprocess failed to spawn.
|
|
2514
|
+
*/
|
|
2515
|
+
pid?: number;
|
|
2516
|
+
/**
|
|
2517
|
+
The subprocess [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)) as a stream.
|
|
2518
|
+
|
|
2519
|
+
This is `null` if the `stdin` option is set to `'inherit'`, `'ignore'`, `Readable` or `integer`.
|
|
2520
|
+
*/
|
|
2521
|
+
stdin: SubprocessStdioStream<'0', OptionsType>;
|
|
2522
|
+
/**
|
|
2523
|
+
The subprocess [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)) as a stream.
|
|
2524
|
+
|
|
2525
|
+
This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
2526
|
+
*/
|
|
2527
|
+
stdout: SubprocessStdioStream<'1', OptionsType>;
|
|
2528
|
+
/**
|
|
2529
|
+
The subprocess [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) as a stream.
|
|
2530
|
+
|
|
2531
|
+
This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
2532
|
+
*/
|
|
2533
|
+
stderr: SubprocessStdioStream<'2', OptionsType>;
|
|
2534
|
+
/**
|
|
2535
|
+
The subprocess `stdin`, `stdout`, `stderr` and other files descriptors as an array of streams.
|
|
2536
|
+
|
|
2537
|
+
Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer`, or if the `buffer` option is `false`.
|
|
2538
|
+
*/
|
|
2539
|
+
stdio: SubprocessStdioArray<OptionsType>;
|
|
2540
|
+
/**
|
|
2541
|
+
Sends a [signal](https://nodejs.org/api/os.html#signal-constants) to the subprocess. The default signal is the `killSignal` option. `killSignal` defaults to `SIGTERM`, which terminates the subprocess.
|
|
2542
|
+
|
|
2543
|
+
This returns `false` when the signal could not be sent, for example when the subprocess has already exited.
|
|
2544
|
+
|
|
2545
|
+
When an error is passed as argument, it is set to the subprocess' `error.cause`. The subprocess is then terminated with the default signal. This does not emit the [`error` event](https://nodejs.org/api/child_process.html#event-error).
|
|
2546
|
+
|
|
2547
|
+
[More info.](https://nodejs.org/api/child_process.html#subprocesskillsignal)
|
|
2548
|
+
*/
|
|
2549
|
+
kill(signal?: keyof SignalConstants | number, error?: Error): boolean;
|
|
2550
|
+
kill(error?: Error): boolean;
|
|
2551
|
+
/**
|
|
2552
|
+
Converts the subprocess to a writable stream.
|
|
2553
|
+
*/
|
|
2554
|
+
writable(writableOptions?: WritableOptions): Writable;
|
|
2555
|
+
/**
|
|
2556
|
+
Converts the subprocess to a duplex stream.
|
|
2557
|
+
*/
|
|
2558
|
+
duplex(duplexOptions?: DuplexOptions): Duplex;
|
|
2559
|
+
/**
|
|
2560
|
+
Converts the subprocess to a writable [web stream](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).
|
|
2561
|
+
*/
|
|
2562
|
+
writableStream(writableOptions?: WritableOptions): WritableStream;
|
|
2563
|
+
/**
|
|
2564
|
+
Converts the subprocess to a [`{readable, writable}`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) pair of web streams.
|
|
2565
|
+
*/
|
|
2566
|
+
transformStream(duplexOptions?: DuplexOptions): ReadableWritablePair;
|
|
2567
|
+
/**
|
|
2568
|
+
Underlying Node.js [`ChildProcess`](https://nodejs.org/api/child_process.html#class-childprocess) instance.
|
|
2569
|
+
|
|
2570
|
+
This is an escape hatch for Node.js-specific APIs not documented by Execa, such as `.on()`, `.send()`, `.disconnect()`, `.ref()` or `.unref()`.
|
|
2571
|
+
*/
|
|
2572
|
+
nodeChildProcess: ChildProcess;
|
|
2573
|
+
};
|
|
2574
|
+
/**
|
|
2575
|
+
Subprocess with Execa-specific methods and properties. It is also a `Promise` either resolving with its successful `result`, or rejecting with its `error`.
|
|
2576
|
+
*/
|
|
2577
|
+
type Subprocess<OptionsType extends Options$1 = Options$1> = ExecaCustomSubprocess<OptionsType> & Promise<Result<OptionsType>>;
|
|
2578
|
+
/**
|
|
2579
|
+
The return value of all asynchronous methods is both:
|
|
2580
|
+
- the subprocess with Execa-specific methods and properties.
|
|
2581
|
+
- a `Promise` either resolving with its successful `result`, or rejecting with its `error`.
|
|
2582
|
+
*/
|
|
2583
|
+
type ResultPromise<OptionsType extends Options$1 = Options$1> = Subprocess<OptionsType>;
|
|
2584
|
+
//#endregion
|
|
2585
|
+
//#region ../../node_modules/execa/types/methods/main-async.d.ts
|
|
2586
|
+
/**
|
|
2587
|
+
Executes a command using `file ...arguments`.
|
|
2588
|
+
|
|
2589
|
+
When `command` is a template string, it includes both the `file` and its `arguments`.
|
|
2590
|
+
|
|
2591
|
+
`execa(options)` can be used to return a new instance of this method but with different default `options`. Consecutive calls are merged to previous ones.
|
|
2592
|
+
|
|
2593
|
+
@param file - The program/script to execute, as a string or file URL
|
|
2594
|
+
@param arguments - Arguments to pass to `file` on execution.
|
|
2595
|
+
@returns A `ResultPromise` that is both:
|
|
2596
|
+
- the subprocess.
|
|
2597
|
+
- a `Promise` either resolving with its successful `result`, or rejecting with its `error`.
|
|
2598
|
+
@throws `ExecaError`
|
|
2599
|
+
|
|
2600
|
+
@example <caption>Simple syntax</caption>
|
|
2601
|
+
|
|
2602
|
+
```
|
|
2603
|
+
import {execa} from 'execa';
|
|
2604
|
+
|
|
2605
|
+
const {stdout} = await execa`npm run build`;
|
|
2606
|
+
// Print command's output
|
|
2607
|
+
console.log(stdout);
|
|
2608
|
+
```
|
|
2609
|
+
|
|
2610
|
+
@example <caption>Script</caption>
|
|
2611
|
+
|
|
2612
|
+
```
|
|
2613
|
+
import {$} from 'execa';
|
|
2614
|
+
|
|
2615
|
+
const {stdout: name} = await $`cat package.json`.pipe`grep name`;
|
|
2616
|
+
console.log(name);
|
|
2617
|
+
|
|
2618
|
+
const branch = await $`git branch --show-current`;
|
|
2619
|
+
await $`dep deploy --branch=${branch}`;
|
|
2620
|
+
|
|
2621
|
+
await Promise.all([
|
|
2622
|
+
$`sleep 1`,
|
|
2623
|
+
$`sleep 2`,
|
|
2624
|
+
$`sleep 3`,
|
|
2625
|
+
]);
|
|
2626
|
+
|
|
2627
|
+
const directoryName = 'foo bar';
|
|
2628
|
+
await $`mkdir /tmp/${directoryName}`;
|
|
2629
|
+
```
|
|
2630
|
+
|
|
2631
|
+
@example <caption>Local binaries</caption>
|
|
2632
|
+
|
|
2633
|
+
```
|
|
2634
|
+
$ npm install -D eslint
|
|
2635
|
+
```
|
|
2636
|
+
|
|
2637
|
+
```
|
|
2638
|
+
await execa({preferLocal: true})`eslint`;
|
|
2639
|
+
```
|
|
2640
|
+
|
|
2641
|
+
@example <caption>Pipe multiple subprocesses</caption>
|
|
2642
|
+
|
|
2643
|
+
```
|
|
2644
|
+
const {stdout, pipedFrom} = await execa`npm run build`
|
|
2645
|
+
.pipe`sort`
|
|
2646
|
+
.pipe`head -n 2`;
|
|
2647
|
+
|
|
2648
|
+
// Output of `npm run build | sort | head -n 2`
|
|
2649
|
+
console.log(stdout);
|
|
2650
|
+
// Output of `npm run build | sort`
|
|
2651
|
+
console.log(pipedFrom[0].stdout);
|
|
2652
|
+
// Output of `npm run build`
|
|
2653
|
+
console.log(pipedFrom[0].pipedFrom[0].stdout);
|
|
2654
|
+
```
|
|
2655
|
+
|
|
2656
|
+
@example <caption>Interleaved output</caption>
|
|
2657
|
+
|
|
2658
|
+
```
|
|
2659
|
+
const {all} = await execa({all: true})`npm run build`;
|
|
2660
|
+
// stdout + stderr, interleaved
|
|
2661
|
+
console.log(all);
|
|
2662
|
+
```
|
|
2663
|
+
|
|
2664
|
+
@example <caption>Programmatic + terminal output</caption>
|
|
2665
|
+
|
|
2666
|
+
```
|
|
2667
|
+
const {stdout} = await execa({stdout: ['pipe', 'inherit']})`npm run build`;
|
|
2668
|
+
// stdout is also printed to the terminal
|
|
2669
|
+
console.log(stdout);
|
|
2670
|
+
```
|
|
2671
|
+
|
|
2672
|
+
@example <caption>Simple input</caption>
|
|
2673
|
+
|
|
2674
|
+
```
|
|
2675
|
+
const getInputString = () => { /* ... *\/ };
|
|
2676
|
+
const {stdout} = await execa({input: getInputString()})`sort`;
|
|
2677
|
+
console.log(stdout);
|
|
2678
|
+
```
|
|
2679
|
+
|
|
2680
|
+
@example <caption>File input</caption>
|
|
2681
|
+
|
|
2682
|
+
```
|
|
2683
|
+
// Similar to: npm run build < input.txt
|
|
2684
|
+
await execa({stdin: {file: 'input.txt'}})`npm run build`;
|
|
2685
|
+
```
|
|
2686
|
+
|
|
2687
|
+
@example <caption>File output</caption>
|
|
2688
|
+
|
|
2689
|
+
```
|
|
2690
|
+
// Similar to: npm run build > output.txt
|
|
2691
|
+
await execa({stdout: {file: 'output.txt'}})`npm run build`;
|
|
2692
|
+
```
|
|
2693
|
+
|
|
2694
|
+
@example <caption>Split into text lines</caption>
|
|
2695
|
+
|
|
2696
|
+
```
|
|
2697
|
+
const {stdout} = await execa({lines: true})`npm run build`;
|
|
2698
|
+
// Print first 10 lines
|
|
2699
|
+
console.log(stdout.slice(0, 10).join('\n'));
|
|
2700
|
+
```
|
|
2701
|
+
|
|
2702
|
+
@example <caption>Iterate over text lines</caption>
|
|
2703
|
+
|
|
2704
|
+
```
|
|
2705
|
+
for await (const line of execa`npm run build`) {
|
|
2706
|
+
if (line.includes('WARN')) {
|
|
2707
|
+
console.warn(line);
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
```
|
|
2711
|
+
|
|
2712
|
+
@example <caption>Transform/filter output</caption>
|
|
2713
|
+
|
|
2714
|
+
```
|
|
2715
|
+
let count = 0;
|
|
2716
|
+
|
|
2717
|
+
// Filter out secret lines, then prepend the line number
|
|
2718
|
+
const transform = function * (line) {
|
|
2719
|
+
if (!line.includes('secret')) {
|
|
2720
|
+
yield `[${count++}] ${line}`;
|
|
2721
|
+
}
|
|
2722
|
+
};
|
|
2723
|
+
|
|
2724
|
+
await execa({stdout: transform})`npm run build`;
|
|
2725
|
+
```
|
|
2726
|
+
|
|
2727
|
+
@example <caption>Web streams</caption>
|
|
2728
|
+
|
|
2729
|
+
```
|
|
2730
|
+
const response = await fetch('https://example.com');
|
|
2731
|
+
await execa({stdin: response.body})`sort`;
|
|
2732
|
+
```
|
|
2733
|
+
|
|
2734
|
+
@example <caption>Convert to Duplex stream</caption>
|
|
2735
|
+
|
|
2736
|
+
```
|
|
2737
|
+
import {execa} from 'execa';
|
|
2738
|
+
import {pipeline} from 'node:stream/promises';
|
|
2739
|
+
import {createReadStream, createWriteStream} from 'node:fs';
|
|
2740
|
+
|
|
2741
|
+
await pipeline(
|
|
2742
|
+
createReadStream('./input.txt'),
|
|
2743
|
+
execa`node ./transform.js`.duplex(),
|
|
2744
|
+
createWriteStream('./output.txt'),
|
|
2745
|
+
);
|
|
2746
|
+
```
|
|
2747
|
+
|
|
2748
|
+
@example <caption>Exchange messages</caption>
|
|
2749
|
+
|
|
2750
|
+
```
|
|
2751
|
+
// parent.js
|
|
2752
|
+
import {execaNode} from 'execa';
|
|
2753
|
+
|
|
2754
|
+
const subprocess = execaNode`child.js`;
|
|
2755
|
+
await subprocess.sendMessage('Hello from parent');
|
|
2756
|
+
const message = await subprocess.getOneMessage();
|
|
2757
|
+
console.log(message); // 'Hello from child'
|
|
2758
|
+
```
|
|
2759
|
+
|
|
2760
|
+
```
|
|
2761
|
+
// child.js
|
|
2762
|
+
import {getOneMessage, sendMessage} from 'execa';
|
|
2763
|
+
|
|
2764
|
+
const message = await getOneMessage(); // 'Hello from parent'
|
|
2765
|
+
const newMessage = message.replace('parent', 'child'); // 'Hello from child'
|
|
2766
|
+
await sendMessage(newMessage);
|
|
2767
|
+
```
|
|
2768
|
+
|
|
2769
|
+
@example <caption>Any input type</caption>
|
|
2770
|
+
|
|
2771
|
+
```
|
|
2772
|
+
// main.js
|
|
2773
|
+
import {execaNode} from 'execa';
|
|
2774
|
+
|
|
2775
|
+
const ipcInput = [
|
|
2776
|
+
{task: 'lint', ignore: /test\.js/},
|
|
2777
|
+
{task: 'copy', files: new Set(['main.js', 'index.js']),
|
|
2778
|
+
}];
|
|
2779
|
+
await execaNode({ipcInput})`build.js`;
|
|
2780
|
+
```
|
|
2781
|
+
|
|
2782
|
+
```
|
|
2783
|
+
// build.js
|
|
2784
|
+
import {getOneMessage} from 'execa';
|
|
2785
|
+
|
|
2786
|
+
const ipcInput = await getOneMessage();
|
|
2787
|
+
```
|
|
2788
|
+
|
|
2789
|
+
@example <caption>Any output type</caption>
|
|
2790
|
+
|
|
2791
|
+
```
|
|
2792
|
+
// main.js
|
|
2793
|
+
import {execaNode} from 'execa';
|
|
2794
|
+
|
|
2795
|
+
const {ipcOutput} = await execaNode`build.js`;
|
|
2796
|
+
console.log(ipcOutput[0]); // {kind: 'start', timestamp: date}
|
|
2797
|
+
console.log(ipcOutput[1]); // {kind: 'stop', timestamp: date}
|
|
2798
|
+
```
|
|
2799
|
+
|
|
2800
|
+
```
|
|
2801
|
+
// build.js
|
|
2802
|
+
import {sendMessage} from 'execa';
|
|
2803
|
+
|
|
2804
|
+
const runBuild = () => { /* ... *\/ };
|
|
2805
|
+
|
|
2806
|
+
await sendMessage({kind: 'start', timestamp: new Date()});
|
|
2807
|
+
await runBuild();
|
|
2808
|
+
await sendMessage({kind: 'stop', timestamp: new Date()});
|
|
2809
|
+
```
|
|
2810
|
+
|
|
2811
|
+
@example <caption>Graceful termination</caption>
|
|
2812
|
+
|
|
2813
|
+
```
|
|
2814
|
+
// main.js
|
|
2815
|
+
import {execaNode} from 'execa';
|
|
2816
|
+
|
|
2817
|
+
const controller = new AbortController();
|
|
2818
|
+
setTimeout(() => {
|
|
2819
|
+
controller.abort();
|
|
2820
|
+
}, 5000);
|
|
2821
|
+
|
|
2822
|
+
await execaNode({
|
|
2823
|
+
cancelSignal: controller.signal,
|
|
2824
|
+
gracefulCancel: true,
|
|
2825
|
+
})`build.js`;
|
|
2826
|
+
```
|
|
2827
|
+
|
|
2828
|
+
```
|
|
2829
|
+
// build.js
|
|
2830
|
+
import {getCancelSignal} from 'execa';
|
|
2831
|
+
|
|
2832
|
+
const cancelSignal = await getCancelSignal();
|
|
2833
|
+
const url = 'https://example.com/build/info';
|
|
2834
|
+
const response = await fetch(url, {signal: cancelSignal});
|
|
2835
|
+
```
|
|
2836
|
+
|
|
2837
|
+
@example <caption>Detailed error</caption>
|
|
2838
|
+
|
|
2839
|
+
```
|
|
2840
|
+
import {execa, ExecaError} from 'execa';
|
|
2841
|
+
|
|
2842
|
+
try {
|
|
2843
|
+
await execa`unknown command`;
|
|
2844
|
+
} catch (error) {
|
|
2845
|
+
if (error instanceof ExecaError) {
|
|
2846
|
+
console.log(error);
|
|
2847
|
+
}
|
|
2848
|
+
/*
|
|
2849
|
+
ExecaError: Command failed with ENOENT: unknown command
|
|
2850
|
+
spawn unknown ENOENT
|
|
2851
|
+
at ...
|
|
2852
|
+
at ... {
|
|
2853
|
+
shortMessage: 'Command failed with ENOENT: unknown command\nspawn unknown ENOENT',
|
|
2854
|
+
originalMessage: 'spawn unknown ENOENT',
|
|
2855
|
+
command: 'unknown command',
|
|
2856
|
+
escapedCommand: 'unknown command',
|
|
2857
|
+
cwd: '/path/to/cwd',
|
|
2858
|
+
durationMs: 28.217566,
|
|
2859
|
+
failed: true,
|
|
2860
|
+
timedOut: false,
|
|
2861
|
+
isCanceled: false,
|
|
2862
|
+
isTerminated: false,
|
|
2863
|
+
isMaxBuffer: false,
|
|
2864
|
+
code: 'ENOENT',
|
|
2865
|
+
stdout: '',
|
|
2866
|
+
stderr: '',
|
|
2867
|
+
stdio: [undefined, '', ''],
|
|
2868
|
+
pipedFrom: []
|
|
2869
|
+
[cause]: Error: spawn unknown ENOENT
|
|
2870
|
+
at ...
|
|
2871
|
+
at ... {
|
|
2872
|
+
errno: -2,
|
|
2873
|
+
code: 'ENOENT',
|
|
2874
|
+
syscall: 'spawn unknown',
|
|
2875
|
+
path: 'unknown',
|
|
2876
|
+
spawnargs: [ 'command' ]
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
*\/
|
|
2880
|
+
}
|
|
2881
|
+
```
|
|
2882
|
+
|
|
2883
|
+
@example <caption>Verbose mode</caption>
|
|
2884
|
+
|
|
2885
|
+
```
|
|
2886
|
+
await execa`npm run build`;
|
|
2887
|
+
await execa`npm run test`;
|
|
2888
|
+
```
|
|
2889
|
+
|
|
2890
|
+
```
|
|
2891
|
+
$ NODE_DEBUG=execa node build.js
|
|
2892
|
+
[00:57:44.581] [0] $ npm run build
|
|
2893
|
+
[00:57:44.653] [0] Building application...
|
|
2894
|
+
[00:57:44.653] [0] Done building.
|
|
2895
|
+
[00:57:44.658] [0] ✔ (done in 78ms)
|
|
2896
|
+
[00:57:44.658] [1] $ npm run test
|
|
2897
|
+
[00:57:44.740] [1] Running tests...
|
|
2898
|
+
[00:57:44.740] [1] Error: the entrypoint is invalid.
|
|
2899
|
+
[00:57:44.747] [1] ✘ Command failed with exit code 1: npm run test
|
|
2900
|
+
[00:57:44.747] [1] ✘ (done in 89ms)
|
|
2901
|
+
```
|
|
2902
|
+
|
|
2903
|
+
@example <caption>Custom logging</caption>
|
|
2904
|
+
|
|
2905
|
+
```
|
|
2906
|
+
import {execa as execa_} from 'execa';
|
|
2907
|
+
import {createLogger, transports} from 'winston';
|
|
2908
|
+
|
|
2909
|
+
// Log to a file using Winston
|
|
2910
|
+
const transport = new transports.File({filename: 'logs.txt'});
|
|
2911
|
+
const logger = createLogger({transports: [transport]});
|
|
2912
|
+
const LOG_LEVELS = {
|
|
2913
|
+
command: 'info',
|
|
2914
|
+
output: 'verbose',
|
|
2915
|
+
ipc: 'verbose',
|
|
2916
|
+
error: 'error',
|
|
2917
|
+
duration: 'info',
|
|
2918
|
+
};
|
|
2919
|
+
|
|
2920
|
+
const execa = execa_({
|
|
2921
|
+
verbose(verboseLine, {message, ...verboseObject}) {
|
|
2922
|
+
const level = LOG_LEVELS[verboseObject.type];
|
|
2923
|
+
logger[level](message, verboseObject);
|
|
2924
|
+
},
|
|
2925
|
+
});
|
|
2926
|
+
|
|
2927
|
+
await execa`npm run build`;
|
|
2928
|
+
await execa`npm run test`;
|
|
2929
|
+
```
|
|
2930
|
+
*/
|
|
2931
|
+
declare const execa: ExecaMethod<{}>;
|
|
2932
|
+
/**
|
|
2933
|
+
`execa()` method either exported by Execa, or bound using `execa(options)`.
|
|
2934
|
+
*/
|
|
2935
|
+
type ExecaMethod<OptionsType extends Options$1 = Options$1> = ExecaBind<OptionsType> & ExecaTemplate<OptionsType> & ExecaArrayLong<OptionsType> & ExecaArrayShort<OptionsType>;
|
|
2936
|
+
// `execa(options)` binding
|
|
2937
|
+
type ExecaBind<OptionsType extends Options$1> = <NewOptionsType extends Options$1 = {}>(options: NewOptionsType) => ExecaMethod<OptionsType & NewOptionsType>;
|
|
2938
|
+
// `execa`command`` template syntax
|
|
2939
|
+
type ExecaTemplate<OptionsType extends Options$1> = (...templateString: TemplateString) => ResultPromise<OptionsType>;
|
|
2940
|
+
// `execa('file', ['argument'], {})` array syntax
|
|
2941
|
+
type ExecaArrayLong<OptionsType extends Options$1> = <NewOptionsType extends Options$1 = {}>(file: string | URL, arguments?: readonly string[], options?: NewOptionsType) => ResultPromise<OptionsType & NewOptionsType>;
|
|
2942
|
+
// `execa('file', {})` array syntax
|
|
2943
|
+
type ExecaArrayShort<OptionsType extends Options$1> = <NewOptionsType extends Options$1 = {}>(file: string | URL, options?: NewOptionsType) => ResultPromise<OptionsType & NewOptionsType>;
|
|
2944
|
+
//#endregion
|
|
2945
|
+
//#region ../../node_modules/execa/types/methods/main-sync.d.ts
|
|
2946
|
+
/**
|
|
2947
|
+
Same as `execa()` but synchronous.
|
|
2948
|
+
|
|
2949
|
+
Returns a subprocess `result` or throws an `error`. The `subprocess` is not returned: its methods and properties are not available.
|
|
2950
|
+
|
|
2951
|
+
When `command` is a template string, it includes both the `file` and its `arguments`.
|
|
2952
|
+
|
|
2953
|
+
`execaSync(options)` can be used to return a new instance of this method but with different default `options`. Consecutive calls are merged to previous ones.
|
|
2954
|
+
|
|
2955
|
+
This method is discouraged as it holds the CPU and lacks multiple features.
|
|
2956
|
+
|
|
2957
|
+
@param file - The program/script to execute, as a string or file URL
|
|
2958
|
+
@param arguments - Arguments to pass to `file` on execution.
|
|
2959
|
+
@returns `SyncResult`
|
|
2960
|
+
@throws `ExecaSyncError`
|
|
2961
|
+
|
|
2962
|
+
@example
|
|
2963
|
+
|
|
2964
|
+
```
|
|
2965
|
+
import {execaSync} from 'execa';
|
|
2966
|
+
|
|
2967
|
+
const {stdout} = execaSync`npm run build`;
|
|
2968
|
+
// Print command's output
|
|
2969
|
+
console.log(stdout);
|
|
2970
|
+
```
|
|
2971
|
+
*/
|
|
2972
|
+
declare const execaSync: ExecaSyncMethod<{}>;
|
|
2973
|
+
// For the moment, we purposely do not export `ExecaSyncMethod` and `ExecaScriptSyncMethod`.
|
|
2974
|
+
// This is because synchronous invocation is discouraged.
|
|
2975
|
+
type ExecaSyncMethod<OptionsType extends SyncOptions = SyncOptions> = ExecaSyncBind<OptionsType> & ExecaSyncTemplate<OptionsType> & ExecaSyncArrayLong<OptionsType> & ExecaSyncArrayShort<OptionsType>;
|
|
2976
|
+
// `execaSync(options)` binding
|
|
2977
|
+
type ExecaSyncBind<OptionsType extends SyncOptions> = <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType) => ExecaSyncMethod<OptionsType & NewOptionsType>;
|
|
2978
|
+
// `execaSync`command`` template syntax
|
|
2979
|
+
type ExecaSyncTemplate<OptionsType extends SyncOptions> = (...templateString: TemplateString) => SyncResult<OptionsType>;
|
|
2980
|
+
// `execaSync('file', ['argument'], {})` array syntax
|
|
2981
|
+
type ExecaSyncArrayLong<OptionsType extends SyncOptions> = <NewOptionsType extends SyncOptions = {}>(file: string | URL, arguments?: readonly string[], options?: NewOptionsType) => SyncResult<OptionsType & NewOptionsType>;
|
|
2982
|
+
// `execaSync('file', {})` array syntax
|
|
2983
|
+
type ExecaSyncArrayShort<OptionsType extends SyncOptions> = <NewOptionsType extends SyncOptions = {}>(file: string | URL, options?: NewOptionsType) => SyncResult<OptionsType & NewOptionsType>;
|
|
1787
2984
|
//#endregion
|
|
1788
2985
|
//#region src/common/cli/cli.d.ts
|
|
1789
2986
|
type RunOptions = Record<string, unknown>;
|
|
2987
|
+
type CliSyncResult = ReturnType<typeof execaSync>;
|
|
1790
2988
|
interface CliResult extends Promise<unknown> {
|
|
1791
2989
|
toObservable(opt?: RunOptions): Observable<string>;
|
|
1792
|
-
toStream(opt?: RunOptions): execa
|
|
2990
|
+
toStream(opt?: RunOptions): ReturnType<typeof execa>;
|
|
1793
2991
|
cwd(cwd: string): CliResult;
|
|
1794
|
-
sync(opt?: RunOptions):
|
|
2992
|
+
sync(opt?: RunOptions): CliSyncResult;
|
|
1795
2993
|
getRaw(opt?: RunOptions): string;
|
|
1796
2994
|
get(opt?: RunOptions): string;
|
|
1797
2995
|
}
|
|
1798
2996
|
declare class Cli {
|
|
1799
2997
|
cmd: string;
|
|
1800
2998
|
constructor(cmd: string);
|
|
1801
|
-
sync(...args: string[]):
|
|
2999
|
+
sync(...args: string[]): CliSyncResult;
|
|
1802
3000
|
run(...args: string[]): CliResult;
|
|
1803
3001
|
get(...args: string[]): string;
|
|
1804
3002
|
static run(cmd: string, args?: string[], options?: RunOptions): CliResult;
|
|
@@ -1808,8 +3006,8 @@ declare class Cli {
|
|
|
1808
3006
|
//#region src/common/cli/bun.d.ts
|
|
1809
3007
|
declare class BunCli extends Cli {
|
|
1810
3008
|
constructor();
|
|
1811
|
-
newVersion(version: string):
|
|
1812
|
-
pm(...args: string[]):
|
|
3009
|
+
newVersion(version: string): CliSyncResult;
|
|
3010
|
+
pm(...args: string[]): CliSyncResult;
|
|
1813
3011
|
run(...args: string[]): CliResult;
|
|
1814
3012
|
install(...args: string[]): CliResult;
|
|
1815
3013
|
/**
|
|
@@ -1824,7 +3022,7 @@ declare const bun: BunCli;
|
|
|
1824
3022
|
declare class DockerCli extends Cli {
|
|
1825
3023
|
constructor();
|
|
1826
3024
|
tag(...args: string[]): string;
|
|
1827
|
-
login(...args: string[]):
|
|
3025
|
+
login(...args: string[]): CliSyncResult;
|
|
1828
3026
|
push(...args: string[]): CliResult;
|
|
1829
3027
|
getToken(username: string, password: string): Promise<any>;
|
|
1830
3028
|
getTags({ token, repository }: {
|
|
@@ -1843,7 +3041,7 @@ declare class GitCli extends Cli {
|
|
|
1843
3041
|
constructor();
|
|
1844
3042
|
init(...args: string[]): CliResult;
|
|
1845
3043
|
add(...args: string[]): CliResult;
|
|
1846
|
-
status(...args: string[]):
|
|
3044
|
+
status(...args: string[]): CliSyncResult;
|
|
1847
3045
|
branch(...args: string[]): CliResult;
|
|
1848
3046
|
clean(...args: string[]): CliResult;
|
|
1849
3047
|
config(...args: string[]): string;
|
|
@@ -1851,8 +3049,8 @@ declare class GitCli extends Cli {
|
|
|
1851
3049
|
commit(...args: string[]): CliResult;
|
|
1852
3050
|
fetch(...args: string[]): CliResult;
|
|
1853
3051
|
prune(...args: string[]): CliResult;
|
|
1854
|
-
merge(...args: string[]):
|
|
1855
|
-
reset(...args: string[]):
|
|
3052
|
+
merge(...args: string[]): CliSyncResult;
|
|
3053
|
+
reset(...args: string[]): CliSyncResult;
|
|
1856
3054
|
remote(...args: string[]): CliResult;
|
|
1857
3055
|
rebase(...args: string[]): CliResult;
|
|
1858
3056
|
getCommitTag(ref?: string): string;
|
|
@@ -1875,8 +3073,8 @@ declare const git: GitCli;
|
|
|
1875
3073
|
//#region src/common/cli/lerna.d.ts
|
|
1876
3074
|
declare class LernaCli extends Cli {
|
|
1877
3075
|
constructor();
|
|
1878
|
-
newVersion(version: string):
|
|
1879
|
-
version(...args: string[]):
|
|
3076
|
+
newVersion(version: string): CliSyncResult;
|
|
3077
|
+
version(...args: string[]): CliSyncResult;
|
|
1880
3078
|
run(...args: string[]): CliResult;
|
|
1881
3079
|
install(...args: string[]): CliResult;
|
|
1882
3080
|
}
|
|
@@ -1885,8 +3083,8 @@ declare const lerna: LernaCli;
|
|
|
1885
3083
|
//#region src/common/cli/npm.d.ts
|
|
1886
3084
|
declare class NpmCli extends Cli {
|
|
1887
3085
|
constructor();
|
|
1888
|
-
newVersion(version: string):
|
|
1889
|
-
version(...args: string[]):
|
|
3086
|
+
newVersion(version: string): CliSyncResult;
|
|
3087
|
+
version(...args: string[]): CliSyncResult;
|
|
1890
3088
|
run(...args: string[]): CliResult;
|
|
1891
3089
|
install(...args: string[]): CliResult;
|
|
1892
3090
|
publish(...args: string[]): CliResult;
|
|
@@ -1902,8 +3100,8 @@ declare const npm: NpmCli;
|
|
|
1902
3100
|
//#region src/common/cli/pnpm.d.ts
|
|
1903
3101
|
declare class PnpmCli extends Cli {
|
|
1904
3102
|
constructor();
|
|
1905
|
-
newVersion(version: string):
|
|
1906
|
-
version(...args: string[]):
|
|
3103
|
+
newVersion(version: string): CliSyncResult;
|
|
3104
|
+
version(...args: string[]): CliSyncResult;
|
|
1907
3105
|
run(...args: string[]): CliResult;
|
|
1908
3106
|
install(...args: string[]): CliResult;
|
|
1909
3107
|
/**
|
|
@@ -1917,8 +3115,8 @@ declare const pnpm: PnpmCli;
|
|
|
1917
3115
|
//#region src/common/cli/yarn.d.ts
|
|
1918
3116
|
declare class YarnCli extends Cli {
|
|
1919
3117
|
constructor();
|
|
1920
|
-
newVersion(version: string):
|
|
1921
|
-
version(...args: string[]):
|
|
3118
|
+
newVersion(version: string): CliSyncResult;
|
|
3119
|
+
version(...args: string[]): CliSyncResult;
|
|
1922
3120
|
run(...args: string[]): CliResult;
|
|
1923
3121
|
install(...args: string[]): CliResult;
|
|
1924
3122
|
/**
|
|
@@ -1936,45 +3134,13 @@ declare function configureGitWorkspace(context: CmContext): void;
|
|
|
1936
3134
|
declare function getPackageJson(): PackageJson;
|
|
1937
3135
|
//#endregion
|
|
1938
3136
|
//#region src/common/get-package-manager.d.ts
|
|
1939
|
-
|
|
1940
|
-
newVersion(version: string):
|
|
1941
|
-
pm(...args: string[]): undefined<string>;
|
|
3137
|
+
interface PackageManager extends Cli {
|
|
3138
|
+
newVersion(version: string): CliSyncResult;
|
|
1942
3139
|
run(...args: string[]): CliResult;
|
|
1943
3140
|
install(...args: string[]): CliResult;
|
|
1944
3141
|
restore(): CliResult;
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
get(...args: string[]): string;
|
|
1948
|
-
} | {
|
|
1949
|
-
cmd: string;
|
|
1950
|
-
newVersion(version: string): undefined<string>;
|
|
1951
|
-
version(...args: string[]): undefined<string>;
|
|
1952
|
-
run(...args: string[]): CliResult;
|
|
1953
|
-
install(...args: string[]): CliResult;
|
|
1954
|
-
publish(...args: string[]): CliResult;
|
|
1955
|
-
pack(...args: string[]): CliResult;
|
|
1956
|
-
restore(): CliResult;
|
|
1957
|
-
sync(...args: string[]): undefined<string>;
|
|
1958
|
-
get(...args: string[]): string;
|
|
1959
|
-
} | {
|
|
1960
|
-
newVersion(version: string): undefined<string>;
|
|
1961
|
-
version(...args: string[]): undefined<string>;
|
|
1962
|
-
run(...args: string[]): CliResult;
|
|
1963
|
-
install(...args: string[]): CliResult;
|
|
1964
|
-
restore(): CliResult;
|
|
1965
|
-
cmd: string;
|
|
1966
|
-
sync(...args: string[]): undefined<string>;
|
|
1967
|
-
get(...args: string[]): string;
|
|
1968
|
-
} | {
|
|
1969
|
-
newVersion(version: string): undefined<string>;
|
|
1970
|
-
version(...args: string[]): undefined<string>;
|
|
1971
|
-
run(...args: string[]): CliResult;
|
|
1972
|
-
install(...args: string[]): CliResult;
|
|
1973
|
-
restore(): CliResult;
|
|
1974
|
-
cmd: string;
|
|
1975
|
-
sync(...args: string[]): undefined<string>;
|
|
1976
|
-
get(...args: string[]): string;
|
|
1977
|
-
};
|
|
3142
|
+
}
|
|
3143
|
+
declare function getPackageManager(pkgManager: string): PackageManager;
|
|
1978
3144
|
//#endregion
|
|
1979
3145
|
//#region src/common/run-command.d.ts
|
|
1980
3146
|
declare function runCommand(klass: CommandConstructor, opts: Record<string, any>): Promise<void>;
|
|
@@ -1988,7 +3154,7 @@ interface ConditionalPluginOptions {
|
|
|
1988
3154
|
[key: string]: unknown;
|
|
1989
3155
|
}
|
|
1990
3156
|
type Plugin = string | [string, ConditionalPluginOptions];
|
|
1991
|
-
interface CmReleaseConfig extends Options
|
|
3157
|
+
interface CmReleaseConfig extends Options {
|
|
1992
3158
|
verifyConditions?: readonly Plugin[];
|
|
1993
3159
|
analyzeCommits?: readonly Plugin[];
|
|
1994
3160
|
verifyRelease?: readonly Plugin[];
|
|
@@ -2062,5 +3228,5 @@ declare global {
|
|
|
2062
3228
|
const __VERSION__: string;
|
|
2063
3229
|
}
|
|
2064
3230
|
//#endregion
|
|
2065
|
-
export { Cli, CliConfig, CliResult, CmReleaseConfig, ConditionalPluginOptions, ReleasePluginContext, WORKFLOW_CONFIGURATION, bun, index_d_exports as commands, configureGitWorkspace, defineConfig, docker, getCI, getConfig, getPackageJson, getPackageManager, git, lerna, npm, pnpm, release, releaseRules, runCommand, transformWriter, yarn };
|
|
3231
|
+
export { Cli, CliConfig, CliResult, CliSyncResult, CmReleaseConfig, ConditionalPluginOptions, PackageManager, ReleasePluginContext, WORKFLOW_CONFIGURATION, bun, index_d_exports as commands, configureGitWorkspace, defineConfig, docker, getCI, getConfig, getPackageJson, getPackageManager, git, lerna, npm, pnpm, release, releaseRules, runCommand, transformWriter, yarn };
|
|
2066
3232
|
//# sourceMappingURL=index.d.mts.map
|