@cmflow/cli 3.4.0-beta.2 → 3.4.0-beta.21
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 +1697 -39248
- package/dist/bin/cmrelease.mjs +1539 -38897
- package/dist/common-CfQycsia.mjs +4 -0
- package/dist/common-CfQycsia.mjs.map +1 -0
- package/dist/{compile-packages-BB08_q2B.mjs → compile-packages-B6nhQT4A.mjs} +4 -2
- package/dist/{compile-packages-BB08_q2B.mjs.map → compile-packages-B6nhQT4A.mjs.map} +1 -1
- package/dist/docker-COfShgcQ.mjs +36 -0
- package/dist/docker-COfShgcQ.mjs.map +1 -0
- package/dist/{docker-clean-tags-EvFdWykP.mjs → docker-clean-tags-ltkwDm3w.mjs} +4 -2
- package/dist/{docker-clean-tags-EvFdWykP.mjs.map → docker-clean-tags-ltkwDm3w.mjs.map} +1 -1
- package/dist/{docker-publish-CG0aN9se.mjs → docker-publish-DQFIuqCn.mjs} +4 -2
- package/dist/{docker-publish-CG0aN9se.mjs.map → docker-publish-DQFIuqCn.mjs.map} +1 -1
- package/dist/{find-packages-611B-66T.mjs → find-packages-CIHA2-RE.mjs} +12 -10
- package/dist/{find-packages-611B-66T.mjs.map → find-packages-CIHA2-RE.mjs.map} +1 -1
- package/dist/get-config-Bojgeyi0.mjs +11 -0
- package/dist/get-config-Bojgeyi0.mjs.map +1 -0
- package/dist/index-B7dZdFg6.d.mts +267 -0
- package/dist/index.d.mts +2067 -0
- package/dist/index.mjs +34 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{npm-VM_GgazT.mjs → npm-Ckg6sg0g.mjs} +4 -2
- package/dist/{npm-VM_GgazT.mjs.map → npm-Ckg6sg0g.mjs.map} +1 -1
- 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-DFjVbN1S.mjs.map → semver-BEj6Vrs4.mjs.map} +1 -1
- package/dist/source-DS6vboEb.mjs +9 -0
- package/dist/{source-CwLcYLzI.mjs.map → source-DS6vboEb.mjs.map} +1 -1
- package/dist/{write-package-cxki9d3K.mjs → write-package-CZMoWfOT.mjs} +8 -6
- package/dist/{write-package-cxki9d3K.mjs.map → write-package-CZMoWfOT.mjs.map} +1 -1
- package/dist/{write-packages-CxCAl_AG.mjs → write-packages-iAGBE9Qr.mjs} +5 -3
- package/dist/{write-packages-CxCAl_AG.mjs.map → write-packages-iAGBE9Qr.mjs.map} +1 -1
- package/package.json +19 -10
- package/dist/cli-truncate-Bi2MjGwF.mjs +0 -323
- package/dist/cli-truncate-DMcpM5Q7.mjs +0 -2
- package/dist/cli-truncate-DMcpM5Q7.mjs.map +0 -1
- package/dist/cli-truncate-DsW0mgI_.mjs +0 -323
- package/dist/common-BdfXquG0.mjs +0 -61
- package/dist/common-BdfXquG0.mjs.map +0 -1
- package/dist/docker-Cc30aRzl.mjs +0 -34
- package/dist/docker-Cc30aRzl.mjs.map +0 -1
- package/dist/get-config-8ivgd1KC.mjs +0 -9
- package/dist/get-config-8ivgd1KC.mjs.map +0 -1
- package/dist/get-east-asian-width-Tfn8qoqd.mjs +0 -2
- package/dist/get-east-asian-width-Tfn8qoqd.mjs.map +0 -1
- package/dist/get-east-asian-width-wiVWCFXf.mjs +0 -682
- package/dist/log-update-CLbF3iV6.mjs +0 -6
- package/dist/log-update-CLbF3iV6.mjs.map +0 -1
- package/dist/log-update-CTXRtajW.mjs +0 -668
- package/dist/log-update-Dy1vPMGY.mjs +0 -668
- package/dist/rolldown-runtime-B4iAMlE-.mjs +0 -35
- package/dist/semver-DFjVbN1S.mjs +0 -2
- package/dist/source-CwLcYLzI.mjs +0 -7
- package/dist/wrap-ansi-9ugahFCy.mjs +0 -9
- package/dist/wrap-ansi-9ugahFCy.mjs.map +0 -1
- package/dist/wrap-ansi-BRr0GA6g.mjs +0 -330
- package/dist/wrap-ansi-Cupoo4Yg.mjs +0 -330
- package/dist/wrap-ansi-dwgEjNWf.mjs +0 -2
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2067 @@
|
|
|
1
|
+
|
|
2
|
+
/// <reference path="operators/index.d.ts" />
|
|
3
|
+
/// <reference path="testing/index.d.ts" />
|
|
4
|
+
/// <reference types="node"/>
|
|
5
|
+
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";
|
|
6
|
+
import { ChildProcess } from "child_process";
|
|
7
|
+
import { Readable, Stream } from "stream";
|
|
8
|
+
import { NextRelease, Options as Options$1 } from "semantic-release";
|
|
9
|
+
//#region ../../node_modules/commander/typings/index.d.ts
|
|
10
|
+
// Type definitions for commander
|
|
11
|
+
// 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>
|
|
12
|
+
// Using method rather than property for method-signature-style, to document method overloads separately. Allow either.
|
|
13
|
+
/* eslint-disable @typescript-eslint/method-signature-style */
|
|
14
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
15
|
+
// This is a trick to encourage editor to suggest the known literals while still
|
|
16
|
+
// allowing any BaseType value.
|
|
17
|
+
// References:
|
|
18
|
+
// - https://github.com/microsoft/TypeScript/issues/29729
|
|
19
|
+
// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
|
|
20
|
+
// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
|
|
21
|
+
type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
|
|
22
|
+
declare class CommanderError extends Error {
|
|
23
|
+
code: string;
|
|
24
|
+
exitCode: number;
|
|
25
|
+
message: string;
|
|
26
|
+
nestedError?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Constructs the CommanderError class
|
|
29
|
+
* @param exitCode - suggested exit code which could be used with process.exit
|
|
30
|
+
* @param code - an id string representing the error
|
|
31
|
+
* @param message - human-readable description of the error
|
|
32
|
+
*/
|
|
33
|
+
constructor(exitCode: number, code: string, message: string);
|
|
34
|
+
}
|
|
35
|
+
interface ErrorOptions {
|
|
36
|
+
// optional parameter for error()
|
|
37
|
+
/** an id string representing the error */
|
|
38
|
+
code?: string;
|
|
39
|
+
/** suggested exit code which could be used with process.exit */
|
|
40
|
+
exitCode?: number;
|
|
41
|
+
}
|
|
42
|
+
declare class Argument {
|
|
43
|
+
description: string;
|
|
44
|
+
required: boolean;
|
|
45
|
+
variadic: boolean;
|
|
46
|
+
defaultValue?: any;
|
|
47
|
+
defaultValueDescription?: string;
|
|
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
|
+
constructor(flags: string, description?: string);
|
|
98
|
+
/**
|
|
99
|
+
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
100
|
+
*/
|
|
101
|
+
default(value: unknown, description?: string): this;
|
|
102
|
+
/**
|
|
103
|
+
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
|
|
104
|
+
* The custom processing (parseArg) is called.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* new Option('--color').default('GREYSCALE').preset('RGB');
|
|
109
|
+
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
preset(arg: unknown): this;
|
|
113
|
+
/**
|
|
114
|
+
* Add option name(s) that conflict with this option.
|
|
115
|
+
* An error will be displayed if conflicting options are found during parsing.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* new Option('--rgb').conflicts('cmyk');
|
|
120
|
+
* new Option('--js').conflicts(['ts', 'jsx']);
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
conflicts(names: string | string[]): this;
|
|
124
|
+
/**
|
|
125
|
+
* Specify implied option values for when this option is set and the implied options are not.
|
|
126
|
+
*
|
|
127
|
+
* The custom processing (parseArg) is not called on the implied values.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* program
|
|
131
|
+
* .addOption(new Option('--log', 'write logging information to file'))
|
|
132
|
+
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
|
133
|
+
*/
|
|
134
|
+
implies(optionValues: OptionValues): this;
|
|
135
|
+
/**
|
|
136
|
+
* Set environment variable to check for option value.
|
|
137
|
+
*
|
|
138
|
+
* An environment variables is only used if when processed the current option value is
|
|
139
|
+
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
|
|
140
|
+
*/
|
|
141
|
+
env(name: string): this;
|
|
142
|
+
/**
|
|
143
|
+
* Set the custom handler for processing CLI option arguments into option values.
|
|
144
|
+
*/
|
|
145
|
+
argParser<T>(fn: (value: string, previous: T) => T): this;
|
|
146
|
+
/**
|
|
147
|
+
* Whether the option is mandatory and must have a value after parsing.
|
|
148
|
+
*/
|
|
149
|
+
makeOptionMandatory(mandatory?: boolean): this;
|
|
150
|
+
/**
|
|
151
|
+
* Hide option in help.
|
|
152
|
+
*/
|
|
153
|
+
hideHelp(hide?: boolean): this;
|
|
154
|
+
/**
|
|
155
|
+
* Only allow option value to be one of choices.
|
|
156
|
+
*/
|
|
157
|
+
choices(values: readonly string[]): this;
|
|
158
|
+
/**
|
|
159
|
+
* Return option name.
|
|
160
|
+
*/
|
|
161
|
+
name(): string;
|
|
162
|
+
/**
|
|
163
|
+
* Return option name, in a camelcase format that can be used
|
|
164
|
+
* as a object attribute key.
|
|
165
|
+
*/
|
|
166
|
+
attributeName(): string;
|
|
167
|
+
/**
|
|
168
|
+
* Return whether a boolean option.
|
|
169
|
+
*
|
|
170
|
+
* Options are one of boolean, negated, required argument, or optional argument.
|
|
171
|
+
*/
|
|
172
|
+
isBoolean(): boolean;
|
|
173
|
+
}
|
|
174
|
+
declare class Help {
|
|
175
|
+
/** output helpWidth, long lines are wrapped to fit */
|
|
176
|
+
helpWidth?: number;
|
|
177
|
+
sortSubcommands: boolean;
|
|
178
|
+
sortOptions: boolean;
|
|
179
|
+
showGlobalOptions: boolean;
|
|
180
|
+
constructor();
|
|
181
|
+
/** Get the command term to show in the list of subcommands. */
|
|
182
|
+
subcommandTerm(cmd: Command): string;
|
|
183
|
+
/** Get the command summary to show in the list of subcommands. */
|
|
184
|
+
subcommandDescription(cmd: Command): string;
|
|
185
|
+
/** Get the option term to show in the list of options. */
|
|
186
|
+
optionTerm(option: Option): string;
|
|
187
|
+
/** Get the option description to show in the list of options. */
|
|
188
|
+
optionDescription(option: Option): string;
|
|
189
|
+
/** Get the argument term to show in the list of arguments. */
|
|
190
|
+
argumentTerm(argument: Argument): string;
|
|
191
|
+
/** Get the argument description to show in the list of arguments. */
|
|
192
|
+
argumentDescription(argument: Argument): string;
|
|
193
|
+
/** Get the command usage to be displayed at the top of the built-in help. */
|
|
194
|
+
commandUsage(cmd: Command): string;
|
|
195
|
+
/** Get the description for the command. */
|
|
196
|
+
commandDescription(cmd: Command): string;
|
|
197
|
+
/** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
|
|
198
|
+
visibleCommands(cmd: Command): Command[];
|
|
199
|
+
/** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
|
|
200
|
+
visibleOptions(cmd: Command): Option[];
|
|
201
|
+
/** Get an array of the visible global options. (Not including help.) */
|
|
202
|
+
visibleGlobalOptions(cmd: Command): Option[];
|
|
203
|
+
/** Get an array of the arguments which have descriptions. */
|
|
204
|
+
visibleArguments(cmd: Command): Argument[];
|
|
205
|
+
/** Get the longest command term length. */
|
|
206
|
+
longestSubcommandTermLength(cmd: Command, helper: Help): number;
|
|
207
|
+
/** Get the longest option term length. */
|
|
208
|
+
longestOptionTermLength(cmd: Command, helper: Help): number;
|
|
209
|
+
/** Get the longest global option term length. */
|
|
210
|
+
longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
|
|
211
|
+
/** Get the longest argument term length. */
|
|
212
|
+
longestArgumentTermLength(cmd: Command, helper: Help): number;
|
|
213
|
+
/** Calculate the pad width from the maximum term length. */
|
|
214
|
+
padWidth(cmd: Command, helper: Help): number;
|
|
215
|
+
/**
|
|
216
|
+
* Wrap the given string to width characters per line, with lines after the first indented.
|
|
217
|
+
* Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
|
|
218
|
+
*/
|
|
219
|
+
wrap(str: string, width: number, indent: number, minColumnWidth?: number): string;
|
|
220
|
+
/** Generate the built-in help text. */
|
|
221
|
+
formatHelp(cmd: Command, helper: Help): string;
|
|
222
|
+
}
|
|
223
|
+
type HelpConfiguration = Partial<Help>;
|
|
224
|
+
interface ParseOptions {
|
|
225
|
+
from: 'node' | 'electron' | 'user';
|
|
226
|
+
}
|
|
227
|
+
interface HelpContext {
|
|
228
|
+
// optional parameter for .help() and .outputHelp()
|
|
229
|
+
error: boolean;
|
|
230
|
+
}
|
|
231
|
+
interface AddHelpTextContext {
|
|
232
|
+
// passed to text function used with .addHelpText()
|
|
233
|
+
error: boolean;
|
|
234
|
+
command: Command;
|
|
235
|
+
}
|
|
236
|
+
interface OutputConfiguration {
|
|
237
|
+
writeOut?(str: string): void;
|
|
238
|
+
writeErr?(str: string): void;
|
|
239
|
+
getOutHelpWidth?(): number;
|
|
240
|
+
getErrHelpWidth?(): number;
|
|
241
|
+
outputError?(str: string, write: (str: string) => void): void;
|
|
242
|
+
}
|
|
243
|
+
type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
|
|
244
|
+
type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
|
|
245
|
+
// The source is a string so author can define their own too.
|
|
246
|
+
type OptionValueSource = LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string> | undefined;
|
|
247
|
+
type OptionValues = Record<string, any>;
|
|
248
|
+
declare class Command {
|
|
249
|
+
args: string[];
|
|
250
|
+
processedArgs: any[];
|
|
251
|
+
readonly commands: readonly Command[];
|
|
252
|
+
readonly options: readonly Option[];
|
|
253
|
+
readonly registeredArguments: readonly Argument[];
|
|
254
|
+
parent: Command | null;
|
|
255
|
+
constructor(name?: string);
|
|
256
|
+
/**
|
|
257
|
+
* Set the program version to `str`.
|
|
258
|
+
*
|
|
259
|
+
* This method auto-registers the "-V, --version" flag
|
|
260
|
+
* which will print the version number when passed.
|
|
261
|
+
*
|
|
262
|
+
* You can optionally supply the flags and description to override the defaults.
|
|
263
|
+
*/
|
|
264
|
+
version(str: string, flags?: string, description?: string): this;
|
|
265
|
+
/**
|
|
266
|
+
* Get the program version.
|
|
267
|
+
*/
|
|
268
|
+
version(): string | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* Define a command, implemented using an action handler.
|
|
271
|
+
*
|
|
272
|
+
* @remarks
|
|
273
|
+
* The command description is supplied using `.description`, not as a parameter to `.command`.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* program
|
|
278
|
+
* .command('clone <source> [destination]')
|
|
279
|
+
* .description('clone a repository into a newly created directory')
|
|
280
|
+
* .action((source, destination) => {
|
|
281
|
+
* console.log('clone command called');
|
|
282
|
+
* });
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
286
|
+
* @param opts - configuration options
|
|
287
|
+
* @returns new command
|
|
288
|
+
*/
|
|
289
|
+
command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
|
|
290
|
+
/**
|
|
291
|
+
* Define a command, implemented in a separate executable file.
|
|
292
|
+
*
|
|
293
|
+
* @remarks
|
|
294
|
+
* The command description is supplied as the second parameter to `.command`.
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```ts
|
|
298
|
+
* program
|
|
299
|
+
* .command('start <service>', 'start named service')
|
|
300
|
+
* .command('stop [service]', 'stop named service, or all if no name supplied');
|
|
301
|
+
* ```
|
|
302
|
+
*
|
|
303
|
+
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
304
|
+
* @param description - description of executable command
|
|
305
|
+
* @param opts - configuration options
|
|
306
|
+
* @returns `this` command for chaining
|
|
307
|
+
*/
|
|
308
|
+
command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
|
|
309
|
+
/**
|
|
310
|
+
* Factory routine to create a new unattached command.
|
|
311
|
+
*
|
|
312
|
+
* See .command() for creating an attached subcommand, which uses this routine to
|
|
313
|
+
* create the command. You can override createCommand to customise subcommands.
|
|
314
|
+
*/
|
|
315
|
+
createCommand(name?: string): Command;
|
|
316
|
+
/**
|
|
317
|
+
* Add a prepared subcommand.
|
|
318
|
+
*
|
|
319
|
+
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
|
320
|
+
*
|
|
321
|
+
* @returns `this` command for chaining
|
|
322
|
+
*/
|
|
323
|
+
addCommand(cmd: Command, opts?: CommandOptions): this;
|
|
324
|
+
/**
|
|
325
|
+
* Factory routine to create a new unattached argument.
|
|
326
|
+
*
|
|
327
|
+
* See .argument() for creating an attached argument, which uses this routine to
|
|
328
|
+
* create the argument. You can override createArgument to return a custom argument.
|
|
329
|
+
*/
|
|
330
|
+
createArgument(name: string, description?: string): Argument;
|
|
331
|
+
/**
|
|
332
|
+
* Define argument syntax for command.
|
|
333
|
+
*
|
|
334
|
+
* The default is that the argument is required, and you can explicitly
|
|
335
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```
|
|
339
|
+
* program.argument('<input-file>');
|
|
340
|
+
* program.argument('[output-file]');
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* @returns `this` command for chaining
|
|
344
|
+
*/
|
|
345
|
+
argument<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
346
|
+
argument(name: string, description?: string, defaultValue?: unknown): this;
|
|
347
|
+
/**
|
|
348
|
+
* Define argument syntax for command, adding a prepared argument.
|
|
349
|
+
*
|
|
350
|
+
* @returns `this` command for chaining
|
|
351
|
+
*/
|
|
352
|
+
addArgument(arg: Argument): this;
|
|
353
|
+
/**
|
|
354
|
+
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
355
|
+
*
|
|
356
|
+
* See also .argument().
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```
|
|
360
|
+
* program.arguments('<cmd> [env]');
|
|
361
|
+
* ```
|
|
362
|
+
*
|
|
363
|
+
* @returns `this` command for chaining
|
|
364
|
+
*/
|
|
365
|
+
arguments(names: string): this;
|
|
366
|
+
/**
|
|
367
|
+
* Customise or override default help command. By default a help command is automatically added if your command has subcommands.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* program.helpCommand('help [cmd]');
|
|
372
|
+
* program.helpCommand('help [cmd]', 'show help');
|
|
373
|
+
* program.helpCommand(false); // suppress default help command
|
|
374
|
+
* program.helpCommand(true); // add help command even if no subcommands
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
helpCommand(nameAndArgs: string, description?: string): this;
|
|
378
|
+
helpCommand(enable: boolean): this;
|
|
379
|
+
/**
|
|
380
|
+
* Add prepared custom help command.
|
|
381
|
+
*/
|
|
382
|
+
addHelpCommand(cmd: Command): this;
|
|
383
|
+
/** @deprecated since v12, instead use helpCommand */
|
|
384
|
+
addHelpCommand(nameAndArgs: string, description?: string): this;
|
|
385
|
+
/** @deprecated since v12, instead use helpCommand */
|
|
386
|
+
addHelpCommand(enable?: boolean): this;
|
|
387
|
+
/**
|
|
388
|
+
* Add hook for life cycle event.
|
|
389
|
+
*/
|
|
390
|
+
hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
|
|
391
|
+
/**
|
|
392
|
+
* Register callback to use as replacement for calling process.exit.
|
|
393
|
+
*/
|
|
394
|
+
exitOverride(callback?: (err: CommanderError) => never | void): this;
|
|
395
|
+
/**
|
|
396
|
+
* Display error message and exit (or call exitOverride).
|
|
397
|
+
*/
|
|
398
|
+
error(message: string, errorOptions?: ErrorOptions): never;
|
|
399
|
+
/**
|
|
400
|
+
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
401
|
+
* or by overriding Help properties using configureHelp().
|
|
402
|
+
*/
|
|
403
|
+
createHelp(): Help;
|
|
404
|
+
/**
|
|
405
|
+
* You can customise the help by overriding Help properties using configureHelp(),
|
|
406
|
+
* or with a subclass of Help by overriding createHelp().
|
|
407
|
+
*/
|
|
408
|
+
configureHelp(configuration: HelpConfiguration): this;
|
|
409
|
+
/** Get configuration */
|
|
410
|
+
configureHelp(): HelpConfiguration;
|
|
411
|
+
/**
|
|
412
|
+
* The default output goes to stdout and stderr. You can customise this for special
|
|
413
|
+
* applications. You can also customise the display of errors by overriding outputError.
|
|
414
|
+
*
|
|
415
|
+
* The configuration properties are all functions:
|
|
416
|
+
* ```
|
|
417
|
+
* // functions to change where being written, stdout and stderr
|
|
418
|
+
* writeOut(str)
|
|
419
|
+
* writeErr(str)
|
|
420
|
+
* // matching functions to specify width for wrapping help
|
|
421
|
+
* getOutHelpWidth()
|
|
422
|
+
* getErrHelpWidth()
|
|
423
|
+
* // functions based on what is being written out
|
|
424
|
+
* outputError(str, write) // used for displaying errors, and not used for displaying help
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
configureOutput(configuration: OutputConfiguration): this;
|
|
428
|
+
/** Get configuration */
|
|
429
|
+
configureOutput(): OutputConfiguration;
|
|
430
|
+
/**
|
|
431
|
+
* Copy settings that are useful to have in common across root command and subcommands.
|
|
432
|
+
*
|
|
433
|
+
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
|
|
434
|
+
*/
|
|
435
|
+
copyInheritedSettings(sourceCommand: Command): this;
|
|
436
|
+
/**
|
|
437
|
+
* Display the help or a custom message after an error occurs.
|
|
438
|
+
*/
|
|
439
|
+
showHelpAfterError(displayHelp?: boolean | string): this;
|
|
440
|
+
/**
|
|
441
|
+
* Display suggestion of similar commands for unknown commands, or options for unknown options.
|
|
442
|
+
*/
|
|
443
|
+
showSuggestionAfterError(displaySuggestion?: boolean): this;
|
|
444
|
+
/**
|
|
445
|
+
* Register callback `fn` for the command.
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```
|
|
449
|
+
* program
|
|
450
|
+
* .command('serve')
|
|
451
|
+
* .description('start service')
|
|
452
|
+
* .action(function() {
|
|
453
|
+
* // do work here
|
|
454
|
+
* });
|
|
455
|
+
* ```
|
|
456
|
+
*
|
|
457
|
+
* @returns `this` command for chaining
|
|
458
|
+
*/
|
|
459
|
+
action(fn: (...args: any[]) => void | Promise<void>): this;
|
|
460
|
+
/**
|
|
461
|
+
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
462
|
+
*
|
|
463
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
|
|
464
|
+
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
|
|
465
|
+
*
|
|
466
|
+
* See the README for more details, and see also addOption() and requiredOption().
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
*
|
|
470
|
+
* ```js
|
|
471
|
+
* program
|
|
472
|
+
* .option('-p, --pepper', 'add pepper')
|
|
473
|
+
* .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
|
474
|
+
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
|
475
|
+
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
|
476
|
+
* ```
|
|
477
|
+
*
|
|
478
|
+
* @returns `this` command for chaining
|
|
479
|
+
*/
|
|
480
|
+
option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
|
481
|
+
option<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
482
|
+
/** @deprecated since v7, instead use choices or a custom function */
|
|
483
|
+
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
|
484
|
+
/**
|
|
485
|
+
* Define a required option, which must have a value after parsing. This usually means
|
|
486
|
+
* the option must be specified on the command line. (Otherwise the same as .option().)
|
|
487
|
+
*
|
|
488
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
|
489
|
+
*/
|
|
490
|
+
requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
|
491
|
+
requiredOption<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
492
|
+
/** @deprecated since v7, instead use choices or a custom function */
|
|
493
|
+
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
|
494
|
+
/**
|
|
495
|
+
* Factory routine to create a new unattached option.
|
|
496
|
+
*
|
|
497
|
+
* See .option() for creating an attached option, which uses this routine to
|
|
498
|
+
* create the option. You can override createOption to return a custom option.
|
|
499
|
+
*/
|
|
500
|
+
createOption(flags: string, description?: string): Option;
|
|
501
|
+
/**
|
|
502
|
+
* Add a prepared Option.
|
|
503
|
+
*
|
|
504
|
+
* See .option() and .requiredOption() for creating and attaching an option in a single call.
|
|
505
|
+
*/
|
|
506
|
+
addOption(option: Option): this;
|
|
507
|
+
/**
|
|
508
|
+
* Whether to store option values as properties on command object,
|
|
509
|
+
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
|
510
|
+
*
|
|
511
|
+
* @returns `this` command for chaining
|
|
512
|
+
*/
|
|
513
|
+
storeOptionsAsProperties<T extends OptionValues>(): this & T;
|
|
514
|
+
storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
|
|
515
|
+
storeOptionsAsProperties(storeAsProperties?: boolean): this;
|
|
516
|
+
/**
|
|
517
|
+
* Retrieve option value.
|
|
518
|
+
*/
|
|
519
|
+
getOptionValue(key: string): any;
|
|
520
|
+
/**
|
|
521
|
+
* Store option value.
|
|
522
|
+
*/
|
|
523
|
+
setOptionValue(key: string, value: unknown): this;
|
|
524
|
+
/**
|
|
525
|
+
* Store option value and where the value came from.
|
|
526
|
+
*/
|
|
527
|
+
setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
|
|
528
|
+
/**
|
|
529
|
+
* Get source of option value.
|
|
530
|
+
*/
|
|
531
|
+
getOptionValueSource(key: string): OptionValueSource | undefined;
|
|
532
|
+
/**
|
|
533
|
+
* Get source of option value. See also .optsWithGlobals().
|
|
534
|
+
*/
|
|
535
|
+
getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
|
|
536
|
+
/**
|
|
537
|
+
* Alter parsing of short flags with optional values.
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* ```
|
|
541
|
+
* // for `.option('-f,--flag [value]'):
|
|
542
|
+
* .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
|
|
543
|
+
* .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
|
|
544
|
+
* ```
|
|
545
|
+
*
|
|
546
|
+
* @returns `this` command for chaining
|
|
547
|
+
*/
|
|
548
|
+
combineFlagAndOptionalValue(combine?: boolean): this;
|
|
549
|
+
/**
|
|
550
|
+
* Allow unknown options on the command line.
|
|
551
|
+
*
|
|
552
|
+
* @returns `this` command for chaining
|
|
553
|
+
*/
|
|
554
|
+
allowUnknownOption(allowUnknown?: boolean): this;
|
|
555
|
+
/**
|
|
556
|
+
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
|
|
557
|
+
*
|
|
558
|
+
* @returns `this` command for chaining
|
|
559
|
+
*/
|
|
560
|
+
allowExcessArguments(allowExcess?: boolean): this;
|
|
561
|
+
/**
|
|
562
|
+
* Enable positional options. Positional means global options are specified before subcommands which lets
|
|
563
|
+
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
|
|
564
|
+
*
|
|
565
|
+
* The default behaviour is non-positional and global options may appear anywhere on the command line.
|
|
566
|
+
*
|
|
567
|
+
* @returns `this` command for chaining
|
|
568
|
+
*/
|
|
569
|
+
enablePositionalOptions(positional?: boolean): this;
|
|
570
|
+
/**
|
|
571
|
+
* Pass through options that come after command-arguments rather than treat them as command-options,
|
|
572
|
+
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
|
|
573
|
+
* positional options to have been enabled on the program (parent commands).
|
|
574
|
+
*
|
|
575
|
+
* The default behaviour is non-positional and options may appear before or after command-arguments.
|
|
576
|
+
*
|
|
577
|
+
* @returns `this` command for chaining
|
|
578
|
+
*/
|
|
579
|
+
passThroughOptions(passThrough?: boolean): this;
|
|
580
|
+
/**
|
|
581
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
582
|
+
*
|
|
583
|
+
* Use parseAsync instead of parse if any of your action handlers are async.
|
|
584
|
+
*
|
|
585
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
586
|
+
*
|
|
587
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
588
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
589
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
590
|
+
* - `'user'`: just user arguments
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
* ```
|
|
594
|
+
* program.parse(); // parse process.argv and auto-detect electron and special node flags
|
|
595
|
+
* program.parse(process.argv); // assume argv[0] is app and argv[1] is script
|
|
596
|
+
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
597
|
+
* ```
|
|
598
|
+
*
|
|
599
|
+
* @returns `this` command for chaining
|
|
600
|
+
*/
|
|
601
|
+
parse(argv?: readonly string[], parseOptions?: ParseOptions): this;
|
|
602
|
+
/**
|
|
603
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
604
|
+
*
|
|
605
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
606
|
+
*
|
|
607
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
608
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
609
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
610
|
+
* - `'user'`: just user arguments
|
|
611
|
+
*
|
|
612
|
+
* @example
|
|
613
|
+
* ```
|
|
614
|
+
* await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
|
|
615
|
+
* await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
|
|
616
|
+
* await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
617
|
+
* ```
|
|
618
|
+
*
|
|
619
|
+
* @returns Promise
|
|
620
|
+
*/
|
|
621
|
+
parseAsync(argv?: readonly string[], parseOptions?: ParseOptions): Promise<this>;
|
|
622
|
+
/**
|
|
623
|
+
* Parse options from `argv` removing known options,
|
|
624
|
+
* and return argv split into operands and unknown arguments.
|
|
625
|
+
*
|
|
626
|
+
* argv => operands, unknown
|
|
627
|
+
* --known kkk op => [op], []
|
|
628
|
+
* op --known kkk => [op], []
|
|
629
|
+
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
|
630
|
+
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
|
631
|
+
*/
|
|
632
|
+
parseOptions(argv: string[]): ParseOptionsResult;
|
|
633
|
+
/**
|
|
634
|
+
* Return an object containing local option values as key-value pairs
|
|
635
|
+
*/
|
|
636
|
+
opts<T extends OptionValues>(): T;
|
|
637
|
+
/**
|
|
638
|
+
* Return an object containing merged local and global option values as key-value pairs.
|
|
639
|
+
*/
|
|
640
|
+
optsWithGlobals<T extends OptionValues>(): T;
|
|
641
|
+
/**
|
|
642
|
+
* Set the description.
|
|
643
|
+
*
|
|
644
|
+
* @returns `this` command for chaining
|
|
645
|
+
*/
|
|
646
|
+
description(str: string): this;
|
|
647
|
+
/** @deprecated since v8, instead use .argument to add command argument with description */
|
|
648
|
+
description(str: string, argsDescription: Record<string, string>): this;
|
|
649
|
+
/**
|
|
650
|
+
* Get the description.
|
|
651
|
+
*/
|
|
652
|
+
description(): string;
|
|
653
|
+
/**
|
|
654
|
+
* Set the summary. Used when listed as subcommand of parent.
|
|
655
|
+
*
|
|
656
|
+
* @returns `this` command for chaining
|
|
657
|
+
*/
|
|
658
|
+
summary(str: string): this;
|
|
659
|
+
/**
|
|
660
|
+
* Get the summary.
|
|
661
|
+
*/
|
|
662
|
+
summary(): string;
|
|
663
|
+
/**
|
|
664
|
+
* Set an alias for the command.
|
|
665
|
+
*
|
|
666
|
+
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
|
667
|
+
*
|
|
668
|
+
* @returns `this` command for chaining
|
|
669
|
+
*/
|
|
670
|
+
alias(alias: string): this;
|
|
671
|
+
/**
|
|
672
|
+
* Get alias for the command.
|
|
673
|
+
*/
|
|
674
|
+
alias(): string;
|
|
675
|
+
/**
|
|
676
|
+
* Set aliases for the command.
|
|
677
|
+
*
|
|
678
|
+
* Only the first alias is shown in the auto-generated help.
|
|
679
|
+
*
|
|
680
|
+
* @returns `this` command for chaining
|
|
681
|
+
*/
|
|
682
|
+
aliases(aliases: readonly string[]): this;
|
|
683
|
+
/**
|
|
684
|
+
* Get aliases for the command.
|
|
685
|
+
*/
|
|
686
|
+
aliases(): string[];
|
|
687
|
+
/**
|
|
688
|
+
* Set the command usage.
|
|
689
|
+
*
|
|
690
|
+
* @returns `this` command for chaining
|
|
691
|
+
*/
|
|
692
|
+
usage(str: string): this;
|
|
693
|
+
/**
|
|
694
|
+
* Get the command usage.
|
|
695
|
+
*/
|
|
696
|
+
usage(): string;
|
|
697
|
+
/**
|
|
698
|
+
* Set the name of the command.
|
|
699
|
+
*
|
|
700
|
+
* @returns `this` command for chaining
|
|
701
|
+
*/
|
|
702
|
+
name(str: string): this;
|
|
703
|
+
/**
|
|
704
|
+
* Get the name of the command.
|
|
705
|
+
*/
|
|
706
|
+
name(): string;
|
|
707
|
+
/**
|
|
708
|
+
* Set the name of the command from script filename, such as process.argv[1],
|
|
709
|
+
* or require.main.filename, or __filename.
|
|
710
|
+
*
|
|
711
|
+
* (Used internally and public although not documented in README.)
|
|
712
|
+
*
|
|
713
|
+
* @example
|
|
714
|
+
* ```ts
|
|
715
|
+
* program.nameFromFilename(require.main.filename);
|
|
716
|
+
* ```
|
|
717
|
+
*
|
|
718
|
+
* @returns `this` command for chaining
|
|
719
|
+
*/
|
|
720
|
+
nameFromFilename(filename: string): this;
|
|
721
|
+
/**
|
|
722
|
+
* Set the directory for searching for executable subcommands of this command.
|
|
723
|
+
*
|
|
724
|
+
* @example
|
|
725
|
+
* ```ts
|
|
726
|
+
* program.executableDir(__dirname);
|
|
727
|
+
* // or
|
|
728
|
+
* program.executableDir('subcommands');
|
|
729
|
+
* ```
|
|
730
|
+
*
|
|
731
|
+
* @returns `this` command for chaining
|
|
732
|
+
*/
|
|
733
|
+
executableDir(path: string): this;
|
|
734
|
+
/**
|
|
735
|
+
* Get the executable search directory.
|
|
736
|
+
*/
|
|
737
|
+
executableDir(): string | null;
|
|
738
|
+
/**
|
|
739
|
+
* Output help information for this command.
|
|
740
|
+
*
|
|
741
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
742
|
+
*
|
|
743
|
+
*/
|
|
744
|
+
outputHelp(context?: HelpContext): void;
|
|
745
|
+
/** @deprecated since v7 */
|
|
746
|
+
outputHelp(cb?: (str: string) => string): void;
|
|
747
|
+
/**
|
|
748
|
+
* Return command help documentation.
|
|
749
|
+
*/
|
|
750
|
+
helpInformation(context?: HelpContext): string;
|
|
751
|
+
/**
|
|
752
|
+
* You can pass in flags and a description to override the help
|
|
753
|
+
* flags and help description for your command. Pass in false
|
|
754
|
+
* to disable the built-in help option.
|
|
755
|
+
*/
|
|
756
|
+
helpOption(flags?: string | boolean, description?: string): this;
|
|
757
|
+
/**
|
|
758
|
+
* Supply your own option to use for the built-in help option.
|
|
759
|
+
* This is an alternative to using helpOption() to customise the flags and description etc.
|
|
760
|
+
*/
|
|
761
|
+
addHelpOption(option: Option): this;
|
|
762
|
+
/**
|
|
763
|
+
* Output help information and exit.
|
|
764
|
+
*
|
|
765
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
766
|
+
*/
|
|
767
|
+
help(context?: HelpContext): never;
|
|
768
|
+
/** @deprecated since v7 */
|
|
769
|
+
help(cb?: (str: string) => string): never;
|
|
770
|
+
/**
|
|
771
|
+
* Add additional text to be displayed with the built-in help.
|
|
772
|
+
*
|
|
773
|
+
* Position is 'before' or 'after' to affect just this command,
|
|
774
|
+
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
|
775
|
+
*/
|
|
776
|
+
addHelpText(position: AddHelpTextPosition, text: string): this;
|
|
777
|
+
addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
|
|
778
|
+
/**
|
|
779
|
+
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
|
|
780
|
+
*/
|
|
781
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
782
|
+
}
|
|
783
|
+
interface CommandOptions {
|
|
784
|
+
hidden?: boolean;
|
|
785
|
+
isDefault?: boolean;
|
|
786
|
+
/** @deprecated since v7, replaced by hidden */
|
|
787
|
+
noHelp?: boolean;
|
|
788
|
+
}
|
|
789
|
+
interface ExecutableCommandOptions extends CommandOptions {
|
|
790
|
+
executableFile?: string;
|
|
791
|
+
}
|
|
792
|
+
interface ParseOptionsResult {
|
|
793
|
+
operands: string[];
|
|
794
|
+
unknown: string[];
|
|
795
|
+
}
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region src/commands/checkfeatures.d.ts
|
|
798
|
+
interface CheckfeaturesOpts {
|
|
799
|
+
verbose?: number;
|
|
800
|
+
}
|
|
801
|
+
declare class Checkfeatures implements ICommand {
|
|
802
|
+
mapContext(_opts: CheckfeaturesOpts, context: CmContext): CmContext;
|
|
803
|
+
getTasks(context: CmContext): CmTask[];
|
|
804
|
+
success(): void;
|
|
805
|
+
}
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region src/commands/clean.d.ts
|
|
808
|
+
interface CleanOpts {
|
|
809
|
+
verbose?: number;
|
|
810
|
+
}
|
|
811
|
+
declare class Clean implements ICommand {
|
|
812
|
+
mapContext(_opts: CleanOpts, context: CmContext): CmContext;
|
|
813
|
+
getTasks(context: CmContext): CmTask[];
|
|
814
|
+
success(): void;
|
|
815
|
+
}
|
|
816
|
+
//#endregion
|
|
817
|
+
//#region src/commands/config.d.ts
|
|
818
|
+
interface ConfigOpts {
|
|
819
|
+
verbose?: number;
|
|
820
|
+
}
|
|
821
|
+
declare class Config implements ICommand {
|
|
822
|
+
mapContext(_opts: ConfigOpts, context: CmContext): CmContext;
|
|
823
|
+
getTasks(context: CmContext): CmTask[];
|
|
824
|
+
}
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region src/commands/deploy.d.ts
|
|
827
|
+
interface DeployOpts {
|
|
828
|
+
target?: string;
|
|
829
|
+
verbose?: number;
|
|
830
|
+
}
|
|
831
|
+
declare class Deploy implements ICommand {
|
|
832
|
+
mapContext(commander: DeployOpts, context: CmContext): CmContext;
|
|
833
|
+
getTasks(context: CmContext): CmTask[];
|
|
834
|
+
success(): void;
|
|
835
|
+
}
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region src/commands/fetch.d.ts
|
|
838
|
+
interface FetchOpts {
|
|
839
|
+
dryRun?: boolean;
|
|
840
|
+
verbose?: number;
|
|
841
|
+
}
|
|
842
|
+
declare class Fetch implements ICommand {
|
|
843
|
+
mapContext(_opts: FetchOpts, context: CmContext): CmContext;
|
|
844
|
+
getTasks(context: CmContext): CmTask[];
|
|
845
|
+
success(context: CmContext): void;
|
|
846
|
+
}
|
|
847
|
+
//#endregion
|
|
848
|
+
//#region src/commands/rebase.d.ts
|
|
849
|
+
interface RebaseOpts {
|
|
850
|
+
unitTest?: number;
|
|
851
|
+
cucumber?: number;
|
|
852
|
+
force?: number;
|
|
853
|
+
verbose?: number;
|
|
854
|
+
}
|
|
855
|
+
declare class Rebase extends Fetch implements ICommand {
|
|
856
|
+
mapContext(commander: RebaseOpts, context: CmContext): CmContext;
|
|
857
|
+
getTasks(context: CmContext): CmTask[];
|
|
858
|
+
success(context: CmContext): void;
|
|
859
|
+
}
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Subscription.d.ts
|
|
862
|
+
/**
|
|
863
|
+
* Represents a disposable resource, such as the execution of an Observable. A
|
|
864
|
+
* Subscription has one important method, `unsubscribe`, that takes no argument
|
|
865
|
+
* and just disposes the resource held by the subscription.
|
|
866
|
+
*
|
|
867
|
+
* Additionally, subscriptions may be grouped together through the `add()`
|
|
868
|
+
* method, which will attach a child Subscription to the current Subscription.
|
|
869
|
+
* When a Subscription is unsubscribed, all its children (and its grandchildren)
|
|
870
|
+
* will be unsubscribed as well.
|
|
871
|
+
*
|
|
872
|
+
* @class Subscription
|
|
873
|
+
*/
|
|
874
|
+
declare class Subscription implements SubscriptionLike {
|
|
875
|
+
private initialTeardown?;
|
|
876
|
+
/** @nocollapse */
|
|
877
|
+
static EMPTY: Subscription;
|
|
878
|
+
/**
|
|
879
|
+
* A flag to indicate whether this Subscription has already been unsubscribed.
|
|
880
|
+
*/
|
|
881
|
+
closed: boolean;
|
|
882
|
+
private _parentage;
|
|
883
|
+
/**
|
|
884
|
+
* The list of registered finalizers to execute upon unsubscription. Adding and removing from this
|
|
885
|
+
* list occurs in the {@link #add} and {@link #remove} methods.
|
|
886
|
+
*/
|
|
887
|
+
private _finalizers;
|
|
888
|
+
/**
|
|
889
|
+
* @param initialTeardown A function executed first as part of the finalization
|
|
890
|
+
* process that is kicked off when {@link #unsubscribe} is called.
|
|
891
|
+
*/
|
|
892
|
+
constructor(initialTeardown?: (() => void) | undefined);
|
|
893
|
+
/**
|
|
894
|
+
* Disposes the resources held by the subscription. May, for instance, cancel
|
|
895
|
+
* an ongoing Observable execution or cancel any other type of work that
|
|
896
|
+
* started when the Subscription was created.
|
|
897
|
+
* @return {void}
|
|
898
|
+
*/
|
|
899
|
+
unsubscribe(): void;
|
|
900
|
+
/**
|
|
901
|
+
* Adds a finalizer to this subscription, so that finalization will be unsubscribed/called
|
|
902
|
+
* when this subscription is unsubscribed. If this subscription is already {@link #closed},
|
|
903
|
+
* because it has already been unsubscribed, then whatever finalizer is passed to it
|
|
904
|
+
* will automatically be executed (unless the finalizer itself is also a closed subscription).
|
|
905
|
+
*
|
|
906
|
+
* Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed
|
|
907
|
+
* subscription to a any subscription will result in no operation. (A noop).
|
|
908
|
+
*
|
|
909
|
+
* Adding a subscription to itself, or adding `null` or `undefined` will not perform any
|
|
910
|
+
* operation at all. (A noop).
|
|
911
|
+
*
|
|
912
|
+
* `Subscription` instances that are added to this instance will automatically remove themselves
|
|
913
|
+
* if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove
|
|
914
|
+
* will need to be removed manually with {@link #remove}
|
|
915
|
+
*
|
|
916
|
+
* @param teardown The finalization logic to add to this subscription.
|
|
917
|
+
*/
|
|
918
|
+
add(teardown: TeardownLogic): void;
|
|
919
|
+
/**
|
|
920
|
+
* Checks to see if a this subscription already has a particular parent.
|
|
921
|
+
* This will signal that this subscription has already been added to the parent in question.
|
|
922
|
+
* @param parent the parent to check for
|
|
923
|
+
*/
|
|
924
|
+
private _hasParent;
|
|
925
|
+
/**
|
|
926
|
+
* Adds a parent to this subscription so it can be removed from the parent if it
|
|
927
|
+
* unsubscribes on it's own.
|
|
928
|
+
*
|
|
929
|
+
* NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.
|
|
930
|
+
* @param parent The parent subscription to add
|
|
931
|
+
*/
|
|
932
|
+
private _addParent;
|
|
933
|
+
/**
|
|
934
|
+
* Called on a child when it is removed via {@link #remove}.
|
|
935
|
+
* @param parent The parent to remove
|
|
936
|
+
*/
|
|
937
|
+
private _removeParent;
|
|
938
|
+
/**
|
|
939
|
+
* Removes a finalizer from this subscription that was previously added with the {@link #add} method.
|
|
940
|
+
*
|
|
941
|
+
* Note that `Subscription` instances, when unsubscribed, will automatically remove themselves
|
|
942
|
+
* from every other `Subscription` they have been added to. This means that using the `remove` method
|
|
943
|
+
* is not a common thing and should be used thoughtfully.
|
|
944
|
+
*
|
|
945
|
+
* If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance
|
|
946
|
+
* more than once, you will need to call `remove` the same number of times to remove all instances.
|
|
947
|
+
*
|
|
948
|
+
* All finalizer instances are removed to free up memory upon unsubscription.
|
|
949
|
+
*
|
|
950
|
+
* @param teardown The finalizer to remove from this subscription
|
|
951
|
+
*/
|
|
952
|
+
remove(teardown: Exclude<TeardownLogic, void>): void;
|
|
953
|
+
}
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region ../../node_modules/rxjs/dist/types/internal/types.d.ts
|
|
956
|
+
/**
|
|
957
|
+
* Note: This will add Symbol.observable globally for all TypeScript users,
|
|
958
|
+
* however, we are no longer polyfilling Symbol.observable
|
|
959
|
+
*/
|
|
960
|
+
declare global {
|
|
961
|
+
interface SymbolConstructor {
|
|
962
|
+
readonly observable: symbol;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* A function type interface that describes a function that accepts one parameter `T`
|
|
967
|
+
* and returns another parameter `R`.
|
|
968
|
+
*
|
|
969
|
+
* Usually used to describe {@link OperatorFunction} - it always takes a single
|
|
970
|
+
* parameter (the source Observable) and returns another Observable.
|
|
971
|
+
*/
|
|
972
|
+
interface UnaryFunction<T, R> {
|
|
973
|
+
(source: T): R;
|
|
974
|
+
}
|
|
975
|
+
interface OperatorFunction<T, R> extends UnaryFunction<Observable<T>, Observable<R>> {}
|
|
976
|
+
interface Unsubscribable {
|
|
977
|
+
unsubscribe(): void;
|
|
978
|
+
}
|
|
979
|
+
declare type TeardownLogic = Subscription | Unsubscribable | (() => void) | void;
|
|
980
|
+
interface SubscriptionLike extends Unsubscribable {
|
|
981
|
+
unsubscribe(): void;
|
|
982
|
+
readonly closed: boolean;
|
|
983
|
+
}
|
|
984
|
+
/** OBSERVABLE INTERFACES */
|
|
985
|
+
interface Subscribable<T> {
|
|
986
|
+
subscribe(observer: Partial<Observer<T>>): Unsubscribable;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* An object interface that defines a set of callback functions a user can use to get
|
|
990
|
+
* notified of any set of {@link Observable}
|
|
991
|
+
* {@link guide/glossary-and-semantics#notification notification} events.
|
|
992
|
+
*
|
|
993
|
+
* For more info, please refer to {@link guide/observer this guide}.
|
|
994
|
+
*/
|
|
995
|
+
interface Observer<T> {
|
|
996
|
+
/**
|
|
997
|
+
* A callback function that gets called by the producer during the subscription when
|
|
998
|
+
* the producer "has" the `value`. It won't be called if `error` or `complete` callback
|
|
999
|
+
* functions have been called, nor after the consumer has unsubscribed.
|
|
1000
|
+
*
|
|
1001
|
+
* For more info, please refer to {@link guide/glossary-and-semantics#next this guide}.
|
|
1002
|
+
*/
|
|
1003
|
+
next: (value: T) => void;
|
|
1004
|
+
/**
|
|
1005
|
+
* A callback function that gets called by the producer if and when it encountered a
|
|
1006
|
+
* problem of any kind. The errored value will be provided through the `err` parameter.
|
|
1007
|
+
* This callback can't be called more than one time, it can't be called if the
|
|
1008
|
+
* `complete` callback function have been called previously, nor it can't be called if
|
|
1009
|
+
* the consumer has unsubscribed.
|
|
1010
|
+
*
|
|
1011
|
+
* For more info, please refer to {@link guide/glossary-and-semantics#error this guide}.
|
|
1012
|
+
*/
|
|
1013
|
+
error: (err: any) => void;
|
|
1014
|
+
/**
|
|
1015
|
+
* A callback function that gets called by the producer if and when it has no more
|
|
1016
|
+
* values to provide (by calling `next` callback function). This means that no error
|
|
1017
|
+
* has happened. This callback can't be called more than one time, it can't be called
|
|
1018
|
+
* if the `error` callback function have been called previously, nor it can't be called
|
|
1019
|
+
* if the consumer has unsubscribed.
|
|
1020
|
+
*
|
|
1021
|
+
* For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}.
|
|
1022
|
+
*/
|
|
1023
|
+
complete: () => void;
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Subscriber.d.ts
|
|
1027
|
+
/**
|
|
1028
|
+
* Implements the {@link Observer} interface and extends the
|
|
1029
|
+
* {@link Subscription} class. While the {@link Observer} is the public API for
|
|
1030
|
+
* consuming the values of an {@link Observable}, all Observers get converted to
|
|
1031
|
+
* a Subscriber, in order to provide Subscription-like capabilities such as
|
|
1032
|
+
* `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
|
|
1033
|
+
* implementing operators, but it is rarely used as a public API.
|
|
1034
|
+
*
|
|
1035
|
+
* @class Subscriber<T>
|
|
1036
|
+
*/
|
|
1037
|
+
declare class Subscriber<T> extends Subscription implements Observer<T> {
|
|
1038
|
+
/**
|
|
1039
|
+
* A static factory for a Subscriber, given a (potentially partial) definition
|
|
1040
|
+
* of an Observer.
|
|
1041
|
+
* @param next The `next` callback of an Observer.
|
|
1042
|
+
* @param error The `error` callback of an
|
|
1043
|
+
* Observer.
|
|
1044
|
+
* @param complete The `complete` callback of an
|
|
1045
|
+
* Observer.
|
|
1046
|
+
* @return A Subscriber wrapping the (partially defined)
|
|
1047
|
+
* Observer represented by the given arguments.
|
|
1048
|
+
* @nocollapse
|
|
1049
|
+
* @deprecated Do not use. Will be removed in v8. There is no replacement for this
|
|
1050
|
+
* method, and there is no reason to be creating instances of `Subscriber` directly.
|
|
1051
|
+
* If you have a specific use case, please file an issue.
|
|
1052
|
+
*/
|
|
1053
|
+
static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T>;
|
|
1054
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
1055
|
+
protected isStopped: boolean;
|
|
1056
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
1057
|
+
protected destination: Subscriber<any> | Observer<any>;
|
|
1058
|
+
/**
|
|
1059
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1060
|
+
* There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.
|
|
1061
|
+
*/
|
|
1062
|
+
constructor(destination?: Subscriber<any> | Observer<any>);
|
|
1063
|
+
/**
|
|
1064
|
+
* The {@link Observer} callback to receive notifications of type `next` from
|
|
1065
|
+
* the Observable, with a value. The Observable may call this method 0 or more
|
|
1066
|
+
* times.
|
|
1067
|
+
* @param {T} [value] The `next` value.
|
|
1068
|
+
* @return {void}
|
|
1069
|
+
*/
|
|
1070
|
+
next(value?: T): void;
|
|
1071
|
+
/**
|
|
1072
|
+
* The {@link Observer} callback to receive notifications of type `error` from
|
|
1073
|
+
* the Observable, with an attached `Error`. Notifies the Observer that
|
|
1074
|
+
* the Observable has experienced an error condition.
|
|
1075
|
+
* @param {any} [err] The `error` exception.
|
|
1076
|
+
* @return {void}
|
|
1077
|
+
*/
|
|
1078
|
+
error(err?: any): void;
|
|
1079
|
+
/**
|
|
1080
|
+
* The {@link Observer} callback to receive a valueless notification of type
|
|
1081
|
+
* `complete` from the Observable. Notifies the Observer that the Observable
|
|
1082
|
+
* has finished sending push-based notifications.
|
|
1083
|
+
* @return {void}
|
|
1084
|
+
*/
|
|
1085
|
+
complete(): void;
|
|
1086
|
+
unsubscribe(): void;
|
|
1087
|
+
protected _next(value: T): void;
|
|
1088
|
+
protected _error(err: any): void;
|
|
1089
|
+
protected _complete(): void;
|
|
1090
|
+
}
|
|
1091
|
+
//#endregion
|
|
1092
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Operator.d.ts
|
|
1093
|
+
/***
|
|
1094
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1095
|
+
*/
|
|
1096
|
+
interface Operator<T, R> {
|
|
1097
|
+
call(subscriber: Subscriber<R>, source: any): TeardownLogic;
|
|
1098
|
+
}
|
|
1099
|
+
//#endregion
|
|
1100
|
+
//#region ../../node_modules/rxjs/dist/types/internal/Observable.d.ts
|
|
1101
|
+
/**
|
|
1102
|
+
* A representation of any set of values over any amount of time. This is the most basic building block
|
|
1103
|
+
* of RxJS.
|
|
1104
|
+
*
|
|
1105
|
+
* @class Observable<T>
|
|
1106
|
+
*/
|
|
1107
|
+
declare class Observable<T> implements Subscribable<T> {
|
|
1108
|
+
/**
|
|
1109
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1110
|
+
*/
|
|
1111
|
+
source: Observable<any> | undefined;
|
|
1112
|
+
/**
|
|
1113
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1114
|
+
*/
|
|
1115
|
+
operator: Operator<any, T> | undefined;
|
|
1116
|
+
/**
|
|
1117
|
+
* @constructor
|
|
1118
|
+
* @param {Function} subscribe the function that is called when the Observable is
|
|
1119
|
+
* initially subscribed to. This function is given a Subscriber, to which new values
|
|
1120
|
+
* can be `next`ed, or an `error` method can be called to raise an error, or
|
|
1121
|
+
* `complete` can be called to notify of a successful completion.
|
|
1122
|
+
*/
|
|
1123
|
+
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
|
|
1124
|
+
/**
|
|
1125
|
+
* Creates a new Observable by calling the Observable constructor
|
|
1126
|
+
* @owner Observable
|
|
1127
|
+
* @method create
|
|
1128
|
+
* @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
|
|
1129
|
+
* @return {Observable} a new observable
|
|
1130
|
+
* @nocollapse
|
|
1131
|
+
* @deprecated Use `new Observable()` instead. Will be removed in v8.
|
|
1132
|
+
*/
|
|
1133
|
+
static create: (...args: any[]) => any;
|
|
1134
|
+
/**
|
|
1135
|
+
* Creates a new Observable, with this Observable instance as the source, and the passed
|
|
1136
|
+
* operator defined as the new observable's operator.
|
|
1137
|
+
* @method lift
|
|
1138
|
+
* @param operator the operator defining the operation to take on the observable
|
|
1139
|
+
* @return a new observable with the Operator applied
|
|
1140
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
1141
|
+
* If you have implemented an operator using `lift`, it is recommended that you create an
|
|
1142
|
+
* operator by simply returning `new Observable()` directly. See "Creating new operators from
|
|
1143
|
+
* scratch" section here: https://rxjs.dev/guide/operators
|
|
1144
|
+
*/
|
|
1145
|
+
lift<R>(operator?: Operator<T, R>): Observable<R>;
|
|
1146
|
+
subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;
|
|
1147
|
+
/** @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 */
|
|
1148
|
+
subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;
|
|
1149
|
+
/**
|
|
1150
|
+
* Used as a NON-CANCELLABLE means of subscribing to an observable, for use with
|
|
1151
|
+
* APIs that expect promises, like `async/await`. You cannot unsubscribe from this.
|
|
1152
|
+
*
|
|
1153
|
+
* **WARNING**: Only use this with observables you *know* will complete. If the source
|
|
1154
|
+
* observable does not complete, you will end up with a promise that is hung up, and
|
|
1155
|
+
* potentially all of the state of an async function hanging out in memory. To avoid
|
|
1156
|
+
* this situation, look into adding something like {@link timeout}, {@link take},
|
|
1157
|
+
* {@link takeWhile}, or {@link takeUntil} amongst others.
|
|
1158
|
+
*
|
|
1159
|
+
* #### Example
|
|
1160
|
+
*
|
|
1161
|
+
* ```ts
|
|
1162
|
+
* import { interval, take } from 'rxjs';
|
|
1163
|
+
*
|
|
1164
|
+
* const source$ = interval(1000).pipe(take(4));
|
|
1165
|
+
*
|
|
1166
|
+
* async function getTotal() {
|
|
1167
|
+
* let total = 0;
|
|
1168
|
+
*
|
|
1169
|
+
* await source$.forEach(value => {
|
|
1170
|
+
* total += value;
|
|
1171
|
+
* console.log('observable -> ' + value);
|
|
1172
|
+
* });
|
|
1173
|
+
*
|
|
1174
|
+
* return total;
|
|
1175
|
+
* }
|
|
1176
|
+
*
|
|
1177
|
+
* getTotal().then(
|
|
1178
|
+
* total => console.log('Total: ' + total)
|
|
1179
|
+
* );
|
|
1180
|
+
*
|
|
1181
|
+
* // Expected:
|
|
1182
|
+
* // 'observable -> 0'
|
|
1183
|
+
* // 'observable -> 1'
|
|
1184
|
+
* // 'observable -> 2'
|
|
1185
|
+
* // 'observable -> 3'
|
|
1186
|
+
* // 'Total: 6'
|
|
1187
|
+
* ```
|
|
1188
|
+
*
|
|
1189
|
+
* @param next a handler for each value emitted by the observable
|
|
1190
|
+
* @return a promise that either resolves on observable completion or
|
|
1191
|
+
* rejects with the handled error
|
|
1192
|
+
*/
|
|
1193
|
+
forEach(next: (value: T) => void): Promise<void>;
|
|
1194
|
+
/**
|
|
1195
|
+
* @param next a handler for each value emitted by the observable
|
|
1196
|
+
* @param promiseCtor a constructor function used to instantiate the Promise
|
|
1197
|
+
* @return a promise that either resolves on observable completion or
|
|
1198
|
+
* rejects with the handled error
|
|
1199
|
+
* @deprecated Passing a Promise constructor will no longer be available
|
|
1200
|
+
* in upcoming versions of RxJS. This is because it adds weight to the library, for very
|
|
1201
|
+
* little benefit. If you need this functionality, it is recommended that you either
|
|
1202
|
+
* polyfill Promise, or you create an adapter to convert the returned native promise
|
|
1203
|
+
* to whatever promise implementation you wanted. Will be removed in v8.
|
|
1204
|
+
*/
|
|
1205
|
+
forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;
|
|
1206
|
+
pipe(): Observable<T>;
|
|
1207
|
+
pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;
|
|
1208
|
+
pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;
|
|
1209
|
+
pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;
|
|
1210
|
+
pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;
|
|
1211
|
+
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>;
|
|
1212
|
+
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>;
|
|
1213
|
+
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>;
|
|
1214
|
+
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>;
|
|
1215
|
+
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>;
|
|
1216
|
+
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>;
|
|
1217
|
+
/** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
|
|
1218
|
+
toPromise(): Promise<T | undefined>;
|
|
1219
|
+
/** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
|
|
1220
|
+
toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;
|
|
1221
|
+
/** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
|
|
1222
|
+
toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;
|
|
1223
|
+
}
|
|
1224
|
+
//#endregion
|
|
1225
|
+
//#region src/commands/tasks/push-branch.d.ts
|
|
1226
|
+
type PushBranchContext = CmContext<{
|
|
1227
|
+
origin?: string;
|
|
1228
|
+
featureBranch?: string;
|
|
1229
|
+
upstream?: boolean;
|
|
1230
|
+
noVerify?: boolean;
|
|
1231
|
+
}>;
|
|
1232
|
+
//#endregion
|
|
1233
|
+
//#region src/commands/finish.d.ts
|
|
1234
|
+
declare class Finish extends Rebase implements ICommand {
|
|
1235
|
+
mapContext(commander: RebaseOpts, context: CmContext): CmContext;
|
|
1236
|
+
verifyConditions(context: CmContext): void;
|
|
1237
|
+
getTasks(context: PushBranchContext & RebaseOpts): CmTask[];
|
|
1238
|
+
success(context: CmContext): void;
|
|
1239
|
+
}
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region src/commands/jira-releases.d.ts
|
|
1242
|
+
interface JiraReleasesOpts {
|
|
1243
|
+
component?: string;
|
|
1244
|
+
projectId?: string;
|
|
1245
|
+
update?: number;
|
|
1246
|
+
verbose?: number;
|
|
1247
|
+
tag?: string;
|
|
1248
|
+
}
|
|
1249
|
+
interface JiraRelease {
|
|
1250
|
+
id: string;
|
|
1251
|
+
name: string;
|
|
1252
|
+
released: boolean;
|
|
1253
|
+
releaseDate?: string;
|
|
1254
|
+
version: string;
|
|
1255
|
+
[key: string]: unknown;
|
|
1256
|
+
}
|
|
1257
|
+
type JiraReleasesContext = CmContext<{
|
|
1258
|
+
projectId?: string;
|
|
1259
|
+
component?: string;
|
|
1260
|
+
tag?: string;
|
|
1261
|
+
update?: number;
|
|
1262
|
+
releases?: JiraRelease[];
|
|
1263
|
+
}>;
|
|
1264
|
+
declare class JiraReleases implements ICommand {
|
|
1265
|
+
mapContext(commander: JiraReleasesOpts, context: CmContext): JiraReleasesContext;
|
|
1266
|
+
getTasks(context: JiraReleasesContext): CmTask[];
|
|
1267
|
+
}
|
|
1268
|
+
//#endregion
|
|
1269
|
+
//#region src/commands/merge.d.ts
|
|
1270
|
+
declare class Merge implements ICommand {
|
|
1271
|
+
private lastCommitMessage;
|
|
1272
|
+
getTasks(context: CmContext): CmTask[];
|
|
1273
|
+
success(context: CmContext): void;
|
|
1274
|
+
}
|
|
1275
|
+
//#endregion
|
|
1276
|
+
//#region src/commands/packages.d.ts
|
|
1277
|
+
declare class Packages implements ICommand {
|
|
1278
|
+
mapContext(options: Record<string, unknown>, context: CmContext): CmContext;
|
|
1279
|
+
getTasks(context: CmContext): CmTask[];
|
|
1280
|
+
}
|
|
1281
|
+
//#endregion
|
|
1282
|
+
//#region src/commands/pull.d.ts
|
|
1283
|
+
declare class Pull implements ICommand {
|
|
1284
|
+
mapContext(options: Record<string, unknown>, context: CmContext): CmContext;
|
|
1285
|
+
getTasks(context: CmContext): CmTask[];
|
|
1286
|
+
success(context: CmContext): void;
|
|
1287
|
+
}
|
|
1288
|
+
//#endregion
|
|
1289
|
+
//#region src/commands/push.d.ts
|
|
1290
|
+
declare class Push extends Rebase implements ICommand {
|
|
1291
|
+
mapContext(commander: RebaseOpts, context: CmContext): CmContext;
|
|
1292
|
+
getTasks(context: CmContext): CmTask[];
|
|
1293
|
+
success(context: CmContext): void;
|
|
1294
|
+
}
|
|
1295
|
+
declare const publish: (program: Command) => void;
|
|
1296
|
+
//#endregion
|
|
1297
|
+
//#region src/commands/republish.d.ts
|
|
1298
|
+
interface RepublishOpts {
|
|
1299
|
+
verbose?: number;
|
|
1300
|
+
}
|
|
1301
|
+
declare class Republish extends Fetch implements ICommand {
|
|
1302
|
+
mapContext(commander: RepublishOpts, context: CmContext): CmContext;
|
|
1303
|
+
getTasks(context: CmContext): CmTask[];
|
|
1304
|
+
success(): void;
|
|
1305
|
+
}
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region src/commands/start.d.ts
|
|
1308
|
+
interface StartOpts {
|
|
1309
|
+
jiraId?: string;
|
|
1310
|
+
branchName?: string;
|
|
1311
|
+
dryRun?: boolean;
|
|
1312
|
+
verbose?: number;
|
|
1313
|
+
}
|
|
1314
|
+
type StartContext = CmContext<{
|
|
1315
|
+
jiraId?: string;
|
|
1316
|
+
branchName?: string;
|
|
1317
|
+
type?: string;
|
|
1318
|
+
featureBranch?: string;
|
|
1319
|
+
fromBranch?: string;
|
|
1320
|
+
origin?: string;
|
|
1321
|
+
}>;
|
|
1322
|
+
declare class Start extends Fetch implements ICommand {
|
|
1323
|
+
mapContext(options: StartOpts, context: CmContext): StartContext;
|
|
1324
|
+
prompt(context: StartContext): Promise<Record<string, unknown> | symbol>;
|
|
1325
|
+
getTasks(context: StartContext): CmTask[];
|
|
1326
|
+
success(context: StartContext): void;
|
|
1327
|
+
}
|
|
1328
|
+
declare namespace index_d_exports {
|
|
1329
|
+
export { Checkfeatures, Clean, Config, Deploy, Fetch, Finish, JiraRelease, JiraReleases, Merge, Packages, Pull, Push, Rebase, RebaseOpts, Republish, Start, publish };
|
|
1330
|
+
}
|
|
1331
|
+
//#endregion
|
|
1332
|
+
//#region src/commands/release.d.ts
|
|
1333
|
+
declare function release(options?: {}): void;
|
|
1334
|
+
//#endregion
|
|
1335
|
+
//#region ../../node_modules/execa/index.d.ts
|
|
1336
|
+
declare namespace execa {
|
|
1337
|
+
type StdioOption = 'pipe' | 'ipc' | 'ignore' | 'inherit' | Stream | number | undefined;
|
|
1338
|
+
interface CommonOptions<EncodingType> {
|
|
1339
|
+
/**
|
|
1340
|
+
Kill the spawned process when the parent process exits unless either:
|
|
1341
|
+
- the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)
|
|
1342
|
+
- the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit
|
|
1343
|
+
|
|
1344
|
+
@default true
|
|
1345
|
+
*/
|
|
1346
|
+
readonly cleanup?: boolean;
|
|
1347
|
+
/**
|
|
1348
|
+
Prefer locally installed binaries when looking for a binary to execute.
|
|
1349
|
+
|
|
1350
|
+
If you `$ npm install foo`, you can then `execa('foo')`.
|
|
1351
|
+
|
|
1352
|
+
@default false
|
|
1353
|
+
*/
|
|
1354
|
+
readonly preferLocal?: boolean;
|
|
1355
|
+
/**
|
|
1356
|
+
Preferred path to find locally installed binaries in (use with `preferLocal`).
|
|
1357
|
+
|
|
1358
|
+
@default process.cwd()
|
|
1359
|
+
*/
|
|
1360
|
+
readonly localDir?: string;
|
|
1361
|
+
/**
|
|
1362
|
+
Path to the Node.js executable to use in child processes.
|
|
1363
|
+
|
|
1364
|
+
This can be either an absolute path or a path relative to the `cwd` option.
|
|
1365
|
+
|
|
1366
|
+
Requires `preferLocal` to be `true`.
|
|
1367
|
+
|
|
1368
|
+
For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process.
|
|
1369
|
+
|
|
1370
|
+
@default process.execPath
|
|
1371
|
+
*/
|
|
1372
|
+
readonly execPath?: string;
|
|
1373
|
+
/**
|
|
1374
|
+
Buffer the output from the spawned process. When set to `false`, you must read the output of `stdout` and `stderr` (or `all` if the `all` option is `true`). Otherwise the returned promise will not be resolved/rejected.
|
|
1375
|
+
|
|
1376
|
+
If the spawned process fails, `error.stdout`, `error.stderr`, and `error.all` will contain the buffered data.
|
|
1377
|
+
|
|
1378
|
+
@default true
|
|
1379
|
+
*/
|
|
1380
|
+
readonly buffer?: boolean;
|
|
1381
|
+
/**
|
|
1382
|
+
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
|
1383
|
+
|
|
1384
|
+
@default 'pipe'
|
|
1385
|
+
*/
|
|
1386
|
+
readonly stdin?: StdioOption;
|
|
1387
|
+
/**
|
|
1388
|
+
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
|
1389
|
+
|
|
1390
|
+
@default 'pipe'
|
|
1391
|
+
*/
|
|
1392
|
+
readonly stdout?: StdioOption;
|
|
1393
|
+
/**
|
|
1394
|
+
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
|
1395
|
+
|
|
1396
|
+
@default 'pipe'
|
|
1397
|
+
*/
|
|
1398
|
+
readonly stderr?: StdioOption;
|
|
1399
|
+
/**
|
|
1400
|
+
Setting this to `false` resolves the promise with the error instead of rejecting it.
|
|
1401
|
+
|
|
1402
|
+
@default true
|
|
1403
|
+
*/
|
|
1404
|
+
readonly reject?: boolean;
|
|
1405
|
+
/**
|
|
1406
|
+
Add an `.all` property on the promise and the resolved value. The property contains the output of the process with `stdout` and `stderr` interleaved.
|
|
1407
|
+
|
|
1408
|
+
@default false
|
|
1409
|
+
*/
|
|
1410
|
+
readonly all?: boolean;
|
|
1411
|
+
/**
|
|
1412
|
+
Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.
|
|
1413
|
+
|
|
1414
|
+
@default true
|
|
1415
|
+
*/
|
|
1416
|
+
readonly stripFinalNewline?: boolean;
|
|
1417
|
+
/**
|
|
1418
|
+
Set to `false` if you don't want to extend the environment variables when providing the `env` property.
|
|
1419
|
+
|
|
1420
|
+
@default true
|
|
1421
|
+
*/
|
|
1422
|
+
readonly extendEnv?: boolean;
|
|
1423
|
+
/**
|
|
1424
|
+
Current working directory of the child process.
|
|
1425
|
+
|
|
1426
|
+
@default process.cwd()
|
|
1427
|
+
*/
|
|
1428
|
+
readonly cwd?: string;
|
|
1429
|
+
/**
|
|
1430
|
+
Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this.
|
|
1431
|
+
|
|
1432
|
+
@default process.env
|
|
1433
|
+
*/
|
|
1434
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
1435
|
+
/**
|
|
1436
|
+
Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified.
|
|
1437
|
+
*/
|
|
1438
|
+
readonly argv0?: string;
|
|
1439
|
+
/**
|
|
1440
|
+
Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.
|
|
1441
|
+
|
|
1442
|
+
@default 'pipe'
|
|
1443
|
+
*/
|
|
1444
|
+
readonly stdio?: 'pipe' | 'ignore' | 'inherit' | readonly StdioOption[];
|
|
1445
|
+
/**
|
|
1446
|
+
Specify the kind of serialization used for sending messages between processes when using the `stdio: 'ipc'` option or `execa.node()`:
|
|
1447
|
+
- `json`: Uses `JSON.stringify()` and `JSON.parse()`.
|
|
1448
|
+
- `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)
|
|
1449
|
+
|
|
1450
|
+
Requires Node.js `13.2.0` or later.
|
|
1451
|
+
|
|
1452
|
+
[More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)
|
|
1453
|
+
|
|
1454
|
+
@default 'json'
|
|
1455
|
+
*/
|
|
1456
|
+
readonly serialization?: 'json' | 'advanced';
|
|
1457
|
+
/**
|
|
1458
|
+
Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).
|
|
1459
|
+
|
|
1460
|
+
@default false
|
|
1461
|
+
*/
|
|
1462
|
+
readonly detached?: boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
Sets the user identity of the process.
|
|
1465
|
+
*/
|
|
1466
|
+
readonly uid?: number;
|
|
1467
|
+
/**
|
|
1468
|
+
Sets the group identity of the process.
|
|
1469
|
+
*/
|
|
1470
|
+
readonly gid?: number;
|
|
1471
|
+
/**
|
|
1472
|
+
If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.
|
|
1473
|
+
|
|
1474
|
+
We recommend against using this option since it is:
|
|
1475
|
+
- not cross-platform, encouraging shell-specific syntax.
|
|
1476
|
+
- slower, because of the additional shell interpretation.
|
|
1477
|
+
- unsafe, potentially allowing command injection.
|
|
1478
|
+
|
|
1479
|
+
@default false
|
|
1480
|
+
*/
|
|
1481
|
+
readonly shell?: boolean | string;
|
|
1482
|
+
/**
|
|
1483
|
+
Specify the character encoding used to decode the `stdout` and `stderr` output. If set to `null`, then `stdout` and `stderr` will be a `Buffer` instead of a string.
|
|
1484
|
+
|
|
1485
|
+
@default 'utf8'
|
|
1486
|
+
*/
|
|
1487
|
+
readonly encoding?: EncodingType;
|
|
1488
|
+
/**
|
|
1489
|
+
If `timeout` is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than `timeout` milliseconds.
|
|
1490
|
+
|
|
1491
|
+
@default 0
|
|
1492
|
+
*/
|
|
1493
|
+
readonly timeout?: number;
|
|
1494
|
+
/**
|
|
1495
|
+
Largest amount of data in bytes allowed on `stdout` or `stderr`. Default: 100 MB.
|
|
1496
|
+
|
|
1497
|
+
@default 100_000_000
|
|
1498
|
+
*/
|
|
1499
|
+
readonly maxBuffer?: number;
|
|
1500
|
+
/**
|
|
1501
|
+
Signal value to be used when the spawned process will be killed.
|
|
1502
|
+
|
|
1503
|
+
@default 'SIGTERM'
|
|
1504
|
+
*/
|
|
1505
|
+
readonly killSignal?: string | number;
|
|
1506
|
+
/**
|
|
1507
|
+
If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.
|
|
1508
|
+
|
|
1509
|
+
@default false
|
|
1510
|
+
*/
|
|
1511
|
+
readonly windowsVerbatimArguments?: boolean;
|
|
1512
|
+
/**
|
|
1513
|
+
On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.
|
|
1514
|
+
|
|
1515
|
+
@default true
|
|
1516
|
+
*/
|
|
1517
|
+
readonly windowsHide?: boolean;
|
|
1518
|
+
}
|
|
1519
|
+
interface Options<EncodingType = string> extends CommonOptions<EncodingType> {
|
|
1520
|
+
/**
|
|
1521
|
+
Write some input to the `stdin` of your binary.
|
|
1522
|
+
*/
|
|
1523
|
+
readonly input?: string | Buffer | Readable;
|
|
1524
|
+
}
|
|
1525
|
+
interface SyncOptions<EncodingType = string> extends CommonOptions<EncodingType> {
|
|
1526
|
+
/**
|
|
1527
|
+
Write some input to the `stdin` of your binary.
|
|
1528
|
+
*/
|
|
1529
|
+
readonly input?: string | Buffer;
|
|
1530
|
+
}
|
|
1531
|
+
interface NodeOptions<EncodingType = string> extends Options<EncodingType> {
|
|
1532
|
+
/**
|
|
1533
|
+
The Node.js executable to use.
|
|
1534
|
+
|
|
1535
|
+
@default process.execPath
|
|
1536
|
+
*/
|
|
1537
|
+
readonly nodePath?: string;
|
|
1538
|
+
/**
|
|
1539
|
+
List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.
|
|
1540
|
+
|
|
1541
|
+
@default process.execArgv
|
|
1542
|
+
*/
|
|
1543
|
+
readonly nodeOptions?: string[];
|
|
1544
|
+
}
|
|
1545
|
+
interface ExecaReturnBase<StdoutStderrType> {
|
|
1546
|
+
/**
|
|
1547
|
+
The file and arguments that were run, for logging purposes.
|
|
1548
|
+
|
|
1549
|
+
This is not escaped and should not be executed directly as a process, including using `execa()` or `execa.command()`.
|
|
1550
|
+
*/
|
|
1551
|
+
command: string;
|
|
1552
|
+
/**
|
|
1553
|
+
Same as `command` but escaped.
|
|
1554
|
+
|
|
1555
|
+
This is meant to be copy and pasted into a shell, for debugging purposes.
|
|
1556
|
+
Since the escaping is fairly basic, this should not be executed directly as a process, including using `execa()` or `execa.command()`.
|
|
1557
|
+
*/
|
|
1558
|
+
escapedCommand: string;
|
|
1559
|
+
/**
|
|
1560
|
+
The numeric exit code of the process that was run.
|
|
1561
|
+
*/
|
|
1562
|
+
exitCode: number;
|
|
1563
|
+
/**
|
|
1564
|
+
The output of the process on stdout.
|
|
1565
|
+
*/
|
|
1566
|
+
stdout: StdoutStderrType;
|
|
1567
|
+
/**
|
|
1568
|
+
The output of the process on stderr.
|
|
1569
|
+
*/
|
|
1570
|
+
stderr: StdoutStderrType;
|
|
1571
|
+
/**
|
|
1572
|
+
Whether the process failed to run.
|
|
1573
|
+
*/
|
|
1574
|
+
failed: boolean;
|
|
1575
|
+
/**
|
|
1576
|
+
Whether the process timed out.
|
|
1577
|
+
*/
|
|
1578
|
+
timedOut: boolean;
|
|
1579
|
+
/**
|
|
1580
|
+
Whether the process was killed.
|
|
1581
|
+
*/
|
|
1582
|
+
killed: boolean;
|
|
1583
|
+
/**
|
|
1584
|
+
The name of the signal that was used to terminate the process. For example, `SIGFPE`.
|
|
1585
|
+
|
|
1586
|
+
If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.
|
|
1587
|
+
*/
|
|
1588
|
+
signal?: string;
|
|
1589
|
+
/**
|
|
1590
|
+
A human-friendly description of the signal that was used to terminate the process. For example, `Floating point arithmetic error`.
|
|
1591
|
+
|
|
1592
|
+
If a signal terminated the process, 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.
|
|
1593
|
+
*/
|
|
1594
|
+
signalDescription?: string;
|
|
1595
|
+
}
|
|
1596
|
+
interface ExecaSyncReturnValue<StdoutErrorType = string> extends ExecaReturnBase<StdoutErrorType> {}
|
|
1597
|
+
/**
|
|
1598
|
+
Result of a child process execution. On success this is a plain object. On failure this is also an `Error` instance.
|
|
1599
|
+
|
|
1600
|
+
The child process fails when:
|
|
1601
|
+
- its exit code is not `0`
|
|
1602
|
+
- it was killed with a signal
|
|
1603
|
+
- timing out
|
|
1604
|
+
- being canceled
|
|
1605
|
+
- there's not enough memory or there are already too many child processes
|
|
1606
|
+
*/
|
|
1607
|
+
interface ExecaReturnValue<StdoutErrorType = string> extends ExecaSyncReturnValue<StdoutErrorType> {
|
|
1608
|
+
/**
|
|
1609
|
+
The output of the process with `stdout` and `stderr` interleaved.
|
|
1610
|
+
|
|
1611
|
+
This is `undefined` if either:
|
|
1612
|
+
- the `all` option is `false` (default value)
|
|
1613
|
+
- `execa.sync()` was used
|
|
1614
|
+
*/
|
|
1615
|
+
all?: StdoutErrorType;
|
|
1616
|
+
/**
|
|
1617
|
+
Whether the process was canceled.
|
|
1618
|
+
*/
|
|
1619
|
+
isCanceled: boolean;
|
|
1620
|
+
}
|
|
1621
|
+
interface ExecaSyncError<StdoutErrorType = string> extends Error, ExecaReturnBase<StdoutErrorType> {
|
|
1622
|
+
/**
|
|
1623
|
+
Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.
|
|
1624
|
+
|
|
1625
|
+
The child process stderr then stdout are appended to the end, separated with newlines and not interleaved.
|
|
1626
|
+
*/
|
|
1627
|
+
message: string;
|
|
1628
|
+
/**
|
|
1629
|
+
This is the same as the `message` property except it does not include the child process stdout/stderr.
|
|
1630
|
+
*/
|
|
1631
|
+
shortMessage: string;
|
|
1632
|
+
/**
|
|
1633
|
+
Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.
|
|
1634
|
+
|
|
1635
|
+
This is `undefined` unless the child process exited due to an `error` event or a timeout.
|
|
1636
|
+
*/
|
|
1637
|
+
originalMessage?: string;
|
|
1638
|
+
}
|
|
1639
|
+
interface ExecaError<StdoutErrorType = string> extends ExecaSyncError<StdoutErrorType> {
|
|
1640
|
+
/**
|
|
1641
|
+
The output of the process with `stdout` and `stderr` interleaved.
|
|
1642
|
+
|
|
1643
|
+
This is `undefined` if either:
|
|
1644
|
+
- the `all` option is `false` (default value)
|
|
1645
|
+
- `execa.sync()` was used
|
|
1646
|
+
*/
|
|
1647
|
+
all?: StdoutErrorType;
|
|
1648
|
+
/**
|
|
1649
|
+
Whether the process was canceled.
|
|
1650
|
+
*/
|
|
1651
|
+
isCanceled: boolean;
|
|
1652
|
+
}
|
|
1653
|
+
interface KillOptions {
|
|
1654
|
+
/**
|
|
1655
|
+
Milliseconds to wait for the child process to terminate before sending `SIGKILL`.
|
|
1656
|
+
|
|
1657
|
+
Can be disabled with `false`.
|
|
1658
|
+
|
|
1659
|
+
@default 5000
|
|
1660
|
+
*/
|
|
1661
|
+
forceKillAfterTimeout?: number | false;
|
|
1662
|
+
}
|
|
1663
|
+
interface ExecaChildPromise<StdoutErrorType> {
|
|
1664
|
+
/**
|
|
1665
|
+
Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
|
|
1666
|
+
|
|
1667
|
+
This is `undefined` if either:
|
|
1668
|
+
- the `all` option is `false` (the default value)
|
|
1669
|
+
- both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
|
|
1670
|
+
*/
|
|
1671
|
+
all?: Readable;
|
|
1672
|
+
catch<ResultType = never>(onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
|
|
1673
|
+
/**
|
|
1674
|
+
Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
|
|
1675
|
+
*/
|
|
1676
|
+
kill(signal?: string, options?: KillOptions): void;
|
|
1677
|
+
/**
|
|
1678
|
+
Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
|
|
1679
|
+
*/
|
|
1680
|
+
cancel(): void;
|
|
1681
|
+
}
|
|
1682
|
+
type ExecaChildProcess<StdoutErrorType = string> = ChildProcess & ExecaChildPromise<StdoutErrorType> & Promise<ExecaReturnValue<StdoutErrorType>>;
|
|
1683
|
+
}
|
|
1684
|
+
declare const execa: {
|
|
1685
|
+
/**
|
|
1686
|
+
Execute a file.
|
|
1687
|
+
|
|
1688
|
+
Think of this as a mix of `child_process.execFile` and `child_process.spawn`.
|
|
1689
|
+
|
|
1690
|
+
@param file - The program/script to execute.
|
|
1691
|
+
@param arguments - Arguments to pass to `file` on execution.
|
|
1692
|
+
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
|
1693
|
+
|
|
1694
|
+
@example
|
|
1695
|
+
```
|
|
1696
|
+
import execa = require('execa');
|
|
1697
|
+
|
|
1698
|
+
(async () => {
|
|
1699
|
+
const {stdout} = await execa('echo', ['unicorns']);
|
|
1700
|
+
console.log(stdout);
|
|
1701
|
+
//=> 'unicorns'
|
|
1702
|
+
|
|
1703
|
+
// Cancelling a spawned process
|
|
1704
|
+
|
|
1705
|
+
const subprocess = execa('node');
|
|
1706
|
+
|
|
1707
|
+
setTimeout(() => {
|
|
1708
|
+
subprocess.cancel()
|
|
1709
|
+
}, 1000);
|
|
1710
|
+
|
|
1711
|
+
try {
|
|
1712
|
+
await subprocess;
|
|
1713
|
+
} catch (error) {
|
|
1714
|
+
console.log(subprocess.killed); // true
|
|
1715
|
+
console.log(error.isCanceled); // true
|
|
1716
|
+
}
|
|
1717
|
+
})();
|
|
1718
|
+
|
|
1719
|
+
// Pipe the child process stdout to the current stdout
|
|
1720
|
+
execa('echo', ['unicorns']).stdout.pipe(process.stdout);
|
|
1721
|
+
```
|
|
1722
|
+
*/
|
|
1723
|
+
(file: string, arguments?: readonly string[], options?: execa.Options): execa.ExecaChildProcess;
|
|
1724
|
+
(file: string, arguments?: readonly string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
1725
|
+
(file: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
1726
|
+
(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
1727
|
+
/**
|
|
1728
|
+
Execute a file synchronously.
|
|
1729
|
+
|
|
1730
|
+
This method throws an `Error` if the command fails.
|
|
1731
|
+
|
|
1732
|
+
@param file - The program/script to execute.
|
|
1733
|
+
@param arguments - Arguments to pass to `file` on execution.
|
|
1734
|
+
@returns A result `Object` with `stdout` and `stderr` properties.
|
|
1735
|
+
*/
|
|
1736
|
+
sync(file: string, arguments?: readonly string[], options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
|
1737
|
+
sync(file: string, arguments?: readonly string[], options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
|
1738
|
+
sync(file: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
|
1739
|
+
sync(file: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
|
1740
|
+
/**
|
|
1741
|
+
Same as `execa()` except both file and arguments are specified in a single `command` string. For example, `execa('echo', ['unicorns'])` is the same as `execa.command('echo unicorns')`.
|
|
1742
|
+
|
|
1743
|
+
If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.
|
|
1744
|
+
|
|
1745
|
+
The `shell` option must be used if the `command` uses shell-specific features (for example, `&&` or `||`), as opposed to being a simple `file` followed by its `arguments`.
|
|
1746
|
+
|
|
1747
|
+
@param command - The program/script to execute and its arguments.
|
|
1748
|
+
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
|
1749
|
+
|
|
1750
|
+
@example
|
|
1751
|
+
```
|
|
1752
|
+
import execa = require('execa');
|
|
1753
|
+
|
|
1754
|
+
(async () => {
|
|
1755
|
+
const {stdout} = await execa.command('echo unicorns');
|
|
1756
|
+
console.log(stdout);
|
|
1757
|
+
//=> 'unicorns'
|
|
1758
|
+
})();
|
|
1759
|
+
```
|
|
1760
|
+
*/
|
|
1761
|
+
command(command: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
1762
|
+
command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
1763
|
+
/**
|
|
1764
|
+
Same as `execa.command()` but synchronous.
|
|
1765
|
+
|
|
1766
|
+
@param command - The program/script to execute and its arguments.
|
|
1767
|
+
@returns A result `Object` with `stdout` and `stderr` properties.
|
|
1768
|
+
*/
|
|
1769
|
+
commandSync(command: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
|
1770
|
+
commandSync(command: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
|
1771
|
+
/**
|
|
1772
|
+
Execute a Node.js script as a child process.
|
|
1773
|
+
|
|
1774
|
+
Same as `execa('node', [scriptPath, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):
|
|
1775
|
+
- the current Node version and options are used. This can be overridden using the `nodePath` and `nodeArguments` options.
|
|
1776
|
+
- the `shell` option cannot be used
|
|
1777
|
+
- an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)
|
|
1778
|
+
|
|
1779
|
+
@param scriptPath - Node.js script to execute.
|
|
1780
|
+
@param arguments - Arguments to pass to `scriptPath` on execution.
|
|
1781
|
+
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
|
1782
|
+
*/
|
|
1783
|
+
node(scriptPath: string, arguments?: readonly string[], options?: execa.NodeOptions): execa.ExecaChildProcess;
|
|
1784
|
+
node(scriptPath: string, arguments?: readonly string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
1785
|
+
node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
1786
|
+
node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
|
1787
|
+
};
|
|
1788
|
+
//#endregion
|
|
1789
|
+
//#region src/common/cli/cli.d.ts
|
|
1790
|
+
type RunOptions = Record<string, unknown>;
|
|
1791
|
+
interface CliResult extends Promise<unknown> {
|
|
1792
|
+
toObservable(opt?: RunOptions): Observable<string>;
|
|
1793
|
+
toStream(opt?: RunOptions): execa.ExecaChildProcess<string>;
|
|
1794
|
+
cwd(cwd: string): CliResult;
|
|
1795
|
+
sync(opt?: RunOptions): execa.ExecaSyncReturnValue<string>;
|
|
1796
|
+
getRaw(opt?: RunOptions): string;
|
|
1797
|
+
get(opt?: RunOptions): string;
|
|
1798
|
+
}
|
|
1799
|
+
declare class Cli {
|
|
1800
|
+
cmd: string;
|
|
1801
|
+
constructor(cmd: string);
|
|
1802
|
+
sync(...args: string[]): execa.ExecaSyncReturnValue<string>;
|
|
1803
|
+
run(...args: string[]): CliResult;
|
|
1804
|
+
get(...args: string[]): string;
|
|
1805
|
+
static run(cmd: string, args?: string[], options?: RunOptions): CliResult;
|
|
1806
|
+
static getRaw(cmd: string, args: string[], options?: RunOptions): string;
|
|
1807
|
+
}
|
|
1808
|
+
//#endregion
|
|
1809
|
+
//#region src/common/cli/bun.d.ts
|
|
1810
|
+
declare class BunCli extends Cli {
|
|
1811
|
+
constructor();
|
|
1812
|
+
newVersion(version: string): undefined<string>;
|
|
1813
|
+
pm(...args: string[]): undefined<string>;
|
|
1814
|
+
run(...args: string[]): CliResult;
|
|
1815
|
+
install(...args: string[]): CliResult;
|
|
1816
|
+
/**
|
|
1817
|
+
* Reinstall dependencies without bun.lock mutation
|
|
1818
|
+
* @returns {Promise<unknown>}
|
|
1819
|
+
*/
|
|
1820
|
+
restore(): CliResult;
|
|
1821
|
+
}
|
|
1822
|
+
declare const bun: BunCli;
|
|
1823
|
+
//#endregion
|
|
1824
|
+
//#region src/common/cli/docker.d.ts
|
|
1825
|
+
declare class DockerCli extends Cli {
|
|
1826
|
+
constructor();
|
|
1827
|
+
tag(...args: string[]): string;
|
|
1828
|
+
login(...args: string[]): undefined<string>;
|
|
1829
|
+
push(...args: string[]): CliResult;
|
|
1830
|
+
getToken(username: string, password: string): Promise<any>;
|
|
1831
|
+
getTags({ token, repository }: {
|
|
1832
|
+
token: string;
|
|
1833
|
+
repository: string;
|
|
1834
|
+
}): Promise<any>;
|
|
1835
|
+
deleteTag(tag: string, { token, repository }: {
|
|
1836
|
+
token: string;
|
|
1837
|
+
repository: string;
|
|
1838
|
+
}): Promise<void>;
|
|
1839
|
+
}
|
|
1840
|
+
declare const docker: DockerCli;
|
|
1841
|
+
//#endregion
|
|
1842
|
+
//#region src/common/cli/git.d.ts
|
|
1843
|
+
declare class GitCli extends Cli {
|
|
1844
|
+
constructor();
|
|
1845
|
+
init(...args: string[]): CliResult;
|
|
1846
|
+
add(...args: string[]): CliResult;
|
|
1847
|
+
status(...args: string[]): undefined<string>;
|
|
1848
|
+
branch(...args: string[]): CliResult;
|
|
1849
|
+
clean(...args: string[]): CliResult;
|
|
1850
|
+
config(...args: string[]): string;
|
|
1851
|
+
checkout(...args: string[]): CliResult;
|
|
1852
|
+
commit(...args: string[]): CliResult;
|
|
1853
|
+
fetch(...args: string[]): CliResult;
|
|
1854
|
+
prune(...args: string[]): CliResult;
|
|
1855
|
+
merge(...args: string[]): undefined<string>;
|
|
1856
|
+
reset(...args: string[]): undefined<string>;
|
|
1857
|
+
remote(...args: string[]): CliResult;
|
|
1858
|
+
rebase(...args: string[]): CliResult;
|
|
1859
|
+
getCommitTag(ref?: string): string;
|
|
1860
|
+
getBranchName(ref?: string): string;
|
|
1861
|
+
getLastCommitMsg(): string;
|
|
1862
|
+
push(...args: string[]): CliResult;
|
|
1863
|
+
branchExists(branch: string, origin?: string): boolean;
|
|
1864
|
+
checkBranchRemoteStatus(branch: string, origin?: string): string;
|
|
1865
|
+
branches(...args: string[]): string[];
|
|
1866
|
+
show(branch: string): string;
|
|
1867
|
+
branchesInfos(...args: string[]): {
|
|
1868
|
+
branch: string;
|
|
1869
|
+
date: string;
|
|
1870
|
+
creation: string;
|
|
1871
|
+
author: string;
|
|
1872
|
+
}[];
|
|
1873
|
+
}
|
|
1874
|
+
declare const git: GitCli;
|
|
1875
|
+
//#endregion
|
|
1876
|
+
//#region src/common/cli/lerna.d.ts
|
|
1877
|
+
declare class LernaCli extends Cli {
|
|
1878
|
+
constructor();
|
|
1879
|
+
newVersion(version: string): undefined<string>;
|
|
1880
|
+
version(...args: string[]): undefined<string>;
|
|
1881
|
+
run(...args: string[]): CliResult;
|
|
1882
|
+
install(...args: string[]): CliResult;
|
|
1883
|
+
}
|
|
1884
|
+
declare const lerna: LernaCli;
|
|
1885
|
+
//#endregion
|
|
1886
|
+
//#region src/common/cli/npm.d.ts
|
|
1887
|
+
declare class NpmCli extends Cli {
|
|
1888
|
+
constructor();
|
|
1889
|
+
newVersion(version: string): undefined<string>;
|
|
1890
|
+
version(...args: string[]): undefined<string>;
|
|
1891
|
+
run(...args: string[]): CliResult;
|
|
1892
|
+
install(...args: string[]): CliResult;
|
|
1893
|
+
publish(...args: string[]): CliResult;
|
|
1894
|
+
pack(...args: string[]): CliResult;
|
|
1895
|
+
/**
|
|
1896
|
+
* Reinstall dependencies without package-lock mutation
|
|
1897
|
+
* @returns {Promise<unknown>}
|
|
1898
|
+
*/
|
|
1899
|
+
restore(): CliResult;
|
|
1900
|
+
}
|
|
1901
|
+
declare const npm: NpmCli;
|
|
1902
|
+
//#endregion
|
|
1903
|
+
//#region src/common/cli/pnpm.d.ts
|
|
1904
|
+
declare class PnpmCli extends Cli {
|
|
1905
|
+
constructor();
|
|
1906
|
+
newVersion(version: string): undefined<string>;
|
|
1907
|
+
version(...args: string[]): undefined<string>;
|
|
1908
|
+
run(...args: string[]): CliResult;
|
|
1909
|
+
install(...args: string[]): CliResult;
|
|
1910
|
+
/**
|
|
1911
|
+
* Reinstall dependencies without pnpm-lock.yaml mutation
|
|
1912
|
+
* @returns {Promise<unknown>}
|
|
1913
|
+
*/
|
|
1914
|
+
restore(): CliResult;
|
|
1915
|
+
}
|
|
1916
|
+
declare const pnpm: PnpmCli;
|
|
1917
|
+
//#endregion
|
|
1918
|
+
//#region src/common/cli/yarn.d.ts
|
|
1919
|
+
declare class YarnCli extends Cli {
|
|
1920
|
+
constructor();
|
|
1921
|
+
newVersion(version: string): undefined<string>;
|
|
1922
|
+
version(...args: string[]): undefined<string>;
|
|
1923
|
+
run(...args: string[]): CliResult;
|
|
1924
|
+
install(...args: string[]): CliResult;
|
|
1925
|
+
/**
|
|
1926
|
+
* Reinstall dependencies without yarn.lock mutation
|
|
1927
|
+
* @returns {Promise<unknown>}
|
|
1928
|
+
*/
|
|
1929
|
+
restore(): CliResult;
|
|
1930
|
+
}
|
|
1931
|
+
declare const yarn: YarnCli;
|
|
1932
|
+
//#endregion
|
|
1933
|
+
//#region src/common/configure-git-workspace.d.ts
|
|
1934
|
+
declare function configureGitWorkspace(context: CmContext): void;
|
|
1935
|
+
//#endregion
|
|
1936
|
+
//#region src/common/get-package-json.d.ts
|
|
1937
|
+
declare function getPackageJson(): PackageJson;
|
|
1938
|
+
//#endregion
|
|
1939
|
+
//#region src/common/get-package-manager.d.ts
|
|
1940
|
+
declare function getPackageManager(pkgManager: string): {
|
|
1941
|
+
newVersion(version: string): undefined<string>;
|
|
1942
|
+
pm(...args: string[]): undefined<string>;
|
|
1943
|
+
run(...args: string[]): CliResult;
|
|
1944
|
+
install(...args: string[]): CliResult;
|
|
1945
|
+
restore(): CliResult;
|
|
1946
|
+
cmd: string;
|
|
1947
|
+
sync(...args: string[]): undefined<string>;
|
|
1948
|
+
get(...args: string[]): string;
|
|
1949
|
+
} | {
|
|
1950
|
+
cmd: string;
|
|
1951
|
+
newVersion(version: string): undefined<string>;
|
|
1952
|
+
version(...args: string[]): undefined<string>;
|
|
1953
|
+
run(...args: string[]): CliResult;
|
|
1954
|
+
install(...args: string[]): CliResult;
|
|
1955
|
+
publish(...args: string[]): CliResult;
|
|
1956
|
+
pack(...args: string[]): CliResult;
|
|
1957
|
+
restore(): CliResult;
|
|
1958
|
+
sync(...args: string[]): undefined<string>;
|
|
1959
|
+
get(...args: string[]): string;
|
|
1960
|
+
} | {
|
|
1961
|
+
newVersion(version: string): undefined<string>;
|
|
1962
|
+
version(...args: string[]): undefined<string>;
|
|
1963
|
+
run(...args: string[]): CliResult;
|
|
1964
|
+
install(...args: string[]): CliResult;
|
|
1965
|
+
restore(): CliResult;
|
|
1966
|
+
cmd: string;
|
|
1967
|
+
sync(...args: string[]): undefined<string>;
|
|
1968
|
+
get(...args: string[]): string;
|
|
1969
|
+
} | {
|
|
1970
|
+
newVersion(version: string): undefined<string>;
|
|
1971
|
+
version(...args: string[]): undefined<string>;
|
|
1972
|
+
run(...args: string[]): CliResult;
|
|
1973
|
+
install(...args: string[]): CliResult;
|
|
1974
|
+
restore(): CliResult;
|
|
1975
|
+
cmd: string;
|
|
1976
|
+
sync(...args: string[]): undefined<string>;
|
|
1977
|
+
get(...args: string[]): string;
|
|
1978
|
+
};
|
|
1979
|
+
//#endregion
|
|
1980
|
+
//#region src/common/run-command.d.ts
|
|
1981
|
+
declare function runCommand(klass: CommandConstructor, opts: Record<string, any>): Promise<void>;
|
|
1982
|
+
//#endregion
|
|
1983
|
+
//#region src/semantic/define-config.d.ts
|
|
1984
|
+
type ReleasePluginContext = SemanticContext & {
|
|
1985
|
+
nextRelease: NextRelease;
|
|
1986
|
+
};
|
|
1987
|
+
interface ConditionalPluginOptions {
|
|
1988
|
+
when?: (context: ReleasePluginContext) => boolean;
|
|
1989
|
+
[key: string]: unknown;
|
|
1990
|
+
}
|
|
1991
|
+
type Plugin = string | [string, ConditionalPluginOptions];
|
|
1992
|
+
interface CmReleaseConfig extends Options$1 {
|
|
1993
|
+
verifyConditions?: readonly Plugin[];
|
|
1994
|
+
analyzeCommits?: readonly Plugin[];
|
|
1995
|
+
verifyRelease?: readonly Plugin[];
|
|
1996
|
+
generateNotes?: readonly Plugin[];
|
|
1997
|
+
prepare?: readonly Plugin[];
|
|
1998
|
+
publish?: readonly Plugin[];
|
|
1999
|
+
success?: readonly Plugin[];
|
|
2000
|
+
fail?: readonly Plugin[];
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Define the semantic-release configuration based on the ClubMed API configuration.
|
|
2004
|
+
*/
|
|
2005
|
+
declare function defineConfig(opts?: CmReleaseConfig): CmReleaseConfig;
|
|
2006
|
+
//#endregion
|
|
2007
|
+
//#region src/semantic/utils/release-rules.d.ts
|
|
2008
|
+
declare const releaseRules: (import("lodash").Omit<{
|
|
2009
|
+
type: string;
|
|
2010
|
+
label: string;
|
|
2011
|
+
release: string;
|
|
2012
|
+
} | {
|
|
2013
|
+
type: string;
|
|
2014
|
+
label: string;
|
|
2015
|
+
release: boolean;
|
|
2016
|
+
}, "label"> | {
|
|
2017
|
+
breaking: boolean;
|
|
2018
|
+
release: string;
|
|
2019
|
+
revert?: undefined;
|
|
2020
|
+
} | {
|
|
2021
|
+
breaking?: undefined;
|
|
2022
|
+
revert: boolean;
|
|
2023
|
+
release: string;
|
|
2024
|
+
})[];
|
|
2025
|
+
//#endregion
|
|
2026
|
+
//#region src/semantic/utils/transform-writer.d.ts
|
|
2027
|
+
interface Commit {
|
|
2028
|
+
type: string;
|
|
2029
|
+
message?: string;
|
|
2030
|
+
subject?: string;
|
|
2031
|
+
scope?: string;
|
|
2032
|
+
hash?: string;
|
|
2033
|
+
shortHash?: string;
|
|
2034
|
+
notes: Array<{
|
|
2035
|
+
title: string;
|
|
2036
|
+
}>;
|
|
2037
|
+
references: Array<{
|
|
2038
|
+
issue: string;
|
|
2039
|
+
}>;
|
|
2040
|
+
[key: string]: unknown;
|
|
2041
|
+
}
|
|
2042
|
+
interface TransformContext {
|
|
2043
|
+
repository?: string;
|
|
2044
|
+
host?: string;
|
|
2045
|
+
owner?: string;
|
|
2046
|
+
repoUrl?: string;
|
|
2047
|
+
}
|
|
2048
|
+
declare function transformWriter(commit: Commit, context: TransformContext): Commit | undefined;
|
|
2049
|
+
//#endregion
|
|
2050
|
+
//#region src/workflow/index.d.ts
|
|
2051
|
+
declare const WORKFLOW_CONFIGURATION: ({
|
|
2052
|
+
type: string;
|
|
2053
|
+
label: string;
|
|
2054
|
+
release: string;
|
|
2055
|
+
} | {
|
|
2056
|
+
type: string;
|
|
2057
|
+
label: string;
|
|
2058
|
+
release: boolean;
|
|
2059
|
+
})[];
|
|
2060
|
+
//#endregion
|
|
2061
|
+
//#region src/index.d.ts
|
|
2062
|
+
declare global {
|
|
2063
|
+
const __VERSION__: string;
|
|
2064
|
+
}
|
|
2065
|
+
//#endregion
|
|
2066
|
+
export { Cli, CliConfig, CliResult, CmReleaseConfig, ConditionalPluginOptions, ReleasePluginContext, WORKFLOW_CONFIGURATION, bun, index_d_exports as commands, configureGitWorkspace, defineConfig, docker, getCI, getConfig, getPackageJson, getPackageManager, git, lerna, npm, pnpm, release, releaseRules, runCommand, transformWriter, yarn };
|
|
2067
|
+
//# sourceMappingURL=index.d.mts.map
|