@modern-js/server-generator 3.0.11 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1427 -1179
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -33114,55 +33114,58 @@ var require_recursive_readdir = __commonJS({
|
|
|
33114
33114
|
var require_commander = __commonJS({
|
|
33115
33115
|
"../../../toolkit/utils/compiled/commander/index.js"(exports, module2) {
|
|
33116
33116
|
(() => {
|
|
33117
|
-
var
|
|
33117
|
+
var t = { 81: (t2) => {
|
|
33118
33118
|
"use strict";
|
|
33119
|
-
|
|
33120
|
-
}, 361: (
|
|
33119
|
+
t2.exports = require("child_process");
|
|
33120
|
+
}, 361: (t2) => {
|
|
33121
33121
|
"use strict";
|
|
33122
|
-
|
|
33123
|
-
}, 147: (
|
|
33122
|
+
t2.exports = require("events");
|
|
33123
|
+
}, 147: (t2) => {
|
|
33124
33124
|
"use strict";
|
|
33125
|
-
|
|
33126
|
-
}, 17: (
|
|
33125
|
+
t2.exports = require("fs");
|
|
33126
|
+
}, 17: (t2) => {
|
|
33127
33127
|
"use strict";
|
|
33128
|
-
|
|
33129
|
-
},
|
|
33130
|
-
|
|
33131
|
-
|
|
33132
|
-
|
|
33133
|
-
const {
|
|
33134
|
-
const {
|
|
33135
|
-
|
|
33136
|
-
|
|
33137
|
-
|
|
33138
|
-
t2.
|
|
33139
|
-
|
|
33140
|
-
|
|
33141
|
-
|
|
33142
|
-
|
|
33143
|
-
|
|
33144
|
-
|
|
33145
|
-
|
|
33128
|
+
t2.exports = require("path");
|
|
33129
|
+
}, 282: (t2) => {
|
|
33130
|
+
"use strict";
|
|
33131
|
+
t2.exports = require("process");
|
|
33132
|
+
}, 632: (t2, e2, i2) => {
|
|
33133
|
+
const { Argument: n } = i2(535);
|
|
33134
|
+
const { Command: s } = i2(302);
|
|
33135
|
+
const { CommanderError: r, InvalidArgumentError: o } = i2(796);
|
|
33136
|
+
const { Help: a } = i2(519);
|
|
33137
|
+
const { Option: l } = i2(437);
|
|
33138
|
+
e2 = t2.exports = new s();
|
|
33139
|
+
e2.program = e2;
|
|
33140
|
+
e2.Argument = n;
|
|
33141
|
+
e2.Command = s;
|
|
33142
|
+
e2.CommanderError = r;
|
|
33143
|
+
e2.Help = a;
|
|
33144
|
+
e2.InvalidArgumentError = o;
|
|
33145
|
+
e2.InvalidOptionArgumentError = o;
|
|
33146
|
+
e2.Option = l;
|
|
33147
|
+
}, 535: (t2, e2, i2) => {
|
|
33148
|
+
const { InvalidArgumentError: n } = i2(796);
|
|
33146
33149
|
class Argument {
|
|
33147
|
-
constructor(
|
|
33148
|
-
this.description =
|
|
33150
|
+
constructor(t3, e3) {
|
|
33151
|
+
this.description = e3 || "";
|
|
33149
33152
|
this.variadic = false;
|
|
33150
33153
|
this.parseArg = void 0;
|
|
33151
33154
|
this.defaultValue = void 0;
|
|
33152
33155
|
this.defaultValueDescription = void 0;
|
|
33153
33156
|
this.argChoices = void 0;
|
|
33154
|
-
switch (
|
|
33157
|
+
switch (t3[0]) {
|
|
33155
33158
|
case "<":
|
|
33156
33159
|
this.required = true;
|
|
33157
|
-
this._name =
|
|
33160
|
+
this._name = t3.slice(1, -1);
|
|
33158
33161
|
break;
|
|
33159
33162
|
case "[":
|
|
33160
33163
|
this.required = false;
|
|
33161
|
-
this._name =
|
|
33164
|
+
this._name = t3.slice(1, -1);
|
|
33162
33165
|
break;
|
|
33163
33166
|
default:
|
|
33164
33167
|
this.required = true;
|
|
33165
|
-
this._name =
|
|
33168
|
+
this._name = t3;
|
|
33166
33169
|
break;
|
|
33167
33170
|
}
|
|
33168
33171
|
if (this._name.length > 3 && this._name.slice(-3) === "...") {
|
|
@@ -33173,31 +33176,31 @@ var require_commander = __commonJS({
|
|
|
33173
33176
|
name() {
|
|
33174
33177
|
return this._name;
|
|
33175
33178
|
}
|
|
33176
|
-
_concatValue(
|
|
33177
|
-
if (
|
|
33178
|
-
return [
|
|
33179
|
+
_concatValue(t3, e3) {
|
|
33180
|
+
if (e3 === this.defaultValue || !Array.isArray(e3)) {
|
|
33181
|
+
return [t3];
|
|
33179
33182
|
}
|
|
33180
|
-
return
|
|
33183
|
+
return e3.concat(t3);
|
|
33181
33184
|
}
|
|
33182
|
-
default(
|
|
33183
|
-
this.defaultValue =
|
|
33184
|
-
this.defaultValueDescription =
|
|
33185
|
+
default(t3, e3) {
|
|
33186
|
+
this.defaultValue = t3;
|
|
33187
|
+
this.defaultValueDescription = e3;
|
|
33185
33188
|
return this;
|
|
33186
33189
|
}
|
|
33187
|
-
argParser(
|
|
33188
|
-
this.parseArg =
|
|
33190
|
+
argParser(t3) {
|
|
33191
|
+
this.parseArg = t3;
|
|
33189
33192
|
return this;
|
|
33190
33193
|
}
|
|
33191
|
-
choices(
|
|
33192
|
-
this.argChoices =
|
|
33193
|
-
this.parseArg = (
|
|
33194
|
-
if (!
|
|
33195
|
-
throw new n(`Allowed choices are ${
|
|
33194
|
+
choices(t3) {
|
|
33195
|
+
this.argChoices = t3.slice();
|
|
33196
|
+
this.parseArg = (t4, e3) => {
|
|
33197
|
+
if (!this.argChoices.includes(t4)) {
|
|
33198
|
+
throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
33196
33199
|
}
|
|
33197
33200
|
if (this.variadic) {
|
|
33198
|
-
return this._concatValue(
|
|
33201
|
+
return this._concatValue(t4, e3);
|
|
33199
33202
|
}
|
|
33200
|
-
return
|
|
33203
|
+
return t4;
|
|
33201
33204
|
};
|
|
33202
33205
|
return this;
|
|
33203
33206
|
}
|
|
@@ -33210,24 +33213,25 @@ var require_commander = __commonJS({
|
|
|
33210
33213
|
return this;
|
|
33211
33214
|
}
|
|
33212
33215
|
}
|
|
33213
|
-
function humanReadableArgName(
|
|
33214
|
-
const
|
|
33215
|
-
return
|
|
33216
|
+
function humanReadableArgName(t3) {
|
|
33217
|
+
const e3 = t3.name() + (t3.variadic === true ? "..." : "");
|
|
33218
|
+
return t3.required ? "<" + e3 + ">" : "[" + e3 + "]";
|
|
33216
33219
|
}
|
|
33217
|
-
|
|
33218
|
-
|
|
33219
|
-
},
|
|
33220
|
+
e2.Argument = Argument;
|
|
33221
|
+
e2.humanReadableArgName = humanReadableArgName;
|
|
33222
|
+
}, 302: (t2, e2, i2) => {
|
|
33220
33223
|
const n = i2(361).EventEmitter;
|
|
33221
33224
|
const s = i2(81);
|
|
33222
33225
|
const r = i2(17);
|
|
33223
33226
|
const o = i2(147);
|
|
33224
|
-
const
|
|
33225
|
-
const {
|
|
33226
|
-
const {
|
|
33227
|
-
const {
|
|
33228
|
-
const {
|
|
33227
|
+
const a = i2(282);
|
|
33228
|
+
const { Argument: l, humanReadableArgName: h } = i2(535);
|
|
33229
|
+
const { CommanderError: u } = i2(796);
|
|
33230
|
+
const { Help: c } = i2(519);
|
|
33231
|
+
const { Option: p, splitOptionFlags: m, DualOptions: d } = i2(437);
|
|
33232
|
+
const { suggestSimilar: f } = i2(860);
|
|
33229
33233
|
class Command2 extends n {
|
|
33230
|
-
constructor(
|
|
33234
|
+
constructor(t3) {
|
|
33231
33235
|
super();
|
|
33232
33236
|
this.commands = [];
|
|
33233
33237
|
this.options = [];
|
|
@@ -33239,25 +33243,27 @@ var require_commander = __commonJS({
|
|
|
33239
33243
|
this.rawArgs = [];
|
|
33240
33244
|
this.processedArgs = [];
|
|
33241
33245
|
this._scriptPath = null;
|
|
33242
|
-
this._name =
|
|
33246
|
+
this._name = t3 || "";
|
|
33243
33247
|
this._optionValues = {};
|
|
33244
33248
|
this._optionValueSources = {};
|
|
33245
33249
|
this._storeOptionsAsProperties = false;
|
|
33246
33250
|
this._actionHandler = null;
|
|
33247
33251
|
this._executableHandler = false;
|
|
33248
33252
|
this._executableFile = null;
|
|
33253
|
+
this._executableDir = null;
|
|
33249
33254
|
this._defaultCommandName = null;
|
|
33250
33255
|
this._exitCallback = null;
|
|
33251
33256
|
this._aliases = [];
|
|
33252
33257
|
this._combineFlagAndOptionalValue = true;
|
|
33253
33258
|
this._description = "";
|
|
33259
|
+
this._summary = "";
|
|
33254
33260
|
this._argsDescription = void 0;
|
|
33255
33261
|
this._enablePositionalOptions = false;
|
|
33256
33262
|
this._passThroughOptions = false;
|
|
33257
33263
|
this._lifeCycleHooks = {};
|
|
33258
33264
|
this._showHelpAfterError = false;
|
|
33259
|
-
this._showSuggestionAfterError =
|
|
33260
|
-
this._outputConfiguration = { writeOut: (
|
|
33265
|
+
this._showSuggestionAfterError = true;
|
|
33266
|
+
this._outputConfiguration = { writeOut: (t4) => a.stdout.write(t4), writeErr: (t4) => a.stderr.write(t4), getOutHelpWidth: () => a.stdout.isTTY ? a.stdout.columns : void 0, getErrHelpWidth: () => a.stderr.isTTY ? a.stderr.columns : void 0, outputError: (t4, e3) => e3(t4) };
|
|
33261
33267
|
this._hidden = false;
|
|
33262
33268
|
this._hasHelpOption = true;
|
|
33263
33269
|
this._helpFlags = "-h, --help";
|
|
@@ -33270,35 +33276,35 @@ var require_commander = __commonJS({
|
|
|
33270
33276
|
this._helpCommandDescription = "display help for command";
|
|
33271
33277
|
this._helpConfiguration = {};
|
|
33272
33278
|
}
|
|
33273
|
-
copyInheritedSettings(
|
|
33274
|
-
this._outputConfiguration =
|
|
33275
|
-
this._hasHelpOption =
|
|
33276
|
-
this._helpFlags =
|
|
33277
|
-
this._helpDescription =
|
|
33278
|
-
this._helpShortFlag =
|
|
33279
|
-
this._helpLongFlag =
|
|
33280
|
-
this._helpCommandName =
|
|
33281
|
-
this._helpCommandnameAndArgs =
|
|
33282
|
-
this._helpCommandDescription =
|
|
33283
|
-
this._helpConfiguration =
|
|
33284
|
-
this._exitCallback =
|
|
33285
|
-
this._storeOptionsAsProperties =
|
|
33286
|
-
this._combineFlagAndOptionalValue =
|
|
33287
|
-
this._allowExcessArguments =
|
|
33288
|
-
this._enablePositionalOptions =
|
|
33289
|
-
this._showHelpAfterError =
|
|
33290
|
-
this._showSuggestionAfterError =
|
|
33279
|
+
copyInheritedSettings(t3) {
|
|
33280
|
+
this._outputConfiguration = t3._outputConfiguration;
|
|
33281
|
+
this._hasHelpOption = t3._hasHelpOption;
|
|
33282
|
+
this._helpFlags = t3._helpFlags;
|
|
33283
|
+
this._helpDescription = t3._helpDescription;
|
|
33284
|
+
this._helpShortFlag = t3._helpShortFlag;
|
|
33285
|
+
this._helpLongFlag = t3._helpLongFlag;
|
|
33286
|
+
this._helpCommandName = t3._helpCommandName;
|
|
33287
|
+
this._helpCommandnameAndArgs = t3._helpCommandnameAndArgs;
|
|
33288
|
+
this._helpCommandDescription = t3._helpCommandDescription;
|
|
33289
|
+
this._helpConfiguration = t3._helpConfiguration;
|
|
33290
|
+
this._exitCallback = t3._exitCallback;
|
|
33291
|
+
this._storeOptionsAsProperties = t3._storeOptionsAsProperties;
|
|
33292
|
+
this._combineFlagAndOptionalValue = t3._combineFlagAndOptionalValue;
|
|
33293
|
+
this._allowExcessArguments = t3._allowExcessArguments;
|
|
33294
|
+
this._enablePositionalOptions = t3._enablePositionalOptions;
|
|
33295
|
+
this._showHelpAfterError = t3._showHelpAfterError;
|
|
33296
|
+
this._showSuggestionAfterError = t3._showSuggestionAfterError;
|
|
33291
33297
|
return this;
|
|
33292
33298
|
}
|
|
33293
|
-
command(
|
|
33294
|
-
let n2 =
|
|
33299
|
+
command(t3, e3, i3) {
|
|
33300
|
+
let n2 = e3;
|
|
33295
33301
|
let s2 = i3;
|
|
33296
33302
|
if (typeof n2 === "object" && n2 !== null) {
|
|
33297
33303
|
s2 = n2;
|
|
33298
33304
|
n2 = null;
|
|
33299
33305
|
}
|
|
33300
33306
|
s2 = s2 || {};
|
|
33301
|
-
const [, r2, o2] =
|
|
33307
|
+
const [, r2, o2] = t3.match(/([^ ]+) *(.*)/);
|
|
33302
33308
|
const a2 = this.createCommand(r2);
|
|
33303
33309
|
if (n2) {
|
|
33304
33310
|
a2.description(n2);
|
|
@@ -33317,60 +33323,53 @@ var require_commander = __commonJS({
|
|
|
33317
33323
|
return this;
|
|
33318
33324
|
return a2;
|
|
33319
33325
|
}
|
|
33320
|
-
createCommand(
|
|
33321
|
-
return new Command2(
|
|
33326
|
+
createCommand(t3) {
|
|
33327
|
+
return new Command2(t3);
|
|
33322
33328
|
}
|
|
33323
33329
|
createHelp() {
|
|
33324
|
-
return Object.assign(new
|
|
33330
|
+
return Object.assign(new c(), this.configureHelp());
|
|
33325
33331
|
}
|
|
33326
|
-
configureHelp(
|
|
33327
|
-
if (
|
|
33332
|
+
configureHelp(t3) {
|
|
33333
|
+
if (t3 === void 0)
|
|
33328
33334
|
return this._helpConfiguration;
|
|
33329
|
-
this._helpConfiguration =
|
|
33335
|
+
this._helpConfiguration = t3;
|
|
33330
33336
|
return this;
|
|
33331
33337
|
}
|
|
33332
|
-
configureOutput(
|
|
33333
|
-
if (
|
|
33338
|
+
configureOutput(t3) {
|
|
33339
|
+
if (t3 === void 0)
|
|
33334
33340
|
return this._outputConfiguration;
|
|
33335
|
-
Object.assign(this._outputConfiguration,
|
|
33341
|
+
Object.assign(this._outputConfiguration, t3);
|
|
33336
33342
|
return this;
|
|
33337
33343
|
}
|
|
33338
|
-
showHelpAfterError(
|
|
33339
|
-
if (typeof
|
|
33340
|
-
|
|
33341
|
-
this._showHelpAfterError =
|
|
33344
|
+
showHelpAfterError(t3 = true) {
|
|
33345
|
+
if (typeof t3 !== "string")
|
|
33346
|
+
t3 = !!t3;
|
|
33347
|
+
this._showHelpAfterError = t3;
|
|
33342
33348
|
return this;
|
|
33343
33349
|
}
|
|
33344
|
-
showSuggestionAfterError(
|
|
33345
|
-
this._showSuggestionAfterError = !!
|
|
33350
|
+
showSuggestionAfterError(t3 = true) {
|
|
33351
|
+
this._showSuggestionAfterError = !!t3;
|
|
33346
33352
|
return this;
|
|
33347
33353
|
}
|
|
33348
|
-
addCommand(
|
|
33349
|
-
if (!
|
|
33350
|
-
throw new Error(
|
|
33351
|
-
|
|
33352
|
-
e4.forEach((e5) => {
|
|
33353
|
-
if (e5._executableHandler && !e5._executableFile) {
|
|
33354
|
-
throw new Error(`Must specify executableFile for deeply nested executable: ${e5.name()}`);
|
|
33355
|
-
}
|
|
33356
|
-
checkExplicitNames(e5.commands);
|
|
33357
|
-
});
|
|
33354
|
+
addCommand(t3, e3) {
|
|
33355
|
+
if (!t3._name) {
|
|
33356
|
+
throw new Error(`Command passed to .addCommand() must have a name
|
|
33357
|
+
- specify the name in Command constructor or using .name()`);
|
|
33358
33358
|
}
|
|
33359
|
-
|
|
33360
|
-
|
|
33361
|
-
|
|
33362
|
-
|
|
33363
|
-
|
|
33364
|
-
|
|
33365
|
-
this
|
|
33366
|
-
e3.parent = this;
|
|
33359
|
+
e3 = e3 || {};
|
|
33360
|
+
if (e3.isDefault)
|
|
33361
|
+
this._defaultCommandName = t3._name;
|
|
33362
|
+
if (e3.noHelp || e3.hidden)
|
|
33363
|
+
t3._hidden = true;
|
|
33364
|
+
this.commands.push(t3);
|
|
33365
|
+
t3.parent = this;
|
|
33367
33366
|
return this;
|
|
33368
33367
|
}
|
|
33369
|
-
createArgument(
|
|
33370
|
-
return new
|
|
33368
|
+
createArgument(t3, e3) {
|
|
33369
|
+
return new l(t3, e3);
|
|
33371
33370
|
}
|
|
33372
|
-
argument(
|
|
33373
|
-
const s2 = this.createArgument(
|
|
33371
|
+
argument(t3, e3, i3, n2) {
|
|
33372
|
+
const s2 = this.createArgument(t3, e3);
|
|
33374
33373
|
if (typeof i3 === "function") {
|
|
33375
33374
|
s2.default(n2).argParser(i3);
|
|
33376
33375
|
} else {
|
|
@@ -33379,33 +33378,33 @@ var require_commander = __commonJS({
|
|
|
33379
33378
|
this.addArgument(s2);
|
|
33380
33379
|
return this;
|
|
33381
33380
|
}
|
|
33382
|
-
arguments(
|
|
33383
|
-
|
|
33384
|
-
this.argument(
|
|
33381
|
+
arguments(t3) {
|
|
33382
|
+
t3.split(/ +/).forEach((t4) => {
|
|
33383
|
+
this.argument(t4);
|
|
33385
33384
|
});
|
|
33386
33385
|
return this;
|
|
33387
33386
|
}
|
|
33388
|
-
addArgument(
|
|
33389
|
-
const
|
|
33390
|
-
if (
|
|
33391
|
-
throw new Error(`only the last argument can be variadic '${
|
|
33387
|
+
addArgument(t3) {
|
|
33388
|
+
const e3 = this._args.slice(-1)[0];
|
|
33389
|
+
if (e3 && e3.variadic) {
|
|
33390
|
+
throw new Error(`only the last argument can be variadic '${e3.name()}'`);
|
|
33392
33391
|
}
|
|
33393
|
-
if (
|
|
33394
|
-
throw new Error(`a default value for a required argument is never used: '${
|
|
33392
|
+
if (t3.required && t3.defaultValue !== void 0 && t3.parseArg === void 0) {
|
|
33393
|
+
throw new Error(`a default value for a required argument is never used: '${t3.name()}'`);
|
|
33395
33394
|
}
|
|
33396
|
-
this._args.push(
|
|
33395
|
+
this._args.push(t3);
|
|
33397
33396
|
return this;
|
|
33398
33397
|
}
|
|
33399
|
-
addHelpCommand(
|
|
33400
|
-
if (
|
|
33398
|
+
addHelpCommand(t3, e3) {
|
|
33399
|
+
if (t3 === false) {
|
|
33401
33400
|
this._addImplicitHelpCommand = false;
|
|
33402
33401
|
} else {
|
|
33403
33402
|
this._addImplicitHelpCommand = true;
|
|
33404
|
-
if (typeof
|
|
33405
|
-
this._helpCommandName =
|
|
33406
|
-
this._helpCommandnameAndArgs =
|
|
33403
|
+
if (typeof t3 === "string") {
|
|
33404
|
+
this._helpCommandName = t3.split(" ")[0];
|
|
33405
|
+
this._helpCommandnameAndArgs = t3;
|
|
33407
33406
|
}
|
|
33408
|
-
this._helpCommandDescription =
|
|
33407
|
+
this._helpCommandDescription = e3 || this._helpCommandDescription;
|
|
33409
33408
|
}
|
|
33410
33409
|
return this;
|
|
33411
33410
|
}
|
|
@@ -33415,116 +33414,121 @@ var require_commander = __commonJS({
|
|
|
33415
33414
|
}
|
|
33416
33415
|
return this._addImplicitHelpCommand;
|
|
33417
33416
|
}
|
|
33418
|
-
hook(
|
|
33419
|
-
const i3 = ["preAction", "postAction"];
|
|
33420
|
-
if (!i3.includes(
|
|
33421
|
-
throw new Error(`Unexpected value for event passed to hook : '${
|
|
33417
|
+
hook(t3, e3) {
|
|
33418
|
+
const i3 = ["preSubcommand", "preAction", "postAction"];
|
|
33419
|
+
if (!i3.includes(t3)) {
|
|
33420
|
+
throw new Error(`Unexpected value for event passed to hook : '${t3}'.
|
|
33422
33421
|
Expecting one of '${i3.join("', '")}'`);
|
|
33423
33422
|
}
|
|
33424
|
-
if (this._lifeCycleHooks[
|
|
33425
|
-
this._lifeCycleHooks[
|
|
33423
|
+
if (this._lifeCycleHooks[t3]) {
|
|
33424
|
+
this._lifeCycleHooks[t3].push(e3);
|
|
33426
33425
|
} else {
|
|
33427
|
-
this._lifeCycleHooks[
|
|
33426
|
+
this._lifeCycleHooks[t3] = [e3];
|
|
33428
33427
|
}
|
|
33429
33428
|
return this;
|
|
33430
33429
|
}
|
|
33431
|
-
exitOverride(
|
|
33432
|
-
if (
|
|
33433
|
-
this._exitCallback =
|
|
33430
|
+
exitOverride(t3) {
|
|
33431
|
+
if (t3) {
|
|
33432
|
+
this._exitCallback = t3;
|
|
33434
33433
|
} else {
|
|
33435
|
-
this._exitCallback = (
|
|
33436
|
-
if (
|
|
33437
|
-
throw
|
|
33434
|
+
this._exitCallback = (t4) => {
|
|
33435
|
+
if (t4.code !== "commander.executeSubCommandAsync") {
|
|
33436
|
+
throw t4;
|
|
33438
33437
|
} else {
|
|
33439
33438
|
}
|
|
33440
33439
|
};
|
|
33441
33440
|
}
|
|
33442
33441
|
return this;
|
|
33443
33442
|
}
|
|
33444
|
-
_exit(
|
|
33443
|
+
_exit(t3, e3, i3) {
|
|
33445
33444
|
if (this._exitCallback) {
|
|
33446
|
-
this._exitCallback(new
|
|
33445
|
+
this._exitCallback(new u(t3, e3, i3));
|
|
33447
33446
|
}
|
|
33448
|
-
|
|
33447
|
+
a.exit(t3);
|
|
33449
33448
|
}
|
|
33450
|
-
action(
|
|
33451
|
-
const listener = (
|
|
33449
|
+
action(t3) {
|
|
33450
|
+
const listener = (e3) => {
|
|
33452
33451
|
const i3 = this._args.length;
|
|
33453
|
-
const n2 =
|
|
33452
|
+
const n2 = e3.slice(0, i3);
|
|
33454
33453
|
if (this._storeOptionsAsProperties) {
|
|
33455
33454
|
n2[i3] = this;
|
|
33456
33455
|
} else {
|
|
33457
33456
|
n2[i3] = this.opts();
|
|
33458
33457
|
}
|
|
33459
33458
|
n2.push(this);
|
|
33460
|
-
return
|
|
33459
|
+
return t3.apply(this, n2);
|
|
33461
33460
|
};
|
|
33462
33461
|
this._actionHandler = listener;
|
|
33463
33462
|
return this;
|
|
33464
33463
|
}
|
|
33465
|
-
createOption(
|
|
33466
|
-
return new
|
|
33464
|
+
createOption(t3, e3) {
|
|
33465
|
+
return new p(t3, e3);
|
|
33467
33466
|
}
|
|
33468
|
-
addOption(
|
|
33469
|
-
const
|
|
33470
|
-
const i3 =
|
|
33471
|
-
|
|
33472
|
-
|
|
33473
|
-
if (
|
|
33474
|
-
|
|
33475
|
-
n2 = this._findOption(t4) ? this.getOptionValue(i3) : true;
|
|
33476
|
-
}
|
|
33477
|
-
if (n2 !== void 0) {
|
|
33478
|
-
this.setOptionValueWithSource(i3, n2, "default");
|
|
33467
|
+
addOption(t3) {
|
|
33468
|
+
const e3 = t3.name();
|
|
33469
|
+
const i3 = t3.attributeName();
|
|
33470
|
+
if (t3.negate) {
|
|
33471
|
+
const e4 = t3.long.replace(/^--no-/, "--");
|
|
33472
|
+
if (!this._findOption(e4)) {
|
|
33473
|
+
this.setOptionValueWithSource(i3, t3.defaultValue === void 0 ? true : t3.defaultValue, "default");
|
|
33479
33474
|
}
|
|
33475
|
+
} else if (t3.defaultValue !== void 0) {
|
|
33476
|
+
this.setOptionValueWithSource(i3, t3.defaultValue, "default");
|
|
33480
33477
|
}
|
|
33481
|
-
this.options.push(
|
|
33482
|
-
const handleOptionValue = (
|
|
33483
|
-
|
|
33484
|
-
|
|
33478
|
+
this.options.push(t3);
|
|
33479
|
+
const handleOptionValue = (e4, n2, s2) => {
|
|
33480
|
+
if (e4 == null && t3.presetArg !== void 0) {
|
|
33481
|
+
e4 = t3.presetArg;
|
|
33482
|
+
}
|
|
33483
|
+
const r2 = this.getOptionValue(i3);
|
|
33484
|
+
if (e4 !== null && t3.parseArg) {
|
|
33485
33485
|
try {
|
|
33486
|
-
|
|
33487
|
-
} catch (
|
|
33488
|
-
if (
|
|
33489
|
-
const
|
|
33490
|
-
this.
|
|
33486
|
+
e4 = t3.parseArg(e4, r2);
|
|
33487
|
+
} catch (t4) {
|
|
33488
|
+
if (t4.code === "commander.invalidArgument") {
|
|
33489
|
+
const e5 = `${n2} ${t4.message}`;
|
|
33490
|
+
this.error(e5, { exitCode: t4.exitCode, code: t4.code });
|
|
33491
33491
|
}
|
|
33492
|
-
throw
|
|
33492
|
+
throw t4;
|
|
33493
33493
|
}
|
|
33494
|
-
} else if (
|
|
33495
|
-
|
|
33494
|
+
} else if (e4 !== null && t3.variadic) {
|
|
33495
|
+
e4 = t3._concatValue(e4, r2);
|
|
33496
33496
|
}
|
|
33497
|
-
if (
|
|
33498
|
-
if (
|
|
33499
|
-
|
|
33497
|
+
if (e4 == null) {
|
|
33498
|
+
if (t3.negate) {
|
|
33499
|
+
e4 = false;
|
|
33500
|
+
} else if (t3.isBoolean() || t3.optional) {
|
|
33501
|
+
e4 = true;
|
|
33500
33502
|
} else {
|
|
33501
|
-
|
|
33503
|
+
e4 = "";
|
|
33502
33504
|
}
|
|
33503
|
-
} else if (t4 !== null) {
|
|
33504
|
-
this.setOptionValueWithSource(i3, e3.negate ? false : t4, r2);
|
|
33505
33505
|
}
|
|
33506
|
+
this.setOptionValueWithSource(i3, e4, s2);
|
|
33506
33507
|
};
|
|
33507
|
-
this.on("option:" +
|
|
33508
|
-
const i4 = `error: option '${
|
|
33509
|
-
handleOptionValue(
|
|
33508
|
+
this.on("option:" + e3, (e4) => {
|
|
33509
|
+
const i4 = `error: option '${t3.flags}' argument '${e4}' is invalid.`;
|
|
33510
|
+
handleOptionValue(e4, i4, "cli");
|
|
33510
33511
|
});
|
|
33511
|
-
if (
|
|
33512
|
-
this.on("optionEnv:" +
|
|
33513
|
-
const i4 = `error: option '${
|
|
33514
|
-
handleOptionValue(
|
|
33512
|
+
if (t3.envVar) {
|
|
33513
|
+
this.on("optionEnv:" + e3, (e4) => {
|
|
33514
|
+
const i4 = `error: option '${t3.flags}' value '${e4}' from env '${t3.envVar}' is invalid.`;
|
|
33515
|
+
handleOptionValue(e4, i4, "env");
|
|
33515
33516
|
});
|
|
33516
33517
|
}
|
|
33517
33518
|
return this;
|
|
33518
33519
|
}
|
|
33519
|
-
_optionEx(
|
|
33520
|
-
|
|
33521
|
-
|
|
33520
|
+
_optionEx(t3, e3, i3, n2, s2) {
|
|
33521
|
+
if (typeof e3 === "object" && e3 instanceof p) {
|
|
33522
|
+
throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");
|
|
33523
|
+
}
|
|
33524
|
+
const r2 = this.createOption(e3, i3);
|
|
33525
|
+
r2.makeOptionMandatory(!!t3.mandatory);
|
|
33522
33526
|
if (typeof n2 === "function") {
|
|
33523
33527
|
r2.default(s2).argParser(n2);
|
|
33524
33528
|
} else if (n2 instanceof RegExp) {
|
|
33525
|
-
const
|
|
33526
|
-
n2 = (
|
|
33527
|
-
const n3 =
|
|
33529
|
+
const t4 = n2;
|
|
33530
|
+
n2 = (e4, i4) => {
|
|
33531
|
+
const n3 = t4.exec(e4);
|
|
33528
33532
|
return n3 ? n3[0] : i4;
|
|
33529
33533
|
};
|
|
33530
33534
|
r2.default(s2).argParser(n2);
|
|
@@ -33533,209 +33537,233 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
33533
33537
|
}
|
|
33534
33538
|
return this.addOption(r2);
|
|
33535
33539
|
}
|
|
33536
|
-
option(
|
|
33537
|
-
return this._optionEx({},
|
|
33540
|
+
option(t3, e3, i3, n2) {
|
|
33541
|
+
return this._optionEx({}, t3, e3, i3, n2);
|
|
33538
33542
|
}
|
|
33539
|
-
requiredOption(
|
|
33540
|
-
return this._optionEx({ mandatory: true },
|
|
33543
|
+
requiredOption(t3, e3, i3, n2) {
|
|
33544
|
+
return this._optionEx({ mandatory: true }, t3, e3, i3, n2);
|
|
33541
33545
|
}
|
|
33542
|
-
combineFlagAndOptionalValue(
|
|
33543
|
-
this._combineFlagAndOptionalValue = !!
|
|
33546
|
+
combineFlagAndOptionalValue(t3 = true) {
|
|
33547
|
+
this._combineFlagAndOptionalValue = !!t3;
|
|
33544
33548
|
return this;
|
|
33545
33549
|
}
|
|
33546
|
-
allowUnknownOption(
|
|
33547
|
-
this._allowUnknownOption = !!
|
|
33550
|
+
allowUnknownOption(t3 = true) {
|
|
33551
|
+
this._allowUnknownOption = !!t3;
|
|
33548
33552
|
return this;
|
|
33549
33553
|
}
|
|
33550
|
-
allowExcessArguments(
|
|
33551
|
-
this._allowExcessArguments = !!
|
|
33554
|
+
allowExcessArguments(t3 = true) {
|
|
33555
|
+
this._allowExcessArguments = !!t3;
|
|
33552
33556
|
return this;
|
|
33553
33557
|
}
|
|
33554
|
-
enablePositionalOptions(
|
|
33555
|
-
this._enablePositionalOptions = !!
|
|
33558
|
+
enablePositionalOptions(t3 = true) {
|
|
33559
|
+
this._enablePositionalOptions = !!t3;
|
|
33556
33560
|
return this;
|
|
33557
33561
|
}
|
|
33558
|
-
passThroughOptions(
|
|
33559
|
-
this._passThroughOptions = !!
|
|
33560
|
-
if (!!this.parent &&
|
|
33562
|
+
passThroughOptions(t3 = true) {
|
|
33563
|
+
this._passThroughOptions = !!t3;
|
|
33564
|
+
if (!!this.parent && t3 && !this.parent._enablePositionalOptions) {
|
|
33561
33565
|
throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");
|
|
33562
33566
|
}
|
|
33563
33567
|
return this;
|
|
33564
33568
|
}
|
|
33565
|
-
storeOptionsAsProperties(
|
|
33566
|
-
this._storeOptionsAsProperties = !!
|
|
33569
|
+
storeOptionsAsProperties(t3 = true) {
|
|
33570
|
+
this._storeOptionsAsProperties = !!t3;
|
|
33567
33571
|
if (this.options.length) {
|
|
33568
33572
|
throw new Error("call .storeOptionsAsProperties() before adding options");
|
|
33569
33573
|
}
|
|
33570
33574
|
return this;
|
|
33571
33575
|
}
|
|
33572
|
-
getOptionValue(
|
|
33576
|
+
getOptionValue(t3) {
|
|
33573
33577
|
if (this._storeOptionsAsProperties) {
|
|
33574
|
-
return this[
|
|
33578
|
+
return this[t3];
|
|
33575
33579
|
}
|
|
33576
|
-
return this._optionValues[
|
|
33580
|
+
return this._optionValues[t3];
|
|
33577
33581
|
}
|
|
33578
|
-
setOptionValue(
|
|
33582
|
+
setOptionValue(t3, e3) {
|
|
33583
|
+
return this.setOptionValueWithSource(t3, e3, void 0);
|
|
33584
|
+
}
|
|
33585
|
+
setOptionValueWithSource(t3, e3, i3) {
|
|
33579
33586
|
if (this._storeOptionsAsProperties) {
|
|
33580
|
-
this[
|
|
33587
|
+
this[t3] = e3;
|
|
33581
33588
|
} else {
|
|
33582
|
-
this._optionValues[
|
|
33589
|
+
this._optionValues[t3] = e3;
|
|
33583
33590
|
}
|
|
33591
|
+
this._optionValueSources[t3] = i3;
|
|
33584
33592
|
return this;
|
|
33585
33593
|
}
|
|
33586
|
-
|
|
33587
|
-
this.
|
|
33588
|
-
this._optionValueSources[e3] = i3;
|
|
33589
|
-
return this;
|
|
33594
|
+
getOptionValueSource(t3) {
|
|
33595
|
+
return this._optionValueSources[t3];
|
|
33590
33596
|
}
|
|
33591
|
-
|
|
33592
|
-
|
|
33597
|
+
getOptionValueSourceWithGlobals(t3) {
|
|
33598
|
+
let e3;
|
|
33599
|
+
getCommandAndParents(this).forEach((i3) => {
|
|
33600
|
+
if (i3.getOptionValueSource(t3) !== void 0) {
|
|
33601
|
+
e3 = i3.getOptionValueSource(t3);
|
|
33602
|
+
}
|
|
33603
|
+
});
|
|
33604
|
+
return e3;
|
|
33593
33605
|
}
|
|
33594
|
-
_prepareUserArgs(
|
|
33595
|
-
if (
|
|
33606
|
+
_prepareUserArgs(t3, e3) {
|
|
33607
|
+
if (t3 !== void 0 && !Array.isArray(t3)) {
|
|
33596
33608
|
throw new Error("first parameter to parse must be array or undefined");
|
|
33597
33609
|
}
|
|
33598
|
-
|
|
33599
|
-
if (
|
|
33600
|
-
|
|
33601
|
-
if (
|
|
33602
|
-
|
|
33610
|
+
e3 = e3 || {};
|
|
33611
|
+
if (t3 === void 0) {
|
|
33612
|
+
t3 = a.argv;
|
|
33613
|
+
if (a.versions && a.versions.electron) {
|
|
33614
|
+
e3.from = "electron";
|
|
33603
33615
|
}
|
|
33604
33616
|
}
|
|
33605
|
-
this.rawArgs =
|
|
33617
|
+
this.rawArgs = t3.slice();
|
|
33606
33618
|
let i3;
|
|
33607
|
-
switch (
|
|
33619
|
+
switch (e3.from) {
|
|
33608
33620
|
case void 0:
|
|
33609
33621
|
case "node":
|
|
33610
|
-
this._scriptPath =
|
|
33611
|
-
i3 =
|
|
33622
|
+
this._scriptPath = t3[1];
|
|
33623
|
+
i3 = t3.slice(2);
|
|
33612
33624
|
break;
|
|
33613
33625
|
case "electron":
|
|
33614
|
-
if (
|
|
33615
|
-
this._scriptPath =
|
|
33616
|
-
i3 =
|
|
33626
|
+
if (a.defaultApp) {
|
|
33627
|
+
this._scriptPath = t3[1];
|
|
33628
|
+
i3 = t3.slice(2);
|
|
33617
33629
|
} else {
|
|
33618
|
-
i3 =
|
|
33630
|
+
i3 = t3.slice(1);
|
|
33619
33631
|
}
|
|
33620
33632
|
break;
|
|
33621
33633
|
case "user":
|
|
33622
|
-
i3 =
|
|
33634
|
+
i3 = t3.slice(0);
|
|
33623
33635
|
break;
|
|
33624
33636
|
default:
|
|
33625
|
-
throw new Error(`unexpected parse option { from: '${
|
|
33626
|
-
}
|
|
33627
|
-
if (!this._scriptPath && require.main) {
|
|
33628
|
-
this._scriptPath = require.main.filename;
|
|
33637
|
+
throw new Error(`unexpected parse option { from: '${e3.from}' }`);
|
|
33629
33638
|
}
|
|
33630
|
-
|
|
33639
|
+
if (!this._name && this._scriptPath)
|
|
33640
|
+
this.nameFromFilename(this._scriptPath);
|
|
33641
|
+
this._name = this._name || "program";
|
|
33631
33642
|
return i3;
|
|
33632
33643
|
}
|
|
33633
|
-
parse(
|
|
33634
|
-
const i3 = this._prepareUserArgs(
|
|
33644
|
+
parse(t3, e3) {
|
|
33645
|
+
const i3 = this._prepareUserArgs(t3, e3);
|
|
33635
33646
|
this._parseCommand([], i3);
|
|
33636
33647
|
return this;
|
|
33637
33648
|
}
|
|
33638
|
-
parseAsync(
|
|
33649
|
+
parseAsync(t3, e3) {
|
|
33639
33650
|
return __async(this, null, function* () {
|
|
33640
|
-
const i3 = this._prepareUserArgs(
|
|
33651
|
+
const i3 = this._prepareUserArgs(t3, e3);
|
|
33641
33652
|
yield this._parseCommand([], i3);
|
|
33642
33653
|
return this;
|
|
33643
33654
|
});
|
|
33644
33655
|
}
|
|
33645
|
-
_executeSubCommand(
|
|
33646
|
-
|
|
33656
|
+
_executeSubCommand(t3, e3) {
|
|
33657
|
+
e3 = e3.slice();
|
|
33647
33658
|
let i3 = false;
|
|
33648
33659
|
const n2 = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
33649
|
-
|
|
33650
|
-
|
|
33651
|
-
|
|
33652
|
-
|
|
33653
|
-
|
|
33654
|
-
|
|
33655
|
-
|
|
33656
|
-
|
|
33657
|
-
|
|
33658
|
-
|
|
33659
|
-
h2 = ".";
|
|
33660
|
+
function findFile(t4, e4) {
|
|
33661
|
+
const i4 = r.resolve(t4, e4);
|
|
33662
|
+
if (o.existsSync(i4))
|
|
33663
|
+
return i4;
|
|
33664
|
+
if (n2.includes(r.extname(e4)))
|
|
33665
|
+
return void 0;
|
|
33666
|
+
const s2 = n2.find((t5) => o.existsSync(`${i4}${t5}`));
|
|
33667
|
+
if (s2)
|
|
33668
|
+
return `${i4}${s2}`;
|
|
33669
|
+
return void 0;
|
|
33660
33670
|
}
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
|
|
33671
|
+
this._checkForMissingMandatoryOptions();
|
|
33672
|
+
this._checkForConflictingOptions();
|
|
33673
|
+
let l2 = t3._executableFile || `${this._name}-${t3._name}`;
|
|
33674
|
+
let h2 = this._executableDir || "";
|
|
33675
|
+
if (this._scriptPath) {
|
|
33676
|
+
let t4;
|
|
33677
|
+
try {
|
|
33678
|
+
t4 = o.realpathSync(this._scriptPath);
|
|
33679
|
+
} catch (e4) {
|
|
33680
|
+
t4 = this._scriptPath;
|
|
33681
|
+
}
|
|
33682
|
+
h2 = r.resolve(r.dirname(t4), h2);
|
|
33664
33683
|
}
|
|
33665
|
-
|
|
33666
|
-
|
|
33667
|
-
|
|
33668
|
-
|
|
33669
|
-
|
|
33670
|
-
|
|
33671
|
-
u2 = `${c2}${e4}`;
|
|
33684
|
+
if (h2) {
|
|
33685
|
+
let e4 = findFile(h2, l2);
|
|
33686
|
+
if (!e4 && !t3._executableFile && this._scriptPath) {
|
|
33687
|
+
const i4 = r.basename(this._scriptPath, r.extname(this._scriptPath));
|
|
33688
|
+
if (i4 !== this._name) {
|
|
33689
|
+
e4 = findFile(h2, `${i4}-${t3._name}`);
|
|
33672
33690
|
}
|
|
33673
|
-
}
|
|
33691
|
+
}
|
|
33692
|
+
l2 = e4 || l2;
|
|
33674
33693
|
}
|
|
33675
|
-
i3 = n2.includes(r.extname(
|
|
33676
|
-
let
|
|
33677
|
-
if (
|
|
33694
|
+
i3 = n2.includes(r.extname(l2));
|
|
33695
|
+
let c2;
|
|
33696
|
+
if (a.platform !== "win32") {
|
|
33678
33697
|
if (i3) {
|
|
33679
|
-
|
|
33680
|
-
|
|
33681
|
-
|
|
33698
|
+
e3.unshift(l2);
|
|
33699
|
+
e3 = incrementNodeInspectorPort(a.execArgv).concat(e3);
|
|
33700
|
+
c2 = s.spawn(a.argv[0], e3, { stdio: "inherit" });
|
|
33682
33701
|
} else {
|
|
33683
|
-
|
|
33702
|
+
c2 = s.spawn(l2, e3, { stdio: "inherit" });
|
|
33684
33703
|
}
|
|
33685
33704
|
} else {
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
}
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33705
|
+
e3.unshift(l2);
|
|
33706
|
+
e3 = incrementNodeInspectorPort(a.execArgv).concat(e3);
|
|
33707
|
+
c2 = s.spawn(a.execPath, e3, { stdio: "inherit" });
|
|
33708
|
+
}
|
|
33709
|
+
if (!c2.killed) {
|
|
33710
|
+
const t4 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
|
|
33711
|
+
t4.forEach((t5) => {
|
|
33712
|
+
a.on(t5, () => {
|
|
33713
|
+
if (c2.killed === false && c2.exitCode === null) {
|
|
33714
|
+
c2.kill(t5);
|
|
33715
|
+
}
|
|
33716
|
+
});
|
|
33696
33717
|
});
|
|
33697
|
-
}
|
|
33698
|
-
const
|
|
33699
|
-
if (!
|
|
33700
|
-
|
|
33718
|
+
}
|
|
33719
|
+
const p2 = this._exitCallback;
|
|
33720
|
+
if (!p2) {
|
|
33721
|
+
c2.on("close", a.exit.bind(a));
|
|
33701
33722
|
} else {
|
|
33702
|
-
|
|
33703
|
-
|
|
33723
|
+
c2.on("close", () => {
|
|
33724
|
+
p2(new u(a.exitCode || 0, "commander.executeSubCommandAsync", "(close)"));
|
|
33704
33725
|
});
|
|
33705
33726
|
}
|
|
33706
|
-
|
|
33707
|
-
if (
|
|
33708
|
-
const
|
|
33709
|
-
|
|
33710
|
-
- if
|
|
33711
|
-
|
|
33712
|
-
|
|
33713
|
-
throw new Error(
|
|
33714
|
-
}
|
|
33715
|
-
|
|
33716
|
-
|
|
33727
|
+
c2.on("error", (e4) => {
|
|
33728
|
+
if (e4.code === "ENOENT") {
|
|
33729
|
+
const e5 = h2 ? `searched for local subcommand relative to directory '${h2}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
33730
|
+
const i4 = `'${l2}' does not exist
|
|
33731
|
+
- if '${t3._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
33732
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
33733
|
+
- ${e5}`;
|
|
33734
|
+
throw new Error(i4);
|
|
33735
|
+
} else if (e4.code === "EACCES") {
|
|
33736
|
+
throw new Error(`'${l2}' not executable`);
|
|
33737
|
+
}
|
|
33738
|
+
if (!p2) {
|
|
33739
|
+
a.exit(1);
|
|
33717
33740
|
} else {
|
|
33718
|
-
const
|
|
33719
|
-
|
|
33720
|
-
|
|
33741
|
+
const t4 = new u(1, "commander.executeSubCommandAsync", "(error)");
|
|
33742
|
+
t4.nestedError = e4;
|
|
33743
|
+
p2(t4);
|
|
33721
33744
|
}
|
|
33722
33745
|
});
|
|
33723
|
-
this.runningCommand =
|
|
33746
|
+
this.runningCommand = c2;
|
|
33724
33747
|
}
|
|
33725
|
-
_dispatchSubcommand(
|
|
33726
|
-
const n2 = this._findCommand(
|
|
33748
|
+
_dispatchSubcommand(t3, e3, i3) {
|
|
33749
|
+
const n2 = this._findCommand(t3);
|
|
33727
33750
|
if (!n2)
|
|
33728
33751
|
this.help({ error: true });
|
|
33729
|
-
|
|
33730
|
-
|
|
33731
|
-
|
|
33732
|
-
|
|
33733
|
-
|
|
33752
|
+
let s2;
|
|
33753
|
+
s2 = this._chainOrCallSubCommandHook(s2, n2, "preSubcommand");
|
|
33754
|
+
s2 = this._chainOrCall(s2, () => {
|
|
33755
|
+
if (n2._executableHandler) {
|
|
33756
|
+
this._executeSubCommand(n2, e3.concat(i3));
|
|
33757
|
+
} else {
|
|
33758
|
+
return n2._parseCommand(e3, i3);
|
|
33759
|
+
}
|
|
33760
|
+
});
|
|
33761
|
+
return s2;
|
|
33734
33762
|
}
|
|
33735
33763
|
_checkNumberOfArguments() {
|
|
33736
|
-
this._args.forEach((
|
|
33737
|
-
if (
|
|
33738
|
-
this.missingArgument(
|
|
33764
|
+
this._args.forEach((t3, e3) => {
|
|
33765
|
+
if (t3.required && this.args[e3] == null) {
|
|
33766
|
+
this.missingArgument(t3.name());
|
|
33739
33767
|
}
|
|
33740
33768
|
});
|
|
33741
33769
|
if (this._args.length > 0 && this._args[this._args.length - 1].variadic) {
|
|
@@ -33746,15 +33774,15 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
33746
33774
|
}
|
|
33747
33775
|
}
|
|
33748
33776
|
_processArguments() {
|
|
33749
|
-
const myParseArg = (
|
|
33750
|
-
let n2 =
|
|
33751
|
-
if (
|
|
33777
|
+
const myParseArg = (t4, e3, i3) => {
|
|
33778
|
+
let n2 = e3;
|
|
33779
|
+
if (e3 !== null && t4.parseArg) {
|
|
33752
33780
|
try {
|
|
33753
|
-
n2 =
|
|
33781
|
+
n2 = t4.parseArg(e3, i3);
|
|
33754
33782
|
} catch (i4) {
|
|
33755
33783
|
if (i4.code === "commander.invalidArgument") {
|
|
33756
|
-
const n3 = `error: command-argument value '${
|
|
33757
|
-
this.
|
|
33784
|
+
const n3 = `error: command-argument value '${e3}' is invalid for argument '${t4.name()}'. ${i4.message}`;
|
|
33785
|
+
this.error(n3, { exitCode: i4.exitCode, code: i4.code });
|
|
33758
33786
|
}
|
|
33759
33787
|
throw i4;
|
|
33760
33788
|
}
|
|
@@ -33762,74 +33790,85 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
33762
33790
|
return n2;
|
|
33763
33791
|
};
|
|
33764
33792
|
this._checkNumberOfArguments();
|
|
33765
|
-
const
|
|
33766
|
-
this._args.forEach((
|
|
33767
|
-
let n2 =
|
|
33768
|
-
if (
|
|
33793
|
+
const t3 = [];
|
|
33794
|
+
this._args.forEach((e3, i3) => {
|
|
33795
|
+
let n2 = e3.defaultValue;
|
|
33796
|
+
if (e3.variadic) {
|
|
33769
33797
|
if (i3 < this.args.length) {
|
|
33770
33798
|
n2 = this.args.slice(i3);
|
|
33771
|
-
if (
|
|
33772
|
-
n2 = n2.reduce((
|
|
33799
|
+
if (e3.parseArg) {
|
|
33800
|
+
n2 = n2.reduce((t4, i4) => myParseArg(e3, i4, t4), e3.defaultValue);
|
|
33773
33801
|
}
|
|
33774
33802
|
} else if (n2 === void 0) {
|
|
33775
33803
|
n2 = [];
|
|
33776
33804
|
}
|
|
33777
33805
|
} else if (i3 < this.args.length) {
|
|
33778
33806
|
n2 = this.args[i3];
|
|
33779
|
-
if (
|
|
33780
|
-
n2 = myParseArg(
|
|
33807
|
+
if (e3.parseArg) {
|
|
33808
|
+
n2 = myParseArg(e3, n2, e3.defaultValue);
|
|
33781
33809
|
}
|
|
33782
33810
|
}
|
|
33783
|
-
|
|
33811
|
+
t3[i3] = n2;
|
|
33784
33812
|
});
|
|
33785
|
-
this.processedArgs =
|
|
33813
|
+
this.processedArgs = t3;
|
|
33786
33814
|
}
|
|
33787
|
-
_chainOrCall(
|
|
33788
|
-
if (
|
|
33789
|
-
return
|
|
33815
|
+
_chainOrCall(t3, e3) {
|
|
33816
|
+
if (t3 && t3.then && typeof t3.then === "function") {
|
|
33817
|
+
return t3.then(() => e3());
|
|
33790
33818
|
}
|
|
33791
|
-
return
|
|
33819
|
+
return e3();
|
|
33792
33820
|
}
|
|
33793
|
-
_chainOrCallHooks(
|
|
33794
|
-
let i3 =
|
|
33821
|
+
_chainOrCallHooks(t3, e3) {
|
|
33822
|
+
let i3 = t3;
|
|
33795
33823
|
const n2 = [];
|
|
33796
|
-
getCommandAndParents(this).reverse().filter((
|
|
33797
|
-
|
|
33798
|
-
n2.push({ hookedCommand:
|
|
33824
|
+
getCommandAndParents(this).reverse().filter((t4) => t4._lifeCycleHooks[e3] !== void 0).forEach((t4) => {
|
|
33825
|
+
t4._lifeCycleHooks[e3].forEach((e4) => {
|
|
33826
|
+
n2.push({ hookedCommand: t4, callback: e4 });
|
|
33799
33827
|
});
|
|
33800
33828
|
});
|
|
33801
|
-
if (
|
|
33829
|
+
if (e3 === "postAction") {
|
|
33802
33830
|
n2.reverse();
|
|
33803
33831
|
}
|
|
33804
|
-
n2.forEach((
|
|
33805
|
-
i3 = this._chainOrCall(i3, () =>
|
|
33832
|
+
n2.forEach((t4) => {
|
|
33833
|
+
i3 = this._chainOrCall(i3, () => t4.callback(t4.hookedCommand, this));
|
|
33806
33834
|
});
|
|
33807
33835
|
return i3;
|
|
33808
33836
|
}
|
|
33809
|
-
|
|
33810
|
-
|
|
33811
|
-
this.
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
if (e3 && this._findCommand(e3[0])) {
|
|
33816
|
-
return this._dispatchSubcommand(e3[0], e3.slice(1), t3);
|
|
33837
|
+
_chainOrCallSubCommandHook(t3, e3, i3) {
|
|
33838
|
+
let n2 = t3;
|
|
33839
|
+
if (this._lifeCycleHooks[i3] !== void 0) {
|
|
33840
|
+
this._lifeCycleHooks[i3].forEach((t4) => {
|
|
33841
|
+
n2 = this._chainOrCall(n2, () => t4(this, e3));
|
|
33842
|
+
});
|
|
33817
33843
|
}
|
|
33818
|
-
|
|
33819
|
-
|
|
33844
|
+
return n2;
|
|
33845
|
+
}
|
|
33846
|
+
_parseCommand(t3, e3) {
|
|
33847
|
+
const i3 = this.parseOptions(e3);
|
|
33848
|
+
this._parseOptionsEnv();
|
|
33849
|
+
this._parseOptionsImplied();
|
|
33850
|
+
t3 = t3.concat(i3.operands);
|
|
33851
|
+
e3 = i3.unknown;
|
|
33852
|
+
this.args = t3.concat(e3);
|
|
33853
|
+
if (t3 && this._findCommand(t3[0])) {
|
|
33854
|
+
return this._dispatchSubcommand(t3[0], t3.slice(1), e3);
|
|
33855
|
+
}
|
|
33856
|
+
if (this._hasImplicitHelpCommand() && t3[0] === this._helpCommandName) {
|
|
33857
|
+
if (t3.length === 1) {
|
|
33820
33858
|
this.help();
|
|
33821
33859
|
}
|
|
33822
|
-
return this._dispatchSubcommand(
|
|
33860
|
+
return this._dispatchSubcommand(t3[1], [], [this._helpLongFlag]);
|
|
33823
33861
|
}
|
|
33824
33862
|
if (this._defaultCommandName) {
|
|
33825
|
-
outputHelpIfRequested(this,
|
|
33826
|
-
return this._dispatchSubcommand(this._defaultCommandName,
|
|
33863
|
+
outputHelpIfRequested(this, e3);
|
|
33864
|
+
return this._dispatchSubcommand(this._defaultCommandName, t3, e3);
|
|
33827
33865
|
}
|
|
33828
33866
|
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
|
|
33829
33867
|
this.help({ error: true });
|
|
33830
33868
|
}
|
|
33831
33869
|
outputHelpIfRequested(this, i3.unknown);
|
|
33832
33870
|
this._checkForMissingMandatoryOptions();
|
|
33871
|
+
this._checkForConflictingOptions();
|
|
33833
33872
|
const checkForUnknownOptions = () => {
|
|
33834
33873
|
if (i3.unknown.length > 0) {
|
|
33835
33874
|
this.unknownOption(i3.unknown[0]);
|
|
@@ -33842,21 +33881,24 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
33842
33881
|
let i4;
|
|
33843
33882
|
i4 = this._chainOrCallHooks(i4, "preAction");
|
|
33844
33883
|
i4 = this._chainOrCall(i4, () => this._actionHandler(this.processedArgs));
|
|
33845
|
-
if (this.parent)
|
|
33846
|
-
this.
|
|
33884
|
+
if (this.parent) {
|
|
33885
|
+
i4 = this._chainOrCall(i4, () => {
|
|
33886
|
+
this.parent.emit(n2, t3, e3);
|
|
33887
|
+
});
|
|
33888
|
+
}
|
|
33847
33889
|
i4 = this._chainOrCallHooks(i4, "postAction");
|
|
33848
33890
|
return i4;
|
|
33849
33891
|
}
|
|
33850
33892
|
if (this.parent && this.parent.listenerCount(n2)) {
|
|
33851
33893
|
checkForUnknownOptions();
|
|
33852
33894
|
this._processArguments();
|
|
33853
|
-
this.parent.emit(n2,
|
|
33854
|
-
} else if (
|
|
33895
|
+
this.parent.emit(n2, t3, e3);
|
|
33896
|
+
} else if (t3.length) {
|
|
33855
33897
|
if (this._findCommand("*")) {
|
|
33856
|
-
return this._dispatchSubcommand("*",
|
|
33898
|
+
return this._dispatchSubcommand("*", t3, e3);
|
|
33857
33899
|
}
|
|
33858
33900
|
if (this.listenerCount("command:*")) {
|
|
33859
|
-
this.emit("command:*",
|
|
33901
|
+
this.emit("command:*", t3, e3);
|
|
33860
33902
|
} else if (this.commands.length) {
|
|
33861
33903
|
this.unknownCommand();
|
|
33862
33904
|
} else {
|
|
@@ -33871,131 +33913,155 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
33871
33913
|
this._processArguments();
|
|
33872
33914
|
}
|
|
33873
33915
|
}
|
|
33874
|
-
_findCommand(
|
|
33875
|
-
if (!
|
|
33916
|
+
_findCommand(t3) {
|
|
33917
|
+
if (!t3)
|
|
33876
33918
|
return void 0;
|
|
33877
|
-
return this.commands.find((
|
|
33919
|
+
return this.commands.find((e3) => e3._name === t3 || e3._aliases.includes(t3));
|
|
33878
33920
|
}
|
|
33879
|
-
_findOption(
|
|
33880
|
-
return this.options.find((
|
|
33921
|
+
_findOption(t3) {
|
|
33922
|
+
return this.options.find((e3) => e3.is(t3));
|
|
33881
33923
|
}
|
|
33882
33924
|
_checkForMissingMandatoryOptions() {
|
|
33883
|
-
for (let
|
|
33884
|
-
|
|
33885
|
-
if (
|
|
33886
|
-
|
|
33925
|
+
for (let t3 = this; t3; t3 = t3.parent) {
|
|
33926
|
+
t3.options.forEach((e3) => {
|
|
33927
|
+
if (e3.mandatory && t3.getOptionValue(e3.attributeName()) === void 0) {
|
|
33928
|
+
t3.missingMandatoryOptionValue(e3);
|
|
33887
33929
|
}
|
|
33888
33930
|
});
|
|
33889
33931
|
}
|
|
33890
33932
|
}
|
|
33891
|
-
|
|
33892
|
-
const t3 =
|
|
33933
|
+
_checkForConflictingLocalOptions() {
|
|
33934
|
+
const t3 = this.options.filter((t4) => {
|
|
33935
|
+
const e4 = t4.attributeName();
|
|
33936
|
+
if (this.getOptionValue(e4) === void 0) {
|
|
33937
|
+
return false;
|
|
33938
|
+
}
|
|
33939
|
+
return this.getOptionValueSource(e4) !== "default";
|
|
33940
|
+
});
|
|
33941
|
+
const e3 = t3.filter((t4) => t4.conflictsWith.length > 0);
|
|
33942
|
+
e3.forEach((e4) => {
|
|
33943
|
+
const i3 = t3.find((t4) => e4.conflictsWith.includes(t4.attributeName()));
|
|
33944
|
+
if (i3) {
|
|
33945
|
+
this._conflictingOption(e4, i3);
|
|
33946
|
+
}
|
|
33947
|
+
});
|
|
33948
|
+
}
|
|
33949
|
+
_checkForConflictingOptions() {
|
|
33950
|
+
for (let t3 = this; t3; t3 = t3.parent) {
|
|
33951
|
+
t3._checkForConflictingLocalOptions();
|
|
33952
|
+
}
|
|
33953
|
+
}
|
|
33954
|
+
parseOptions(t3) {
|
|
33955
|
+
const e3 = [];
|
|
33893
33956
|
const i3 = [];
|
|
33894
|
-
let n2 =
|
|
33895
|
-
const s2 =
|
|
33896
|
-
function maybeOption(
|
|
33897
|
-
return
|
|
33957
|
+
let n2 = e3;
|
|
33958
|
+
const s2 = t3.slice();
|
|
33959
|
+
function maybeOption(t4) {
|
|
33960
|
+
return t4.length > 1 && t4[0] === "-";
|
|
33898
33961
|
}
|
|
33899
33962
|
let r2 = null;
|
|
33900
33963
|
while (s2.length) {
|
|
33901
|
-
const
|
|
33902
|
-
if (
|
|
33964
|
+
const t4 = s2.shift();
|
|
33965
|
+
if (t4 === "--") {
|
|
33903
33966
|
if (n2 === i3)
|
|
33904
|
-
n2.push(
|
|
33967
|
+
n2.push(t4);
|
|
33905
33968
|
n2.push(...s2);
|
|
33906
33969
|
break;
|
|
33907
33970
|
}
|
|
33908
|
-
if (r2 && !maybeOption(
|
|
33909
|
-
this.emit(`option:${r2.name()}`,
|
|
33971
|
+
if (r2 && !maybeOption(t4)) {
|
|
33972
|
+
this.emit(`option:${r2.name()}`, t4);
|
|
33910
33973
|
continue;
|
|
33911
33974
|
}
|
|
33912
33975
|
r2 = null;
|
|
33913
|
-
if (maybeOption(
|
|
33914
|
-
const
|
|
33915
|
-
if (
|
|
33916
|
-
if (
|
|
33917
|
-
const
|
|
33918
|
-
if (
|
|
33919
|
-
this.optionMissingArgument(
|
|
33920
|
-
this.emit(`option:${
|
|
33921
|
-
} else if (
|
|
33922
|
-
let
|
|
33976
|
+
if (maybeOption(t4)) {
|
|
33977
|
+
const e4 = this._findOption(t4);
|
|
33978
|
+
if (e4) {
|
|
33979
|
+
if (e4.required) {
|
|
33980
|
+
const t5 = s2.shift();
|
|
33981
|
+
if (t5 === void 0)
|
|
33982
|
+
this.optionMissingArgument(e4);
|
|
33983
|
+
this.emit(`option:${e4.name()}`, t5);
|
|
33984
|
+
} else if (e4.optional) {
|
|
33985
|
+
let t5 = null;
|
|
33923
33986
|
if (s2.length > 0 && !maybeOption(s2[0])) {
|
|
33924
|
-
|
|
33987
|
+
t5 = s2.shift();
|
|
33925
33988
|
}
|
|
33926
|
-
this.emit(`option:${
|
|
33989
|
+
this.emit(`option:${e4.name()}`, t5);
|
|
33927
33990
|
} else {
|
|
33928
|
-
this.emit(`option:${
|
|
33991
|
+
this.emit(`option:${e4.name()}`);
|
|
33929
33992
|
}
|
|
33930
|
-
r2 =
|
|
33993
|
+
r2 = e4.variadic ? e4 : null;
|
|
33931
33994
|
continue;
|
|
33932
33995
|
}
|
|
33933
33996
|
}
|
|
33934
|
-
if (
|
|
33935
|
-
const
|
|
33936
|
-
if (
|
|
33937
|
-
if (
|
|
33938
|
-
this.emit(`option:${
|
|
33997
|
+
if (t4.length > 2 && t4[0] === "-" && t4[1] !== "-") {
|
|
33998
|
+
const e4 = this._findOption(`-${t4[1]}`);
|
|
33999
|
+
if (e4) {
|
|
34000
|
+
if (e4.required || e4.optional && this._combineFlagAndOptionalValue) {
|
|
34001
|
+
this.emit(`option:${e4.name()}`, t4.slice(2));
|
|
33939
34002
|
} else {
|
|
33940
|
-
this.emit(`option:${
|
|
33941
|
-
s2.unshift(`-${
|
|
34003
|
+
this.emit(`option:${e4.name()}`);
|
|
34004
|
+
s2.unshift(`-${t4.slice(2)}`);
|
|
33942
34005
|
}
|
|
33943
34006
|
continue;
|
|
33944
34007
|
}
|
|
33945
34008
|
}
|
|
33946
|
-
if (/^--[^=]+=/.test(
|
|
33947
|
-
const
|
|
33948
|
-
const i4 = this._findOption(
|
|
34009
|
+
if (/^--[^=]+=/.test(t4)) {
|
|
34010
|
+
const e4 = t4.indexOf("=");
|
|
34011
|
+
const i4 = this._findOption(t4.slice(0, e4));
|
|
33949
34012
|
if (i4 && (i4.required || i4.optional)) {
|
|
33950
|
-
this.emit(`option:${i4.name()}`,
|
|
34013
|
+
this.emit(`option:${i4.name()}`, t4.slice(e4 + 1));
|
|
33951
34014
|
continue;
|
|
33952
34015
|
}
|
|
33953
34016
|
}
|
|
33954
|
-
if (maybeOption(
|
|
34017
|
+
if (maybeOption(t4)) {
|
|
33955
34018
|
n2 = i3;
|
|
33956
34019
|
}
|
|
33957
|
-
if ((this._enablePositionalOptions || this._passThroughOptions) &&
|
|
33958
|
-
if (this._findCommand(
|
|
33959
|
-
|
|
34020
|
+
if ((this._enablePositionalOptions || this._passThroughOptions) && e3.length === 0 && i3.length === 0) {
|
|
34021
|
+
if (this._findCommand(t4)) {
|
|
34022
|
+
e3.push(t4);
|
|
33960
34023
|
if (s2.length > 0)
|
|
33961
34024
|
i3.push(...s2);
|
|
33962
34025
|
break;
|
|
33963
|
-
} else if (
|
|
33964
|
-
|
|
34026
|
+
} else if (t4 === this._helpCommandName && this._hasImplicitHelpCommand()) {
|
|
34027
|
+
e3.push(t4);
|
|
33965
34028
|
if (s2.length > 0)
|
|
33966
|
-
|
|
34029
|
+
e3.push(...s2);
|
|
33967
34030
|
break;
|
|
33968
34031
|
} else if (this._defaultCommandName) {
|
|
33969
|
-
i3.push(
|
|
34032
|
+
i3.push(t4);
|
|
33970
34033
|
if (s2.length > 0)
|
|
33971
34034
|
i3.push(...s2);
|
|
33972
34035
|
break;
|
|
33973
34036
|
}
|
|
33974
34037
|
}
|
|
33975
34038
|
if (this._passThroughOptions) {
|
|
33976
|
-
n2.push(
|
|
34039
|
+
n2.push(t4);
|
|
33977
34040
|
if (s2.length > 0)
|
|
33978
34041
|
n2.push(...s2);
|
|
33979
34042
|
break;
|
|
33980
34043
|
}
|
|
33981
|
-
n2.push(
|
|
34044
|
+
n2.push(t4);
|
|
33982
34045
|
}
|
|
33983
|
-
return { operands:
|
|
34046
|
+
return { operands: e3, unknown: i3 };
|
|
33984
34047
|
}
|
|
33985
34048
|
opts() {
|
|
33986
34049
|
if (this._storeOptionsAsProperties) {
|
|
33987
|
-
const
|
|
33988
|
-
const
|
|
33989
|
-
for (let i3 = 0; i3 <
|
|
33990
|
-
const
|
|
33991
|
-
|
|
34050
|
+
const t3 = {};
|
|
34051
|
+
const e3 = this.options.length;
|
|
34052
|
+
for (let i3 = 0; i3 < e3; i3++) {
|
|
34053
|
+
const e4 = this.options[i3].attributeName();
|
|
34054
|
+
t3[e4] = e4 === this._versionOptionName ? this._version : this[e4];
|
|
33992
34055
|
}
|
|
33993
|
-
return
|
|
34056
|
+
return t3;
|
|
33994
34057
|
}
|
|
33995
34058
|
return this._optionValues;
|
|
33996
34059
|
}
|
|
33997
|
-
|
|
33998
|
-
this.
|
|
34060
|
+
optsWithGlobals() {
|
|
34061
|
+
return getCommandAndParents(this).reduce((t3, e3) => Object.assign(t3, e3.opts()), {});
|
|
34062
|
+
}
|
|
34063
|
+
error(t3, e3) {
|
|
34064
|
+
this._outputConfiguration.outputError(`${t3}
|
|
33999
34065
|
`, this._outputConfiguration.writeErr);
|
|
34000
34066
|
if (typeof this._showHelpAfterError === "string") {
|
|
34001
34067
|
this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
@@ -34004,166 +34070,217 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
34004
34070
|
this._outputConfiguration.writeErr("\n");
|
|
34005
34071
|
this.outputHelp({ error: true });
|
|
34006
34072
|
}
|
|
34007
|
-
|
|
34073
|
+
const i3 = e3 || {};
|
|
34074
|
+
const n2 = i3.exitCode || 1;
|
|
34075
|
+
const s2 = i3.code || "commander.error";
|
|
34076
|
+
this._exit(n2, s2, t3);
|
|
34008
34077
|
}
|
|
34009
34078
|
_parseOptionsEnv() {
|
|
34010
|
-
this.options.forEach((
|
|
34011
|
-
if (
|
|
34012
|
-
const
|
|
34013
|
-
if (this.getOptionValue(
|
|
34014
|
-
if (
|
|
34015
|
-
this.emit(`optionEnv:${
|
|
34079
|
+
this.options.forEach((t3) => {
|
|
34080
|
+
if (t3.envVar && t3.envVar in a.env) {
|
|
34081
|
+
const e3 = t3.attributeName();
|
|
34082
|
+
if (this.getOptionValue(e3) === void 0 || ["default", "config", "env"].includes(this.getOptionValueSource(e3))) {
|
|
34083
|
+
if (t3.required || t3.optional) {
|
|
34084
|
+
this.emit(`optionEnv:${t3.name()}`, a.env[t3.envVar]);
|
|
34016
34085
|
} else {
|
|
34017
|
-
this.emit(`optionEnv:${
|
|
34086
|
+
this.emit(`optionEnv:${t3.name()}`);
|
|
34018
34087
|
}
|
|
34019
34088
|
}
|
|
34020
34089
|
}
|
|
34021
34090
|
});
|
|
34022
34091
|
}
|
|
34023
|
-
|
|
34024
|
-
const t3 =
|
|
34025
|
-
this.
|
|
34026
|
-
|
|
34027
|
-
|
|
34028
|
-
|
|
34029
|
-
|
|
34092
|
+
_parseOptionsImplied() {
|
|
34093
|
+
const t3 = new d(this.options);
|
|
34094
|
+
const hasCustomOptionValue = (t4) => this.getOptionValue(t4) !== void 0 && !["default", "implied"].includes(this.getOptionValueSource(t4));
|
|
34095
|
+
this.options.filter((e3) => e3.implied !== void 0 && hasCustomOptionValue(e3.attributeName()) && t3.valueFromOption(this.getOptionValue(e3.attributeName()), e3)).forEach((t4) => {
|
|
34096
|
+
Object.keys(t4.implied).filter((t5) => !hasCustomOptionValue(t5)).forEach((e3) => {
|
|
34097
|
+
this.setOptionValueWithSource(e3, t4.implied[e3], "implied");
|
|
34098
|
+
});
|
|
34099
|
+
});
|
|
34030
34100
|
}
|
|
34031
|
-
|
|
34032
|
-
const
|
|
34033
|
-
this.
|
|
34101
|
+
missingArgument(t3) {
|
|
34102
|
+
const e3 = `error: missing required argument '${t3}'`;
|
|
34103
|
+
this.error(e3, { code: "commander.missingArgument" });
|
|
34104
|
+
}
|
|
34105
|
+
optionMissingArgument(t3) {
|
|
34106
|
+
const e3 = `error: option '${t3.flags}' argument missing`;
|
|
34107
|
+
this.error(e3, { code: "commander.optionMissingArgument" });
|
|
34108
|
+
}
|
|
34109
|
+
missingMandatoryOptionValue(t3) {
|
|
34110
|
+
const e3 = `error: required option '${t3.flags}' not specified`;
|
|
34111
|
+
this.error(e3, { code: "commander.missingMandatoryOptionValue" });
|
|
34112
|
+
}
|
|
34113
|
+
_conflictingOption(t3, e3) {
|
|
34114
|
+
const findBestOptionFromValue = (t4) => {
|
|
34115
|
+
const e4 = t4.attributeName();
|
|
34116
|
+
const i4 = this.getOptionValue(e4);
|
|
34117
|
+
const n2 = this.options.find((t5) => t5.negate && e4 === t5.attributeName());
|
|
34118
|
+
const s2 = this.options.find((t5) => !t5.negate && e4 === t5.attributeName());
|
|
34119
|
+
if (n2 && (n2.presetArg === void 0 && i4 === false || n2.presetArg !== void 0 && i4 === n2.presetArg)) {
|
|
34120
|
+
return n2;
|
|
34121
|
+
}
|
|
34122
|
+
return s2 || t4;
|
|
34123
|
+
};
|
|
34124
|
+
const getErrorMessage = (t4) => {
|
|
34125
|
+
const e4 = findBestOptionFromValue(t4);
|
|
34126
|
+
const i4 = e4.attributeName();
|
|
34127
|
+
const n2 = this.getOptionValueSource(i4);
|
|
34128
|
+
if (n2 === "env") {
|
|
34129
|
+
return `environment variable '${e4.envVar}'`;
|
|
34130
|
+
}
|
|
34131
|
+
return `option '${e4.flags}'`;
|
|
34132
|
+
};
|
|
34133
|
+
const i3 = `error: ${getErrorMessage(t3)} cannot be used with ${getErrorMessage(e3)}`;
|
|
34134
|
+
this.error(i3, { code: "commander.conflictingOption" });
|
|
34034
34135
|
}
|
|
34035
|
-
unknownOption(
|
|
34136
|
+
unknownOption(t3) {
|
|
34036
34137
|
if (this._allowUnknownOption)
|
|
34037
34138
|
return;
|
|
34038
|
-
let
|
|
34039
|
-
if (
|
|
34139
|
+
let e3 = "";
|
|
34140
|
+
if (t3.startsWith("--") && this._showSuggestionAfterError) {
|
|
34040
34141
|
let i4 = [];
|
|
34041
34142
|
let n2 = this;
|
|
34042
34143
|
do {
|
|
34043
|
-
const
|
|
34044
|
-
i4 = i4.concat(
|
|
34144
|
+
const t4 = n2.createHelp().visibleOptions(n2).filter((t5) => t5.long).map((t5) => t5.long);
|
|
34145
|
+
i4 = i4.concat(t4);
|
|
34045
34146
|
n2 = n2.parent;
|
|
34046
34147
|
} while (n2 && !n2._enablePositionalOptions);
|
|
34047
|
-
|
|
34148
|
+
e3 = f(t3, i4);
|
|
34048
34149
|
}
|
|
34049
|
-
const i3 = `error: unknown option '${
|
|
34050
|
-
this.
|
|
34150
|
+
const i3 = `error: unknown option '${t3}'${e3}`;
|
|
34151
|
+
this.error(i3, { code: "commander.unknownOption" });
|
|
34051
34152
|
}
|
|
34052
|
-
_excessArguments(
|
|
34153
|
+
_excessArguments(t3) {
|
|
34053
34154
|
if (this._allowExcessArguments)
|
|
34054
34155
|
return;
|
|
34055
|
-
const
|
|
34056
|
-
const i3 =
|
|
34156
|
+
const e3 = this._args.length;
|
|
34157
|
+
const i3 = e3 === 1 ? "" : "s";
|
|
34057
34158
|
const n2 = this.parent ? ` for '${this.name()}'` : "";
|
|
34058
|
-
const s2 = `error: too many arguments${n2}. Expected ${
|
|
34059
|
-
this.
|
|
34159
|
+
const s2 = `error: too many arguments${n2}. Expected ${e3} argument${i3} but got ${t3.length}.`;
|
|
34160
|
+
this.error(s2, { code: "commander.excessArguments" });
|
|
34060
34161
|
}
|
|
34061
34162
|
unknownCommand() {
|
|
34062
|
-
const
|
|
34063
|
-
let
|
|
34163
|
+
const t3 = this.args[0];
|
|
34164
|
+
let e3 = "";
|
|
34064
34165
|
if (this._showSuggestionAfterError) {
|
|
34065
34166
|
const i4 = [];
|
|
34066
|
-
this.createHelp().visibleCommands(this).forEach((
|
|
34067
|
-
i4.push(
|
|
34068
|
-
if (
|
|
34069
|
-
i4.push(
|
|
34167
|
+
this.createHelp().visibleCommands(this).forEach((t4) => {
|
|
34168
|
+
i4.push(t4.name());
|
|
34169
|
+
if (t4.alias())
|
|
34170
|
+
i4.push(t4.alias());
|
|
34070
34171
|
});
|
|
34071
|
-
|
|
34172
|
+
e3 = f(t3, i4);
|
|
34072
34173
|
}
|
|
34073
|
-
const i3 = `error: unknown command '${
|
|
34074
|
-
this.
|
|
34174
|
+
const i3 = `error: unknown command '${t3}'${e3}`;
|
|
34175
|
+
this.error(i3, { code: "commander.unknownCommand" });
|
|
34075
34176
|
}
|
|
34076
|
-
version(
|
|
34077
|
-
if (
|
|
34177
|
+
version(t3, e3, i3) {
|
|
34178
|
+
if (t3 === void 0)
|
|
34078
34179
|
return this._version;
|
|
34079
|
-
this._version =
|
|
34080
|
-
|
|
34180
|
+
this._version = t3;
|
|
34181
|
+
e3 = e3 || "-V, --version";
|
|
34081
34182
|
i3 = i3 || "output the version number";
|
|
34082
|
-
const n2 = this.createOption(
|
|
34183
|
+
const n2 = this.createOption(e3, i3);
|
|
34083
34184
|
this._versionOptionName = n2.attributeName();
|
|
34084
34185
|
this.options.push(n2);
|
|
34085
34186
|
this.on("option:" + n2.name(), () => {
|
|
34086
|
-
this._outputConfiguration.writeOut(`${
|
|
34187
|
+
this._outputConfiguration.writeOut(`${t3}
|
|
34087
34188
|
`);
|
|
34088
|
-
this._exit(0, "commander.version",
|
|
34189
|
+
this._exit(0, "commander.version", t3);
|
|
34089
34190
|
});
|
|
34090
34191
|
return this;
|
|
34091
34192
|
}
|
|
34092
|
-
description(
|
|
34093
|
-
if (
|
|
34193
|
+
description(t3, e3) {
|
|
34194
|
+
if (t3 === void 0 && e3 === void 0)
|
|
34094
34195
|
return this._description;
|
|
34095
|
-
this._description =
|
|
34096
|
-
if (
|
|
34097
|
-
this._argsDescription =
|
|
34196
|
+
this._description = t3;
|
|
34197
|
+
if (e3) {
|
|
34198
|
+
this._argsDescription = e3;
|
|
34098
34199
|
}
|
|
34099
34200
|
return this;
|
|
34100
34201
|
}
|
|
34101
|
-
|
|
34102
|
-
if (
|
|
34202
|
+
summary(t3) {
|
|
34203
|
+
if (t3 === void 0)
|
|
34204
|
+
return this._summary;
|
|
34205
|
+
this._summary = t3;
|
|
34206
|
+
return this;
|
|
34207
|
+
}
|
|
34208
|
+
alias(t3) {
|
|
34209
|
+
if (t3 === void 0)
|
|
34103
34210
|
return this._aliases[0];
|
|
34104
|
-
let
|
|
34211
|
+
let e3 = this;
|
|
34105
34212
|
if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
|
|
34106
|
-
|
|
34213
|
+
e3 = this.commands[this.commands.length - 1];
|
|
34107
34214
|
}
|
|
34108
|
-
if (
|
|
34215
|
+
if (t3 === e3._name)
|
|
34109
34216
|
throw new Error("Command alias can't be the same as its name");
|
|
34110
|
-
|
|
34217
|
+
e3._aliases.push(t3);
|
|
34111
34218
|
return this;
|
|
34112
34219
|
}
|
|
34113
|
-
aliases(
|
|
34114
|
-
if (
|
|
34220
|
+
aliases(t3) {
|
|
34221
|
+
if (t3 === void 0)
|
|
34115
34222
|
return this._aliases;
|
|
34116
|
-
|
|
34223
|
+
t3.forEach((t4) => this.alias(t4));
|
|
34117
34224
|
return this;
|
|
34118
34225
|
}
|
|
34119
|
-
usage(
|
|
34120
|
-
if (
|
|
34226
|
+
usage(t3) {
|
|
34227
|
+
if (t3 === void 0) {
|
|
34121
34228
|
if (this._usage)
|
|
34122
34229
|
return this._usage;
|
|
34123
|
-
const
|
|
34124
|
-
return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this._args.length ?
|
|
34230
|
+
const t4 = this._args.map((t5) => h(t5));
|
|
34231
|
+
return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this._args.length ? t4 : []).join(" ");
|
|
34125
34232
|
}
|
|
34126
|
-
this._usage =
|
|
34233
|
+
this._usage = t3;
|
|
34127
34234
|
return this;
|
|
34128
34235
|
}
|
|
34129
|
-
name(
|
|
34130
|
-
if (
|
|
34236
|
+
name(t3) {
|
|
34237
|
+
if (t3 === void 0)
|
|
34131
34238
|
return this._name;
|
|
34132
|
-
this._name =
|
|
34239
|
+
this._name = t3;
|
|
34133
34240
|
return this;
|
|
34134
34241
|
}
|
|
34135
|
-
|
|
34136
|
-
|
|
34137
|
-
|
|
34138
|
-
|
|
34242
|
+
nameFromFilename(t3) {
|
|
34243
|
+
this._name = r.basename(t3, r.extname(t3));
|
|
34244
|
+
return this;
|
|
34245
|
+
}
|
|
34246
|
+
executableDir(t3) {
|
|
34247
|
+
if (t3 === void 0)
|
|
34248
|
+
return this._executableDir;
|
|
34249
|
+
this._executableDir = t3;
|
|
34250
|
+
return this;
|
|
34251
|
+
}
|
|
34252
|
+
helpInformation(t3) {
|
|
34253
|
+
const e3 = this.createHelp();
|
|
34254
|
+
if (e3.helpWidth === void 0) {
|
|
34255
|
+
e3.helpWidth = t3 && t3.error ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
|
|
34139
34256
|
}
|
|
34140
|
-
return
|
|
34257
|
+
return e3.formatHelp(this, e3);
|
|
34141
34258
|
}
|
|
34142
|
-
_getHelpContext(
|
|
34143
|
-
|
|
34144
|
-
const
|
|
34259
|
+
_getHelpContext(t3) {
|
|
34260
|
+
t3 = t3 || {};
|
|
34261
|
+
const e3 = { error: !!t3.error };
|
|
34145
34262
|
let i3;
|
|
34146
|
-
if (
|
|
34147
|
-
i3 = (
|
|
34263
|
+
if (e3.error) {
|
|
34264
|
+
i3 = (t4) => this._outputConfiguration.writeErr(t4);
|
|
34148
34265
|
} else {
|
|
34149
|
-
i3 = (
|
|
34266
|
+
i3 = (t4) => this._outputConfiguration.writeOut(t4);
|
|
34150
34267
|
}
|
|
34151
|
-
|
|
34152
|
-
|
|
34153
|
-
return
|
|
34268
|
+
e3.write = t3.write || i3;
|
|
34269
|
+
e3.command = this;
|
|
34270
|
+
return e3;
|
|
34154
34271
|
}
|
|
34155
|
-
outputHelp(
|
|
34156
|
-
let
|
|
34157
|
-
if (typeof
|
|
34158
|
-
|
|
34159
|
-
|
|
34272
|
+
outputHelp(t3) {
|
|
34273
|
+
let e3;
|
|
34274
|
+
if (typeof t3 === "function") {
|
|
34275
|
+
e3 = t3;
|
|
34276
|
+
t3 = void 0;
|
|
34160
34277
|
}
|
|
34161
|
-
const i3 = this._getHelpContext(
|
|
34162
|
-
getCommandAndParents(this).reverse().forEach((
|
|
34278
|
+
const i3 = this._getHelpContext(t3);
|
|
34279
|
+
getCommandAndParents(this).reverse().forEach((t4) => t4.emit("beforeAllHelp", i3));
|
|
34163
34280
|
this.emit("beforeHelp", i3);
|
|
34164
34281
|
let n2 = this.helpInformation(i3);
|
|
34165
|
-
if (
|
|
34166
|
-
n2 =
|
|
34282
|
+
if (e3) {
|
|
34283
|
+
n2 = e3(n2);
|
|
34167
34284
|
if (typeof n2 !== "string" && !Buffer.isBuffer(n2)) {
|
|
34168
34285
|
throw new Error("outputHelp callback must return a string or a Buffer");
|
|
34169
34286
|
}
|
|
@@ -34171,306 +34288,342 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
34171
34288
|
i3.write(n2);
|
|
34172
34289
|
this.emit(this._helpLongFlag);
|
|
34173
34290
|
this.emit("afterHelp", i3);
|
|
34174
|
-
getCommandAndParents(this).forEach((
|
|
34291
|
+
getCommandAndParents(this).forEach((t4) => t4.emit("afterAllHelp", i3));
|
|
34175
34292
|
}
|
|
34176
|
-
helpOption(
|
|
34177
|
-
if (typeof
|
|
34178
|
-
this._hasHelpOption =
|
|
34293
|
+
helpOption(t3, e3) {
|
|
34294
|
+
if (typeof t3 === "boolean") {
|
|
34295
|
+
this._hasHelpOption = t3;
|
|
34179
34296
|
return this;
|
|
34180
34297
|
}
|
|
34181
|
-
this._helpFlags =
|
|
34182
|
-
this._helpDescription =
|
|
34183
|
-
const i3 =
|
|
34298
|
+
this._helpFlags = t3 || this._helpFlags;
|
|
34299
|
+
this._helpDescription = e3 || this._helpDescription;
|
|
34300
|
+
const i3 = m(this._helpFlags);
|
|
34184
34301
|
this._helpShortFlag = i3.shortFlag;
|
|
34185
34302
|
this._helpLongFlag = i3.longFlag;
|
|
34186
34303
|
return this;
|
|
34187
34304
|
}
|
|
34188
|
-
help(
|
|
34189
|
-
this.outputHelp(
|
|
34190
|
-
let
|
|
34191
|
-
if (
|
|
34192
|
-
|
|
34305
|
+
help(t3) {
|
|
34306
|
+
this.outputHelp(t3);
|
|
34307
|
+
let e3 = a.exitCode || 0;
|
|
34308
|
+
if (e3 === 0 && t3 && typeof t3 !== "function" && t3.error) {
|
|
34309
|
+
e3 = 1;
|
|
34193
34310
|
}
|
|
34194
|
-
this._exit(
|
|
34311
|
+
this._exit(e3, "commander.help", "(outputHelp)");
|
|
34195
34312
|
}
|
|
34196
|
-
addHelpText(
|
|
34313
|
+
addHelpText(t3, e3) {
|
|
34197
34314
|
const i3 = ["beforeAll", "before", "after", "afterAll"];
|
|
34198
|
-
if (!i3.includes(
|
|
34315
|
+
if (!i3.includes(t3)) {
|
|
34199
34316
|
throw new Error(`Unexpected value for position to addHelpText.
|
|
34200
34317
|
Expecting one of '${i3.join("', '")}'`);
|
|
34201
34318
|
}
|
|
34202
|
-
const n2 = `${
|
|
34203
|
-
this.on(n2, (
|
|
34319
|
+
const n2 = `${t3}Help`;
|
|
34320
|
+
this.on(n2, (t4) => {
|
|
34204
34321
|
let i4;
|
|
34205
|
-
if (typeof
|
|
34206
|
-
i4 =
|
|
34322
|
+
if (typeof e3 === "function") {
|
|
34323
|
+
i4 = e3({ error: t4.error, command: t4.command });
|
|
34207
34324
|
} else {
|
|
34208
|
-
i4 =
|
|
34325
|
+
i4 = e3;
|
|
34209
34326
|
}
|
|
34210
34327
|
if (i4) {
|
|
34211
|
-
|
|
34328
|
+
t4.write(`${i4}
|
|
34212
34329
|
`);
|
|
34213
34330
|
}
|
|
34214
34331
|
});
|
|
34215
34332
|
return this;
|
|
34216
34333
|
}
|
|
34217
34334
|
}
|
|
34218
|
-
function outputHelpIfRequested(
|
|
34219
|
-
const i3 =
|
|
34335
|
+
function outputHelpIfRequested(t3, e3) {
|
|
34336
|
+
const i3 = t3._hasHelpOption && e3.find((e4) => e4 === t3._helpLongFlag || e4 === t3._helpShortFlag);
|
|
34220
34337
|
if (i3) {
|
|
34221
|
-
|
|
34222
|
-
|
|
34338
|
+
t3.outputHelp();
|
|
34339
|
+
t3._exit(0, "commander.helpDisplayed", "(outputHelp)");
|
|
34223
34340
|
}
|
|
34224
34341
|
}
|
|
34225
|
-
function incrementNodeInspectorPort(
|
|
34226
|
-
return
|
|
34227
|
-
if (!
|
|
34228
|
-
return
|
|
34342
|
+
function incrementNodeInspectorPort(t3) {
|
|
34343
|
+
return t3.map((t4) => {
|
|
34344
|
+
if (!t4.startsWith("--inspect")) {
|
|
34345
|
+
return t4;
|
|
34229
34346
|
}
|
|
34230
|
-
let
|
|
34347
|
+
let e3;
|
|
34231
34348
|
let i3 = "127.0.0.1";
|
|
34232
34349
|
let n2 = "9229";
|
|
34233
34350
|
let s2;
|
|
34234
|
-
if ((s2 =
|
|
34235
|
-
|
|
34236
|
-
} else if ((s2 =
|
|
34237
|
-
|
|
34351
|
+
if ((s2 = t4.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
34352
|
+
e3 = s2[1];
|
|
34353
|
+
} else if ((s2 = t4.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
|
|
34354
|
+
e3 = s2[1];
|
|
34238
34355
|
if (/^\d+$/.test(s2[3])) {
|
|
34239
34356
|
n2 = s2[3];
|
|
34240
34357
|
} else {
|
|
34241
34358
|
i3 = s2[3];
|
|
34242
34359
|
}
|
|
34243
|
-
} else if ((s2 =
|
|
34244
|
-
|
|
34360
|
+
} else if ((s2 = t4.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
|
|
34361
|
+
e3 = s2[1];
|
|
34245
34362
|
i3 = s2[3];
|
|
34246
34363
|
n2 = s2[4];
|
|
34247
34364
|
}
|
|
34248
|
-
if (
|
|
34249
|
-
return `${
|
|
34365
|
+
if (e3 && n2 !== "0") {
|
|
34366
|
+
return `${e3}=${i3}:${parseInt(n2) + 1}`;
|
|
34250
34367
|
}
|
|
34251
|
-
return
|
|
34368
|
+
return t4;
|
|
34252
34369
|
});
|
|
34253
34370
|
}
|
|
34254
|
-
function getCommandAndParents(
|
|
34255
|
-
const
|
|
34256
|
-
for (let i3 =
|
|
34257
|
-
|
|
34371
|
+
function getCommandAndParents(t3) {
|
|
34372
|
+
const e3 = [];
|
|
34373
|
+
for (let i3 = t3; i3; i3 = i3.parent) {
|
|
34374
|
+
e3.push(i3);
|
|
34258
34375
|
}
|
|
34259
|
-
return
|
|
34376
|
+
return e3;
|
|
34260
34377
|
}
|
|
34261
|
-
|
|
34262
|
-
},
|
|
34378
|
+
e2.Command = Command2;
|
|
34379
|
+
}, 796: (t2, e2) => {
|
|
34263
34380
|
class CommanderError extends Error {
|
|
34264
|
-
constructor(
|
|
34381
|
+
constructor(t3, e3, i2) {
|
|
34265
34382
|
super(i2);
|
|
34266
34383
|
Error.captureStackTrace(this, this.constructor);
|
|
34267
34384
|
this.name = this.constructor.name;
|
|
34268
|
-
this.code =
|
|
34269
|
-
this.exitCode =
|
|
34385
|
+
this.code = e3;
|
|
34386
|
+
this.exitCode = t3;
|
|
34270
34387
|
this.nestedError = void 0;
|
|
34271
34388
|
}
|
|
34272
34389
|
}
|
|
34273
34390
|
class InvalidArgumentError extends CommanderError {
|
|
34274
|
-
constructor(
|
|
34275
|
-
super(1, "commander.invalidArgument",
|
|
34391
|
+
constructor(t3) {
|
|
34392
|
+
super(1, "commander.invalidArgument", t3);
|
|
34276
34393
|
Error.captureStackTrace(this, this.constructor);
|
|
34277
34394
|
this.name = this.constructor.name;
|
|
34278
34395
|
}
|
|
34279
34396
|
}
|
|
34280
|
-
|
|
34281
|
-
|
|
34282
|
-
},
|
|
34283
|
-
const { humanReadableArgName: n } = i2(
|
|
34397
|
+
e2.CommanderError = CommanderError;
|
|
34398
|
+
e2.InvalidArgumentError = InvalidArgumentError;
|
|
34399
|
+
}, 519: (t2, e2, i2) => {
|
|
34400
|
+
const { humanReadableArgName: n } = i2(535);
|
|
34284
34401
|
class Help {
|
|
34285
34402
|
constructor() {
|
|
34286
34403
|
this.helpWidth = void 0;
|
|
34287
34404
|
this.sortSubcommands = false;
|
|
34288
34405
|
this.sortOptions = false;
|
|
34289
|
-
|
|
34290
|
-
|
|
34291
|
-
|
|
34292
|
-
|
|
34293
|
-
|
|
34294
|
-
const
|
|
34295
|
-
s.
|
|
34406
|
+
this.showGlobalOptions = false;
|
|
34407
|
+
}
|
|
34408
|
+
visibleCommands(t3) {
|
|
34409
|
+
const e3 = t3.commands.filter((t4) => !t4._hidden);
|
|
34410
|
+
if (t3._hasImplicitHelpCommand()) {
|
|
34411
|
+
const [, i3, n2] = t3._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);
|
|
34412
|
+
const s = t3.createCommand(i3).helpOption(false);
|
|
34413
|
+
s.description(t3._helpCommandDescription);
|
|
34296
34414
|
if (n2)
|
|
34297
34415
|
s.arguments(n2);
|
|
34298
|
-
|
|
34416
|
+
e3.push(s);
|
|
34299
34417
|
}
|
|
34300
34418
|
if (this.sortSubcommands) {
|
|
34301
|
-
|
|
34419
|
+
e3.sort((t4, e4) => t4.name().localeCompare(e4.name()));
|
|
34302
34420
|
}
|
|
34303
|
-
return
|
|
34421
|
+
return e3;
|
|
34304
34422
|
}
|
|
34305
|
-
|
|
34306
|
-
const
|
|
34307
|
-
|
|
34308
|
-
|
|
34423
|
+
compareOptions(t3, e3) {
|
|
34424
|
+
const getSortKey = (t4) => t4.short ? t4.short.replace(/^-/, "") : t4.long.replace(/^--/, "");
|
|
34425
|
+
return getSortKey(t3).localeCompare(getSortKey(e3));
|
|
34426
|
+
}
|
|
34427
|
+
visibleOptions(t3) {
|
|
34428
|
+
const e3 = t3.options.filter((t4) => !t4.hidden);
|
|
34429
|
+
const i3 = t3._hasHelpOption && t3._helpShortFlag && !t3._findOption(t3._helpShortFlag);
|
|
34430
|
+
const n2 = t3._hasHelpOption && !t3._findOption(t3._helpLongFlag);
|
|
34309
34431
|
if (i3 || n2) {
|
|
34310
34432
|
let s;
|
|
34311
34433
|
if (!i3) {
|
|
34312
|
-
s =
|
|
34434
|
+
s = t3.createOption(t3._helpLongFlag, t3._helpDescription);
|
|
34313
34435
|
} else if (!n2) {
|
|
34314
|
-
s =
|
|
34436
|
+
s = t3.createOption(t3._helpShortFlag, t3._helpDescription);
|
|
34315
34437
|
} else {
|
|
34316
|
-
s =
|
|
34438
|
+
s = t3.createOption(t3._helpFlags, t3._helpDescription);
|
|
34317
34439
|
}
|
|
34318
|
-
|
|
34440
|
+
e3.push(s);
|
|
34319
34441
|
}
|
|
34320
34442
|
if (this.sortOptions) {
|
|
34321
|
-
|
|
34322
|
-
t3.sort((e4, t4) => getSortKey(e4).localeCompare(getSortKey(t4)));
|
|
34443
|
+
e3.sort(this.compareOptions);
|
|
34323
34444
|
}
|
|
34324
|
-
return
|
|
34445
|
+
return e3;
|
|
34325
34446
|
}
|
|
34326
|
-
|
|
34327
|
-
if (
|
|
34328
|
-
|
|
34329
|
-
|
|
34447
|
+
visibleGlobalOptions(t3) {
|
|
34448
|
+
if (!this.showGlobalOptions)
|
|
34449
|
+
return [];
|
|
34450
|
+
const e3 = [];
|
|
34451
|
+
for (let i3 = t3.parent; i3; i3 = i3.parent) {
|
|
34452
|
+
const t4 = i3.options.filter((t5) => !t5.hidden);
|
|
34453
|
+
e3.push(...t4);
|
|
34454
|
+
}
|
|
34455
|
+
if (this.sortOptions) {
|
|
34456
|
+
e3.sort(this.compareOptions);
|
|
34457
|
+
}
|
|
34458
|
+
return e3;
|
|
34459
|
+
}
|
|
34460
|
+
visibleArguments(t3) {
|
|
34461
|
+
if (t3._argsDescription) {
|
|
34462
|
+
t3._args.forEach((e3) => {
|
|
34463
|
+
e3.description = e3.description || t3._argsDescription[e3.name()] || "";
|
|
34330
34464
|
});
|
|
34331
34465
|
}
|
|
34332
|
-
if (
|
|
34333
|
-
return
|
|
34466
|
+
if (t3._args.find((t4) => t4.description)) {
|
|
34467
|
+
return t3._args;
|
|
34334
34468
|
}
|
|
34335
34469
|
return [];
|
|
34336
34470
|
}
|
|
34337
|
-
subcommandTerm(
|
|
34338
|
-
const
|
|
34339
|
-
return
|
|
34471
|
+
subcommandTerm(t3) {
|
|
34472
|
+
const e3 = t3._args.map((t4) => n(t4)).join(" ");
|
|
34473
|
+
return t3._name + (t3._aliases[0] ? "|" + t3._aliases[0] : "") + (t3.options.length ? " [options]" : "") + (e3 ? " " + e3 : "");
|
|
34340
34474
|
}
|
|
34341
|
-
optionTerm(
|
|
34342
|
-
return
|
|
34475
|
+
optionTerm(t3) {
|
|
34476
|
+
return t3.flags;
|
|
34343
34477
|
}
|
|
34344
|
-
argumentTerm(
|
|
34345
|
-
return
|
|
34478
|
+
argumentTerm(t3) {
|
|
34479
|
+
return t3.name();
|
|
34346
34480
|
}
|
|
34347
|
-
longestSubcommandTermLength(
|
|
34348
|
-
return
|
|
34481
|
+
longestSubcommandTermLength(t3, e3) {
|
|
34482
|
+
return e3.visibleCommands(t3).reduce((t4, i3) => Math.max(t4, e3.subcommandTerm(i3).length), 0);
|
|
34349
34483
|
}
|
|
34350
|
-
longestOptionTermLength(
|
|
34351
|
-
return
|
|
34484
|
+
longestOptionTermLength(t3, e3) {
|
|
34485
|
+
return e3.visibleOptions(t3).reduce((t4, i3) => Math.max(t4, e3.optionTerm(i3).length), 0);
|
|
34352
34486
|
}
|
|
34353
|
-
|
|
34354
|
-
return
|
|
34487
|
+
longestGlobalOptionTermLength(t3, e3) {
|
|
34488
|
+
return e3.visibleGlobalOptions(t3).reduce((t4, i3) => Math.max(t4, e3.optionTerm(i3).length), 0);
|
|
34355
34489
|
}
|
|
34356
|
-
|
|
34357
|
-
|
|
34358
|
-
|
|
34359
|
-
|
|
34490
|
+
longestArgumentTermLength(t3, e3) {
|
|
34491
|
+
return e3.visibleArguments(t3).reduce((t4, i3) => Math.max(t4, e3.argumentTerm(i3).length), 0);
|
|
34492
|
+
}
|
|
34493
|
+
commandUsage(t3) {
|
|
34494
|
+
let e3 = t3._name;
|
|
34495
|
+
if (t3._aliases[0]) {
|
|
34496
|
+
e3 = e3 + "|" + t3._aliases[0];
|
|
34360
34497
|
}
|
|
34361
34498
|
let i3 = "";
|
|
34362
|
-
for (let
|
|
34363
|
-
i3 =
|
|
34499
|
+
for (let e4 = t3.parent; e4; e4 = e4.parent) {
|
|
34500
|
+
i3 = e4.name() + " " + i3;
|
|
34364
34501
|
}
|
|
34365
|
-
return i3 +
|
|
34502
|
+
return i3 + e3 + " " + t3.usage();
|
|
34366
34503
|
}
|
|
34367
|
-
commandDescription(
|
|
34368
|
-
return
|
|
34504
|
+
commandDescription(t3) {
|
|
34505
|
+
return t3.description();
|
|
34369
34506
|
}
|
|
34370
|
-
subcommandDescription(
|
|
34371
|
-
return
|
|
34507
|
+
subcommandDescription(t3) {
|
|
34508
|
+
return t3.summary() || t3.description();
|
|
34372
34509
|
}
|
|
34373
|
-
optionDescription(
|
|
34374
|
-
const
|
|
34375
|
-
if (
|
|
34376
|
-
|
|
34510
|
+
optionDescription(t3) {
|
|
34511
|
+
const e3 = [];
|
|
34512
|
+
if (t3.argChoices) {
|
|
34513
|
+
e3.push(`choices: ${t3.argChoices.map((t4) => JSON.stringify(t4)).join(", ")}`);
|
|
34377
34514
|
}
|
|
34378
|
-
if (
|
|
34379
|
-
t3.
|
|
34515
|
+
if (t3.defaultValue !== void 0) {
|
|
34516
|
+
const i3 = t3.required || t3.optional || t3.isBoolean() && typeof t3.defaultValue === "boolean";
|
|
34517
|
+
if (i3) {
|
|
34518
|
+
e3.push(`default: ${t3.defaultValueDescription || JSON.stringify(t3.defaultValue)}`);
|
|
34519
|
+
}
|
|
34380
34520
|
}
|
|
34381
|
-
if (
|
|
34382
|
-
|
|
34521
|
+
if (t3.presetArg !== void 0 && t3.optional) {
|
|
34522
|
+
e3.push(`preset: ${JSON.stringify(t3.presetArg)}`);
|
|
34383
34523
|
}
|
|
34384
|
-
if (t3.
|
|
34385
|
-
|
|
34524
|
+
if (t3.envVar !== void 0) {
|
|
34525
|
+
e3.push(`env: ${t3.envVar}`);
|
|
34386
34526
|
}
|
|
34387
|
-
|
|
34527
|
+
if (e3.length > 0) {
|
|
34528
|
+
return `${t3.description} (${e3.join(", ")})`;
|
|
34529
|
+
}
|
|
34530
|
+
return t3.description;
|
|
34388
34531
|
}
|
|
34389
|
-
argumentDescription(
|
|
34390
|
-
const
|
|
34391
|
-
if (
|
|
34392
|
-
|
|
34532
|
+
argumentDescription(t3) {
|
|
34533
|
+
const e3 = [];
|
|
34534
|
+
if (t3.argChoices) {
|
|
34535
|
+
e3.push(`choices: ${t3.argChoices.map((t4) => JSON.stringify(t4)).join(", ")}`);
|
|
34393
34536
|
}
|
|
34394
|
-
if (
|
|
34395
|
-
|
|
34537
|
+
if (t3.defaultValue !== void 0) {
|
|
34538
|
+
e3.push(`default: ${t3.defaultValueDescription || JSON.stringify(t3.defaultValue)}`);
|
|
34396
34539
|
}
|
|
34397
|
-
if (
|
|
34398
|
-
const i3 = `(${
|
|
34399
|
-
if (
|
|
34400
|
-
return `${
|
|
34540
|
+
if (e3.length > 0) {
|
|
34541
|
+
const i3 = `(${e3.join(", ")})`;
|
|
34542
|
+
if (t3.description) {
|
|
34543
|
+
return `${t3.description} ${i3}`;
|
|
34401
34544
|
}
|
|
34402
34545
|
return i3;
|
|
34403
34546
|
}
|
|
34404
|
-
return
|
|
34547
|
+
return t3.description;
|
|
34405
34548
|
}
|
|
34406
|
-
formatHelp(
|
|
34407
|
-
const i3 =
|
|
34408
|
-
const n2 =
|
|
34549
|
+
formatHelp(t3, e3) {
|
|
34550
|
+
const i3 = e3.padWidth(t3, e3);
|
|
34551
|
+
const n2 = e3.helpWidth || 80;
|
|
34409
34552
|
const s = 2;
|
|
34410
34553
|
const r = 2;
|
|
34411
|
-
function formatItem(
|
|
34554
|
+
function formatItem(t4, o2) {
|
|
34412
34555
|
if (o2) {
|
|
34413
|
-
const a2 = `${
|
|
34414
|
-
return
|
|
34556
|
+
const a2 = `${t4.padEnd(i3 + r)}${o2}`;
|
|
34557
|
+
return e3.wrap(a2, n2 - s, i3 + r);
|
|
34415
34558
|
}
|
|
34416
|
-
return
|
|
34559
|
+
return t4;
|
|
34417
34560
|
}
|
|
34418
|
-
function formatList(
|
|
34419
|
-
return
|
|
34561
|
+
function formatList(t4) {
|
|
34562
|
+
return t4.join("\n").replace(/^/gm, " ".repeat(s));
|
|
34420
34563
|
}
|
|
34421
|
-
let o = [`Usage: ${
|
|
34422
|
-
const a =
|
|
34564
|
+
let o = [`Usage: ${e3.commandUsage(t3)}`, ""];
|
|
34565
|
+
const a = e3.commandDescription(t3);
|
|
34423
34566
|
if (a.length > 0) {
|
|
34424
|
-
o = o.concat([a, ""]);
|
|
34567
|
+
o = o.concat([e3.wrap(a, n2, 0), ""]);
|
|
34425
34568
|
}
|
|
34426
|
-
const
|
|
34569
|
+
const l = e3.visibleArguments(t3).map((t4) => formatItem(e3.argumentTerm(t4), e3.argumentDescription(t4)));
|
|
34570
|
+
if (l.length > 0) {
|
|
34571
|
+
o = o.concat(["Arguments:", formatList(l), ""]);
|
|
34572
|
+
}
|
|
34573
|
+
const h = e3.visibleOptions(t3).map((t4) => formatItem(e3.optionTerm(t4), e3.optionDescription(t4)));
|
|
34427
34574
|
if (h.length > 0) {
|
|
34428
|
-
o = o.concat(["
|
|
34575
|
+
o = o.concat(["Options:", formatList(h), ""]);
|
|
34429
34576
|
}
|
|
34430
|
-
|
|
34431
|
-
|
|
34432
|
-
|
|
34577
|
+
if (this.showGlobalOptions) {
|
|
34578
|
+
const i4 = e3.visibleGlobalOptions(t3).map((t4) => formatItem(e3.optionTerm(t4), e3.optionDescription(t4)));
|
|
34579
|
+
if (i4.length > 0) {
|
|
34580
|
+
o = o.concat(["Global Options:", formatList(i4), ""]);
|
|
34581
|
+
}
|
|
34433
34582
|
}
|
|
34434
|
-
const u =
|
|
34583
|
+
const u = e3.visibleCommands(t3).map((t4) => formatItem(e3.subcommandTerm(t4), e3.subcommandDescription(t4)));
|
|
34435
34584
|
if (u.length > 0) {
|
|
34436
34585
|
o = o.concat(["Commands:", formatList(u), ""]);
|
|
34437
34586
|
}
|
|
34438
34587
|
return o.join("\n");
|
|
34439
34588
|
}
|
|
34440
|
-
padWidth(
|
|
34441
|
-
return Math.max(
|
|
34589
|
+
padWidth(t3, e3) {
|
|
34590
|
+
return Math.max(e3.longestOptionTermLength(t3, e3), e3.longestGlobalOptionTermLength(t3, e3), e3.longestSubcommandTermLength(t3, e3), e3.longestArgumentTermLength(t3, e3));
|
|
34442
34591
|
}
|
|
34443
|
-
wrap(
|
|
34444
|
-
|
|
34445
|
-
|
|
34446
|
-
|
|
34447
|
-
|
|
34448
|
-
|
|
34449
|
-
|
|
34450
|
-
|
|
34451
|
-
const a =
|
|
34452
|
-
const
|
|
34453
|
-
const
|
|
34454
|
-
|
|
34455
|
-
|
|
34456
|
-
|
|
34457
|
-
|
|
34458
|
-
|
|
34592
|
+
wrap(t3, e3, i3, n2 = 40) {
|
|
34593
|
+
const s = " \\f\\t\\v - \uFEFF";
|
|
34594
|
+
const r = new RegExp(`[\\n][${s}]+`);
|
|
34595
|
+
if (t3.match(r))
|
|
34596
|
+
return t3;
|
|
34597
|
+
const o = e3 - i3;
|
|
34598
|
+
if (o < n2)
|
|
34599
|
+
return t3;
|
|
34600
|
+
const a = t3.slice(0, i3);
|
|
34601
|
+
const l = t3.slice(i3).replace("\r\n", "\n");
|
|
34602
|
+
const h = " ".repeat(i3);
|
|
34603
|
+
const u = "";
|
|
34604
|
+
const c = `\\s${u}`;
|
|
34605
|
+
const p = new RegExp(`
|
|
34606
|
+
|.{1,${o - 1}}([${c}]|$)|[^${c}]+?([${c}]|$)`, "g");
|
|
34607
|
+
const m = l.match(p) || [];
|
|
34608
|
+
return a + m.map((t4, e4) => {
|
|
34609
|
+
if (t4 === "\n")
|
|
34610
|
+
return "";
|
|
34611
|
+
return (e4 > 0 ? h : "") + t4.trimEnd();
|
|
34459
34612
|
}).join("\n");
|
|
34460
34613
|
}
|
|
34461
34614
|
}
|
|
34462
|
-
|
|
34463
|
-
},
|
|
34464
|
-
const { InvalidArgumentError: n } = i2(
|
|
34615
|
+
e2.Help = Help;
|
|
34616
|
+
}, 437: (t2, e2, i2) => {
|
|
34617
|
+
const { InvalidArgumentError: n } = i2(796);
|
|
34465
34618
|
class Option {
|
|
34466
|
-
constructor(
|
|
34467
|
-
this.flags =
|
|
34468
|
-
this.description =
|
|
34469
|
-
this.required =
|
|
34470
|
-
this.optional =
|
|
34471
|
-
this.variadic = /\w\.\.\.[>\]]$/.test(
|
|
34619
|
+
constructor(t3, e3) {
|
|
34620
|
+
this.flags = t3;
|
|
34621
|
+
this.description = e3 || "";
|
|
34622
|
+
this.required = t3.includes("<");
|
|
34623
|
+
this.optional = t3.includes("[");
|
|
34624
|
+
this.variadic = /\w\.\.\.[>\]]$/.test(t3);
|
|
34472
34625
|
this.mandatory = false;
|
|
34473
|
-
const i3 = splitOptionFlags(
|
|
34626
|
+
const i3 = splitOptionFlags(t3);
|
|
34474
34627
|
this.short = i3.shortFlag;
|
|
34475
34628
|
this.long = i3.longFlag;
|
|
34476
34629
|
this.negate = false;
|
|
@@ -34479,48 +34632,63 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
34479
34632
|
}
|
|
34480
34633
|
this.defaultValue = void 0;
|
|
34481
34634
|
this.defaultValueDescription = void 0;
|
|
34635
|
+
this.presetArg = void 0;
|
|
34482
34636
|
this.envVar = void 0;
|
|
34483
34637
|
this.parseArg = void 0;
|
|
34484
34638
|
this.hidden = false;
|
|
34485
34639
|
this.argChoices = void 0;
|
|
34640
|
+
this.conflictsWith = [];
|
|
34641
|
+
this.implied = void 0;
|
|
34486
34642
|
}
|
|
34487
|
-
default(
|
|
34488
|
-
this.defaultValue =
|
|
34489
|
-
this.defaultValueDescription =
|
|
34643
|
+
default(t3, e3) {
|
|
34644
|
+
this.defaultValue = t3;
|
|
34645
|
+
this.defaultValueDescription = e3;
|
|
34490
34646
|
return this;
|
|
34491
34647
|
}
|
|
34492
|
-
|
|
34493
|
-
this.
|
|
34648
|
+
preset(t3) {
|
|
34649
|
+
this.presetArg = t3;
|
|
34494
34650
|
return this;
|
|
34495
34651
|
}
|
|
34496
|
-
|
|
34497
|
-
this.
|
|
34652
|
+
conflicts(t3) {
|
|
34653
|
+
this.conflictsWith = this.conflictsWith.concat(t3);
|
|
34498
34654
|
return this;
|
|
34499
34655
|
}
|
|
34500
|
-
|
|
34501
|
-
this.
|
|
34656
|
+
implies(t3) {
|
|
34657
|
+
this.implied = Object.assign(this.implied || {}, t3);
|
|
34502
34658
|
return this;
|
|
34503
34659
|
}
|
|
34504
|
-
|
|
34505
|
-
this.
|
|
34660
|
+
env(t3) {
|
|
34661
|
+
this.envVar = t3;
|
|
34506
34662
|
return this;
|
|
34507
34663
|
}
|
|
34508
|
-
|
|
34509
|
-
|
|
34510
|
-
|
|
34664
|
+
argParser(t3) {
|
|
34665
|
+
this.parseArg = t3;
|
|
34666
|
+
return this;
|
|
34667
|
+
}
|
|
34668
|
+
makeOptionMandatory(t3 = true) {
|
|
34669
|
+
this.mandatory = !!t3;
|
|
34670
|
+
return this;
|
|
34671
|
+
}
|
|
34672
|
+
hideHelp(t3 = true) {
|
|
34673
|
+
this.hidden = !!t3;
|
|
34674
|
+
return this;
|
|
34675
|
+
}
|
|
34676
|
+
_concatValue(t3, e3) {
|
|
34677
|
+
if (e3 === this.defaultValue || !Array.isArray(e3)) {
|
|
34678
|
+
return [t3];
|
|
34511
34679
|
}
|
|
34512
|
-
return
|
|
34680
|
+
return e3.concat(t3);
|
|
34513
34681
|
}
|
|
34514
|
-
choices(
|
|
34515
|
-
this.argChoices =
|
|
34516
|
-
this.parseArg = (
|
|
34517
|
-
if (!
|
|
34518
|
-
throw new n(`Allowed choices are ${
|
|
34682
|
+
choices(t3) {
|
|
34683
|
+
this.argChoices = t3.slice();
|
|
34684
|
+
this.parseArg = (t4, e3) => {
|
|
34685
|
+
if (!this.argChoices.includes(t4)) {
|
|
34686
|
+
throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
34519
34687
|
}
|
|
34520
34688
|
if (this.variadic) {
|
|
34521
|
-
return this._concatValue(
|
|
34689
|
+
return this._concatValue(t4, e3);
|
|
34522
34690
|
}
|
|
34523
|
-
return
|
|
34691
|
+
return t4;
|
|
34524
34692
|
};
|
|
34525
34693
|
return this;
|
|
34526
34694
|
}
|
|
@@ -34533,86 +34701,117 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
34533
34701
|
attributeName() {
|
|
34534
34702
|
return camelcase(this.name().replace(/^no-/, ""));
|
|
34535
34703
|
}
|
|
34536
|
-
is(
|
|
34537
|
-
return this.short ===
|
|
34704
|
+
is(t3) {
|
|
34705
|
+
return this.short === t3 || this.long === t3;
|
|
34706
|
+
}
|
|
34707
|
+
isBoolean() {
|
|
34708
|
+
return !this.required && !this.optional && !this.negate;
|
|
34538
34709
|
}
|
|
34539
34710
|
}
|
|
34540
|
-
|
|
34541
|
-
|
|
34711
|
+
class DualOptions {
|
|
34712
|
+
constructor(t3) {
|
|
34713
|
+
this.positiveOptions = /* @__PURE__ */ new Map();
|
|
34714
|
+
this.negativeOptions = /* @__PURE__ */ new Map();
|
|
34715
|
+
this.dualOptions = /* @__PURE__ */ new Set();
|
|
34716
|
+
t3.forEach((t4) => {
|
|
34717
|
+
if (t4.negate) {
|
|
34718
|
+
this.negativeOptions.set(t4.attributeName(), t4);
|
|
34719
|
+
} else {
|
|
34720
|
+
this.positiveOptions.set(t4.attributeName(), t4);
|
|
34721
|
+
}
|
|
34722
|
+
});
|
|
34723
|
+
this.negativeOptions.forEach((t4, e3) => {
|
|
34724
|
+
if (this.positiveOptions.has(e3)) {
|
|
34725
|
+
this.dualOptions.add(e3);
|
|
34726
|
+
}
|
|
34727
|
+
});
|
|
34728
|
+
}
|
|
34729
|
+
valueFromOption(t3, e3) {
|
|
34730
|
+
const i3 = e3.attributeName();
|
|
34731
|
+
if (!this.dualOptions.has(i3))
|
|
34732
|
+
return true;
|
|
34733
|
+
const n2 = this.negativeOptions.get(i3).presetArg;
|
|
34734
|
+
const s = n2 !== void 0 ? n2 : false;
|
|
34735
|
+
return e3.negate === (s === t3);
|
|
34736
|
+
}
|
|
34542
34737
|
}
|
|
34543
|
-
function
|
|
34544
|
-
|
|
34738
|
+
function camelcase(t3) {
|
|
34739
|
+
return t3.split("-").reduce((t4, e3) => t4 + e3[0].toUpperCase() + e3.slice(1));
|
|
34740
|
+
}
|
|
34741
|
+
function splitOptionFlags(t3) {
|
|
34742
|
+
let e3;
|
|
34545
34743
|
let i3;
|
|
34546
|
-
const n2 =
|
|
34744
|
+
const n2 = t3.split(/[ |,]+/);
|
|
34547
34745
|
if (n2.length > 1 && !/^[[<]/.test(n2[1]))
|
|
34548
|
-
|
|
34746
|
+
e3 = n2.shift();
|
|
34549
34747
|
i3 = n2.shift();
|
|
34550
|
-
if (!
|
|
34551
|
-
|
|
34748
|
+
if (!e3 && /^-[^-]$/.test(i3)) {
|
|
34749
|
+
e3 = i3;
|
|
34552
34750
|
i3 = void 0;
|
|
34553
34751
|
}
|
|
34554
|
-
return { shortFlag:
|
|
34752
|
+
return { shortFlag: e3, longFlag: i3 };
|
|
34555
34753
|
}
|
|
34556
|
-
|
|
34557
|
-
|
|
34558
|
-
|
|
34754
|
+
e2.Option = Option;
|
|
34755
|
+
e2.splitOptionFlags = splitOptionFlags;
|
|
34756
|
+
e2.DualOptions = DualOptions;
|
|
34757
|
+
}, 860: (t2, e2) => {
|
|
34559
34758
|
const i2 = 3;
|
|
34560
|
-
function editDistance(
|
|
34561
|
-
if (Math.abs(
|
|
34562
|
-
return Math.max(
|
|
34759
|
+
function editDistance(t3, e3) {
|
|
34760
|
+
if (Math.abs(t3.length - e3.length) > i2)
|
|
34761
|
+
return Math.max(t3.length, e3.length);
|
|
34563
34762
|
const n = [];
|
|
34564
|
-
for (let t4 = 0; t4 <= e3.length; t4++) {
|
|
34565
|
-
n[t4] = [t4];
|
|
34566
|
-
}
|
|
34567
34763
|
for (let e4 = 0; e4 <= t3.length; e4++) {
|
|
34568
|
-
n[
|
|
34764
|
+
n[e4] = [e4];
|
|
34569
34765
|
}
|
|
34570
|
-
for (let
|
|
34571
|
-
|
|
34766
|
+
for (let t4 = 0; t4 <= e3.length; t4++) {
|
|
34767
|
+
n[0][t4] = t4;
|
|
34768
|
+
}
|
|
34769
|
+
for (let i3 = 1; i3 <= e3.length; i3++) {
|
|
34770
|
+
for (let s = 1; s <= t3.length; s++) {
|
|
34572
34771
|
let r = 1;
|
|
34573
|
-
if (
|
|
34772
|
+
if (t3[s - 1] === e3[i3 - 1]) {
|
|
34574
34773
|
r = 0;
|
|
34575
34774
|
} else {
|
|
34576
34775
|
r = 1;
|
|
34577
34776
|
}
|
|
34578
34777
|
n[s][i3] = Math.min(n[s - 1][i3] + 1, n[s][i3 - 1] + 1, n[s - 1][i3 - 1] + r);
|
|
34579
|
-
if (s > 1 && i3 > 1 &&
|
|
34778
|
+
if (s > 1 && i3 > 1 && t3[s - 1] === e3[i3 - 2] && t3[s - 2] === e3[i3 - 1]) {
|
|
34580
34779
|
n[s][i3] = Math.min(n[s][i3], n[s - 2][i3 - 2] + 1);
|
|
34581
34780
|
}
|
|
34582
34781
|
}
|
|
34583
34782
|
}
|
|
34584
|
-
return n[
|
|
34783
|
+
return n[t3.length][e3.length];
|
|
34585
34784
|
}
|
|
34586
|
-
function suggestSimilar(
|
|
34587
|
-
if (!
|
|
34785
|
+
function suggestSimilar(t3, e3) {
|
|
34786
|
+
if (!e3 || e3.length === 0)
|
|
34588
34787
|
return "";
|
|
34589
|
-
|
|
34590
|
-
const n =
|
|
34788
|
+
e3 = Array.from(new Set(e3));
|
|
34789
|
+
const n = t3.startsWith("--");
|
|
34591
34790
|
if (n) {
|
|
34592
|
-
|
|
34593
|
-
|
|
34791
|
+
t3 = t3.slice(2);
|
|
34792
|
+
e3 = e3.map((t4) => t4.slice(2));
|
|
34594
34793
|
}
|
|
34595
34794
|
let s = [];
|
|
34596
34795
|
let r = i2;
|
|
34597
34796
|
const o = 0.4;
|
|
34598
|
-
|
|
34599
|
-
if (
|
|
34797
|
+
e3.forEach((e4) => {
|
|
34798
|
+
if (e4.length <= 1)
|
|
34600
34799
|
return;
|
|
34601
|
-
const i3 = editDistance(
|
|
34602
|
-
const n2 = Math.max(
|
|
34800
|
+
const i3 = editDistance(t3, e4);
|
|
34801
|
+
const n2 = Math.max(t3.length, e4.length);
|
|
34603
34802
|
const a = (n2 - i3) / n2;
|
|
34604
34803
|
if (a > o) {
|
|
34605
34804
|
if (i3 < r) {
|
|
34606
34805
|
r = i3;
|
|
34607
|
-
s = [
|
|
34806
|
+
s = [e4];
|
|
34608
34807
|
} else if (i3 === r) {
|
|
34609
|
-
s.push(
|
|
34808
|
+
s.push(e4);
|
|
34610
34809
|
}
|
|
34611
34810
|
}
|
|
34612
34811
|
});
|
|
34613
|
-
s.sort((
|
|
34812
|
+
s.sort((t4, e4) => t4.localeCompare(e4));
|
|
34614
34813
|
if (n) {
|
|
34615
|
-
s = s.map((
|
|
34814
|
+
s = s.map((t4) => `--${t4}`);
|
|
34616
34815
|
}
|
|
34617
34816
|
if (s.length > 1) {
|
|
34618
34817
|
return `
|
|
@@ -34624,28 +34823,28 @@ Expecting one of '${i3.join("', '")}'`);
|
|
|
34624
34823
|
}
|
|
34625
34824
|
return "";
|
|
34626
34825
|
}
|
|
34627
|
-
|
|
34826
|
+
e2.suggestSimilar = suggestSimilar;
|
|
34628
34827
|
} };
|
|
34629
|
-
var
|
|
34828
|
+
var e = {};
|
|
34630
34829
|
function __nccwpck_require__(i2) {
|
|
34631
|
-
var n =
|
|
34830
|
+
var n = e[i2];
|
|
34632
34831
|
if (n !== void 0) {
|
|
34633
34832
|
return n.exports;
|
|
34634
34833
|
}
|
|
34635
|
-
var s =
|
|
34834
|
+
var s = e[i2] = { exports: {} };
|
|
34636
34835
|
var r = true;
|
|
34637
34836
|
try {
|
|
34638
|
-
|
|
34837
|
+
t[i2](s, s.exports, __nccwpck_require__);
|
|
34639
34838
|
r = false;
|
|
34640
34839
|
} finally {
|
|
34641
34840
|
if (r)
|
|
34642
|
-
delete
|
|
34841
|
+
delete e[i2];
|
|
34643
34842
|
}
|
|
34644
34843
|
return s.exports;
|
|
34645
34844
|
}
|
|
34646
34845
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
34647
34846
|
__nccwpck_require__.ab = __dirname + "/";
|
|
34648
|
-
var i = __nccwpck_require__(
|
|
34847
|
+
var i = __nccwpck_require__(632);
|
|
34649
34848
|
module2.exports = i;
|
|
34650
34849
|
})();
|
|
34651
34850
|
}
|
|
@@ -34785,12 +34984,17 @@ var require_commands = __commonJS({
|
|
|
34785
34984
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
34786
34985
|
var commands_exports = {};
|
|
34787
34986
|
__export2(commands_exports, {
|
|
34987
|
+
getArgv: () => getArgv,
|
|
34788
34988
|
getCommand: () => getCommand,
|
|
34789
34989
|
isDevCommand: () => isDevCommand
|
|
34790
34990
|
});
|
|
34791
34991
|
module2.exports = __toCommonJS2(commands_exports);
|
|
34992
|
+
var getArgv = () => {
|
|
34993
|
+
var _a2;
|
|
34994
|
+
return (((_a2 = process.env.MODERN_ARGV) == null ? void 0 : _a2.split(" ")) || process.argv).slice(2);
|
|
34995
|
+
};
|
|
34792
34996
|
var getCommand = () => {
|
|
34793
|
-
const args =
|
|
34997
|
+
const args = getArgv();
|
|
34794
34998
|
const command = args[0];
|
|
34795
34999
|
return command;
|
|
34796
35000
|
};
|
|
@@ -34801,108 +35005,6 @@ var require_commands = __commonJS({
|
|
|
34801
35005
|
}
|
|
34802
35006
|
});
|
|
34803
35007
|
|
|
34804
|
-
// ../../../toolkit/utils/dist/format.js
|
|
34805
|
-
var require_format = __commonJS({
|
|
34806
|
-
"../../../toolkit/utils/dist/format.js"(exports, module2) {
|
|
34807
|
-
var __defProp2 = Object.defineProperty;
|
|
34808
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
34809
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
34810
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
34811
|
-
var __export2 = (target, all) => {
|
|
34812
|
-
for (var name in all)
|
|
34813
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
34814
|
-
};
|
|
34815
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
34816
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
34817
|
-
for (let key of __getOwnPropNames2(from))
|
|
34818
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
34819
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
34820
|
-
}
|
|
34821
|
-
return to;
|
|
34822
|
-
};
|
|
34823
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
34824
|
-
var format_exports = {};
|
|
34825
|
-
__export2(format_exports, {
|
|
34826
|
-
formatWebpackMessages: () => formatWebpackMessages
|
|
34827
|
-
});
|
|
34828
|
-
module2.exports = __toCommonJS2(format_exports);
|
|
34829
|
-
var friendlySyntaxErrorLabel = "SyntaxError:";
|
|
34830
|
-
function isLikelyASyntaxError(message) {
|
|
34831
|
-
return message.includes(friendlySyntaxErrorLabel);
|
|
34832
|
-
}
|
|
34833
|
-
function formatMessage(stats) {
|
|
34834
|
-
let lines = [];
|
|
34835
|
-
let message;
|
|
34836
|
-
if (typeof stats === "object") {
|
|
34837
|
-
const fileName = stats.moduleName ? `File: ${stats.moduleName}
|
|
34838
|
-
` : "";
|
|
34839
|
-
const mainMessage = stats.message;
|
|
34840
|
-
const details = stats.details ? `
|
|
34841
|
-
Details: ${stats.details}
|
|
34842
|
-
` : "";
|
|
34843
|
-
const stack = stats.stack ? `
|
|
34844
|
-
${stats.stack}` : "";
|
|
34845
|
-
message = `${fileName}${mainMessage}${details}${stack}`;
|
|
34846
|
-
} else {
|
|
34847
|
-
message = stats;
|
|
34848
|
-
}
|
|
34849
|
-
lines = message.split("\n");
|
|
34850
|
-
lines = lines.map((line) => {
|
|
34851
|
-
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
|
|
34852
|
-
line
|
|
34853
|
-
);
|
|
34854
|
-
if (!parsingError) {
|
|
34855
|
-
return line;
|
|
34856
|
-
}
|
|
34857
|
-
const [, errorLine, errorColumn, errorMessage] = parsingError;
|
|
34858
|
-
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
|
|
34859
|
-
});
|
|
34860
|
-
message = lines.join("\n");
|
|
34861
|
-
message = message.replace(
|
|
34862
|
-
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
|
|
34863
|
-
`${friendlySyntaxErrorLabel} $3 ($1:$2)
|
|
34864
|
-
`
|
|
34865
|
-
);
|
|
34866
|
-
lines = message.split("\n");
|
|
34867
|
-
if (lines.length > 2 && lines[1].trim() === "") {
|
|
34868
|
-
lines.splice(1, 1);
|
|
34869
|
-
}
|
|
34870
|
-
lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, "$1");
|
|
34871
|
-
if (lines[1] && lines[1].indexOf("Module not found:") !== -1) {
|
|
34872
|
-
lines[1] = lines[1].replace("Error: ", "");
|
|
34873
|
-
}
|
|
34874
|
-
message = lines.join("\n");
|
|
34875
|
-
message = message.replace(
|
|
34876
|
-
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
|
|
34877
|
-
""
|
|
34878
|
-
);
|
|
34879
|
-
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, "");
|
|
34880
|
-
lines = message.split("\n");
|
|
34881
|
-
lines = lines.filter(
|
|
34882
|
-
(line, index, arr) => index === 0 || line.trim() !== "" || line.trim() !== arr[index - 1].trim()
|
|
34883
|
-
);
|
|
34884
|
-
message = lines.join("\n");
|
|
34885
|
-
return message.trim();
|
|
34886
|
-
}
|
|
34887
|
-
function formatWebpackMessages(json) {
|
|
34888
|
-
var _a2, _b, _c;
|
|
34889
|
-
const formattedErrors = (_a2 = json == null ? void 0 : json.errors) == null ? void 0 : _a2.map(formatMessage);
|
|
34890
|
-
const formattedWarnings = (_b = json == null ? void 0 : json.warnings) == null ? void 0 : _b.map(formatMessage);
|
|
34891
|
-
const result = {
|
|
34892
|
-
errors: formattedErrors || [],
|
|
34893
|
-
warnings: formattedWarnings || []
|
|
34894
|
-
};
|
|
34895
|
-
if ((_c = result.errors) == null ? void 0 : _c.some(isLikelyASyntaxError)) {
|
|
34896
|
-
result.errors = result.errors.filter(isLikelyASyntaxError);
|
|
34897
|
-
}
|
|
34898
|
-
if (result.errors.length > 1) {
|
|
34899
|
-
result.errors.length = 1;
|
|
34900
|
-
}
|
|
34901
|
-
return result;
|
|
34902
|
-
}
|
|
34903
|
-
}
|
|
34904
|
-
});
|
|
34905
|
-
|
|
34906
35008
|
// ../../../toolkit/utils/dist/logger.js
|
|
34907
35009
|
var require_logger = __commonJS({
|
|
34908
35010
|
"../../../toolkit/utils/dist/logger.js"(exports, module2) {
|
|
@@ -35687,10 +35789,10 @@ var require_constants = __commonJS({
|
|
|
35687
35789
|
API_DIR: () => API_DIR,
|
|
35688
35790
|
CONFIG_CACHE_DIR: () => CONFIG_CACHE_DIR,
|
|
35689
35791
|
CONFIG_FILE_EXTENSIONS: () => CONFIG_FILE_EXTENSIONS,
|
|
35792
|
+
DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: () => DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS,
|
|
35690
35793
|
DEFAULT_DEV_HOST: () => DEFAULT_DEV_HOST,
|
|
35691
35794
|
DEFAULT_SERVER_CONFIG: () => DEFAULT_SERVER_CONFIG,
|
|
35692
35795
|
ENTRY_NAME_PATTERN: () => ENTRY_NAME_PATTERN,
|
|
35693
|
-
HMR_SOCK_PATH: () => HMR_SOCK_PATH,
|
|
35694
35796
|
INTERNAL_APP_TOOLS_PLUGINS: () => INTERNAL_APP_TOOLS_PLUGINS,
|
|
35695
35797
|
INTERNAL_APP_TOOLS_RUNTIME_PLUGINS: () => INTERNAL_APP_TOOLS_RUNTIME_PLUGINS,
|
|
35696
35798
|
INTERNAL_CLI_PLUGINS: () => INTERNAL_CLI_PLUGINS,
|
|
@@ -35704,8 +35806,7 @@ var require_constants = __commonJS({
|
|
|
35704
35806
|
MAIN_ENTRY_NAME: () => MAIN_ENTRY_NAME,
|
|
35705
35807
|
OUTPUT_CONFIG_FILE: () => OUTPUT_CONFIG_FILE,
|
|
35706
35808
|
PLUGIN_SCHEMAS: () => PLUGIN_SCHEMAS,
|
|
35707
|
-
|
|
35708
|
-
ROUTE_MINIFEST_FILE: () => ROUTE_MINIFEST_FILE,
|
|
35809
|
+
ROUTE_MANIFEST_FILE: () => ROUTE_MANIFEST_FILE,
|
|
35709
35810
|
ROUTE_SPEC_FILE: () => ROUTE_SPEC_FILE,
|
|
35710
35811
|
SERVER_BUNDLE_DIRECTORY: () => SERVER_BUNDLE_DIRECTORY,
|
|
35711
35812
|
SERVER_DIR: () => SERVER_DIR,
|
|
@@ -35721,7 +35822,6 @@ var require_constants = __commonJS({
|
|
|
35721
35822
|
SHARED_DIR: () => SHARED_DIR
|
|
35722
35823
|
});
|
|
35723
35824
|
module2.exports = __toCommonJS2(constants_exports);
|
|
35724
|
-
var HMR_SOCK_PATH = "/webpack-hmr";
|
|
35725
35825
|
var ROUTE_SPEC_FILE = "route.json";
|
|
35726
35826
|
var MAIN_ENTRY_NAME = "main";
|
|
35727
35827
|
var LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
|
|
@@ -35737,8 +35837,7 @@ var require_constants = __commonJS({
|
|
|
35737
35837
|
var CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
|
|
35738
35838
|
var OUTPUT_CONFIG_FILE = "modern.config.json";
|
|
35739
35839
|
var DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
|
35740
|
-
var
|
|
35741
|
-
var ROUTE_MANIFEST = `_MODERNJS_ROUTE_MANIFEST`;
|
|
35840
|
+
var ROUTE_MANIFEST_FILE = "routes-manifest.json";
|
|
35742
35841
|
var LOADER_ROUTES_DIR = `loader-routes`;
|
|
35743
35842
|
var DEFAULT_DEV_HOST = "0.0.0.0";
|
|
35744
35843
|
var INTERNAL_APP_TOOLS_PLUGINS = {
|
|
@@ -35942,6 +36041,15 @@ var require_constants = __commonJS({
|
|
|
35942
36041
|
],
|
|
35943
36042
|
"@modern-js/plugin-nocode": []
|
|
35944
36043
|
};
|
|
36044
|
+
var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
|
|
36045
|
+
allowNamespaces: true,
|
|
36046
|
+
allExtensions: true,
|
|
36047
|
+
allowDeclareFields: true,
|
|
36048
|
+
// aligns Babel's behavior with TypeScript's default behavior.
|
|
36049
|
+
// https://babeljs.io/docs/en/babel-preset-typescript#optimizeconstenums
|
|
36050
|
+
optimizeConstEnums: true,
|
|
36051
|
+
isTSX: true
|
|
36052
|
+
};
|
|
35945
36053
|
}
|
|
35946
36054
|
});
|
|
35947
36055
|
|
|
@@ -37463,9 +37571,9 @@ var require_getServerConfig = __commonJS({
|
|
|
37463
37571
|
}
|
|
37464
37572
|
});
|
|
37465
37573
|
|
|
37466
|
-
// ../../../toolkit/utils/dist/
|
|
37467
|
-
var
|
|
37468
|
-
"../../../toolkit/utils/dist/
|
|
37574
|
+
// ../../../toolkit/utils/dist/resolve.js
|
|
37575
|
+
var require_resolve = __commonJS({
|
|
37576
|
+
"../../../toolkit/utils/dist/resolve.js"(exports, module2) {
|
|
37469
37577
|
var __defProp2 = Object.defineProperty;
|
|
37470
37578
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
37471
37579
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -37483,12 +37591,13 @@ var require_tryResolve = __commonJS({
|
|
|
37483
37591
|
return to;
|
|
37484
37592
|
};
|
|
37485
37593
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
37486
|
-
var
|
|
37487
|
-
__export2(
|
|
37594
|
+
var resolve_exports = {};
|
|
37595
|
+
__export2(resolve_exports, {
|
|
37596
|
+
getAntdMajorVersion: () => getAntdMajorVersion,
|
|
37488
37597
|
isPackageInstalled: () => isPackageInstalled,
|
|
37489
37598
|
tryResolve: () => tryResolve
|
|
37490
37599
|
});
|
|
37491
|
-
module2.exports = __toCommonJS2(
|
|
37600
|
+
module2.exports = __toCommonJS2(resolve_exports);
|
|
37492
37601
|
var import_ensureArray = require_ensureArray();
|
|
37493
37602
|
var tryResolve = (name, resolvePath) => {
|
|
37494
37603
|
let filePath = "";
|
|
@@ -37511,6 +37620,17 @@ var require_tryResolve = __commonJS({
|
|
|
37511
37620
|
return false;
|
|
37512
37621
|
}
|
|
37513
37622
|
};
|
|
37623
|
+
var getAntdMajorVersion = (appDirectory) => {
|
|
37624
|
+
try {
|
|
37625
|
+
const pkgJsonPath = require.resolve("antd/package.json", {
|
|
37626
|
+
paths: [appDirectory]
|
|
37627
|
+
});
|
|
37628
|
+
const { version } = require(pkgJsonPath);
|
|
37629
|
+
return Number(version.split(".")[0]);
|
|
37630
|
+
} catch (err) {
|
|
37631
|
+
return null;
|
|
37632
|
+
}
|
|
37633
|
+
};
|
|
37514
37634
|
}
|
|
37515
37635
|
});
|
|
37516
37636
|
|
|
@@ -37571,15 +37691,16 @@ var require_analyzeProject = __commonJS({
|
|
|
37571
37691
|
});
|
|
37572
37692
|
module2.exports = __toCommonJS2(analyzeProject_exports);
|
|
37573
37693
|
var path3 = __toESM2(require("path"));
|
|
37694
|
+
var import_commands = require_commands();
|
|
37574
37695
|
var import_compiled = require_compiled();
|
|
37575
37696
|
var isApiOnly = (appDirectory, entryDir) => __async2(void 0, null, function* () {
|
|
37576
37697
|
const srcDir = path3.join(appDirectory, entryDir != null ? entryDir : "src");
|
|
37577
37698
|
const existSrc = yield import_compiled.fs.pathExists(srcDir);
|
|
37578
|
-
const options = (0, import_compiled.minimist)(
|
|
37699
|
+
const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
|
|
37579
37700
|
return !existSrc || Boolean(options["api-only"]);
|
|
37580
37701
|
});
|
|
37581
37702
|
var isWebOnly = () => __async2(void 0, null, function* () {
|
|
37582
|
-
const options = (0, import_compiled.minimist)(
|
|
37703
|
+
const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
|
|
37583
37704
|
return Boolean(options["web-only"]);
|
|
37584
37705
|
});
|
|
37585
37706
|
}
|
|
@@ -37650,27 +37771,10 @@ var require_chainId = __commonJS({
|
|
|
37650
37771
|
},
|
|
37651
37772
|
/** Predefined rule groups */
|
|
37652
37773
|
ONE_OF: {
|
|
37653
|
-
JS: "js",
|
|
37654
|
-
TS: "ts",
|
|
37655
|
-
CSS: "css",
|
|
37656
|
-
LESS: "less",
|
|
37657
|
-
SASS: "sass",
|
|
37658
|
-
YAML: "yml",
|
|
37659
|
-
TOML: "toml",
|
|
37660
|
-
FALLBACK: "fallback",
|
|
37661
|
-
MARKDOWN: "markdown",
|
|
37662
|
-
BFF_CLIENT: "bff-client",
|
|
37663
|
-
CSS_MODULES: "css-modules",
|
|
37664
|
-
LESS_MODULES: "less-modules",
|
|
37665
|
-
SASS_MODULES: "sass-modules",
|
|
37666
37774
|
SVG: "svg",
|
|
37667
37775
|
SVG_URL: "svg-url",
|
|
37668
37776
|
SVG_ASSET: "svg-asset",
|
|
37669
|
-
SVG_INLINE: "svg-inline"
|
|
37670
|
-
ASSETS: "assets",
|
|
37671
|
-
ASSETS_URL: "assets-url",
|
|
37672
|
-
ASSETS_INLINE: "assets-inline",
|
|
37673
|
-
IMAGE_COMPRESS: "image-compress"
|
|
37777
|
+
SVG_INLINE: "svg-inline"
|
|
37674
37778
|
},
|
|
37675
37779
|
/** Predefined loaders */
|
|
37676
37780
|
USE: {
|
|
@@ -37844,205 +37948,319 @@ var require_version = __commonJS({
|
|
|
37844
37948
|
mod
|
|
37845
37949
|
));
|
|
37846
37950
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
37847
|
-
var __async2 = (__this, __arguments, generator) => {
|
|
37848
|
-
return new Promise((resolve, reject) => {
|
|
37849
|
-
var fulfilled = (value) => {
|
|
37850
|
-
try {
|
|
37851
|
-
step(generator.next(value));
|
|
37852
|
-
} catch (e) {
|
|
37853
|
-
reject(e);
|
|
37854
|
-
}
|
|
37855
|
-
};
|
|
37856
|
-
var rejected = (value) => {
|
|
37857
|
-
try {
|
|
37858
|
-
step(generator.throw(value));
|
|
37859
|
-
} catch (e) {
|
|
37860
|
-
reject(e);
|
|
37861
|
-
}
|
|
37862
|
-
};
|
|
37863
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37864
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
37865
|
-
});
|
|
37866
|
-
};
|
|
37867
|
-
var version_exports = {};
|
|
37868
|
-
__export2(version_exports, {
|
|
37869
|
-
getPnpmVersion: () => getPnpmVersion,
|
|
37870
|
-
isReact18: () => isReact182
|
|
37951
|
+
var __async2 = (__this, __arguments, generator) => {
|
|
37952
|
+
return new Promise((resolve, reject) => {
|
|
37953
|
+
var fulfilled = (value) => {
|
|
37954
|
+
try {
|
|
37955
|
+
step(generator.next(value));
|
|
37956
|
+
} catch (e) {
|
|
37957
|
+
reject(e);
|
|
37958
|
+
}
|
|
37959
|
+
};
|
|
37960
|
+
var rejected = (value) => {
|
|
37961
|
+
try {
|
|
37962
|
+
step(generator.throw(value));
|
|
37963
|
+
} catch (e) {
|
|
37964
|
+
reject(e);
|
|
37965
|
+
}
|
|
37966
|
+
};
|
|
37967
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37968
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
37969
|
+
});
|
|
37970
|
+
};
|
|
37971
|
+
var version_exports = {};
|
|
37972
|
+
__export2(version_exports, {
|
|
37973
|
+
getPnpmVersion: () => getPnpmVersion,
|
|
37974
|
+
isReact18: () => isReact182
|
|
37975
|
+
});
|
|
37976
|
+
module2.exports = __toCommonJS2(version_exports);
|
|
37977
|
+
var import_path4 = __toESM2(require("path"));
|
|
37978
|
+
var import_compiled = require_compiled();
|
|
37979
|
+
function getPnpmVersion() {
|
|
37980
|
+
return __async2(this, null, function* () {
|
|
37981
|
+
const { stdout } = yield (0, import_compiled.execa)("pnpm", ["--version"]);
|
|
37982
|
+
return stdout;
|
|
37983
|
+
});
|
|
37984
|
+
}
|
|
37985
|
+
var isReact182 = (cwd) => {
|
|
37986
|
+
const pkgPath = import_path4.default.join(cwd, "package.json");
|
|
37987
|
+
if (!import_compiled.fs.existsSync(pkgPath)) {
|
|
37988
|
+
return false;
|
|
37989
|
+
}
|
|
37990
|
+
const pkgInfo = JSON.parse(import_compiled.fs.readFileSync(pkgPath, "utf8"));
|
|
37991
|
+
const deps = __spreadValues2(__spreadValues2({}, pkgInfo.devDependencies), pkgInfo.dependencies);
|
|
37992
|
+
if (typeof deps.react !== "string") {
|
|
37993
|
+
return false;
|
|
37994
|
+
}
|
|
37995
|
+
return import_compiled.semver.satisfies(import_compiled.semver.minVersion(deps.react), ">=18.0.0");
|
|
37996
|
+
};
|
|
37997
|
+
}
|
|
37998
|
+
});
|
|
37999
|
+
|
|
38000
|
+
// ../../../toolkit/utils/dist/plugin.js
|
|
38001
|
+
var require_plugin = __commonJS({
|
|
38002
|
+
"../../../toolkit/utils/dist/plugin.js"(exports, module2) {
|
|
38003
|
+
var __defProp2 = Object.defineProperty;
|
|
38004
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38005
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38006
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38007
|
+
var __export2 = (target, all) => {
|
|
38008
|
+
for (var name in all)
|
|
38009
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38010
|
+
};
|
|
38011
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
38012
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
38013
|
+
for (let key of __getOwnPropNames2(from))
|
|
38014
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
38015
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
38016
|
+
}
|
|
38017
|
+
return to;
|
|
38018
|
+
};
|
|
38019
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38020
|
+
var plugin_exports = {};
|
|
38021
|
+
__export2(plugin_exports, {
|
|
38022
|
+
getInternalPlugins: () => getInternalPlugins
|
|
38023
|
+
});
|
|
38024
|
+
module2.exports = __toCommonJS2(plugin_exports);
|
|
38025
|
+
var import_constants3 = require_constants();
|
|
38026
|
+
var import_is = require_is();
|
|
38027
|
+
function getInternalPlugins(appDirectory, internalPlugins = import_constants3.INTERNAL_CLI_PLUGINS) {
|
|
38028
|
+
return [
|
|
38029
|
+
...Object.keys(internalPlugins).filter((name) => {
|
|
38030
|
+
const config = internalPlugins[name];
|
|
38031
|
+
if (typeof config !== "string" && config.forced === true) {
|
|
38032
|
+
return true;
|
|
38033
|
+
}
|
|
38034
|
+
return (0, import_is.isDepExists)(appDirectory, name);
|
|
38035
|
+
}).map((name) => {
|
|
38036
|
+
const config = internalPlugins[name];
|
|
38037
|
+
if (typeof config !== "string") {
|
|
38038
|
+
return config.path;
|
|
38039
|
+
} else {
|
|
38040
|
+
return config;
|
|
38041
|
+
}
|
|
38042
|
+
})
|
|
38043
|
+
];
|
|
38044
|
+
}
|
|
38045
|
+
}
|
|
38046
|
+
});
|
|
38047
|
+
|
|
38048
|
+
// ../../../toolkit/utils/dist/routes.js
|
|
38049
|
+
var require_routes = __commonJS({
|
|
38050
|
+
"../../../toolkit/utils/dist/routes.js"(exports, module2) {
|
|
38051
|
+
var __create2 = Object.create;
|
|
38052
|
+
var __defProp2 = Object.defineProperty;
|
|
38053
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38054
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38055
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
38056
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38057
|
+
var __export2 = (target, all) => {
|
|
38058
|
+
for (var name in all)
|
|
38059
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38060
|
+
};
|
|
38061
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
38062
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
38063
|
+
for (let key of __getOwnPropNames2(from))
|
|
38064
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
38065
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
38066
|
+
}
|
|
38067
|
+
return to;
|
|
38068
|
+
};
|
|
38069
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
38070
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
38071
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38072
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38073
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38074
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
38075
|
+
mod
|
|
38076
|
+
));
|
|
38077
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38078
|
+
var routes_exports = {};
|
|
38079
|
+
__export2(routes_exports, {
|
|
38080
|
+
getPathWithoutExt: () => getPathWithoutExt,
|
|
38081
|
+
getRouteId: () => getRouteId
|
|
38082
|
+
});
|
|
38083
|
+
module2.exports = __toCommonJS2(routes_exports);
|
|
38084
|
+
var import_path4 = __toESM2(require("path"));
|
|
38085
|
+
var import_path22 = require_path();
|
|
38086
|
+
var import_constants3 = require_constants();
|
|
38087
|
+
var getPathWithoutExt = (filename) => {
|
|
38088
|
+
const extname = import_path4.default.extname(filename);
|
|
38089
|
+
return filename.slice(0, -extname.length);
|
|
38090
|
+
};
|
|
38091
|
+
var getRouteId = (componentPath, routesDir, entryName) => {
|
|
38092
|
+
const relativePath = (0, import_path22.normalizeToPosixPath)(
|
|
38093
|
+
import_path4.default.relative(routesDir, componentPath)
|
|
38094
|
+
);
|
|
38095
|
+
const pathWithoutExt = getPathWithoutExt(relativePath);
|
|
38096
|
+
let id = ``;
|
|
38097
|
+
if (entryName === import_constants3.MAIN_ENTRY_NAME) {
|
|
38098
|
+
id = pathWithoutExt;
|
|
38099
|
+
} else {
|
|
38100
|
+
id = `${entryName}_${pathWithoutExt}`;
|
|
38101
|
+
}
|
|
38102
|
+
return id;
|
|
38103
|
+
};
|
|
38104
|
+
}
|
|
38105
|
+
});
|
|
38106
|
+
|
|
38107
|
+
// ../../../toolkit/utils/dist/testUtils.js
|
|
38108
|
+
var require_testUtils = __commonJS({
|
|
38109
|
+
"../../../toolkit/utils/dist/testUtils.js"(exports, module2) {
|
|
38110
|
+
var __defProp2 = Object.defineProperty;
|
|
38111
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38112
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38113
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38114
|
+
var __export2 = (target, all) => {
|
|
38115
|
+
for (var name in all)
|
|
38116
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38117
|
+
};
|
|
38118
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
38119
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
38120
|
+
for (let key of __getOwnPropNames2(from))
|
|
38121
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
38122
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
38123
|
+
}
|
|
38124
|
+
return to;
|
|
38125
|
+
};
|
|
38126
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38127
|
+
var testUtils_exports = {};
|
|
38128
|
+
__export2(testUtils_exports, {
|
|
38129
|
+
initSnapshotSerializer: () => initSnapshotSerializer
|
|
38130
|
+
});
|
|
38131
|
+
module2.exports = __toCommonJS2(testUtils_exports);
|
|
38132
|
+
var initSnapshotSerializer = (root) => {
|
|
38133
|
+
expect.addSnapshotSerializer({
|
|
38134
|
+
test: (val) => typeof val === "string" && (val.includes("modern.js") || val.includes("node_modules") || val.includes(root)),
|
|
38135
|
+
print: (val) => (
|
|
38136
|
+
// eslint-disable-next-line no-nested-ternary
|
|
38137
|
+
typeof val === "string" ? (
|
|
38138
|
+
// eslint-disable-next-line no-nested-ternary
|
|
38139
|
+
val.includes("node_modules") ? `"${val.replace(/.+node_modules/, ``).replace(/\\/g, "/")}"` : val.includes("modern.js") ? `"${val.replace(/.+modern\.js/, ``).replace(/\\/g, "/")}"` : `"${val.replace(root, "").replace(/\\/g, "/")}"`
|
|
38140
|
+
) : val
|
|
38141
|
+
)
|
|
38142
|
+
});
|
|
38143
|
+
};
|
|
38144
|
+
}
|
|
38145
|
+
});
|
|
38146
|
+
|
|
38147
|
+
// ../../../toolkit/utils/dist/getCoreJsVersion.js
|
|
38148
|
+
var require_getCoreJsVersion = __commonJS({
|
|
38149
|
+
"../../../toolkit/utils/dist/getCoreJsVersion.js"(exports, module2) {
|
|
38150
|
+
var __create2 = Object.create;
|
|
38151
|
+
var __defProp2 = Object.defineProperty;
|
|
38152
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38153
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38154
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
38155
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38156
|
+
var __export2 = (target, all) => {
|
|
38157
|
+
for (var name in all)
|
|
38158
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38159
|
+
};
|
|
38160
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
38161
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
38162
|
+
for (let key of __getOwnPropNames2(from))
|
|
38163
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
38164
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
38165
|
+
}
|
|
38166
|
+
return to;
|
|
38167
|
+
};
|
|
38168
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
38169
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
38170
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38171
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38172
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38173
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
38174
|
+
mod
|
|
38175
|
+
));
|
|
38176
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38177
|
+
var getCoreJsVersion_exports = {};
|
|
38178
|
+
__export2(getCoreJsVersion_exports, {
|
|
38179
|
+
getCoreJsVersion: () => getCoreJsVersion
|
|
38180
|
+
});
|
|
38181
|
+
module2.exports = __toCommonJS2(getCoreJsVersion_exports);
|
|
38182
|
+
var fs3 = __toESM2(require_fs_extra());
|
|
38183
|
+
var getCoreJsVersion = (corejsPkgPath) => {
|
|
38184
|
+
try {
|
|
38185
|
+
const { version } = fs3.readJSONSync(corejsPkgPath);
|
|
38186
|
+
const [major, minor] = version.split(".");
|
|
38187
|
+
return `${major}.${minor}`;
|
|
38188
|
+
} catch (err) {
|
|
38189
|
+
return "3";
|
|
38190
|
+
}
|
|
38191
|
+
};
|
|
38192
|
+
}
|
|
38193
|
+
});
|
|
38194
|
+
|
|
38195
|
+
// ../../../toolkit/utils/dist/react.js
|
|
38196
|
+
var require_react = __commonJS({
|
|
38197
|
+
"../../../toolkit/utils/dist/react.js"(exports, module2) {
|
|
38198
|
+
var __create2 = Object.create;
|
|
38199
|
+
var __defProp2 = Object.defineProperty;
|
|
38200
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38201
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38202
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
38203
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
38204
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38205
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
38206
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
38207
|
+
var __spreadValues2 = (a, b) => {
|
|
38208
|
+
for (var prop in b || (b = {}))
|
|
38209
|
+
if (__hasOwnProp2.call(b, prop))
|
|
38210
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
38211
|
+
if (__getOwnPropSymbols2)
|
|
38212
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
38213
|
+
if (__propIsEnum2.call(b, prop))
|
|
38214
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
38215
|
+
}
|
|
38216
|
+
return a;
|
|
38217
|
+
};
|
|
38218
|
+
var __export2 = (target, all) => {
|
|
38219
|
+
for (var name in all)
|
|
38220
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38221
|
+
};
|
|
38222
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
38223
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
38224
|
+
for (let key of __getOwnPropNames2(from))
|
|
38225
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
38226
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
38227
|
+
}
|
|
38228
|
+
return to;
|
|
38229
|
+
};
|
|
38230
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
38231
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
38232
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38233
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38234
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38235
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
38236
|
+
mod
|
|
38237
|
+
));
|
|
38238
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38239
|
+
var react_exports = {};
|
|
38240
|
+
__export2(react_exports, {
|
|
38241
|
+
isBeyondReact17: () => isBeyondReact17
|
|
37871
38242
|
});
|
|
37872
|
-
module2.exports = __toCommonJS2(
|
|
38243
|
+
module2.exports = __toCommonJS2(react_exports);
|
|
37873
38244
|
var import_path4 = __toESM2(require("path"));
|
|
37874
|
-
var
|
|
37875
|
-
|
|
37876
|
-
return __async2(this, null, function* () {
|
|
37877
|
-
const { stdout } = yield (0, import_compiled.execa)("pnpm", ["--version"]);
|
|
37878
|
-
return stdout;
|
|
37879
|
-
});
|
|
37880
|
-
}
|
|
37881
|
-
var isReact182 = (cwd) => {
|
|
38245
|
+
var import__ = require_dist();
|
|
38246
|
+
var isBeyondReact17 = (cwd) => {
|
|
37882
38247
|
const pkgPath = import_path4.default.join(cwd, "package.json");
|
|
37883
|
-
if (!
|
|
38248
|
+
if (!import__.fs.existsSync(pkgPath)) {
|
|
37884
38249
|
return false;
|
|
37885
38250
|
}
|
|
37886
|
-
const pkgInfo = JSON.parse(
|
|
38251
|
+
const pkgInfo = JSON.parse(import__.fs.readFileSync(pkgPath, "utf8"));
|
|
37887
38252
|
const deps = __spreadValues2(__spreadValues2({}, pkgInfo.devDependencies), pkgInfo.dependencies);
|
|
37888
38253
|
if (typeof deps.react !== "string") {
|
|
37889
38254
|
return false;
|
|
37890
38255
|
}
|
|
37891
|
-
return
|
|
37892
|
-
};
|
|
37893
|
-
}
|
|
37894
|
-
});
|
|
37895
|
-
|
|
37896
|
-
// ../../../toolkit/utils/dist/plugin.js
|
|
37897
|
-
var require_plugin = __commonJS({
|
|
37898
|
-
"../../../toolkit/utils/dist/plugin.js"(exports, module2) {
|
|
37899
|
-
var __defProp2 = Object.defineProperty;
|
|
37900
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
37901
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
37902
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
37903
|
-
var __export2 = (target, all) => {
|
|
37904
|
-
for (var name in all)
|
|
37905
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
37906
|
-
};
|
|
37907
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
37908
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
37909
|
-
for (let key of __getOwnPropNames2(from))
|
|
37910
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
37911
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
37912
|
-
}
|
|
37913
|
-
return to;
|
|
37914
|
-
};
|
|
37915
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
37916
|
-
var plugin_exports = {};
|
|
37917
|
-
__export2(plugin_exports, {
|
|
37918
|
-
getInternalPlugins: () => getInternalPlugins
|
|
37919
|
-
});
|
|
37920
|
-
module2.exports = __toCommonJS2(plugin_exports);
|
|
37921
|
-
var import_constants3 = require_constants();
|
|
37922
|
-
var import_is = require_is();
|
|
37923
|
-
function getInternalPlugins(appDirectory, internalPlugins = import_constants3.INTERNAL_CLI_PLUGINS) {
|
|
37924
|
-
return [
|
|
37925
|
-
...Object.keys(internalPlugins).filter((name) => {
|
|
37926
|
-
const config = internalPlugins[name];
|
|
37927
|
-
if (typeof config !== "string" && config.forced === true) {
|
|
37928
|
-
return true;
|
|
37929
|
-
}
|
|
37930
|
-
return (0, import_is.isDepExists)(appDirectory, name);
|
|
37931
|
-
}).map((name) => {
|
|
37932
|
-
const config = internalPlugins[name];
|
|
37933
|
-
if (typeof config !== "string") {
|
|
37934
|
-
return config.path;
|
|
37935
|
-
} else {
|
|
37936
|
-
return config;
|
|
37937
|
-
}
|
|
37938
|
-
})
|
|
37939
|
-
];
|
|
37940
|
-
}
|
|
37941
|
-
}
|
|
37942
|
-
});
|
|
37943
|
-
|
|
37944
|
-
// ../../../toolkit/utils/dist/routes.js
|
|
37945
|
-
var require_routes = __commonJS({
|
|
37946
|
-
"../../../toolkit/utils/dist/routes.js"(exports, module2) {
|
|
37947
|
-
var __create2 = Object.create;
|
|
37948
|
-
var __defProp2 = Object.defineProperty;
|
|
37949
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
37950
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
37951
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
37952
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
37953
|
-
var __export2 = (target, all) => {
|
|
37954
|
-
for (var name in all)
|
|
37955
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
37956
|
-
};
|
|
37957
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
37958
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
37959
|
-
for (let key of __getOwnPropNames2(from))
|
|
37960
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
37961
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
37962
|
-
}
|
|
37963
|
-
return to;
|
|
37964
|
-
};
|
|
37965
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
37966
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
37967
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
37968
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37969
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37970
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
37971
|
-
mod
|
|
37972
|
-
));
|
|
37973
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
37974
|
-
var routes_exports = {};
|
|
37975
|
-
__export2(routes_exports, {
|
|
37976
|
-
getPathWithoutExt: () => getPathWithoutExt,
|
|
37977
|
-
getRouteId: () => getRouteId
|
|
37978
|
-
});
|
|
37979
|
-
module2.exports = __toCommonJS2(routes_exports);
|
|
37980
|
-
var import_path4 = __toESM2(require("path"));
|
|
37981
|
-
var import_path22 = require_path();
|
|
37982
|
-
var import_constants3 = require_constants();
|
|
37983
|
-
var getPathWithoutExt = (filename) => {
|
|
37984
|
-
const extname = import_path4.default.extname(filename);
|
|
37985
|
-
return filename.slice(0, -extname.length);
|
|
37986
|
-
};
|
|
37987
|
-
var getRouteId = (componentPath, routesDir, entryName) => {
|
|
37988
|
-
const relativePath = (0, import_path22.normalizeToPosixPath)(
|
|
37989
|
-
import_path4.default.relative(routesDir, componentPath)
|
|
37990
|
-
);
|
|
37991
|
-
const pathWithoutExt = getPathWithoutExt(relativePath);
|
|
37992
|
-
let id = ``;
|
|
37993
|
-
if (entryName === import_constants3.MAIN_ENTRY_NAME) {
|
|
37994
|
-
id = pathWithoutExt;
|
|
37995
|
-
} else {
|
|
37996
|
-
id = `${entryName}_${pathWithoutExt}`;
|
|
37997
|
-
}
|
|
37998
|
-
return id;
|
|
37999
|
-
};
|
|
38000
|
-
}
|
|
38001
|
-
});
|
|
38002
|
-
|
|
38003
|
-
// ../../../toolkit/utils/dist/testUtils.js
|
|
38004
|
-
var require_testUtils = __commonJS({
|
|
38005
|
-
"../../../toolkit/utils/dist/testUtils.js"(exports, module2) {
|
|
38006
|
-
var __defProp2 = Object.defineProperty;
|
|
38007
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38008
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38009
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38010
|
-
var __export2 = (target, all) => {
|
|
38011
|
-
for (var name in all)
|
|
38012
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38013
|
-
};
|
|
38014
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
38015
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
38016
|
-
for (let key of __getOwnPropNames2(from))
|
|
38017
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
38018
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
38019
|
-
}
|
|
38020
|
-
return to;
|
|
38021
|
-
};
|
|
38022
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38023
|
-
var testUtils_exports = {};
|
|
38024
|
-
__export2(testUtils_exports, {
|
|
38025
|
-
initSnapshotSerializer: () => initSnapshotSerializer
|
|
38026
|
-
});
|
|
38027
|
-
module2.exports = __toCommonJS2(testUtils_exports);
|
|
38028
|
-
var initSnapshotSerializer = (root) => {
|
|
38029
|
-
expect.addSnapshotSerializer({
|
|
38030
|
-
test: (val) => typeof val === "string" && (val.includes("modern.js") || val.includes("node_modules") || val.includes(root)),
|
|
38031
|
-
print: (val) => (
|
|
38032
|
-
// eslint-disable-next-line no-nested-ternary
|
|
38033
|
-
typeof val === "string" ? (
|
|
38034
|
-
// eslint-disable-next-line no-nested-ternary
|
|
38035
|
-
val.includes("node_modules") ? `"${val.replace(/.+node_modules/, ``).replace(/\\/g, "/")}"` : val.includes("modern.js") ? `"${val.replace(/.+modern\.js/, ``).replace(/\\/g, "/")}"` : `"${val.replace(root, "").replace(/\\/g, "/")}"`
|
|
38036
|
-
) : val
|
|
38037
|
-
)
|
|
38038
|
-
});
|
|
38256
|
+
return import__.semver.satisfies(import__.semver.minVersion(deps.react), ">=17.0.0");
|
|
38039
38257
|
};
|
|
38040
38258
|
}
|
|
38041
38259
|
});
|
|
38042
38260
|
|
|
38043
|
-
// ../../../toolkit/utils/dist/
|
|
38044
|
-
var
|
|
38045
|
-
"../../../toolkit/utils/dist/
|
|
38261
|
+
// ../../../toolkit/utils/dist/getTargetDir.js
|
|
38262
|
+
var require_getTargetDir = __commonJS({
|
|
38263
|
+
"../../../toolkit/utils/dist/getTargetDir.js"(exports, module2) {
|
|
38046
38264
|
var __create2 = Object.create;
|
|
38047
38265
|
var __defProp2 = Object.defineProperty;
|
|
38048
38266
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -38070,33 +38288,26 @@ var require_getCoreJsVersion = __commonJS({
|
|
|
38070
38288
|
mod
|
|
38071
38289
|
));
|
|
38072
38290
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38073
|
-
var
|
|
38074
|
-
__export2(
|
|
38075
|
-
|
|
38291
|
+
var getTargetDir_exports = {};
|
|
38292
|
+
__export2(getTargetDir_exports, {
|
|
38293
|
+
getTargetDir: () => getTargetDir
|
|
38076
38294
|
});
|
|
38077
|
-
module2.exports = __toCommonJS2(
|
|
38078
|
-
var
|
|
38079
|
-
var
|
|
38080
|
-
|
|
38081
|
-
|
|
38082
|
-
const [major, minor] = version.split(".");
|
|
38083
|
-
return `${major}.${minor}`;
|
|
38084
|
-
} catch (err) {
|
|
38085
|
-
return "3";
|
|
38086
|
-
}
|
|
38295
|
+
module2.exports = __toCommonJS2(getTargetDir_exports);
|
|
38296
|
+
var path3 = __toESM2(require("path"));
|
|
38297
|
+
var getTargetDir = (from, baseDir, targetBaseDir) => {
|
|
38298
|
+
const relativePath = path3.relative(baseDir, from);
|
|
38299
|
+
return path3.resolve(targetBaseDir, relativePath);
|
|
38087
38300
|
};
|
|
38088
38301
|
}
|
|
38089
38302
|
});
|
|
38090
38303
|
|
|
38091
|
-
// ../../../toolkit/utils/dist/
|
|
38092
|
-
var
|
|
38093
|
-
"../../../toolkit/utils/dist/
|
|
38094
|
-
var __create2 = Object.create;
|
|
38304
|
+
// ../../../toolkit/utils/dist/babel.js
|
|
38305
|
+
var require_babel = __commonJS({
|
|
38306
|
+
"../../../toolkit/utils/dist/babel.js"(exports, module2) {
|
|
38095
38307
|
var __defProp2 = Object.defineProperty;
|
|
38096
38308
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38097
38309
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38098
38310
|
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
38099
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
38100
38311
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38101
38312
|
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
38102
38313
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -38123,76 +38334,106 @@ var require_react = __commonJS({
|
|
|
38123
38334
|
}
|
|
38124
38335
|
return to;
|
|
38125
38336
|
};
|
|
38126
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
38127
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
38128
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
38129
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38130
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38131
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
38132
|
-
mod
|
|
38133
|
-
));
|
|
38134
38337
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
38135
|
-
var
|
|
38136
|
-
__export2(
|
|
38137
|
-
|
|
38338
|
+
var babel_exports = {};
|
|
38339
|
+
__export2(babel_exports, {
|
|
38340
|
+
applyUserBabelConfig: () => applyUserBabelConfig,
|
|
38341
|
+
getBabelUtils: () => getBabelUtils
|
|
38138
38342
|
});
|
|
38139
|
-
module2.exports = __toCommonJS2(
|
|
38140
|
-
var import_path4 =
|
|
38141
|
-
var
|
|
38142
|
-
var
|
|
38143
|
-
|
|
38144
|
-
|
|
38145
|
-
|
|
38343
|
+
module2.exports = __toCommonJS2(babel_exports);
|
|
38344
|
+
var import_path4 = require("path");
|
|
38345
|
+
var import_applyOptionsChain = require_applyOptionsChain();
|
|
38346
|
+
var import_ensureArray = require_ensureArray();
|
|
38347
|
+
var import_path22 = require_path();
|
|
38348
|
+
var formatPath = (originPath) => {
|
|
38349
|
+
if ((0, import_path4.isAbsolute)(originPath)) {
|
|
38350
|
+
return originPath.split(import_path4.sep).join("/");
|
|
38146
38351
|
}
|
|
38147
|
-
|
|
38148
|
-
|
|
38149
|
-
|
|
38150
|
-
|
|
38352
|
+
return originPath;
|
|
38353
|
+
};
|
|
38354
|
+
var getPluginItemName = (item) => {
|
|
38355
|
+
if (typeof item === "string") {
|
|
38356
|
+
return formatPath(item);
|
|
38151
38357
|
}
|
|
38152
|
-
|
|
38358
|
+
if (Array.isArray(item) && typeof item[0] === "string") {
|
|
38359
|
+
return formatPath(item[0]);
|
|
38360
|
+
}
|
|
38361
|
+
return null;
|
|
38153
38362
|
};
|
|
38154
|
-
|
|
38155
|
-
|
|
38156
|
-
|
|
38157
|
-
|
|
38158
|
-
|
|
38159
|
-
|
|
38160
|
-
var __create2 = Object.create;
|
|
38161
|
-
var __defProp2 = Object.defineProperty;
|
|
38162
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
38163
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
38164
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
38165
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
38166
|
-
var __export2 = (target, all) => {
|
|
38167
|
-
for (var name in all)
|
|
38168
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
38363
|
+
var addPlugins = (plugins, config) => {
|
|
38364
|
+
if (config.plugins) {
|
|
38365
|
+
config.plugins.push(...plugins);
|
|
38366
|
+
} else {
|
|
38367
|
+
config.plugins = plugins;
|
|
38368
|
+
}
|
|
38169
38369
|
};
|
|
38170
|
-
var
|
|
38171
|
-
if (
|
|
38172
|
-
|
|
38173
|
-
|
|
38174
|
-
|
|
38370
|
+
var addPresets = (presets, config) => {
|
|
38371
|
+
if (config.presets) {
|
|
38372
|
+
config.presets.push(...presets);
|
|
38373
|
+
} else {
|
|
38374
|
+
config.presets = presets;
|
|
38175
38375
|
}
|
|
38176
|
-
return to;
|
|
38177
38376
|
};
|
|
38178
|
-
var
|
|
38179
|
-
|
|
38180
|
-
|
|
38181
|
-
|
|
38182
|
-
|
|
38183
|
-
|
|
38184
|
-
|
|
38185
|
-
|
|
38186
|
-
|
|
38187
|
-
|
|
38188
|
-
|
|
38189
|
-
|
|
38190
|
-
}
|
|
38191
|
-
|
|
38192
|
-
|
|
38193
|
-
|
|
38194
|
-
|
|
38195
|
-
|
|
38377
|
+
var removePlugins = (plugins, config) => {
|
|
38378
|
+
if (!config.plugins) {
|
|
38379
|
+
return;
|
|
38380
|
+
}
|
|
38381
|
+
const removeList = (0, import_ensureArray.ensureArray)(plugins);
|
|
38382
|
+
config.plugins = config.plugins.filter((item) => {
|
|
38383
|
+
const name = getPluginItemName(item);
|
|
38384
|
+
if (name) {
|
|
38385
|
+
return !removeList.find((removeItem) => name.includes(removeItem));
|
|
38386
|
+
}
|
|
38387
|
+
return true;
|
|
38388
|
+
});
|
|
38389
|
+
};
|
|
38390
|
+
var removePresets = (presets, config) => {
|
|
38391
|
+
if (!config.presets) {
|
|
38392
|
+
return;
|
|
38393
|
+
}
|
|
38394
|
+
const removeList = (0, import_ensureArray.ensureArray)(presets);
|
|
38395
|
+
config.presets = config.presets.filter((item) => {
|
|
38396
|
+
const name = getPluginItemName(item);
|
|
38397
|
+
if (name) {
|
|
38398
|
+
return !removeList.find((removeItem) => name.includes(removeItem));
|
|
38399
|
+
}
|
|
38400
|
+
return true;
|
|
38401
|
+
});
|
|
38402
|
+
};
|
|
38403
|
+
var modifyPresetOptions = (presetName, options, presets = []) => {
|
|
38404
|
+
presets.forEach((preset, index) => {
|
|
38405
|
+
if (Array.isArray(preset)) {
|
|
38406
|
+
if (typeof preset[0] === "string" && (0, import_path22.normalizeToPosixPath)(preset[0]).includes(presetName)) {
|
|
38407
|
+
preset[1] = __spreadValues2(__spreadValues2({}, preset[1] || {}), options);
|
|
38408
|
+
}
|
|
38409
|
+
} else if (typeof preset === "string" && (0, import_path22.normalizeToPosixPath)(preset).includes(presetName)) {
|
|
38410
|
+
presets[index] = [preset, options];
|
|
38411
|
+
}
|
|
38412
|
+
});
|
|
38413
|
+
};
|
|
38414
|
+
var getBabelUtils = (config) => {
|
|
38415
|
+
const noop = () => {
|
|
38416
|
+
};
|
|
38417
|
+
return {
|
|
38418
|
+
addPlugins: (plugins) => addPlugins(plugins, config),
|
|
38419
|
+
addPresets: (presets) => addPresets(presets, config),
|
|
38420
|
+
removePlugins: (plugins) => removePlugins(plugins, config),
|
|
38421
|
+
removePresets: (presets) => removePresets(presets, config),
|
|
38422
|
+
// `addIncludes` and `addExcludes` are noop functions by default,
|
|
38423
|
+
// It can be overridden by `extraBabelUtils`.
|
|
38424
|
+
addIncludes: noop,
|
|
38425
|
+
addExcludes: noop,
|
|
38426
|
+
// Compat `presetEnvOptions` and `presetReactOptions` in Eden.
|
|
38427
|
+
modifyPresetEnvOptions: (options) => modifyPresetOptions("@babel/preset-env", options, config.presets || []),
|
|
38428
|
+
modifyPresetReactOptions: (options) => modifyPresetOptions("@babel/preset-react", options, config.presets || [])
|
|
38429
|
+
};
|
|
38430
|
+
};
|
|
38431
|
+
var applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
|
|
38432
|
+
if (userBabelConfig) {
|
|
38433
|
+
const babelUtils = __spreadValues2(__spreadValues2({}, getBabelUtils(defaultOptions)), extraBabelUtils);
|
|
38434
|
+
return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
|
|
38435
|
+
}
|
|
38436
|
+
return defaultOptions;
|
|
38196
38437
|
};
|
|
38197
38438
|
}
|
|
38198
38439
|
});
|
|
@@ -38218,7 +38459,6 @@ var require_dist = __commonJS({
|
|
|
38218
38459
|
module2.exports = __toCommonJS2(src_exports2);
|
|
38219
38460
|
__reExport(src_exports2, require_compiled(), module2.exports);
|
|
38220
38461
|
__reExport(src_exports2, require_commands(), module2.exports);
|
|
38221
|
-
__reExport(src_exports2, require_format(), module2.exports);
|
|
38222
38462
|
__reExport(src_exports2, require_FileSizeReporter(), module2.exports);
|
|
38223
38463
|
__reExport(src_exports2, require_printBuildError(), module2.exports);
|
|
38224
38464
|
__reExport(src_exports2, require_debug2(), module2.exports);
|
|
@@ -38250,7 +38490,7 @@ var require_dist = __commonJS({
|
|
|
38250
38490
|
__reExport(src_exports2, require_wait(), module2.exports);
|
|
38251
38491
|
__reExport(src_exports2, require_emptyDir(), module2.exports);
|
|
38252
38492
|
__reExport(src_exports2, require_getServerConfig(), module2.exports);
|
|
38253
|
-
__reExport(src_exports2,
|
|
38493
|
+
__reExport(src_exports2, require_resolve(), module2.exports);
|
|
38254
38494
|
__reExport(src_exports2, require_analyzeProject(), module2.exports);
|
|
38255
38495
|
__reExport(src_exports2, require_chainId(), module2.exports);
|
|
38256
38496
|
__reExport(src_exports2, require_version(), module2.exports);
|
|
@@ -38260,6 +38500,7 @@ var require_dist = __commonJS({
|
|
|
38260
38500
|
__reExport(src_exports2, require_getCoreJsVersion(), module2.exports);
|
|
38261
38501
|
__reExport(src_exports2, require_react(), module2.exports);
|
|
38262
38502
|
__reExport(src_exports2, require_getTargetDir(), module2.exports);
|
|
38503
|
+
__reExport(src_exports2, require_babel(), module2.exports);
|
|
38263
38504
|
}
|
|
38264
38505
|
});
|
|
38265
38506
|
|
|
@@ -67277,7 +67518,7 @@ var require_compiled2 = __commonJS({
|
|
|
67277
67518
|
});
|
|
67278
67519
|
|
|
67279
67520
|
// ../../../../node_modules/.pnpm/@modern-js+utils@1.21.5/node_modules/@modern-js/utils/dist/format.js
|
|
67280
|
-
var
|
|
67521
|
+
var require_format = __commonJS({
|
|
67281
67522
|
"../../../../node_modules/.pnpm/@modern-js+utils@1.21.5/node_modules/@modern-js/utils/dist/format.js"(exports) {
|
|
67282
67523
|
"use strict";
|
|
67283
67524
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -68927,7 +69168,7 @@ var require_ssr = __commonJS({
|
|
|
68927
69168
|
});
|
|
68928
69169
|
|
|
68929
69170
|
// ../../../../node_modules/.pnpm/@modern-js+utils@1.21.5/node_modules/@modern-js/utils/dist/tryResolve.js
|
|
68930
|
-
var
|
|
69171
|
+
var require_tryResolve = __commonJS({
|
|
68931
69172
|
"../../../../node_modules/.pnpm/@modern-js+utils@1.21.5/node_modules/@modern-js/utils/dist/tryResolve.js"(exports) {
|
|
68932
69173
|
"use strict";
|
|
68933
69174
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -69238,7 +69479,7 @@ var require_dist2 = __commonJS({
|
|
|
69238
69479
|
};
|
|
69239
69480
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69240
69481
|
__exportStar(require_compiled2(), exports);
|
|
69241
|
-
__exportStar(
|
|
69482
|
+
__exportStar(require_format(), exports);
|
|
69242
69483
|
__exportStar(require_FileSizeReporter2(), exports);
|
|
69243
69484
|
__exportStar(require_printBuildError2(), exports);
|
|
69244
69485
|
__exportStar(require_debug4(), exports);
|
|
@@ -69270,7 +69511,7 @@ var require_dist2 = __commonJS({
|
|
|
69270
69511
|
__exportStar(require_emptyDir2(), exports);
|
|
69271
69512
|
__exportStar(require_getServerConfig2(), exports);
|
|
69272
69513
|
__exportStar(require_ssr(), exports);
|
|
69273
|
-
__exportStar(
|
|
69514
|
+
__exportStar(require_tryResolve(), exports);
|
|
69274
69515
|
__exportStar(require_analyzeProject2(), exports);
|
|
69275
69516
|
__exportStar(require_chainId2(), exports);
|
|
69276
69517
|
__exportStar(require_version2(), exports);
|
|
@@ -139670,6 +139911,7 @@ var ZH_LOCALE = {
|
|
|
139670
139911
|
self: "请选择你想创建的工程类型",
|
|
139671
139912
|
mwa: "Web 应用",
|
|
139672
139913
|
module: "Npm 模块",
|
|
139914
|
+
doc: "文档站",
|
|
139673
139915
|
monorepo: "Monorepo",
|
|
139674
139916
|
custom: "自定义",
|
|
139675
139917
|
default: "默认"
|
|
@@ -139766,6 +140008,7 @@ var EN_LOCALE = {
|
|
|
139766
140008
|
self: "Please select the solution you want to create",
|
|
139767
140009
|
mwa: "Web App",
|
|
139768
140010
|
module: "Npm Module",
|
|
140011
|
+
doc: "Doc Site",
|
|
139769
140012
|
monorepo: "Monorepo",
|
|
139770
140013
|
custom: "Custom Solution",
|
|
139771
140014
|
default: "Default"
|
|
@@ -139865,6 +140108,7 @@ var localeKeys = i18n.init("zh", { zh: ZH_LOCALE, en: EN_LOCALE });
|
|
|
139865
140108
|
var Solution = /* @__PURE__ */ ((Solution2) => {
|
|
139866
140109
|
Solution2["MWA"] = "mwa";
|
|
139867
140110
|
Solution2["Module"] = "module";
|
|
140111
|
+
Solution2["Doc"] = "doc";
|
|
139868
140112
|
Solution2["Monorepo"] = "monorepo";
|
|
139869
140113
|
return Solution2;
|
|
139870
140114
|
})(Solution || {});
|
|
@@ -139877,6 +140121,10 @@ var SolutionToolsMap = {
|
|
|
139877
140121
|
"module"
|
|
139878
140122
|
/* Module */
|
|
139879
140123
|
]: "@modern-js/module-tools",
|
|
140124
|
+
[
|
|
140125
|
+
"doc"
|
|
140126
|
+
/* Doc */
|
|
140127
|
+
]: "@modern-js/doc-tools",
|
|
139880
140128
|
[
|
|
139881
140129
|
"monorepo"
|
|
139882
140130
|
/* Monorepo */
|