@cmflow/cli 3.4.0-beta.3 → 3.4.0-beta.31
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/README.md +11 -14
- package/dist/bin/cm.mjs +13856 -6412
- 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-C3W4j84x.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-BM66YJe3.mjs → docker-clean-tags-4Z1VHhE4.mjs} +4 -2
- package/dist/{docker-clean-tags-BM66YJe3.mjs.map → docker-clean-tags-4Z1VHhE4.mjs.map} +1 -1
- package/dist/{docker-publish-DCVRkc5l.mjs → docker-publish-BFuDmUA1.mjs} +4 -2
- package/dist/{docker-publish-DCVRkc5l.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-B7dZdFg6.d.mts +267 -0
- package/dist/index.d.mts +3232 -0
- package/dist/index.mjs +38 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{npm-DHki_SHg.mjs → npm-CN1gb9zd.mjs} +4 -2
- package/dist/npm-CN1gb9zd.mjs.map +1 -0
- package/dist/rolldown-runtime-DQqWX4ve.mjs +3 -0
- package/dist/semantic/core/analyze-commits.d.mts +7 -0
- package/dist/semantic/core/analyze-commits.mjs +4 -0
- package/dist/semantic/core/analyze-commits.mjs.map +1 -0
- package/dist/semantic/core/conditional.d.mts +16 -0
- package/dist/semantic/core/conditional.mjs +4 -0
- package/dist/semantic/core/conditional.mjs.map +1 -0
- package/dist/semantic/core/exit.d.mts +7 -0
- package/dist/semantic/core/exit.mjs +4 -0
- package/dist/semantic/core/exit.mjs.map +1 -0
- package/dist/semantic/core/prepare/artifacts.d.mts +7 -0
- package/dist/semantic/core/prepare/artifacts.mjs +4 -0
- package/dist/semantic/core/prepare/artifacts.mjs.map +1 -0
- package/dist/semantic/core/prepare/bump-version.d.mts +7 -0
- package/dist/semantic/core/prepare/bump-version.mjs +4 -0
- package/dist/semantic/core/prepare/bump-version.mjs.map +1 -0
- package/dist/semantic/core/prepare/commit.d.mts +7 -0
- package/dist/semantic/core/prepare/commit.mjs +4 -0
- package/dist/semantic/core/prepare/commit.mjs.map +1 -0
- package/dist/semantic/core/prepare/release-info.d.mts +9 -0
- package/dist/semantic/core/prepare/release-info.mjs +4 -0
- package/dist/semantic/core/prepare/release-info.mjs.map +1 -0
- package/dist/semantic/core/publish-packages.d.mts +11 -0
- package/dist/semantic/core/publish-packages.mjs +7 -0
- package/dist/semantic/core/publish-packages.mjs.map +1 -0
- package/dist/semantic/core/push-release.d.mts +8 -0
- package/dist/semantic/core/push-release.mjs +4 -0
- package/dist/semantic/core/push-release.mjs.map +1 -0
- package/dist/semantic/core/run.d.mts +14 -0
- package/dist/semantic/core/run.mjs +4 -0
- package/dist/semantic/core/run.mjs.map +1 -0
- package/dist/semantic/core/sync-repository.d.mts +7 -0
- package/dist/semantic/core/sync-repository.mjs +4 -0
- package/dist/semantic/core/sync-repository.mjs.map +1 -0
- package/dist/semantic/core/verify-conditions.d.mts +7 -0
- package/dist/semantic/core/verify-conditions.mjs +4 -0
- package/dist/semantic/core/verify-conditions.mjs.map +1 -0
- package/dist/semantic/core/verify-release.d.mts +7 -0
- package/dist/semantic/core/verify-release.mjs +4 -0
- package/dist/semantic/core/verify-release.mjs.map +1 -0
- package/dist/semantic/docker/publish.d.mts +7 -0
- package/dist/semantic/docker/publish.mjs +4 -0
- package/dist/semantic/docker/publish.mjs.map +1 -0
- package/dist/semantic/docker/success.d.mts +7 -0
- package/dist/semantic/docker/success.mjs +4 -0
- package/dist/semantic/docker/success.mjs.map +1 -0
- package/dist/semver-BEj6Vrs4.mjs +4 -0
- package/dist/{semver-DfG5T6W4.mjs.map → semver-BEj6Vrs4.mjs.map} +1 -1
- package/dist/source-DKfioGh_.mjs +9 -0
- package/dist/{source-CZqdi7bj.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-BuxaZvCH.mjs +12 -0
- package/dist/write-packages-BuxaZvCH.mjs.map +1 -0
- package/package.json +24 -18
- package/dist/common-Dm4NPnuV.mjs +0 -2
- package/dist/common-Dm4NPnuV.mjs.map +0 -1
- package/dist/compile-packages-C3W4j84x.mjs.map +0 -1
- package/dist/docker-DIPmaasN.mjs +0 -34
- package/dist/docker-DIPmaasN.mjs.map +0 -1
- package/dist/find-packages-MKlLERHA.mjs +0 -42
- package/dist/find-packages-MKlLERHA.mjs.map +0 -1
- package/dist/get-config-sVSMVDr6.mjs +0 -9
- package/dist/get-config-sVSMVDr6.mjs.map +0 -1
- package/dist/npm-DHki_SHg.mjs.map +0 -1
- package/dist/semver-DfG5T6W4.mjs +0 -2
- package/dist/source-CZqdi7bj.mjs +0 -7
- package/dist/write-package-DiCHz3W9.mjs +0 -8
- package/dist/write-package-DiCHz3W9.mjs.map +0 -1
- package/dist/write-packages-CR0XLQhM.mjs +0 -10
- package/dist/write-packages-CR0XLQhM.mjs.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,3232 @@
|
|
|
1
|
+
|
|
2
|
+
/// <reference path="operators/index.d.ts" />
|
|
3
|
+
/// <reference path="testing/index.d.ts" />
|
|
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";
|
|
10
|
+
//#region ../../node_modules/commander/typings/index.d.ts
|
|
11
|
+
// Type definitions for commander
|
|
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>
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
|
+
// This is a trick to encourage editor to suggest the known literals while still
|
|
15
|
+
// allowing any BaseType value.
|
|
16
|
+
// References:
|
|
17
|
+
// - https://github.com/microsoft/TypeScript/issues/29729
|
|
18
|
+
// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
|
|
19
|
+
// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
|
|
20
|
+
type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
|
|
21
|
+
declare class CommanderError extends Error {
|
|
22
|
+
code: string;
|
|
23
|
+
exitCode: number;
|
|
24
|
+
message: string;
|
|
25
|
+
nestedError?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Constructs the CommanderError class
|
|
28
|
+
* @param exitCode - suggested exit code which could be used with process.exit
|
|
29
|
+
* @param code - an id string representing the error
|
|
30
|
+
* @param message - human-readable description of the error
|
|
31
|
+
*/
|
|
32
|
+
constructor(exitCode: number, code: string, message: string);
|
|
33
|
+
}
|
|
34
|
+
interface ErrorOptions {
|
|
35
|
+
// optional parameter for error()
|
|
36
|
+
/** an id string representing the error */
|
|
37
|
+
code?: string;
|
|
38
|
+
/** suggested exit code which could be used with process.exit */
|
|
39
|
+
exitCode?: number;
|
|
40
|
+
}
|
|
41
|
+
declare class Argument {
|
|
42
|
+
description: string;
|
|
43
|
+
required: boolean;
|
|
44
|
+
variadic: boolean;
|
|
45
|
+
defaultValue?: any;
|
|
46
|
+
defaultValueDescription?: string;
|
|
47
|
+
parseArg?: <T>(value: string, previous: T) => T;
|
|
48
|
+
argChoices?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Initialize a new command argument with the given name and description.
|
|
51
|
+
* The default is that the argument is required, and you can explicitly
|
|
52
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
53
|
+
*/
|
|
54
|
+
constructor(arg: string, description?: string);
|
|
55
|
+
/**
|
|
56
|
+
* Return argument name.
|
|
57
|
+
*/
|
|
58
|
+
name(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
61
|
+
*/
|
|
62
|
+
default(value: unknown, description?: string): this;
|
|
63
|
+
/**
|
|
64
|
+
* Set the custom handler for processing CLI command arguments into argument values.
|
|
65
|
+
*/
|
|
66
|
+
argParser<T>(fn: (value: string, previous: T) => T): this;
|
|
67
|
+
/**
|
|
68
|
+
* Only allow argument value to be one of choices.
|
|
69
|
+
*/
|
|
70
|
+
choices(values: readonly string[]): this;
|
|
71
|
+
/**
|
|
72
|
+
* Make argument required.
|
|
73
|
+
*/
|
|
74
|
+
argRequired(): this;
|
|
75
|
+
/**
|
|
76
|
+
* Make argument optional.
|
|
77
|
+
*/
|
|
78
|
+
argOptional(): this;
|
|
79
|
+
}
|
|
80
|
+
declare class Option {
|
|
81
|
+
flags: string;
|
|
82
|
+
description: string;
|
|
83
|
+
required: boolean; // A value must be supplied when the option is specified.
|
|
84
|
+
optional: boolean; // A value is optional when the option is specified.
|
|
85
|
+
variadic: boolean;
|
|
86
|
+
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
|
|
87
|
+
short?: string;
|
|
88
|
+
long?: string;
|
|
89
|
+
negate: boolean;
|
|
90
|
+
defaultValue?: any;
|
|
91
|
+
defaultValueDescription?: string;
|
|
92
|
+
presetArg?: unknown;
|
|
93
|
+
envVar?: string;
|
|
94
|
+
parseArg?: <T>(value: string, previous: T) => T;
|
|
95
|
+
hidden: boolean;
|
|
96
|
+
argChoices?: string[];
|
|
97
|
+
helpGroupHeading?: string;
|
|
98
|
+
constructor(flags: string, description?: string);
|
|
99
|
+
/**
|
|
100
|
+
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
101
|
+
*/
|
|
102
|
+
default(value: unknown, description?: string): this;
|
|
103
|
+
/**
|
|
104
|
+
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
|
|
105
|
+
* The custom processing (parseArg) is called.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* new Option('--color').default('GREYSCALE').preset('RGB');
|
|
110
|
+
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
preset(arg: unknown): this;
|
|
114
|
+
/**
|
|
115
|
+
* Add option name(s) that conflict with this option.
|
|
116
|
+
* An error will be displayed if conflicting options are found during parsing.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* new Option('--rgb').conflicts('cmyk');
|
|
121
|
+
* new Option('--js').conflicts(['ts', 'jsx']);
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
conflicts(names: string | string[]): this;
|
|
125
|
+
/**
|
|
126
|
+
* Specify implied option values for when this option is set and the implied options are not.
|
|
127
|
+
*
|
|
128
|
+
* The custom processing (parseArg) is not called on the implied values.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* program
|
|
132
|
+
* .addOption(new Option('--log', 'write logging information to file'))
|
|
133
|
+
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
|
134
|
+
*/
|
|
135
|
+
implies(optionValues: OptionValues): this;
|
|
136
|
+
/**
|
|
137
|
+
* Set environment variable to check for option value.
|
|
138
|
+
*
|
|
139
|
+
* An environment variables is only used if when processed the current option value is
|
|
140
|
+
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
|
|
141
|
+
*/
|
|
142
|
+
env(name: string): this;
|
|
143
|
+
/**
|
|
144
|
+
* Set the custom handler for processing CLI option arguments into option values.
|
|
145
|
+
*/
|
|
146
|
+
argParser<T>(fn: (value: string, previous: T) => T): this;
|
|
147
|
+
/**
|
|
148
|
+
* Whether the option is mandatory and must have a value after parsing.
|
|
149
|
+
*/
|
|
150
|
+
makeOptionMandatory(mandatory?: boolean): this;
|
|
151
|
+
/**
|
|
152
|
+
* Hide option in help.
|
|
153
|
+
*/
|
|
154
|
+
hideHelp(hide?: boolean): this;
|
|
155
|
+
/**
|
|
156
|
+
* Only allow option value to be one of choices.
|
|
157
|
+
*/
|
|
158
|
+
choices(values: readonly string[]): this;
|
|
159
|
+
/**
|
|
160
|
+
* Return option name.
|
|
161
|
+
*/
|
|
162
|
+
name(): string;
|
|
163
|
+
/**
|
|
164
|
+
* Return option name, in a camelcase format that can be used
|
|
165
|
+
* as an object attribute key.
|
|
166
|
+
*/
|
|
167
|
+
attributeName(): string;
|
|
168
|
+
/**
|
|
169
|
+
* Set the help group heading.
|
|
170
|
+
*/
|
|
171
|
+
helpGroup(heading: string): this;
|
|
172
|
+
/**
|
|
173
|
+
* Return whether a boolean option.
|
|
174
|
+
*
|
|
175
|
+
* Options are one of boolean, negated, required argument, or optional argument.
|
|
176
|
+
*/
|
|
177
|
+
isBoolean(): boolean;
|
|
178
|
+
}
|
|
179
|
+
declare class Help {
|
|
180
|
+
/** output helpWidth, long lines are wrapped to fit */
|
|
181
|
+
helpWidth?: number;
|
|
182
|
+
minWidthToWrap: number;
|
|
183
|
+
sortSubcommands: boolean;
|
|
184
|
+
sortOptions: boolean;
|
|
185
|
+
showGlobalOptions: boolean;
|
|
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;
|
|
198
|
+
/** Get the command term to show in the list of subcommands. */
|
|
199
|
+
subcommandTerm(cmd: Command): string;
|
|
200
|
+
/** Get the command summary to show in the list of subcommands. */
|
|
201
|
+
subcommandDescription(cmd: Command): string;
|
|
202
|
+
/** Get the option term to show in the list of options. */
|
|
203
|
+
optionTerm(option: Option): string;
|
|
204
|
+
/** Get the option description to show in the list of options. */
|
|
205
|
+
optionDescription(option: Option): string;
|
|
206
|
+
/** Get the argument term to show in the list of arguments. */
|
|
207
|
+
argumentTerm(argument: Argument): string;
|
|
208
|
+
/** Get the argument description to show in the list of arguments. */
|
|
209
|
+
argumentDescription(argument: Argument): string;
|
|
210
|
+
/** Get the command usage to be displayed at the top of the built-in help. */
|
|
211
|
+
commandUsage(cmd: Command): string;
|
|
212
|
+
/** Get the description for the command. */
|
|
213
|
+
commandDescription(cmd: Command): string;
|
|
214
|
+
/** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
|
|
215
|
+
visibleCommands(cmd: Command): Command[];
|
|
216
|
+
/** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
|
|
217
|
+
visibleOptions(cmd: Command): Option[];
|
|
218
|
+
/** Get an array of the visible global options. (Not including help.) */
|
|
219
|
+
visibleGlobalOptions(cmd: Command): Option[];
|
|
220
|
+
/** Get an array of the arguments which have descriptions. */
|
|
221
|
+
visibleArguments(cmd: Command): Argument[];
|
|
222
|
+
/** Get the longest command term length. */
|
|
223
|
+
longestSubcommandTermLength(cmd: Command, helper: Help): number;
|
|
224
|
+
/** Get the longest option term length. */
|
|
225
|
+
longestOptionTermLength(cmd: Command, helper: Help): number;
|
|
226
|
+
/** Get the longest global option term length. */
|
|
227
|
+
longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
|
|
228
|
+
/** Get the longest argument term length. */
|
|
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;
|
|
253
|
+
/** Calculate the pad width from the maximum term length. */
|
|
254
|
+
padWidth(cmd: Command, helper: Help): number;
|
|
255
|
+
/**
|
|
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.
|
|
276
|
+
*/
|
|
277
|
+
groupItems<T extends Command | Option>(unsortedItems: T[], visibleItems: T[], getGroup: (item: T) => string): Map<string, T[]>;
|
|
278
|
+
/** Generate the built-in help text. */
|
|
279
|
+
formatHelp(cmd: Command, helper: Help): string;
|
|
280
|
+
}
|
|
281
|
+
type HelpConfiguration = Partial<Help>;
|
|
282
|
+
interface ParseOptions {
|
|
283
|
+
from: 'node' | 'electron' | 'user';
|
|
284
|
+
}
|
|
285
|
+
interface HelpContext {
|
|
286
|
+
// optional parameter for .help() and .outputHelp()
|
|
287
|
+
error: boolean;
|
|
288
|
+
}
|
|
289
|
+
interface AddHelpTextContext {
|
|
290
|
+
// passed to text function used with .addHelpText()
|
|
291
|
+
error: boolean;
|
|
292
|
+
command: Command;
|
|
293
|
+
}
|
|
294
|
+
interface OutputConfiguration {
|
|
295
|
+
writeOut?(str: string): void;
|
|
296
|
+
writeErr?(str: string): void;
|
|
297
|
+
outputError?(str: string, write: (str: string) => void): void;
|
|
298
|
+
getOutHelpWidth?(): number;
|
|
299
|
+
getErrHelpWidth?(): number;
|
|
300
|
+
getOutHasColors?(): boolean;
|
|
301
|
+
getErrHasColors?(): boolean;
|
|
302
|
+
stripColor?(str: string): string;
|
|
303
|
+
}
|
|
304
|
+
type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
|
|
305
|
+
type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
|
|
306
|
+
// The source is a string so author can define their own too.
|
|
307
|
+
type OptionValueSource = LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string> | undefined;
|
|
308
|
+
type OptionValues = Record<string, any>;
|
|
309
|
+
declare class Command {
|
|
310
|
+
args: string[];
|
|
311
|
+
processedArgs: any[];
|
|
312
|
+
readonly commands: readonly Command[];
|
|
313
|
+
readonly options: readonly Option[];
|
|
314
|
+
readonly registeredArguments: readonly Argument[];
|
|
315
|
+
parent: Command | null;
|
|
316
|
+
constructor(name?: string);
|
|
317
|
+
/**
|
|
318
|
+
* Set the program version to `str`.
|
|
319
|
+
*
|
|
320
|
+
* This method auto-registers the "-V, --version" flag
|
|
321
|
+
* which will print the version number when passed.
|
|
322
|
+
*
|
|
323
|
+
* You can optionally supply the flags and description to override the defaults.
|
|
324
|
+
*/
|
|
325
|
+
version(str: string, flags?: string, description?: string): this;
|
|
326
|
+
/**
|
|
327
|
+
* Get the program version.
|
|
328
|
+
*/
|
|
329
|
+
version(): string | undefined;
|
|
330
|
+
/**
|
|
331
|
+
* Define a command, implemented using an action handler.
|
|
332
|
+
*
|
|
333
|
+
* @remarks
|
|
334
|
+
* The command description is supplied using `.description`, not as a parameter to `.command`.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```ts
|
|
338
|
+
* program
|
|
339
|
+
* .command('clone <source> [destination]')
|
|
340
|
+
* .description('clone a repository into a newly created directory')
|
|
341
|
+
* .action((source, destination) => {
|
|
342
|
+
* console.log('clone command called');
|
|
343
|
+
* });
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
347
|
+
* @param opts - configuration options
|
|
348
|
+
* @returns new command
|
|
349
|
+
*/
|
|
350
|
+
command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
|
|
351
|
+
/**
|
|
352
|
+
* Define a command, implemented in a separate executable file.
|
|
353
|
+
*
|
|
354
|
+
* @remarks
|
|
355
|
+
* The command description is supplied as the second parameter to `.command`.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```ts
|
|
359
|
+
* program
|
|
360
|
+
* .command('start <service>', 'start named service')
|
|
361
|
+
* .command('stop [service]', 'stop named service, or all if no name supplied');
|
|
362
|
+
* ```
|
|
363
|
+
*
|
|
364
|
+
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
365
|
+
* @param description - description of executable command
|
|
366
|
+
* @param opts - configuration options
|
|
367
|
+
* @returns `this` command for chaining
|
|
368
|
+
*/
|
|
369
|
+
command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
|
|
370
|
+
/**
|
|
371
|
+
* Factory routine to create a new unattached command.
|
|
372
|
+
*
|
|
373
|
+
* See .command() for creating an attached subcommand, which uses this routine to
|
|
374
|
+
* create the command. You can override createCommand to customise subcommands.
|
|
375
|
+
*/
|
|
376
|
+
createCommand(name?: string): Command;
|
|
377
|
+
/**
|
|
378
|
+
* Add a prepared subcommand.
|
|
379
|
+
*
|
|
380
|
+
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
|
381
|
+
*
|
|
382
|
+
* @returns `this` command for chaining
|
|
383
|
+
*/
|
|
384
|
+
addCommand(cmd: Command, opts?: CommandOptions): this;
|
|
385
|
+
/**
|
|
386
|
+
* Factory routine to create a new unattached argument.
|
|
387
|
+
*
|
|
388
|
+
* See .argument() for creating an attached argument, which uses this routine to
|
|
389
|
+
* create the argument. You can override createArgument to return a custom argument.
|
|
390
|
+
*/
|
|
391
|
+
createArgument(name: string, description?: string): Argument;
|
|
392
|
+
/**
|
|
393
|
+
* Define argument syntax for command.
|
|
394
|
+
*
|
|
395
|
+
* The default is that the argument is required, and you can explicitly
|
|
396
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```
|
|
400
|
+
* program.argument('<input-file>');
|
|
401
|
+
* program.argument('[output-file]');
|
|
402
|
+
* ```
|
|
403
|
+
*
|
|
404
|
+
* @returns `this` command for chaining
|
|
405
|
+
*/
|
|
406
|
+
argument<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
407
|
+
argument(name: string, description?: string, defaultValue?: unknown): this;
|
|
408
|
+
/**
|
|
409
|
+
* Define argument syntax for command, adding a prepared argument.
|
|
410
|
+
*
|
|
411
|
+
* @returns `this` command for chaining
|
|
412
|
+
*/
|
|
413
|
+
addArgument(arg: Argument): this;
|
|
414
|
+
/**
|
|
415
|
+
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
416
|
+
*
|
|
417
|
+
* See also .argument().
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* ```
|
|
421
|
+
* program.arguments('<cmd> [env]');
|
|
422
|
+
* ```
|
|
423
|
+
*
|
|
424
|
+
* @returns `this` command for chaining
|
|
425
|
+
*/
|
|
426
|
+
arguments(names: string): this;
|
|
427
|
+
/**
|
|
428
|
+
* Customise or override default help command. By default a help command is automatically added if your command has subcommands.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```ts
|
|
432
|
+
* program.helpCommand('help [cmd]');
|
|
433
|
+
* program.helpCommand('help [cmd]', 'show help');
|
|
434
|
+
* program.helpCommand(false); // suppress default help command
|
|
435
|
+
* program.helpCommand(true); // add help command even if no subcommands
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
helpCommand(nameAndArgs: string, description?: string): this;
|
|
439
|
+
helpCommand(enable: boolean): this;
|
|
440
|
+
/**
|
|
441
|
+
* Add prepared custom help command.
|
|
442
|
+
*/
|
|
443
|
+
addHelpCommand(cmd: Command): this;
|
|
444
|
+
/** @deprecated since v12, instead use helpCommand */
|
|
445
|
+
addHelpCommand(nameAndArgs: string, description?: string): this;
|
|
446
|
+
/** @deprecated since v12, instead use helpCommand */
|
|
447
|
+
addHelpCommand(enable?: boolean): this;
|
|
448
|
+
/**
|
|
449
|
+
* Add hook for life cycle event.
|
|
450
|
+
*/
|
|
451
|
+
hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
|
|
452
|
+
/**
|
|
453
|
+
* Register callback to use as replacement for calling process.exit.
|
|
454
|
+
*/
|
|
455
|
+
exitOverride(callback?: (err: CommanderError) => never | void): this;
|
|
456
|
+
/**
|
|
457
|
+
* Display error message and exit (or call exitOverride).
|
|
458
|
+
*/
|
|
459
|
+
error(message: string, errorOptions?: ErrorOptions): never;
|
|
460
|
+
/**
|
|
461
|
+
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
462
|
+
* or by overriding Help properties using configureHelp().
|
|
463
|
+
*/
|
|
464
|
+
createHelp(): Help;
|
|
465
|
+
/**
|
|
466
|
+
* You can customise the help by overriding Help properties using configureHelp(),
|
|
467
|
+
* or with a subclass of Help by overriding createHelp().
|
|
468
|
+
*/
|
|
469
|
+
configureHelp(configuration: HelpConfiguration): this;
|
|
470
|
+
/** Get configuration */
|
|
471
|
+
configureHelp(): HelpConfiguration;
|
|
472
|
+
/**
|
|
473
|
+
* The default output goes to stdout and stderr. You can customise this for special
|
|
474
|
+
* applications. You can also customise the display of errors by overriding outputError.
|
|
475
|
+
*
|
|
476
|
+
* The configuration properties are all functions:
|
|
477
|
+
* ```
|
|
478
|
+
* // functions to change where being written, stdout and stderr
|
|
479
|
+
* writeOut(str)
|
|
480
|
+
* writeErr(str)
|
|
481
|
+
* // matching functions to specify width for wrapping help
|
|
482
|
+
* getOutHelpWidth()
|
|
483
|
+
* getErrHelpWidth()
|
|
484
|
+
* // functions based on what is being written out
|
|
485
|
+
* outputError(str, write) // used for displaying errors, and not used for displaying help
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
configureOutput(configuration: OutputConfiguration): this;
|
|
489
|
+
/** Get configuration */
|
|
490
|
+
configureOutput(): OutputConfiguration;
|
|
491
|
+
/**
|
|
492
|
+
* Copy settings that are useful to have in common across root command and subcommands.
|
|
493
|
+
*
|
|
494
|
+
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
|
|
495
|
+
*/
|
|
496
|
+
copyInheritedSettings(sourceCommand: Command): this;
|
|
497
|
+
/**
|
|
498
|
+
* Display the help or a custom message after an error occurs.
|
|
499
|
+
*/
|
|
500
|
+
showHelpAfterError(displayHelp?: boolean | string): this;
|
|
501
|
+
/**
|
|
502
|
+
* Display suggestion of similar commands for unknown commands, or options for unknown options.
|
|
503
|
+
*/
|
|
504
|
+
showSuggestionAfterError(displaySuggestion?: boolean): this;
|
|
505
|
+
/**
|
|
506
|
+
* Register callback `fn` for the command.
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* ```
|
|
510
|
+
* program
|
|
511
|
+
* .command('serve')
|
|
512
|
+
* .description('start service')
|
|
513
|
+
* .action(function() {
|
|
514
|
+
* // do work here
|
|
515
|
+
* });
|
|
516
|
+
* ```
|
|
517
|
+
*
|
|
518
|
+
* @returns `this` command for chaining
|
|
519
|
+
*/
|
|
520
|
+
action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;
|
|
521
|
+
/**
|
|
522
|
+
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
523
|
+
*
|
|
524
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
|
|
525
|
+
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
|
|
526
|
+
*
|
|
527
|
+
* See the README for more details, and see also addOption() and requiredOption().
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
*
|
|
531
|
+
* ```js
|
|
532
|
+
* program
|
|
533
|
+
* .option('-p, --pepper', 'add pepper')
|
|
534
|
+
* .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
|
535
|
+
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
|
536
|
+
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
|
537
|
+
* ```
|
|
538
|
+
*
|
|
539
|
+
* @returns `this` command for chaining
|
|
540
|
+
*/
|
|
541
|
+
option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
|
542
|
+
option<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
543
|
+
/** @deprecated since v7, instead use choices or a custom function */
|
|
544
|
+
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
|
545
|
+
/**
|
|
546
|
+
* Define a required option, which must have a value after parsing. This usually means
|
|
547
|
+
* the option must be specified on the command line. (Otherwise the same as .option().)
|
|
548
|
+
*
|
|
549
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
|
550
|
+
*/
|
|
551
|
+
requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
|
552
|
+
requiredOption<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
553
|
+
/** @deprecated since v7, instead use choices or a custom function */
|
|
554
|
+
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
|
555
|
+
/**
|
|
556
|
+
* Factory routine to create a new unattached option.
|
|
557
|
+
*
|
|
558
|
+
* See .option() for creating an attached option, which uses this routine to
|
|
559
|
+
* create the option. You can override createOption to return a custom option.
|
|
560
|
+
*/
|
|
561
|
+
createOption(flags: string, description?: string): Option;
|
|
562
|
+
/**
|
|
563
|
+
* Add a prepared Option.
|
|
564
|
+
*
|
|
565
|
+
* See .option() and .requiredOption() for creating and attaching an option in a single call.
|
|
566
|
+
*/
|
|
567
|
+
addOption(option: Option): this;
|
|
568
|
+
/**
|
|
569
|
+
* Whether to store option values as properties on command object,
|
|
570
|
+
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
|
571
|
+
*
|
|
572
|
+
* @returns `this` command for chaining
|
|
573
|
+
*/
|
|
574
|
+
storeOptionsAsProperties<T extends OptionValues>(): this & T;
|
|
575
|
+
storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
|
|
576
|
+
storeOptionsAsProperties(storeAsProperties?: boolean): this;
|
|
577
|
+
/**
|
|
578
|
+
* Retrieve option value.
|
|
579
|
+
*/
|
|
580
|
+
getOptionValue(key: string): any;
|
|
581
|
+
/**
|
|
582
|
+
* Store option value.
|
|
583
|
+
*/
|
|
584
|
+
setOptionValue(key: string, value: unknown): this;
|
|
585
|
+
/**
|
|
586
|
+
* Store option value and where the value came from.
|
|
587
|
+
*/
|
|
588
|
+
setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
|
|
589
|
+
/**
|
|
590
|
+
* Get source of option value.
|
|
591
|
+
*/
|
|
592
|
+
getOptionValueSource(key: string): OptionValueSource | undefined;
|
|
593
|
+
/**
|
|
594
|
+
* Get source of option value. See also .optsWithGlobals().
|
|
595
|
+
*/
|
|
596
|
+
getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
|
|
597
|
+
/**
|
|
598
|
+
* Alter parsing of short flags with optional values.
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```
|
|
602
|
+
* // for `.option('-f,--flag [value]'):
|
|
603
|
+
* .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
|
|
604
|
+
* .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
|
|
605
|
+
* ```
|
|
606
|
+
*
|
|
607
|
+
* @returns `this` command for chaining
|
|
608
|
+
*/
|
|
609
|
+
combineFlagAndOptionalValue(combine?: boolean): this;
|
|
610
|
+
/**
|
|
611
|
+
* Allow unknown options on the command line.
|
|
612
|
+
*
|
|
613
|
+
* @returns `this` command for chaining
|
|
614
|
+
*/
|
|
615
|
+
allowUnknownOption(allowUnknown?: boolean): this;
|
|
616
|
+
/**
|
|
617
|
+
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
|
|
618
|
+
*
|
|
619
|
+
* @returns `this` command for chaining
|
|
620
|
+
*/
|
|
621
|
+
allowExcessArguments(allowExcess?: boolean): this;
|
|
622
|
+
/**
|
|
623
|
+
* Enable positional options. Positional means global options are specified before subcommands which lets
|
|
624
|
+
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
|
|
625
|
+
*
|
|
626
|
+
* The default behaviour is non-positional and global options may appear anywhere on the command line.
|
|
627
|
+
*
|
|
628
|
+
* @returns `this` command for chaining
|
|
629
|
+
*/
|
|
630
|
+
enablePositionalOptions(positional?: boolean): this;
|
|
631
|
+
/**
|
|
632
|
+
* Pass through options that come after command-arguments rather than treat them as command-options,
|
|
633
|
+
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
|
|
634
|
+
* positional options to have been enabled on the program (parent commands).
|
|
635
|
+
*
|
|
636
|
+
* The default behaviour is non-positional and options may appear before or after command-arguments.
|
|
637
|
+
*
|
|
638
|
+
* @returns `this` command for chaining
|
|
639
|
+
*/
|
|
640
|
+
passThroughOptions(passThrough?: boolean): this;
|
|
641
|
+
/**
|
|
642
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
643
|
+
*
|
|
644
|
+
* Use parseAsync instead of parse if any of your action handlers are async.
|
|
645
|
+
*
|
|
646
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
647
|
+
*
|
|
648
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
649
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
650
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
651
|
+
* - `'user'`: just user arguments
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```
|
|
655
|
+
* program.parse(); // parse process.argv and auto-detect electron and special node flags
|
|
656
|
+
* program.parse(process.argv); // assume argv[0] is app and argv[1] is script
|
|
657
|
+
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
658
|
+
* ```
|
|
659
|
+
*
|
|
660
|
+
* @returns `this` command for chaining
|
|
661
|
+
*/
|
|
662
|
+
parse(argv?: readonly string[], parseOptions?: ParseOptions): this;
|
|
663
|
+
/**
|
|
664
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
665
|
+
*
|
|
666
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
667
|
+
*
|
|
668
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
669
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
670
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
671
|
+
* - `'user'`: just user arguments
|
|
672
|
+
*
|
|
673
|
+
* @example
|
|
674
|
+
* ```
|
|
675
|
+
* await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
|
|
676
|
+
* await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
|
|
677
|
+
* await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
678
|
+
* ```
|
|
679
|
+
*
|
|
680
|
+
* @returns Promise
|
|
681
|
+
*/
|
|
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;
|
|
697
|
+
/**
|
|
698
|
+
* Parse options from `argv` removing known options,
|
|
699
|
+
* and return argv split into operands and unknown arguments.
|
|
700
|
+
*
|
|
701
|
+
* Side effects: modifies command by storing options. Does not reset state if called again.
|
|
702
|
+
*
|
|
703
|
+
* argv => operands, unknown
|
|
704
|
+
* --known kkk op => [op], []
|
|
705
|
+
* op --known kkk => [op], []
|
|
706
|
+
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
|
707
|
+
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
|
708
|
+
*/
|
|
709
|
+
parseOptions(argv: string[]): ParseOptionsResult;
|
|
710
|
+
/**
|
|
711
|
+
* Return an object containing local option values as key-value pairs
|
|
712
|
+
*/
|
|
713
|
+
opts<T extends OptionValues>(): T;
|
|
714
|
+
/**
|
|
715
|
+
* Return an object containing merged local and global option values as key-value pairs.
|
|
716
|
+
*/
|
|
717
|
+
optsWithGlobals<T extends OptionValues>(): T;
|
|
718
|
+
/**
|
|
719
|
+
* Set the description.
|
|
720
|
+
*
|
|
721
|
+
* @returns `this` command for chaining
|
|
722
|
+
*/
|
|
723
|
+
description(str: string): this;
|
|
724
|
+
/** @deprecated since v8, instead use .argument to add command argument with description */
|
|
725
|
+
description(str: string, argsDescription: Record<string, string>): this;
|
|
726
|
+
/**
|
|
727
|
+
* Get the description.
|
|
728
|
+
*/
|
|
729
|
+
description(): string;
|
|
730
|
+
/**
|
|
731
|
+
* Set the summary. Used when listed as subcommand of parent.
|
|
732
|
+
*
|
|
733
|
+
* @returns `this` command for chaining
|
|
734
|
+
*/
|
|
735
|
+
summary(str: string): this;
|
|
736
|
+
/**
|
|
737
|
+
* Get the summary.
|
|
738
|
+
*/
|
|
739
|
+
summary(): string;
|
|
740
|
+
/**
|
|
741
|
+
* Set an alias for the command.
|
|
742
|
+
*
|
|
743
|
+
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
|
744
|
+
*
|
|
745
|
+
* @returns `this` command for chaining
|
|
746
|
+
*/
|
|
747
|
+
alias(alias: string): this;
|
|
748
|
+
/**
|
|
749
|
+
* Get alias for the command.
|
|
750
|
+
*/
|
|
751
|
+
alias(): string;
|
|
752
|
+
/**
|
|
753
|
+
* Set aliases for the command.
|
|
754
|
+
*
|
|
755
|
+
* Only the first alias is shown in the auto-generated help.
|
|
756
|
+
*
|
|
757
|
+
* @returns `this` command for chaining
|
|
758
|
+
*/
|
|
759
|
+
aliases(aliases: readonly string[]): this;
|
|
760
|
+
/**
|
|
761
|
+
* Get aliases for the command.
|
|
762
|
+
*/
|
|
763
|
+
aliases(): string[];
|
|
764
|
+
/**
|
|
765
|
+
* Set the command usage.
|
|
766
|
+
*
|
|
767
|
+
* @returns `this` command for chaining
|
|
768
|
+
*/
|
|
769
|
+
usage(str: string): this;
|
|
770
|
+
/**
|
|
771
|
+
* Get the command usage.
|
|
772
|
+
*/
|
|
773
|
+
usage(): string;
|
|
774
|
+
/**
|
|
775
|
+
* Set the name of the command.
|
|
776
|
+
*
|
|
777
|
+
* @returns `this` command for chaining
|
|
778
|
+
*/
|
|
779
|
+
name(str: string): this;
|
|
780
|
+
/**
|
|
781
|
+
* Get the name of the command.
|
|
782
|
+
*/
|
|
783
|
+
name(): string;
|
|
784
|
+
/**
|
|
785
|
+
* Set the name of the command from script filename, such as process.argv[1],
|
|
786
|
+
* or import.meta.filename.
|
|
787
|
+
*
|
|
788
|
+
* (Used internally and public although not documented in README.)
|
|
789
|
+
*
|
|
790
|
+
* @example
|
|
791
|
+
* ```ts
|
|
792
|
+
* program.nameFromFilename(import.meta.filename);
|
|
793
|
+
* ```
|
|
794
|
+
*
|
|
795
|
+
* @returns `this` command for chaining
|
|
796
|
+
*/
|
|
797
|
+
nameFromFilename(filename: string): this;
|
|
798
|
+
/**
|
|
799
|
+
* Set the directory for searching for executable subcommands of this command.
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```ts
|
|
803
|
+
* program.executableDir(import.meta.dirname);
|
|
804
|
+
* // or
|
|
805
|
+
* program.executableDir('subcommands');
|
|
806
|
+
* ```
|
|
807
|
+
*
|
|
808
|
+
* @returns `this` command for chaining
|
|
809
|
+
*/
|
|
810
|
+
executableDir(path: string): this;
|
|
811
|
+
/**
|
|
812
|
+
* Get the executable search directory.
|
|
813
|
+
*/
|
|
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;
|
|
859
|
+
/**
|
|
860
|
+
* Output help information for this command.
|
|
861
|
+
*
|
|
862
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
863
|
+
*
|
|
864
|
+
*/
|
|
865
|
+
outputHelp(context?: HelpContext): void;
|
|
866
|
+
/** @deprecated since v7 */
|
|
867
|
+
outputHelp(cb: (str: string) => string): void;
|
|
868
|
+
/**
|
|
869
|
+
* Return command help documentation.
|
|
870
|
+
*/
|
|
871
|
+
helpInformation(context?: HelpContext): string;
|
|
872
|
+
/**
|
|
873
|
+
* You can pass in flags and a description to override the help
|
|
874
|
+
* flags and help description for your command. Pass in false
|
|
875
|
+
* to disable the built-in help option.
|
|
876
|
+
*/
|
|
877
|
+
helpOption(flags?: string | boolean, description?: string): this;
|
|
878
|
+
/**
|
|
879
|
+
* Supply your own option to use for the built-in help option.
|
|
880
|
+
* This is an alternative to using helpOption() to customise the flags and description etc.
|
|
881
|
+
*/
|
|
882
|
+
addHelpOption(option: Option): this;
|
|
883
|
+
/**
|
|
884
|
+
* Output help information and exit.
|
|
885
|
+
*
|
|
886
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
887
|
+
*/
|
|
888
|
+
help(context?: HelpContext): never;
|
|
889
|
+
/** @deprecated since v7 */
|
|
890
|
+
help(cb: (str: string) => string): never;
|
|
891
|
+
/**
|
|
892
|
+
* Add additional text to be displayed with the built-in help.
|
|
893
|
+
*
|
|
894
|
+
* Position is 'before' or 'after' to affect just this command,
|
|
895
|
+
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
|
896
|
+
*/
|
|
897
|
+
addHelpText(position: AddHelpTextPosition, text: string): this;
|
|
898
|
+
addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
|
|
899
|
+
/**
|
|
900
|
+
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
|
|
901
|
+
*/
|
|
902
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
903
|
+
}
|
|
904
|
+
interface CommandOptions {
|
|
905
|
+
hidden?: boolean;
|
|
906
|
+
isDefault?: boolean;
|
|
907
|
+
/** @deprecated since v7, replaced by hidden */
|
|
908
|
+
noHelp?: boolean;
|
|
909
|
+
}
|
|
910
|
+
interface ExecutableCommandOptions extends CommandOptions {
|
|
911
|
+
executableFile?: string;
|
|
912
|
+
}
|
|
913
|
+
interface ParseOptionsResult {
|
|
914
|
+
operands: string[];
|
|
915
|
+
unknown: string[];
|
|
916
|
+
}
|
|
917
|
+
//#endregion
|
|
918
|
+
//#region src/commands/checkfeatures.d.ts
|
|
919
|
+
interface CheckfeaturesOpts {
|
|
920
|
+
verbose?: number;
|
|
921
|
+
}
|
|
922
|
+
declare class Checkfeatures implements ICommand {
|
|
923
|
+
mapContext(_opts: CheckfeaturesOpts, context: CmContext): CmContext;
|
|
924
|
+
getTasks(context: CmContext): CmTask[];
|
|
925
|
+
success(): void;
|
|
926
|
+
}
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region src/commands/clean.d.ts
|
|
929
|
+
interface CleanOpts {
|
|
930
|
+
verbose?: number;
|
|
931
|
+
}
|
|
932
|
+
declare class Clean implements ICommand {
|
|
933
|
+
mapContext(_opts: CleanOpts, context: CmContext): CmContext;
|
|
934
|
+
getTasks(context: CmContext): CmTask[];
|
|
935
|
+
success(): void;
|
|
936
|
+
}
|
|
937
|
+
//#endregion
|
|
938
|
+
//#region src/commands/config.d.ts
|
|
939
|
+
interface ConfigOpts {
|
|
940
|
+
verbose?: number;
|
|
941
|
+
}
|
|
942
|
+
declare class Config implements ICommand {
|
|
943
|
+
mapContext(_opts: ConfigOpts, context: CmContext): CmContext;
|
|
944
|
+
getTasks(context: CmContext): CmTask[];
|
|
945
|
+
}
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region src/commands/deploy.d.ts
|
|
948
|
+
interface DeployOpts {
|
|
949
|
+
target?: string;
|
|
950
|
+
verbose?: number;
|
|
951
|
+
}
|
|
952
|
+
declare class Deploy implements ICommand {
|
|
953
|
+
mapContext(commander: DeployOpts, context: CmContext): CmContext;
|
|
954
|
+
getTasks(context: CmContext): CmTask[];
|
|
955
|
+
success(): void;
|
|
956
|
+
}
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/commands/fetch.d.ts
|
|
959
|
+
interface FetchOpts {
|
|
960
|
+
dryRun?: boolean;
|
|
961
|
+
verbose?: number;
|
|
962
|
+
}
|
|
963
|
+
declare class Fetch implements ICommand {
|
|
964
|
+
mapContext(_opts: FetchOpts, context: CmContext): CmContext;
|
|
965
|
+
getTasks(context: CmContext): CmTask[];
|
|
966
|
+
success(context: CmContext): void;
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/commands/rebase.d.ts
|
|
970
|
+
interface RebaseOpts {
|
|
971
|
+
unitTest?: number;
|
|
972
|
+
cucumber?: number;
|
|
973
|
+
force?: number;
|
|
974
|
+
verbose?: number;
|
|
975
|
+
}
|
|
976
|
+
declare class Rebase extends Fetch implements ICommand {
|
|
977
|
+
mapContext(commander: RebaseOpts, context: CmContext): CmContext;
|
|
978
|
+
getTasks(context: CmContext): CmTask[];
|
|
979
|
+
success(context: CmContext): void;
|
|
980
|
+
}
|
|
981
|
+
//#endregion
|
|
982
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Subscription.d.ts
|
|
983
|
+
/**
|
|
984
|
+
* Represents a disposable resource, such as the execution of an Observable. A
|
|
985
|
+
* Subscription has one important method, `unsubscribe`, that takes no argument
|
|
986
|
+
* and just disposes the resource held by the subscription.
|
|
987
|
+
*
|
|
988
|
+
* Additionally, subscriptions may be grouped together through the `add()`
|
|
989
|
+
* method, which will attach a child Subscription to the current Subscription.
|
|
990
|
+
* When a Subscription is unsubscribed, all its children (and its grandchildren)
|
|
991
|
+
* will be unsubscribed as well.
|
|
992
|
+
*/
|
|
993
|
+
declare class Subscription implements SubscriptionLike {
|
|
994
|
+
private initialTeardown?;
|
|
995
|
+
static EMPTY: Subscription;
|
|
996
|
+
/**
|
|
997
|
+
* A flag to indicate whether this Subscription has already been unsubscribed.
|
|
998
|
+
*/
|
|
999
|
+
closed: boolean;
|
|
1000
|
+
private _parentage;
|
|
1001
|
+
/**
|
|
1002
|
+
* The list of registered finalizers to execute upon unsubscription. Adding and removing from this
|
|
1003
|
+
* list occurs in the {@link #add} and {@link #remove} methods.
|
|
1004
|
+
*/
|
|
1005
|
+
private _finalizers;
|
|
1006
|
+
/**
|
|
1007
|
+
* @param initialTeardown A function executed first as part of the finalization
|
|
1008
|
+
* process that is kicked off when {@link #unsubscribe} is called.
|
|
1009
|
+
*/
|
|
1010
|
+
constructor(initialTeardown?: (() => void) | undefined);
|
|
1011
|
+
/**
|
|
1012
|
+
* Disposes the resources held by the subscription. May, for instance, cancel
|
|
1013
|
+
* an ongoing Observable execution or cancel any other type of work that
|
|
1014
|
+
* started when the Subscription was created.
|
|
1015
|
+
*/
|
|
1016
|
+
unsubscribe(): void;
|
|
1017
|
+
/**
|
|
1018
|
+
* Adds a finalizer to this subscription, so that finalization will be unsubscribed/called
|
|
1019
|
+
* when this subscription is unsubscribed. If this subscription is already {@link #closed},
|
|
1020
|
+
* because it has already been unsubscribed, then whatever finalizer is passed to it
|
|
1021
|
+
* will automatically be executed (unless the finalizer itself is also a closed subscription).
|
|
1022
|
+
*
|
|
1023
|
+
* Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed
|
|
1024
|
+
* subscription to a any subscription will result in no operation. (A noop).
|
|
1025
|
+
*
|
|
1026
|
+
* Adding a subscription to itself, or adding `null` or `undefined` will not perform any
|
|
1027
|
+
* operation at all. (A noop).
|
|
1028
|
+
*
|
|
1029
|
+
* `Subscription` instances that are added to this instance will automatically remove themselves
|
|
1030
|
+
* if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove
|
|
1031
|
+
* will need to be removed manually with {@link #remove}
|
|
1032
|
+
*
|
|
1033
|
+
* @param teardown The finalization logic to add to this subscription.
|
|
1034
|
+
*/
|
|
1035
|
+
add(teardown: TeardownLogic): void;
|
|
1036
|
+
/**
|
|
1037
|
+
* Checks to see if a this subscription already has a particular parent.
|
|
1038
|
+
* This will signal that this subscription has already been added to the parent in question.
|
|
1039
|
+
* @param parent the parent to check for
|
|
1040
|
+
*/
|
|
1041
|
+
private _hasParent;
|
|
1042
|
+
/**
|
|
1043
|
+
* Adds a parent to this subscription so it can be removed from the parent if it
|
|
1044
|
+
* unsubscribes on it's own.
|
|
1045
|
+
*
|
|
1046
|
+
* NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.
|
|
1047
|
+
* @param parent The parent subscription to add
|
|
1048
|
+
*/
|
|
1049
|
+
private _addParent;
|
|
1050
|
+
/**
|
|
1051
|
+
* Called on a child when it is removed via {@link #remove}.
|
|
1052
|
+
* @param parent The parent to remove
|
|
1053
|
+
*/
|
|
1054
|
+
private _removeParent;
|
|
1055
|
+
/**
|
|
1056
|
+
* Removes a finalizer from this subscription that was previously added with the {@link #add} method.
|
|
1057
|
+
*
|
|
1058
|
+
* Note that `Subscription` instances, when unsubscribed, will automatically remove themselves
|
|
1059
|
+
* from every other `Subscription` they have been added to. This means that using the `remove` method
|
|
1060
|
+
* is not a common thing and should be used thoughtfully.
|
|
1061
|
+
*
|
|
1062
|
+
* If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance
|
|
1063
|
+
* more than once, you will need to call `remove` the same number of times to remove all instances.
|
|
1064
|
+
*
|
|
1065
|
+
* All finalizer instances are removed to free up memory upon unsubscription.
|
|
1066
|
+
*
|
|
1067
|
+
* @param teardown The finalizer to remove from this subscription
|
|
1068
|
+
*/
|
|
1069
|
+
remove(teardown: Exclude<TeardownLogic, void>): void;
|
|
1070
|
+
}
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region ../../node_modules/rxjs/dist/types/internal/types.d.ts
|
|
1073
|
+
/**
|
|
1074
|
+
* Note: This will add Symbol.observable globally for all TypeScript users,
|
|
1075
|
+
* however, we are no longer polyfilling Symbol.observable
|
|
1076
|
+
*/
|
|
1077
|
+
declare global {
|
|
1078
|
+
interface SymbolConstructor {
|
|
1079
|
+
readonly observable: symbol;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* A function type interface that describes a function that accepts one parameter `T`
|
|
1084
|
+
* and returns another parameter `R`.
|
|
1085
|
+
*
|
|
1086
|
+
* Usually used to describe {@link OperatorFunction} - it always takes a single
|
|
1087
|
+
* parameter (the source Observable) and returns another Observable.
|
|
1088
|
+
*/
|
|
1089
|
+
interface UnaryFunction<T, R> {
|
|
1090
|
+
(source: T): R;
|
|
1091
|
+
}
|
|
1092
|
+
interface OperatorFunction<T, R> extends UnaryFunction<Observable<T>, Observable<R>> {}
|
|
1093
|
+
interface Unsubscribable {
|
|
1094
|
+
unsubscribe(): void;
|
|
1095
|
+
}
|
|
1096
|
+
declare type TeardownLogic = Subscription | Unsubscribable | (() => void) | void;
|
|
1097
|
+
interface SubscriptionLike extends Unsubscribable {
|
|
1098
|
+
unsubscribe(): void;
|
|
1099
|
+
readonly closed: boolean;
|
|
1100
|
+
}
|
|
1101
|
+
/** OBSERVABLE INTERFACES */
|
|
1102
|
+
interface Subscribable<T> {
|
|
1103
|
+
subscribe(observer: Partial<Observer<T>>): Unsubscribable;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* An object interface that defines a set of callback functions a user can use to get
|
|
1107
|
+
* notified of any set of {@link Observable}
|
|
1108
|
+
* {@link guide/glossary-and-semantics#notification notification} events.
|
|
1109
|
+
*
|
|
1110
|
+
* For more info, please refer to {@link guide/observer this guide}.
|
|
1111
|
+
*/
|
|
1112
|
+
interface Observer<T> {
|
|
1113
|
+
/**
|
|
1114
|
+
* A callback function that gets called by the producer during the subscription when
|
|
1115
|
+
* the producer "has" the `value`. It won't be called if `error` or `complete` callback
|
|
1116
|
+
* functions have been called, nor after the consumer has unsubscribed.
|
|
1117
|
+
*
|
|
1118
|
+
* For more info, please refer to {@link guide/glossary-and-semantics#next this guide}.
|
|
1119
|
+
*/
|
|
1120
|
+
next: (value: T) => void;
|
|
1121
|
+
/**
|
|
1122
|
+
* A callback function that gets called by the producer if and when it encountered a
|
|
1123
|
+
* problem of any kind. The errored value will be provided through the `err` parameter.
|
|
1124
|
+
* This callback can't be called more than one time, it can't be called if the
|
|
1125
|
+
* `complete` callback function have been called previously, nor it can't be called if
|
|
1126
|
+
* the consumer has unsubscribed.
|
|
1127
|
+
*
|
|
1128
|
+
* For more info, please refer to {@link guide/glossary-and-semantics#error this guide}.
|
|
1129
|
+
*/
|
|
1130
|
+
error: (err: any) => void;
|
|
1131
|
+
/**
|
|
1132
|
+
* A callback function that gets called by the producer if and when it has no more
|
|
1133
|
+
* values to provide (by calling `next` callback function). This means that no error
|
|
1134
|
+
* has happened. This callback can't be called more than one time, it can't be called
|
|
1135
|
+
* if the `error` callback function have been called previously, nor it can't be called
|
|
1136
|
+
* if the consumer has unsubscribed.
|
|
1137
|
+
*
|
|
1138
|
+
* For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}.
|
|
1139
|
+
*/
|
|
1140
|
+
complete: () => void;
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Subscriber.d.ts
|
|
1144
|
+
/**
|
|
1145
|
+
* Implements the {@link Observer} interface and extends the
|
|
1146
|
+
* {@link Subscription} class. While the {@link Observer} is the public API for
|
|
1147
|
+
* consuming the values of an {@link Observable}, all Observers get converted to
|
|
1148
|
+
* a Subscriber, in order to provide Subscription-like capabilities such as
|
|
1149
|
+
* `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
|
|
1150
|
+
* implementing operators, but it is rarely used as a public API.
|
|
1151
|
+
*/
|
|
1152
|
+
declare class Subscriber<T> extends Subscription implements Observer<T> {
|
|
1153
|
+
/**
|
|
1154
|
+
* A static factory for a Subscriber, given a (potentially partial) definition
|
|
1155
|
+
* of an Observer.
|
|
1156
|
+
* @param next The `next` callback of an Observer.
|
|
1157
|
+
* @param error The `error` callback of an
|
|
1158
|
+
* Observer.
|
|
1159
|
+
* @param complete The `complete` callback of an
|
|
1160
|
+
* Observer.
|
|
1161
|
+
* @return A Subscriber wrapping the (partially defined)
|
|
1162
|
+
* Observer represented by the given arguments.
|
|
1163
|
+
* @deprecated Do not use. Will be removed in v8. There is no replacement for this
|
|
1164
|
+
* method, and there is no reason to be creating instances of `Subscriber` directly.
|
|
1165
|
+
* If you have a specific use case, please file an issue.
|
|
1166
|
+
*/
|
|
1167
|
+
static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T>;
|
|
1168
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
1169
|
+
protected isStopped: boolean;
|
|
1170
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
1171
|
+
protected destination: Subscriber<any> | Observer<any>;
|
|
1172
|
+
/**
|
|
1173
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1174
|
+
* There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.
|
|
1175
|
+
*/
|
|
1176
|
+
constructor(destination?: Subscriber<any> | Observer<any>);
|
|
1177
|
+
/**
|
|
1178
|
+
* The {@link Observer} callback to receive notifications of type `next` from
|
|
1179
|
+
* the Observable, with a value. The Observable may call this method 0 or more
|
|
1180
|
+
* times.
|
|
1181
|
+
* @param value The `next` value.
|
|
1182
|
+
*/
|
|
1183
|
+
next(value: T): void;
|
|
1184
|
+
/**
|
|
1185
|
+
* The {@link Observer} callback to receive notifications of type `error` from
|
|
1186
|
+
* the Observable, with an attached `Error`. Notifies the Observer that
|
|
1187
|
+
* the Observable has experienced an error condition.
|
|
1188
|
+
* @param err The `error` exception.
|
|
1189
|
+
*/
|
|
1190
|
+
error(err?: any): void;
|
|
1191
|
+
/**
|
|
1192
|
+
* The {@link Observer} callback to receive a valueless notification of type
|
|
1193
|
+
* `complete` from the Observable. Notifies the Observer that the Observable
|
|
1194
|
+
* has finished sending push-based notifications.
|
|
1195
|
+
*/
|
|
1196
|
+
complete(): void;
|
|
1197
|
+
unsubscribe(): void;
|
|
1198
|
+
protected _next(value: T): void;
|
|
1199
|
+
protected _error(err: any): void;
|
|
1200
|
+
protected _complete(): void;
|
|
1201
|
+
}
|
|
1202
|
+
//#endregion
|
|
1203
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Operator.d.ts
|
|
1204
|
+
/***
|
|
1205
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1206
|
+
*/
|
|
1207
|
+
interface Operator<T, R> {
|
|
1208
|
+
call(subscriber: Subscriber<R>, source: any): TeardownLogic;
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Observable.d.ts
|
|
1212
|
+
/**
|
|
1213
|
+
* A representation of any set of values over any amount of time. This is the most basic building block
|
|
1214
|
+
* of RxJS.
|
|
1215
|
+
*/
|
|
1216
|
+
declare class Observable<T> implements Subscribable<T> {
|
|
1217
|
+
/**
|
|
1218
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1219
|
+
*/
|
|
1220
|
+
source: Observable<any> | undefined;
|
|
1221
|
+
/**
|
|
1222
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1223
|
+
*/
|
|
1224
|
+
operator: Operator<any, T> | undefined;
|
|
1225
|
+
/**
|
|
1226
|
+
* @param subscribe The function that is called when the Observable is
|
|
1227
|
+
* initially subscribed to. This function is given a Subscriber, to which new values
|
|
1228
|
+
* can be `next`ed, or an `error` method can be called to raise an error, or
|
|
1229
|
+
* `complete` can be called to notify of a successful completion.
|
|
1230
|
+
*/
|
|
1231
|
+
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
|
|
1232
|
+
/**
|
|
1233
|
+
* Creates a new Observable by calling the Observable constructor
|
|
1234
|
+
* @param subscribe the subscriber function to be passed to the Observable constructor
|
|
1235
|
+
* @return A new observable.
|
|
1236
|
+
* @deprecated Use `new Observable()` instead. Will be removed in v8.
|
|
1237
|
+
*/
|
|
1238
|
+
static create: (...args: any[]) => any;
|
|
1239
|
+
/**
|
|
1240
|
+
* Creates a new Observable, with this Observable instance as the source, and the passed
|
|
1241
|
+
* operator defined as the new observable's operator.
|
|
1242
|
+
* @param operator the operator defining the operation to take on the observable
|
|
1243
|
+
* @return A new observable with the Operator applied.
|
|
1244
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1245
|
+
* If you have implemented an operator using `lift`, it is recommended that you create an
|
|
1246
|
+
* operator by simply returning `new Observable()` directly. See "Creating new operators from
|
|
1247
|
+
* scratch" section here: https://rxjs.dev/guide/operators
|
|
1248
|
+
*/
|
|
1249
|
+
lift<R>(operator?: Operator<T, R>): Observable<R>;
|
|
1250
|
+
subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;
|
|
1251
|
+
/** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */
|
|
1252
|
+
subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;
|
|
1253
|
+
/**
|
|
1254
|
+
* Used as a NON-CANCELLABLE means of subscribing to an observable, for use with
|
|
1255
|
+
* APIs that expect promises, like `async/await`. You cannot unsubscribe from this.
|
|
1256
|
+
*
|
|
1257
|
+
* **WARNING**: Only use this with observables you *know* will complete. If the source
|
|
1258
|
+
* observable does not complete, you will end up with a promise that is hung up, and
|
|
1259
|
+
* potentially all of the state of an async function hanging out in memory. To avoid
|
|
1260
|
+
* this situation, look into adding something like {@link timeout}, {@link take},
|
|
1261
|
+
* {@link takeWhile}, or {@link takeUntil} amongst others.
|
|
1262
|
+
*
|
|
1263
|
+
* #### Example
|
|
1264
|
+
*
|
|
1265
|
+
* ```ts
|
|
1266
|
+
* import { interval, take } from 'rxjs';
|
|
1267
|
+
*
|
|
1268
|
+
* const source$ = interval(1000).pipe(take(4));
|
|
1269
|
+
*
|
|
1270
|
+
* async function getTotal() {
|
|
1271
|
+
* let total = 0;
|
|
1272
|
+
*
|
|
1273
|
+
* await source$.forEach(value => {
|
|
1274
|
+
* total += value;
|
|
1275
|
+
* console.log('observable -> ' + value);
|
|
1276
|
+
* });
|
|
1277
|
+
*
|
|
1278
|
+
* return total;
|
|
1279
|
+
* }
|
|
1280
|
+
*
|
|
1281
|
+
* getTotal().then(
|
|
1282
|
+
* total => console.log('Total: ' + total)
|
|
1283
|
+
* );
|
|
1284
|
+
*
|
|
1285
|
+
* // Expected:
|
|
1286
|
+
* // 'observable -> 0'
|
|
1287
|
+
* // 'observable -> 1'
|
|
1288
|
+
* // 'observable -> 2'
|
|
1289
|
+
* // 'observable -> 3'
|
|
1290
|
+
* // 'Total: 6'
|
|
1291
|
+
* ```
|
|
1292
|
+
*
|
|
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.
|
|
1296
|
+
*/
|
|
1297
|
+
forEach(next: (value: T) => void): Promise<void>;
|
|
1298
|
+
/**
|
|
1299
|
+
* @param next a handler for each value emitted by the observable
|
|
1300
|
+
* @param promiseCtor a constructor function used to instantiate the Promise
|
|
1301
|
+
* @return a promise that either resolves on observable completion or
|
|
1302
|
+
* rejects with the handled error
|
|
1303
|
+
* @deprecated Passing a Promise constructor will no longer be available
|
|
1304
|
+
* in upcoming versions of RxJS. This is because it adds weight to the library, for very
|
|
1305
|
+
* little benefit. If you need this functionality, it is recommended that you either
|
|
1306
|
+
* polyfill Promise, or you create an adapter to convert the returned native promise
|
|
1307
|
+
* to whatever promise implementation you wanted. Will be removed in v8.
|
|
1308
|
+
*/
|
|
1309
|
+
forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;
|
|
1310
|
+
pipe(): Observable<T>;
|
|
1311
|
+
pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;
|
|
1312
|
+
pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;
|
|
1313
|
+
pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;
|
|
1314
|
+
pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;
|
|
1315
|
+
pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;
|
|
1316
|
+
pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;
|
|
1317
|
+
pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;
|
|
1318
|
+
pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;
|
|
1319
|
+
pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;
|
|
1320
|
+
pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<unknown>;
|
|
1321
|
+
/** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
|
|
1322
|
+
toPromise(): Promise<T | undefined>;
|
|
1323
|
+
/** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
|
|
1324
|
+
toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;
|
|
1325
|
+
/** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
|
|
1326
|
+
toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;
|
|
1327
|
+
}
|
|
1328
|
+
//#endregion
|
|
1329
|
+
//#region src/commands/tasks/push-branch.d.ts
|
|
1330
|
+
type PushBranchContext = CmContext<{
|
|
1331
|
+
origin?: string;
|
|
1332
|
+
featureBranch?: string;
|
|
1333
|
+
upstream?: boolean;
|
|
1334
|
+
noVerify?: boolean;
|
|
1335
|
+
}>;
|
|
1336
|
+
//#endregion
|
|
1337
|
+
//#region src/commands/finish.d.ts
|
|
1338
|
+
declare class Finish extends Rebase implements ICommand {
|
|
1339
|
+
mapContext(commander: RebaseOpts, context: CmContext): CmContext;
|
|
1340
|
+
verifyConditions(context: CmContext): void;
|
|
1341
|
+
getTasks(context: PushBranchContext & RebaseOpts): CmTask[];
|
|
1342
|
+
success(context: CmContext): void;
|
|
1343
|
+
}
|
|
1344
|
+
//#endregion
|
|
1345
|
+
//#region src/commands/jira-releases.d.ts
|
|
1346
|
+
interface JiraReleasesOpts {
|
|
1347
|
+
component?: string;
|
|
1348
|
+
projectId?: string;
|
|
1349
|
+
update?: number;
|
|
1350
|
+
verbose?: number;
|
|
1351
|
+
tag?: string;
|
|
1352
|
+
}
|
|
1353
|
+
interface JiraRelease {
|
|
1354
|
+
id: string;
|
|
1355
|
+
name: string;
|
|
1356
|
+
released: boolean;
|
|
1357
|
+
releaseDate?: string;
|
|
1358
|
+
version: string;
|
|
1359
|
+
[key: string]: unknown;
|
|
1360
|
+
}
|
|
1361
|
+
type JiraReleasesContext = CmContext<{
|
|
1362
|
+
projectId?: string;
|
|
1363
|
+
component?: string;
|
|
1364
|
+
tag?: string;
|
|
1365
|
+
update?: number;
|
|
1366
|
+
releases?: JiraRelease[];
|
|
1367
|
+
}>;
|
|
1368
|
+
declare class JiraReleases implements ICommand {
|
|
1369
|
+
mapContext(commander: JiraReleasesOpts, context: CmContext): JiraReleasesContext;
|
|
1370
|
+
getTasks(context: JiraReleasesContext): CmTask[];
|
|
1371
|
+
}
|
|
1372
|
+
//#endregion
|
|
1373
|
+
//#region src/commands/merge.d.ts
|
|
1374
|
+
declare class Merge implements ICommand {
|
|
1375
|
+
private lastCommitMessage;
|
|
1376
|
+
getTasks(context: CmContext): CmTask[];
|
|
1377
|
+
success(context: CmContext): void;
|
|
1378
|
+
}
|
|
1379
|
+
//#endregion
|
|
1380
|
+
//#region src/commands/packages.d.ts
|
|
1381
|
+
declare class Packages implements ICommand {
|
|
1382
|
+
mapContext(options: Record<string, unknown>, context: CmContext): CmContext;
|
|
1383
|
+
getTasks(context: CmContext): CmTask[];
|
|
1384
|
+
}
|
|
1385
|
+
//#endregion
|
|
1386
|
+
//#region src/commands/pull.d.ts
|
|
1387
|
+
declare class Pull implements ICommand {
|
|
1388
|
+
mapContext(options: Record<string, unknown>, context: CmContext): CmContext;
|
|
1389
|
+
getTasks(context: CmContext): CmTask[];
|
|
1390
|
+
success(context: CmContext): void;
|
|
1391
|
+
}
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region src/commands/push.d.ts
|
|
1394
|
+
declare class Push extends Rebase implements ICommand {
|
|
1395
|
+
mapContext(commander: RebaseOpts, context: CmContext): CmContext;
|
|
1396
|
+
getTasks(context: CmContext): CmTask[];
|
|
1397
|
+
success(context: CmContext): void;
|
|
1398
|
+
}
|
|
1399
|
+
declare const publish: (program: Command) => void;
|
|
1400
|
+
//#endregion
|
|
1401
|
+
//#region src/commands/republish.d.ts
|
|
1402
|
+
interface RepublishOpts {
|
|
1403
|
+
verbose?: number;
|
|
1404
|
+
}
|
|
1405
|
+
declare class Republish extends Fetch implements ICommand {
|
|
1406
|
+
mapContext(commander: RepublishOpts, context: CmContext): CmContext;
|
|
1407
|
+
getTasks(context: CmContext): CmTask[];
|
|
1408
|
+
success(): void;
|
|
1409
|
+
}
|
|
1410
|
+
//#endregion
|
|
1411
|
+
//#region src/commands/start.d.ts
|
|
1412
|
+
interface StartOpts {
|
|
1413
|
+
jiraId?: string;
|
|
1414
|
+
branchName?: string;
|
|
1415
|
+
dryRun?: boolean;
|
|
1416
|
+
verbose?: number;
|
|
1417
|
+
}
|
|
1418
|
+
type StartContext = CmContext<{
|
|
1419
|
+
jiraId?: string;
|
|
1420
|
+
branchName?: string;
|
|
1421
|
+
type?: string;
|
|
1422
|
+
featureBranch?: string;
|
|
1423
|
+
fromBranch?: string;
|
|
1424
|
+
origin?: string;
|
|
1425
|
+
}>;
|
|
1426
|
+
declare class Start extends Fetch implements ICommand {
|
|
1427
|
+
mapContext(options: StartOpts, context: CmContext): StartContext;
|
|
1428
|
+
prompt(context: StartContext): Promise<Record<string, unknown> | symbol>;
|
|
1429
|
+
getTasks(context: StartContext): CmTask[];
|
|
1430
|
+
success(context: StartContext): void;
|
|
1431
|
+
}
|
|
1432
|
+
declare namespace index_d_exports {
|
|
1433
|
+
export { Checkfeatures, Clean, Config, Deploy, Fetch, Finish, JiraRelease, JiraReleases, Merge, Packages, Pull, Push, Rebase, RebaseOpts, Republish, Start, publish };
|
|
1434
|
+
}
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region src/commands/release.d.ts
|
|
1437
|
+
declare function release(options?: {}): void;
|
|
1438
|
+
//#endregion
|
|
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.
|
|
1490
|
+
*/
|
|
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()`.
|
|
1614
|
+
|
|
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.
|
|
1624
|
+
|
|
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.
|
|
1639
|
+
|
|
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.
|
|
1650
|
+
|
|
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.
|
|
1659
|
+
|
|
1660
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1661
|
+
*/
|
|
1662
|
+
sendMessage(message: Message<Serialization>, sendMessageOptions?: SendMessageOptions): Promise<void>;
|
|
1663
|
+
/**
|
|
1664
|
+
Receive a single `message` from the subprocess.
|
|
1665
|
+
|
|
1666
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1667
|
+
*/
|
|
1668
|
+
getOneMessage(getOneMessageOptions?: GetOneMessageOptions<Serialization>): Promise<Message<Serialization>>;
|
|
1669
|
+
/**
|
|
1670
|
+
Iterate over each `message` from the subprocess.
|
|
1671
|
+
|
|
1672
|
+
This requires the `ipc` option to be `true`. The type of `message` depends on the `serialization` option.
|
|
1673
|
+
*/
|
|
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)).
|
|
1794
|
+
|
|
1795
|
+
This is `undefined` if the `stdout` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
1796
|
+
|
|
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)).
|
|
1802
|
+
|
|
1803
|
+
This is `undefined` if the `stderr` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`, or if the `buffer` option is `false`.
|
|
1804
|
+
|
|
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.
|
|
1810
|
+
|
|
1811
|
+
This requires the `all` option to be `true`.
|
|
1812
|
+
|
|
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`.
|
|
1814
|
+
|
|
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.
|
|
1820
|
+
|
|
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`.
|
|
1822
|
+
|
|
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.
|
|
1828
|
+
|
|
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.
|
|
1834
|
+
|
|
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.
|
|
1856
|
+
|
|
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.
|
|
1888
|
+
|
|
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).
|
|
1896
|
+
|
|
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.
|
|
1902
|
+
|
|
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.
|
|
1916
|
+
|
|
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)`.
|
|
1922
|
+
|
|
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.
|
|
1938
|
+
|
|
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.
|
|
1944
|
+
|
|
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'`.
|
|
1977
|
+
|
|
1978
|
+
This is helpful when multiple subprocesses are running at the same time.
|
|
1979
|
+
|
|
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.
|
|
2003
|
+
|
|
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.
|
|
2009
|
+
|
|
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.
|
|
2015
|
+
|
|
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.
|
|
2017
|
+
|
|
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.
|
|
2023
|
+
|
|
2024
|
+
Requires the `node` option to be `true`.
|
|
2025
|
+
|
|
2026
|
+
@default [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv) (current Node.js CLI flags)
|
|
2027
|
+
*/
|
|
2028
|
+
readonly nodeOptions?: readonly string[];
|
|
2029
|
+
/**
|
|
2030
|
+
Path to the Node.js executable.
|
|
2031
|
+
|
|
2032
|
+
Requires the `node` option to be `true`.
|
|
2033
|
+
|
|
2034
|
+
@default [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath) (current Node.js executable)
|
|
2035
|
+
*/
|
|
2036
|
+
readonly nodePath?: string | URL;
|
|
2037
|
+
/**
|
|
2038
|
+
If `true`, runs the command inside of a [shell](https://en.wikipedia.org/wiki/Shell_(computing)).
|
|
2039
|
+
|
|
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.
|
|
2041
|
+
|
|
2042
|
+
We recommend against using this option.
|
|
2043
|
+
|
|
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.
|
|
2049
|
+
|
|
2050
|
+
This is also used to resolve the `nodePath` option when it is a relative path.
|
|
2051
|
+
|
|
2052
|
+
@default process.cwd()
|
|
2053
|
+
*/
|
|
2054
|
+
readonly cwd?: string | URL;
|
|
2055
|
+
/**
|
|
2056
|
+
[Environment variables](https://en.wikipedia.org/wiki/Environment_variable).
|
|
2057
|
+
|
|
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)).
|
|
2059
|
+
|
|
2060
|
+
@default [process.env](https://nodejs.org/api/process.html#processenv)
|
|
2061
|
+
*/
|
|
2062
|
+
readonly env?: Readonly<Partial<Record<string, string>>>;
|
|
2063
|
+
/**
|
|
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`.
|
|
2066
|
+
|
|
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)).
|
|
2072
|
+
|
|
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)).
|
|
2078
|
+
|
|
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`.
|
|
2084
|
+
|
|
2085
|
+
This can be an array of values such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.
|
|
2086
|
+
|
|
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`.
|
|
2092
|
+
|
|
2093
|
+
This can be an array of values such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.
|
|
2094
|
+
|
|
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`.
|
|
2100
|
+
|
|
2101
|
+
This can be an array of values such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.
|
|
2102
|
+
|
|
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
|
|
2120
|
+
*/
|
|
2121
|
+
readonly all?: boolean;
|
|
2122
|
+
/**
|
|
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).
|
|
2124
|
+
|
|
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.
|
|
2128
|
+
|
|
2129
|
+
The output is available with `result.stdout`, `result.stderr` and `result.stdio`.
|
|
2130
|
+
|
|
2131
|
+
@default 'utf8'
|
|
2132
|
+
*/
|
|
2133
|
+
readonly encoding?: Encoding;
|
|
2134
|
+
/**
|
|
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.
|
|
2140
|
+
|
|
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.
|
|
2146
|
+
|
|
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`.
|
|
2156
|
+
|
|
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`.
|
|
2222
|
+
|
|
2223
|
+
@example
|
|
2224
|
+
```
|
|
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
|
+
}
|
|
2240
|
+
|
|
2241
|
+
throw error;
|
|
2242
|
+
}
|
|
2243
|
+
```
|
|
2244
|
+
*/
|
|
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;
|
|
2302
|
+
/**
|
|
2303
|
+
Sets the [group identifier](https://en.wikipedia.org/wiki/Group_identifier) of the subprocess.
|
|
2304
|
+
|
|
2305
|
+
@default current group identifier
|
|
2306
|
+
*/
|
|
2307
|
+
readonly gid?: number;
|
|
2308
|
+
/**
|
|
2309
|
+
Value of [`argv[0]`](https://nodejs.org/api/process.html#processargv0) sent to the subprocess.
|
|
2310
|
+
|
|
2311
|
+
@default file being executed
|
|
2312
|
+
*/
|
|
2313
|
+
readonly argv0?: string;
|
|
2314
|
+
/**
|
|
2315
|
+
On Windows, do not create a new console window.
|
|
2316
|
+
|
|
2317
|
+
@default true
|
|
2318
|
+
*/
|
|
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;
|
|
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>;
|
|
2984
|
+
//#endregion
|
|
2985
|
+
//#region src/common/cli/cli.d.ts
|
|
2986
|
+
type RunOptions = Record<string, unknown>;
|
|
2987
|
+
type CliSyncResult = ReturnType<typeof execaSync>;
|
|
2988
|
+
interface CliResult extends Promise<unknown> {
|
|
2989
|
+
toObservable(opt?: RunOptions): Observable<string>;
|
|
2990
|
+
toStream(opt?: RunOptions): ReturnType<typeof execa>;
|
|
2991
|
+
cwd(cwd: string): CliResult;
|
|
2992
|
+
sync(opt?: RunOptions): CliSyncResult;
|
|
2993
|
+
getRaw(opt?: RunOptions): string;
|
|
2994
|
+
get(opt?: RunOptions): string;
|
|
2995
|
+
}
|
|
2996
|
+
declare class Cli {
|
|
2997
|
+
cmd: string;
|
|
2998
|
+
constructor(cmd: string);
|
|
2999
|
+
sync(...args: string[]): CliSyncResult;
|
|
3000
|
+
run(...args: string[]): CliResult;
|
|
3001
|
+
get(...args: string[]): string;
|
|
3002
|
+
static run(cmd: string, args?: string[], options?: RunOptions): CliResult;
|
|
3003
|
+
static getRaw(cmd: string, args: string[], options?: RunOptions): string;
|
|
3004
|
+
}
|
|
3005
|
+
//#endregion
|
|
3006
|
+
//#region src/common/cli/bun.d.ts
|
|
3007
|
+
declare class BunCli extends Cli {
|
|
3008
|
+
constructor();
|
|
3009
|
+
newVersion(version: string): CliSyncResult;
|
|
3010
|
+
pm(...args: string[]): CliSyncResult;
|
|
3011
|
+
run(...args: string[]): CliResult;
|
|
3012
|
+
install(...args: string[]): CliResult;
|
|
3013
|
+
/**
|
|
3014
|
+
* Reinstall dependencies without bun.lock mutation
|
|
3015
|
+
* @returns {Promise<unknown>}
|
|
3016
|
+
*/
|
|
3017
|
+
restore(): CliResult;
|
|
3018
|
+
}
|
|
3019
|
+
declare const bun: BunCli;
|
|
3020
|
+
//#endregion
|
|
3021
|
+
//#region src/common/cli/docker.d.ts
|
|
3022
|
+
declare class DockerCli extends Cli {
|
|
3023
|
+
constructor();
|
|
3024
|
+
tag(...args: string[]): string;
|
|
3025
|
+
login(...args: string[]): CliSyncResult;
|
|
3026
|
+
push(...args: string[]): CliResult;
|
|
3027
|
+
getToken(username: string, password: string): Promise<any>;
|
|
3028
|
+
getTags({ token, repository }: {
|
|
3029
|
+
token: string;
|
|
3030
|
+
repository: string;
|
|
3031
|
+
}): Promise<any>;
|
|
3032
|
+
deleteTag(tag: string, { token, repository }: {
|
|
3033
|
+
token: string;
|
|
3034
|
+
repository: string;
|
|
3035
|
+
}): Promise<void>;
|
|
3036
|
+
}
|
|
3037
|
+
declare const docker: DockerCli;
|
|
3038
|
+
//#endregion
|
|
3039
|
+
//#region src/common/cli/git.d.ts
|
|
3040
|
+
declare class GitCli extends Cli {
|
|
3041
|
+
constructor();
|
|
3042
|
+
init(...args: string[]): CliResult;
|
|
3043
|
+
add(...args: string[]): CliResult;
|
|
3044
|
+
status(...args: string[]): CliSyncResult;
|
|
3045
|
+
branch(...args: string[]): CliResult;
|
|
3046
|
+
clean(...args: string[]): CliResult;
|
|
3047
|
+
config(...args: string[]): string;
|
|
3048
|
+
checkout(...args: string[]): CliResult;
|
|
3049
|
+
commit(...args: string[]): CliResult;
|
|
3050
|
+
fetch(...args: string[]): CliResult;
|
|
3051
|
+
prune(...args: string[]): CliResult;
|
|
3052
|
+
merge(...args: string[]): CliSyncResult;
|
|
3053
|
+
reset(...args: string[]): CliSyncResult;
|
|
3054
|
+
remote(...args: string[]): CliResult;
|
|
3055
|
+
rebase(...args: string[]): CliResult;
|
|
3056
|
+
getCommitTag(ref?: string): string;
|
|
3057
|
+
getBranchName(ref?: string): string;
|
|
3058
|
+
getLastCommitMsg(): string;
|
|
3059
|
+
push(...args: string[]): CliResult;
|
|
3060
|
+
branchExists(branch: string, origin?: string): boolean;
|
|
3061
|
+
checkBranchRemoteStatus(branch: string, origin?: string): string;
|
|
3062
|
+
branches(...args: string[]): string[];
|
|
3063
|
+
show(branch: string): string;
|
|
3064
|
+
branchesInfos(...args: string[]): {
|
|
3065
|
+
branch: string;
|
|
3066
|
+
date: string;
|
|
3067
|
+
creation: string;
|
|
3068
|
+
author: string;
|
|
3069
|
+
}[];
|
|
3070
|
+
}
|
|
3071
|
+
declare const git: GitCli;
|
|
3072
|
+
//#endregion
|
|
3073
|
+
//#region src/common/cli/lerna.d.ts
|
|
3074
|
+
declare class LernaCli extends Cli {
|
|
3075
|
+
constructor();
|
|
3076
|
+
newVersion(version: string): CliSyncResult;
|
|
3077
|
+
version(...args: string[]): CliSyncResult;
|
|
3078
|
+
run(...args: string[]): CliResult;
|
|
3079
|
+
install(...args: string[]): CliResult;
|
|
3080
|
+
}
|
|
3081
|
+
declare const lerna: LernaCli;
|
|
3082
|
+
//#endregion
|
|
3083
|
+
//#region src/common/cli/npm.d.ts
|
|
3084
|
+
declare class NpmCli extends Cli {
|
|
3085
|
+
constructor();
|
|
3086
|
+
newVersion(version: string): CliSyncResult;
|
|
3087
|
+
version(...args: string[]): CliSyncResult;
|
|
3088
|
+
run(...args: string[]): CliResult;
|
|
3089
|
+
install(...args: string[]): CliResult;
|
|
3090
|
+
publish(...args: string[]): CliResult;
|
|
3091
|
+
pack(...args: string[]): CliResult;
|
|
3092
|
+
/**
|
|
3093
|
+
* Reinstall dependencies without package-lock mutation
|
|
3094
|
+
* @returns {Promise<unknown>}
|
|
3095
|
+
*/
|
|
3096
|
+
restore(): CliResult;
|
|
3097
|
+
}
|
|
3098
|
+
declare const npm: NpmCli;
|
|
3099
|
+
//#endregion
|
|
3100
|
+
//#region src/common/cli/pnpm.d.ts
|
|
3101
|
+
declare class PnpmCli extends Cli {
|
|
3102
|
+
constructor();
|
|
3103
|
+
newVersion(version: string): CliSyncResult;
|
|
3104
|
+
version(...args: string[]): CliSyncResult;
|
|
3105
|
+
run(...args: string[]): CliResult;
|
|
3106
|
+
install(...args: string[]): CliResult;
|
|
3107
|
+
/**
|
|
3108
|
+
* Reinstall dependencies without pnpm-lock.yaml mutation
|
|
3109
|
+
* @returns {Promise<unknown>}
|
|
3110
|
+
*/
|
|
3111
|
+
restore(): CliResult;
|
|
3112
|
+
}
|
|
3113
|
+
declare const pnpm: PnpmCli;
|
|
3114
|
+
//#endregion
|
|
3115
|
+
//#region src/common/cli/yarn.d.ts
|
|
3116
|
+
declare class YarnCli extends Cli {
|
|
3117
|
+
constructor();
|
|
3118
|
+
newVersion(version: string): CliSyncResult;
|
|
3119
|
+
version(...args: string[]): CliSyncResult;
|
|
3120
|
+
run(...args: string[]): CliResult;
|
|
3121
|
+
install(...args: string[]): CliResult;
|
|
3122
|
+
/**
|
|
3123
|
+
* Reinstall dependencies without yarn.lock mutation
|
|
3124
|
+
* @returns {Promise<unknown>}
|
|
3125
|
+
*/
|
|
3126
|
+
restore(): CliResult;
|
|
3127
|
+
}
|
|
3128
|
+
declare const yarn: YarnCli;
|
|
3129
|
+
//#endregion
|
|
3130
|
+
//#region src/common/configure-git-workspace.d.ts
|
|
3131
|
+
declare function configureGitWorkspace(context: CmContext): void;
|
|
3132
|
+
//#endregion
|
|
3133
|
+
//#region src/common/get-package-json.d.ts
|
|
3134
|
+
declare function getPackageJson(): PackageJson;
|
|
3135
|
+
//#endregion
|
|
3136
|
+
//#region src/common/get-package-manager.d.ts
|
|
3137
|
+
interface PackageManager extends Cli {
|
|
3138
|
+
newVersion(version: string): CliSyncResult;
|
|
3139
|
+
run(...args: string[]): CliResult;
|
|
3140
|
+
install(...args: string[]): CliResult;
|
|
3141
|
+
restore(): CliResult;
|
|
3142
|
+
}
|
|
3143
|
+
declare function getPackageManager(pkgManager: string): PackageManager;
|
|
3144
|
+
//#endregion
|
|
3145
|
+
//#region src/common/run-command.d.ts
|
|
3146
|
+
declare function runCommand(klass: CommandConstructor, opts: Record<string, any>): Promise<void>;
|
|
3147
|
+
//#endregion
|
|
3148
|
+
//#region src/semantic/define-config.d.ts
|
|
3149
|
+
type ReleasePluginContext = SemanticContext & {
|
|
3150
|
+
nextRelease: NextRelease;
|
|
3151
|
+
};
|
|
3152
|
+
interface ConditionalPluginOptions {
|
|
3153
|
+
when?: (context: ReleasePluginContext) => boolean;
|
|
3154
|
+
[key: string]: unknown;
|
|
3155
|
+
}
|
|
3156
|
+
type Plugin = string | [string, ConditionalPluginOptions];
|
|
3157
|
+
interface CmReleaseConfig extends Options {
|
|
3158
|
+
verifyConditions?: readonly Plugin[];
|
|
3159
|
+
analyzeCommits?: readonly Plugin[];
|
|
3160
|
+
verifyRelease?: readonly Plugin[];
|
|
3161
|
+
generateNotes?: readonly Plugin[];
|
|
3162
|
+
prepare?: readonly Plugin[];
|
|
3163
|
+
publish?: readonly Plugin[];
|
|
3164
|
+
success?: readonly Plugin[];
|
|
3165
|
+
fail?: readonly Plugin[];
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* Define the semantic-release configuration based on the ClubMed API configuration.
|
|
3169
|
+
*/
|
|
3170
|
+
declare function defineConfig(opts?: CmReleaseConfig): CmReleaseConfig;
|
|
3171
|
+
//#endregion
|
|
3172
|
+
//#region src/semantic/utils/release-rules.d.ts
|
|
3173
|
+
declare const releaseRules: (import("lodash").Omit<{
|
|
3174
|
+
type: string;
|
|
3175
|
+
label: string;
|
|
3176
|
+
release: string;
|
|
3177
|
+
} | {
|
|
3178
|
+
type: string;
|
|
3179
|
+
label: string;
|
|
3180
|
+
release: boolean;
|
|
3181
|
+
}, "label"> | {
|
|
3182
|
+
breaking: boolean;
|
|
3183
|
+
release: string;
|
|
3184
|
+
revert?: undefined;
|
|
3185
|
+
} | {
|
|
3186
|
+
breaking?: undefined;
|
|
3187
|
+
revert: boolean;
|
|
3188
|
+
release: string;
|
|
3189
|
+
})[];
|
|
3190
|
+
//#endregion
|
|
3191
|
+
//#region src/semantic/utils/transform-writer.d.ts
|
|
3192
|
+
interface Commit {
|
|
3193
|
+
type: string;
|
|
3194
|
+
message?: string;
|
|
3195
|
+
subject?: string;
|
|
3196
|
+
scope?: string;
|
|
3197
|
+
hash?: string;
|
|
3198
|
+
shortHash?: string;
|
|
3199
|
+
notes: Array<{
|
|
3200
|
+
title: string;
|
|
3201
|
+
}>;
|
|
3202
|
+
references: Array<{
|
|
3203
|
+
issue: string;
|
|
3204
|
+
}>;
|
|
3205
|
+
[key: string]: unknown;
|
|
3206
|
+
}
|
|
3207
|
+
interface TransformContext {
|
|
3208
|
+
repository?: string;
|
|
3209
|
+
host?: string;
|
|
3210
|
+
owner?: string;
|
|
3211
|
+
repoUrl?: string;
|
|
3212
|
+
}
|
|
3213
|
+
declare function transformWriter(commit: Commit, context: TransformContext): Commit | undefined;
|
|
3214
|
+
//#endregion
|
|
3215
|
+
//#region src/workflow/index.d.ts
|
|
3216
|
+
declare const WORKFLOW_CONFIGURATION: ({
|
|
3217
|
+
type: string;
|
|
3218
|
+
label: string;
|
|
3219
|
+
release: string;
|
|
3220
|
+
} | {
|
|
3221
|
+
type: string;
|
|
3222
|
+
label: string;
|
|
3223
|
+
release: boolean;
|
|
3224
|
+
})[];
|
|
3225
|
+
//#endregion
|
|
3226
|
+
//#region src/index.d.ts
|
|
3227
|
+
declare global {
|
|
3228
|
+
const __VERSION__: string;
|
|
3229
|
+
}
|
|
3230
|
+
//#endregion
|
|
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 };
|
|
3232
|
+
//# sourceMappingURL=index.d.mts.map
|