@modern-js/monorepo-generator 3.1.0 → 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 +1014 -911
- package/package.json +9 -9
- package/templates/base-template/package.json.handlebars +1 -1
package/dist/index.js
CHANGED
@@ -134446,55 +134446,58 @@ var require_recursive_readdir2 = __commonJS({
|
|
134446
134446
|
var require_commander2 = __commonJS({
|
134447
134447
|
"../../../toolkit/utils/compiled/commander/index.js"(exports, module2) {
|
134448
134448
|
(() => {
|
134449
|
-
var
|
134449
|
+
var t = { 81: (t2) => {
|
134450
134450
|
"use strict";
|
134451
|
-
|
134452
|
-
}, 361: (
|
134451
|
+
t2.exports = require("child_process");
|
134452
|
+
}, 361: (t2) => {
|
134453
134453
|
"use strict";
|
134454
|
-
|
134455
|
-
}, 147: (
|
134454
|
+
t2.exports = require("events");
|
134455
|
+
}, 147: (t2) => {
|
134456
134456
|
"use strict";
|
134457
|
-
|
134458
|
-
}, 17: (
|
134457
|
+
t2.exports = require("fs");
|
134458
|
+
}, 17: (t2) => {
|
134459
134459
|
"use strict";
|
134460
|
-
|
134461
|
-
},
|
134462
|
-
|
134463
|
-
|
134464
|
-
|
134465
|
-
const {
|
134466
|
-
const {
|
134467
|
-
|
134468
|
-
|
134469
|
-
|
134470
|
-
t2.
|
134471
|
-
|
134472
|
-
|
134473
|
-
|
134474
|
-
|
134475
|
-
|
134476
|
-
|
134477
|
-
|
134460
|
+
t2.exports = require("path");
|
134461
|
+
}, 282: (t2) => {
|
134462
|
+
"use strict";
|
134463
|
+
t2.exports = require("process");
|
134464
|
+
}, 632: (t2, e2, i2) => {
|
134465
|
+
const { Argument: n } = i2(535);
|
134466
|
+
const { Command: s } = i2(302);
|
134467
|
+
const { CommanderError: r, InvalidArgumentError: o } = i2(796);
|
134468
|
+
const { Help: a } = i2(519);
|
134469
|
+
const { Option: l } = i2(437);
|
134470
|
+
e2 = t2.exports = new s();
|
134471
|
+
e2.program = e2;
|
134472
|
+
e2.Argument = n;
|
134473
|
+
e2.Command = s;
|
134474
|
+
e2.CommanderError = r;
|
134475
|
+
e2.Help = a;
|
134476
|
+
e2.InvalidArgumentError = o;
|
134477
|
+
e2.InvalidOptionArgumentError = o;
|
134478
|
+
e2.Option = l;
|
134479
|
+
}, 535: (t2, e2, i2) => {
|
134480
|
+
const { InvalidArgumentError: n } = i2(796);
|
134478
134481
|
class Argument {
|
134479
|
-
constructor(
|
134480
|
-
this.description =
|
134482
|
+
constructor(t3, e3) {
|
134483
|
+
this.description = e3 || "";
|
134481
134484
|
this.variadic = false;
|
134482
134485
|
this.parseArg = void 0;
|
134483
134486
|
this.defaultValue = void 0;
|
134484
134487
|
this.defaultValueDescription = void 0;
|
134485
134488
|
this.argChoices = void 0;
|
134486
|
-
switch (
|
134489
|
+
switch (t3[0]) {
|
134487
134490
|
case "<":
|
134488
134491
|
this.required = true;
|
134489
|
-
this._name =
|
134492
|
+
this._name = t3.slice(1, -1);
|
134490
134493
|
break;
|
134491
134494
|
case "[":
|
134492
134495
|
this.required = false;
|
134493
|
-
this._name =
|
134496
|
+
this._name = t3.slice(1, -1);
|
134494
134497
|
break;
|
134495
134498
|
default:
|
134496
134499
|
this.required = true;
|
134497
|
-
this._name =
|
134500
|
+
this._name = t3;
|
134498
134501
|
break;
|
134499
134502
|
}
|
134500
134503
|
if (this._name.length > 3 && this._name.slice(-3) === "...") {
|
@@ -134505,31 +134508,31 @@ var require_commander2 = __commonJS({
|
|
134505
134508
|
name() {
|
134506
134509
|
return this._name;
|
134507
134510
|
}
|
134508
|
-
_concatValue(
|
134509
|
-
if (
|
134510
|
-
return [
|
134511
|
+
_concatValue(t3, e3) {
|
134512
|
+
if (e3 === this.defaultValue || !Array.isArray(e3)) {
|
134513
|
+
return [t3];
|
134511
134514
|
}
|
134512
|
-
return
|
134515
|
+
return e3.concat(t3);
|
134513
134516
|
}
|
134514
|
-
default(
|
134515
|
-
this.defaultValue =
|
134516
|
-
this.defaultValueDescription =
|
134517
|
+
default(t3, e3) {
|
134518
|
+
this.defaultValue = t3;
|
134519
|
+
this.defaultValueDescription = e3;
|
134517
134520
|
return this;
|
134518
134521
|
}
|
134519
|
-
argParser(
|
134520
|
-
this.parseArg =
|
134522
|
+
argParser(t3) {
|
134523
|
+
this.parseArg = t3;
|
134521
134524
|
return this;
|
134522
134525
|
}
|
134523
|
-
choices(
|
134524
|
-
this.argChoices =
|
134525
|
-
this.parseArg = (
|
134526
|
-
if (!
|
134527
|
-
throw new n(`Allowed choices are ${
|
134526
|
+
choices(t3) {
|
134527
|
+
this.argChoices = t3.slice();
|
134528
|
+
this.parseArg = (t4, e3) => {
|
134529
|
+
if (!this.argChoices.includes(t4)) {
|
134530
|
+
throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
134528
134531
|
}
|
134529
134532
|
if (this.variadic) {
|
134530
|
-
return this._concatValue(
|
134533
|
+
return this._concatValue(t4, e3);
|
134531
134534
|
}
|
134532
|
-
return
|
134535
|
+
return t4;
|
134533
134536
|
};
|
134534
134537
|
return this;
|
134535
134538
|
}
|
@@ -134542,24 +134545,25 @@ var require_commander2 = __commonJS({
|
|
134542
134545
|
return this;
|
134543
134546
|
}
|
134544
134547
|
}
|
134545
|
-
function humanReadableArgName(
|
134546
|
-
const
|
134547
|
-
return
|
134548
|
+
function humanReadableArgName(t3) {
|
134549
|
+
const e3 = t3.name() + (t3.variadic === true ? "..." : "");
|
134550
|
+
return t3.required ? "<" + e3 + ">" : "[" + e3 + "]";
|
134548
134551
|
}
|
134549
|
-
|
134550
|
-
|
134551
|
-
},
|
134552
|
+
e2.Argument = Argument;
|
134553
|
+
e2.humanReadableArgName = humanReadableArgName;
|
134554
|
+
}, 302: (t2, e2, i2) => {
|
134552
134555
|
const n = i2(361).EventEmitter;
|
134553
134556
|
const s = i2(81);
|
134554
134557
|
const r = i2(17);
|
134555
134558
|
const o = i2(147);
|
134556
|
-
const
|
134557
|
-
const {
|
134558
|
-
const {
|
134559
|
-
const {
|
134560
|
-
const {
|
134559
|
+
const a = i2(282);
|
134560
|
+
const { Argument: l, humanReadableArgName: h } = i2(535);
|
134561
|
+
const { CommanderError: u } = i2(796);
|
134562
|
+
const { Help: c } = i2(519);
|
134563
|
+
const { Option: p, splitOptionFlags: m, DualOptions: d } = i2(437);
|
134564
|
+
const { suggestSimilar: f } = i2(860);
|
134561
134565
|
class Command2 extends n {
|
134562
|
-
constructor(
|
134566
|
+
constructor(t3) {
|
134563
134567
|
super();
|
134564
134568
|
this.commands = [];
|
134565
134569
|
this.options = [];
|
@@ -134571,25 +134575,27 @@ var require_commander2 = __commonJS({
|
|
134571
134575
|
this.rawArgs = [];
|
134572
134576
|
this.processedArgs = [];
|
134573
134577
|
this._scriptPath = null;
|
134574
|
-
this._name =
|
134578
|
+
this._name = t3 || "";
|
134575
134579
|
this._optionValues = {};
|
134576
134580
|
this._optionValueSources = {};
|
134577
134581
|
this._storeOptionsAsProperties = false;
|
134578
134582
|
this._actionHandler = null;
|
134579
134583
|
this._executableHandler = false;
|
134580
134584
|
this._executableFile = null;
|
134585
|
+
this._executableDir = null;
|
134581
134586
|
this._defaultCommandName = null;
|
134582
134587
|
this._exitCallback = null;
|
134583
134588
|
this._aliases = [];
|
134584
134589
|
this._combineFlagAndOptionalValue = true;
|
134585
134590
|
this._description = "";
|
134591
|
+
this._summary = "";
|
134586
134592
|
this._argsDescription = void 0;
|
134587
134593
|
this._enablePositionalOptions = false;
|
134588
134594
|
this._passThroughOptions = false;
|
134589
134595
|
this._lifeCycleHooks = {};
|
134590
134596
|
this._showHelpAfterError = false;
|
134591
|
-
this._showSuggestionAfterError =
|
134592
|
-
this._outputConfiguration = { writeOut: (
|
134597
|
+
this._showSuggestionAfterError = true;
|
134598
|
+
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) };
|
134593
134599
|
this._hidden = false;
|
134594
134600
|
this._hasHelpOption = true;
|
134595
134601
|
this._helpFlags = "-h, --help";
|
@@ -134602,35 +134608,35 @@ var require_commander2 = __commonJS({
|
|
134602
134608
|
this._helpCommandDescription = "display help for command";
|
134603
134609
|
this._helpConfiguration = {};
|
134604
134610
|
}
|
134605
|
-
copyInheritedSettings(
|
134606
|
-
this._outputConfiguration =
|
134607
|
-
this._hasHelpOption =
|
134608
|
-
this._helpFlags =
|
134609
|
-
this._helpDescription =
|
134610
|
-
this._helpShortFlag =
|
134611
|
-
this._helpLongFlag =
|
134612
|
-
this._helpCommandName =
|
134613
|
-
this._helpCommandnameAndArgs =
|
134614
|
-
this._helpCommandDescription =
|
134615
|
-
this._helpConfiguration =
|
134616
|
-
this._exitCallback =
|
134617
|
-
this._storeOptionsAsProperties =
|
134618
|
-
this._combineFlagAndOptionalValue =
|
134619
|
-
this._allowExcessArguments =
|
134620
|
-
this._enablePositionalOptions =
|
134621
|
-
this._showHelpAfterError =
|
134622
|
-
this._showSuggestionAfterError =
|
134611
|
+
copyInheritedSettings(t3) {
|
134612
|
+
this._outputConfiguration = t3._outputConfiguration;
|
134613
|
+
this._hasHelpOption = t3._hasHelpOption;
|
134614
|
+
this._helpFlags = t3._helpFlags;
|
134615
|
+
this._helpDescription = t3._helpDescription;
|
134616
|
+
this._helpShortFlag = t3._helpShortFlag;
|
134617
|
+
this._helpLongFlag = t3._helpLongFlag;
|
134618
|
+
this._helpCommandName = t3._helpCommandName;
|
134619
|
+
this._helpCommandnameAndArgs = t3._helpCommandnameAndArgs;
|
134620
|
+
this._helpCommandDescription = t3._helpCommandDescription;
|
134621
|
+
this._helpConfiguration = t3._helpConfiguration;
|
134622
|
+
this._exitCallback = t3._exitCallback;
|
134623
|
+
this._storeOptionsAsProperties = t3._storeOptionsAsProperties;
|
134624
|
+
this._combineFlagAndOptionalValue = t3._combineFlagAndOptionalValue;
|
134625
|
+
this._allowExcessArguments = t3._allowExcessArguments;
|
134626
|
+
this._enablePositionalOptions = t3._enablePositionalOptions;
|
134627
|
+
this._showHelpAfterError = t3._showHelpAfterError;
|
134628
|
+
this._showSuggestionAfterError = t3._showSuggestionAfterError;
|
134623
134629
|
return this;
|
134624
134630
|
}
|
134625
|
-
command(
|
134626
|
-
let n2 =
|
134631
|
+
command(t3, e3, i3) {
|
134632
|
+
let n2 = e3;
|
134627
134633
|
let s2 = i3;
|
134628
134634
|
if (typeof n2 === "object" && n2 !== null) {
|
134629
134635
|
s2 = n2;
|
134630
134636
|
n2 = null;
|
134631
134637
|
}
|
134632
134638
|
s2 = s2 || {};
|
134633
|
-
const [, r2, o2] =
|
134639
|
+
const [, r2, o2] = t3.match(/([^ ]+) *(.*)/);
|
134634
134640
|
const a2 = this.createCommand(r2);
|
134635
134641
|
if (n2) {
|
134636
134642
|
a2.description(n2);
|
@@ -134649,60 +134655,53 @@ var require_commander2 = __commonJS({
|
|
134649
134655
|
return this;
|
134650
134656
|
return a2;
|
134651
134657
|
}
|
134652
|
-
createCommand(
|
134653
|
-
return new Command2(
|
134658
|
+
createCommand(t3) {
|
134659
|
+
return new Command2(t3);
|
134654
134660
|
}
|
134655
134661
|
createHelp() {
|
134656
|
-
return Object.assign(new
|
134662
|
+
return Object.assign(new c(), this.configureHelp());
|
134657
134663
|
}
|
134658
|
-
configureHelp(
|
134659
|
-
if (
|
134664
|
+
configureHelp(t3) {
|
134665
|
+
if (t3 === void 0)
|
134660
134666
|
return this._helpConfiguration;
|
134661
|
-
this._helpConfiguration =
|
134667
|
+
this._helpConfiguration = t3;
|
134662
134668
|
return this;
|
134663
134669
|
}
|
134664
|
-
configureOutput(
|
134665
|
-
if (
|
134670
|
+
configureOutput(t3) {
|
134671
|
+
if (t3 === void 0)
|
134666
134672
|
return this._outputConfiguration;
|
134667
|
-
Object.assign(this._outputConfiguration,
|
134673
|
+
Object.assign(this._outputConfiguration, t3);
|
134668
134674
|
return this;
|
134669
134675
|
}
|
134670
|
-
showHelpAfterError(
|
134671
|
-
if (typeof
|
134672
|
-
|
134673
|
-
this._showHelpAfterError =
|
134676
|
+
showHelpAfterError(t3 = true) {
|
134677
|
+
if (typeof t3 !== "string")
|
134678
|
+
t3 = !!t3;
|
134679
|
+
this._showHelpAfterError = t3;
|
134674
134680
|
return this;
|
134675
134681
|
}
|
134676
|
-
showSuggestionAfterError(
|
134677
|
-
this._showSuggestionAfterError = !!
|
134682
|
+
showSuggestionAfterError(t3 = true) {
|
134683
|
+
this._showSuggestionAfterError = !!t3;
|
134678
134684
|
return this;
|
134679
134685
|
}
|
134680
|
-
addCommand(
|
134681
|
-
if (!
|
134682
|
-
throw new Error(
|
134683
|
-
|
134684
|
-
e4.forEach((e5) => {
|
134685
|
-
if (e5._executableHandler && !e5._executableFile) {
|
134686
|
-
throw new Error(`Must specify executableFile for deeply nested executable: ${e5.name()}`);
|
134687
|
-
}
|
134688
|
-
checkExplicitNames(e5.commands);
|
134689
|
-
});
|
134686
|
+
addCommand(t3, e3) {
|
134687
|
+
if (!t3._name) {
|
134688
|
+
throw new Error(`Command passed to .addCommand() must have a name
|
134689
|
+
- specify the name in Command constructor or using .name()`);
|
134690
134690
|
}
|
134691
|
-
|
134692
|
-
|
134693
|
-
|
134694
|
-
|
134695
|
-
|
134696
|
-
|
134697
|
-
this
|
134698
|
-
e3.parent = this;
|
134691
|
+
e3 = e3 || {};
|
134692
|
+
if (e3.isDefault)
|
134693
|
+
this._defaultCommandName = t3._name;
|
134694
|
+
if (e3.noHelp || e3.hidden)
|
134695
|
+
t3._hidden = true;
|
134696
|
+
this.commands.push(t3);
|
134697
|
+
t3.parent = this;
|
134699
134698
|
return this;
|
134700
134699
|
}
|
134701
|
-
createArgument(
|
134702
|
-
return new
|
134700
|
+
createArgument(t3, e3) {
|
134701
|
+
return new l(t3, e3);
|
134703
134702
|
}
|
134704
|
-
argument(
|
134705
|
-
const s2 = this.createArgument(
|
134703
|
+
argument(t3, e3, i3, n2) {
|
134704
|
+
const s2 = this.createArgument(t3, e3);
|
134706
134705
|
if (typeof i3 === "function") {
|
134707
134706
|
s2.default(n2).argParser(i3);
|
134708
134707
|
} else {
|
@@ -134711,33 +134710,33 @@ var require_commander2 = __commonJS({
|
|
134711
134710
|
this.addArgument(s2);
|
134712
134711
|
return this;
|
134713
134712
|
}
|
134714
|
-
arguments(
|
134715
|
-
|
134716
|
-
this.argument(
|
134713
|
+
arguments(t3) {
|
134714
|
+
t3.split(/ +/).forEach((t4) => {
|
134715
|
+
this.argument(t4);
|
134717
134716
|
});
|
134718
134717
|
return this;
|
134719
134718
|
}
|
134720
|
-
addArgument(
|
134721
|
-
const
|
134722
|
-
if (
|
134723
|
-
throw new Error(`only the last argument can be variadic '${
|
134719
|
+
addArgument(t3) {
|
134720
|
+
const e3 = this._args.slice(-1)[0];
|
134721
|
+
if (e3 && e3.variadic) {
|
134722
|
+
throw new Error(`only the last argument can be variadic '${e3.name()}'`);
|
134724
134723
|
}
|
134725
|
-
if (
|
134726
|
-
throw new Error(`a default value for a required argument is never used: '${
|
134724
|
+
if (t3.required && t3.defaultValue !== void 0 && t3.parseArg === void 0) {
|
134725
|
+
throw new Error(`a default value for a required argument is never used: '${t3.name()}'`);
|
134727
134726
|
}
|
134728
|
-
this._args.push(
|
134727
|
+
this._args.push(t3);
|
134729
134728
|
return this;
|
134730
134729
|
}
|
134731
|
-
addHelpCommand(
|
134732
|
-
if (
|
134730
|
+
addHelpCommand(t3, e3) {
|
134731
|
+
if (t3 === false) {
|
134733
134732
|
this._addImplicitHelpCommand = false;
|
134734
134733
|
} else {
|
134735
134734
|
this._addImplicitHelpCommand = true;
|
134736
|
-
if (typeof
|
134737
|
-
this._helpCommandName =
|
134738
|
-
this._helpCommandnameAndArgs =
|
134735
|
+
if (typeof t3 === "string") {
|
134736
|
+
this._helpCommandName = t3.split(" ")[0];
|
134737
|
+
this._helpCommandnameAndArgs = t3;
|
134739
134738
|
}
|
134740
|
-
this._helpCommandDescription =
|
134739
|
+
this._helpCommandDescription = e3 || this._helpCommandDescription;
|
134741
134740
|
}
|
134742
134741
|
return this;
|
134743
134742
|
}
|
@@ -134747,116 +134746,121 @@ var require_commander2 = __commonJS({
|
|
134747
134746
|
}
|
134748
134747
|
return this._addImplicitHelpCommand;
|
134749
134748
|
}
|
134750
|
-
hook(
|
134751
|
-
const i3 = ["preAction", "postAction"];
|
134752
|
-
if (!i3.includes(
|
134753
|
-
throw new Error(`Unexpected value for event passed to hook : '${
|
134749
|
+
hook(t3, e3) {
|
134750
|
+
const i3 = ["preSubcommand", "preAction", "postAction"];
|
134751
|
+
if (!i3.includes(t3)) {
|
134752
|
+
throw new Error(`Unexpected value for event passed to hook : '${t3}'.
|
134754
134753
|
Expecting one of '${i3.join("', '")}'`);
|
134755
134754
|
}
|
134756
|
-
if (this._lifeCycleHooks[
|
134757
|
-
this._lifeCycleHooks[
|
134755
|
+
if (this._lifeCycleHooks[t3]) {
|
134756
|
+
this._lifeCycleHooks[t3].push(e3);
|
134758
134757
|
} else {
|
134759
|
-
this._lifeCycleHooks[
|
134758
|
+
this._lifeCycleHooks[t3] = [e3];
|
134760
134759
|
}
|
134761
134760
|
return this;
|
134762
134761
|
}
|
134763
|
-
exitOverride(
|
134764
|
-
if (
|
134765
|
-
this._exitCallback =
|
134762
|
+
exitOverride(t3) {
|
134763
|
+
if (t3) {
|
134764
|
+
this._exitCallback = t3;
|
134766
134765
|
} else {
|
134767
|
-
this._exitCallback = (
|
134768
|
-
if (
|
134769
|
-
throw
|
134766
|
+
this._exitCallback = (t4) => {
|
134767
|
+
if (t4.code !== "commander.executeSubCommandAsync") {
|
134768
|
+
throw t4;
|
134770
134769
|
} else {
|
134771
134770
|
}
|
134772
134771
|
};
|
134773
134772
|
}
|
134774
134773
|
return this;
|
134775
134774
|
}
|
134776
|
-
_exit(
|
134775
|
+
_exit(t3, e3, i3) {
|
134777
134776
|
if (this._exitCallback) {
|
134778
|
-
this._exitCallback(new
|
134777
|
+
this._exitCallback(new u(t3, e3, i3));
|
134779
134778
|
}
|
134780
|
-
|
134779
|
+
a.exit(t3);
|
134781
134780
|
}
|
134782
|
-
action(
|
134783
|
-
const listener = (
|
134781
|
+
action(t3) {
|
134782
|
+
const listener = (e3) => {
|
134784
134783
|
const i3 = this._args.length;
|
134785
|
-
const n2 =
|
134784
|
+
const n2 = e3.slice(0, i3);
|
134786
134785
|
if (this._storeOptionsAsProperties) {
|
134787
134786
|
n2[i3] = this;
|
134788
134787
|
} else {
|
134789
134788
|
n2[i3] = this.opts();
|
134790
134789
|
}
|
134791
134790
|
n2.push(this);
|
134792
|
-
return
|
134791
|
+
return t3.apply(this, n2);
|
134793
134792
|
};
|
134794
134793
|
this._actionHandler = listener;
|
134795
134794
|
return this;
|
134796
134795
|
}
|
134797
|
-
createOption(
|
134798
|
-
return new
|
134796
|
+
createOption(t3, e3) {
|
134797
|
+
return new p(t3, e3);
|
134799
134798
|
}
|
134800
|
-
addOption(
|
134801
|
-
const
|
134802
|
-
const i3 =
|
134803
|
-
|
134804
|
-
|
134805
|
-
if (
|
134806
|
-
|
134807
|
-
n2 = this._findOption(t4) ? this.getOptionValue(i3) : true;
|
134808
|
-
}
|
134809
|
-
if (n2 !== void 0) {
|
134810
|
-
this.setOptionValueWithSource(i3, n2, "default");
|
134799
|
+
addOption(t3) {
|
134800
|
+
const e3 = t3.name();
|
134801
|
+
const i3 = t3.attributeName();
|
134802
|
+
if (t3.negate) {
|
134803
|
+
const e4 = t3.long.replace(/^--no-/, "--");
|
134804
|
+
if (!this._findOption(e4)) {
|
134805
|
+
this.setOptionValueWithSource(i3, t3.defaultValue === void 0 ? true : t3.defaultValue, "default");
|
134811
134806
|
}
|
134807
|
+
} else if (t3.defaultValue !== void 0) {
|
134808
|
+
this.setOptionValueWithSource(i3, t3.defaultValue, "default");
|
134812
134809
|
}
|
134813
|
-
this.options.push(
|
134814
|
-
const handleOptionValue = (
|
134815
|
-
|
134816
|
-
|
134810
|
+
this.options.push(t3);
|
134811
|
+
const handleOptionValue = (e4, n2, s2) => {
|
134812
|
+
if (e4 == null && t3.presetArg !== void 0) {
|
134813
|
+
e4 = t3.presetArg;
|
134814
|
+
}
|
134815
|
+
const r2 = this.getOptionValue(i3);
|
134816
|
+
if (e4 !== null && t3.parseArg) {
|
134817
134817
|
try {
|
134818
|
-
|
134819
|
-
} catch (
|
134820
|
-
if (
|
134821
|
-
const
|
134822
|
-
this.
|
134818
|
+
e4 = t3.parseArg(e4, r2);
|
134819
|
+
} catch (t4) {
|
134820
|
+
if (t4.code === "commander.invalidArgument") {
|
134821
|
+
const e5 = `${n2} ${t4.message}`;
|
134822
|
+
this.error(e5, { exitCode: t4.exitCode, code: t4.code });
|
134823
134823
|
}
|
134824
|
-
throw
|
134824
|
+
throw t4;
|
134825
134825
|
}
|
134826
|
-
} else if (
|
134827
|
-
|
134826
|
+
} else if (e4 !== null && t3.variadic) {
|
134827
|
+
e4 = t3._concatValue(e4, r2);
|
134828
134828
|
}
|
134829
|
-
if (
|
134830
|
-
if (
|
134831
|
-
|
134829
|
+
if (e4 == null) {
|
134830
|
+
if (t3.negate) {
|
134831
|
+
e4 = false;
|
134832
|
+
} else if (t3.isBoolean() || t3.optional) {
|
134833
|
+
e4 = true;
|
134832
134834
|
} else {
|
134833
|
-
|
134835
|
+
e4 = "";
|
134834
134836
|
}
|
134835
|
-
} else if (t4 !== null) {
|
134836
|
-
this.setOptionValueWithSource(i3, e3.negate ? false : t4, r2);
|
134837
134837
|
}
|
134838
|
+
this.setOptionValueWithSource(i3, e4, s2);
|
134838
134839
|
};
|
134839
|
-
this.on("option:" +
|
134840
|
-
const i4 = `error: option '${
|
134841
|
-
handleOptionValue(
|
134840
|
+
this.on("option:" + e3, (e4) => {
|
134841
|
+
const i4 = `error: option '${t3.flags}' argument '${e4}' is invalid.`;
|
134842
|
+
handleOptionValue(e4, i4, "cli");
|
134842
134843
|
});
|
134843
|
-
if (
|
134844
|
-
this.on("optionEnv:" +
|
134845
|
-
const i4 = `error: option '${
|
134846
|
-
handleOptionValue(
|
134844
|
+
if (t3.envVar) {
|
134845
|
+
this.on("optionEnv:" + e3, (e4) => {
|
134846
|
+
const i4 = `error: option '${t3.flags}' value '${e4}' from env '${t3.envVar}' is invalid.`;
|
134847
|
+
handleOptionValue(e4, i4, "env");
|
134847
134848
|
});
|
134848
134849
|
}
|
134849
134850
|
return this;
|
134850
134851
|
}
|
134851
|
-
_optionEx(
|
134852
|
-
|
134853
|
-
|
134852
|
+
_optionEx(t3, e3, i3, n2, s2) {
|
134853
|
+
if (typeof e3 === "object" && e3 instanceof p) {
|
134854
|
+
throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");
|
134855
|
+
}
|
134856
|
+
const r2 = this.createOption(e3, i3);
|
134857
|
+
r2.makeOptionMandatory(!!t3.mandatory);
|
134854
134858
|
if (typeof n2 === "function") {
|
134855
134859
|
r2.default(s2).argParser(n2);
|
134856
134860
|
} else if (n2 instanceof RegExp) {
|
134857
|
-
const
|
134858
|
-
n2 = (
|
134859
|
-
const n3 =
|
134861
|
+
const t4 = n2;
|
134862
|
+
n2 = (e4, i4) => {
|
134863
|
+
const n3 = t4.exec(e4);
|
134860
134864
|
return n3 ? n3[0] : i4;
|
134861
134865
|
};
|
134862
134866
|
r2.default(s2).argParser(n2);
|
@@ -134865,209 +134869,233 @@ Expecting one of '${i3.join("', '")}'`);
|
|
134865
134869
|
}
|
134866
134870
|
return this.addOption(r2);
|
134867
134871
|
}
|
134868
|
-
option(
|
134869
|
-
return this._optionEx({},
|
134872
|
+
option(t3, e3, i3, n2) {
|
134873
|
+
return this._optionEx({}, t3, e3, i3, n2);
|
134870
134874
|
}
|
134871
|
-
requiredOption(
|
134872
|
-
return this._optionEx({ mandatory: true },
|
134875
|
+
requiredOption(t3, e3, i3, n2) {
|
134876
|
+
return this._optionEx({ mandatory: true }, t3, e3, i3, n2);
|
134873
134877
|
}
|
134874
|
-
combineFlagAndOptionalValue(
|
134875
|
-
this._combineFlagAndOptionalValue = !!
|
134878
|
+
combineFlagAndOptionalValue(t3 = true) {
|
134879
|
+
this._combineFlagAndOptionalValue = !!t3;
|
134876
134880
|
return this;
|
134877
134881
|
}
|
134878
|
-
allowUnknownOption(
|
134879
|
-
this._allowUnknownOption = !!
|
134882
|
+
allowUnknownOption(t3 = true) {
|
134883
|
+
this._allowUnknownOption = !!t3;
|
134880
134884
|
return this;
|
134881
134885
|
}
|
134882
|
-
allowExcessArguments(
|
134883
|
-
this._allowExcessArguments = !!
|
134886
|
+
allowExcessArguments(t3 = true) {
|
134887
|
+
this._allowExcessArguments = !!t3;
|
134884
134888
|
return this;
|
134885
134889
|
}
|
134886
|
-
enablePositionalOptions(
|
134887
|
-
this._enablePositionalOptions = !!
|
134890
|
+
enablePositionalOptions(t3 = true) {
|
134891
|
+
this._enablePositionalOptions = !!t3;
|
134888
134892
|
return this;
|
134889
134893
|
}
|
134890
|
-
passThroughOptions(
|
134891
|
-
this._passThroughOptions = !!
|
134892
|
-
if (!!this.parent &&
|
134894
|
+
passThroughOptions(t3 = true) {
|
134895
|
+
this._passThroughOptions = !!t3;
|
134896
|
+
if (!!this.parent && t3 && !this.parent._enablePositionalOptions) {
|
134893
134897
|
throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");
|
134894
134898
|
}
|
134895
134899
|
return this;
|
134896
134900
|
}
|
134897
|
-
storeOptionsAsProperties(
|
134898
|
-
this._storeOptionsAsProperties = !!
|
134901
|
+
storeOptionsAsProperties(t3 = true) {
|
134902
|
+
this._storeOptionsAsProperties = !!t3;
|
134899
134903
|
if (this.options.length) {
|
134900
134904
|
throw new Error("call .storeOptionsAsProperties() before adding options");
|
134901
134905
|
}
|
134902
134906
|
return this;
|
134903
134907
|
}
|
134904
|
-
getOptionValue(
|
134908
|
+
getOptionValue(t3) {
|
134905
134909
|
if (this._storeOptionsAsProperties) {
|
134906
|
-
return this[
|
134910
|
+
return this[t3];
|
134907
134911
|
}
|
134908
|
-
return this._optionValues[
|
134912
|
+
return this._optionValues[t3];
|
134909
134913
|
}
|
134910
|
-
setOptionValue(
|
134914
|
+
setOptionValue(t3, e3) {
|
134915
|
+
return this.setOptionValueWithSource(t3, e3, void 0);
|
134916
|
+
}
|
134917
|
+
setOptionValueWithSource(t3, e3, i3) {
|
134911
134918
|
if (this._storeOptionsAsProperties) {
|
134912
|
-
this[
|
134919
|
+
this[t3] = e3;
|
134913
134920
|
} else {
|
134914
|
-
this._optionValues[
|
134921
|
+
this._optionValues[t3] = e3;
|
134915
134922
|
}
|
134923
|
+
this._optionValueSources[t3] = i3;
|
134916
134924
|
return this;
|
134917
134925
|
}
|
134918
|
-
|
134919
|
-
this.
|
134920
|
-
this._optionValueSources[e3] = i3;
|
134921
|
-
return this;
|
134926
|
+
getOptionValueSource(t3) {
|
134927
|
+
return this._optionValueSources[t3];
|
134922
134928
|
}
|
134923
|
-
|
134924
|
-
|
134929
|
+
getOptionValueSourceWithGlobals(t3) {
|
134930
|
+
let e3;
|
134931
|
+
getCommandAndParents(this).forEach((i3) => {
|
134932
|
+
if (i3.getOptionValueSource(t3) !== void 0) {
|
134933
|
+
e3 = i3.getOptionValueSource(t3);
|
134934
|
+
}
|
134935
|
+
});
|
134936
|
+
return e3;
|
134925
134937
|
}
|
134926
|
-
_prepareUserArgs(
|
134927
|
-
if (
|
134938
|
+
_prepareUserArgs(t3, e3) {
|
134939
|
+
if (t3 !== void 0 && !Array.isArray(t3)) {
|
134928
134940
|
throw new Error("first parameter to parse must be array or undefined");
|
134929
134941
|
}
|
134930
|
-
|
134931
|
-
if (
|
134932
|
-
|
134933
|
-
if (
|
134934
|
-
|
134942
|
+
e3 = e3 || {};
|
134943
|
+
if (t3 === void 0) {
|
134944
|
+
t3 = a.argv;
|
134945
|
+
if (a.versions && a.versions.electron) {
|
134946
|
+
e3.from = "electron";
|
134935
134947
|
}
|
134936
134948
|
}
|
134937
|
-
this.rawArgs =
|
134949
|
+
this.rawArgs = t3.slice();
|
134938
134950
|
let i3;
|
134939
|
-
switch (
|
134951
|
+
switch (e3.from) {
|
134940
134952
|
case void 0:
|
134941
134953
|
case "node":
|
134942
|
-
this._scriptPath =
|
134943
|
-
i3 =
|
134954
|
+
this._scriptPath = t3[1];
|
134955
|
+
i3 = t3.slice(2);
|
134944
134956
|
break;
|
134945
134957
|
case "electron":
|
134946
|
-
if (
|
134947
|
-
this._scriptPath =
|
134948
|
-
i3 =
|
134958
|
+
if (a.defaultApp) {
|
134959
|
+
this._scriptPath = t3[1];
|
134960
|
+
i3 = t3.slice(2);
|
134949
134961
|
} else {
|
134950
|
-
i3 =
|
134962
|
+
i3 = t3.slice(1);
|
134951
134963
|
}
|
134952
134964
|
break;
|
134953
134965
|
case "user":
|
134954
|
-
i3 =
|
134966
|
+
i3 = t3.slice(0);
|
134955
134967
|
break;
|
134956
134968
|
default:
|
134957
|
-
throw new Error(`unexpected parse option { from: '${
|
134969
|
+
throw new Error(`unexpected parse option { from: '${e3.from}' }`);
|
134958
134970
|
}
|
134959
|
-
if (!this.
|
134960
|
-
this._scriptPath
|
134961
|
-
|
134962
|
-
this._name = this._name || this._scriptPath && r.basename(this._scriptPath, r.extname(this._scriptPath));
|
134971
|
+
if (!this._name && this._scriptPath)
|
134972
|
+
this.nameFromFilename(this._scriptPath);
|
134973
|
+
this._name = this._name || "program";
|
134963
134974
|
return i3;
|
134964
134975
|
}
|
134965
|
-
parse(
|
134966
|
-
const i3 = this._prepareUserArgs(
|
134976
|
+
parse(t3, e3) {
|
134977
|
+
const i3 = this._prepareUserArgs(t3, e3);
|
134967
134978
|
this._parseCommand([], i3);
|
134968
134979
|
return this;
|
134969
134980
|
}
|
134970
|
-
parseAsync(
|
134981
|
+
parseAsync(t3, e3) {
|
134971
134982
|
return __async(this, null, function* () {
|
134972
|
-
const i3 = this._prepareUserArgs(
|
134983
|
+
const i3 = this._prepareUserArgs(t3, e3);
|
134973
134984
|
yield this._parseCommand([], i3);
|
134974
134985
|
return this;
|
134975
134986
|
});
|
134976
134987
|
}
|
134977
|
-
_executeSubCommand(
|
134978
|
-
|
134988
|
+
_executeSubCommand(t3, e3) {
|
134989
|
+
e3 = e3.slice();
|
134979
134990
|
let i3 = false;
|
134980
134991
|
const n2 = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
134981
|
-
|
134982
|
-
|
134983
|
-
|
134984
|
-
|
134985
|
-
|
134986
|
-
|
134987
|
-
|
134988
|
-
|
134989
|
-
|
134990
|
-
|
134991
|
-
h2 = ".";
|
134992
|
+
function findFile(t4, e4) {
|
134993
|
+
const i4 = r.resolve(t4, e4);
|
134994
|
+
if (o.existsSync(i4))
|
134995
|
+
return i4;
|
134996
|
+
if (n2.includes(r.extname(e4)))
|
134997
|
+
return void 0;
|
134998
|
+
const s2 = n2.find((t5) => o.existsSync(`${i4}${t5}`));
|
134999
|
+
if (s2)
|
135000
|
+
return `${i4}${s2}`;
|
135001
|
+
return void 0;
|
134992
135002
|
}
|
134993
|
-
|
134994
|
-
|
134995
|
-
|
135003
|
+
this._checkForMissingMandatoryOptions();
|
135004
|
+
this._checkForConflictingOptions();
|
135005
|
+
let l2 = t3._executableFile || `${this._name}-${t3._name}`;
|
135006
|
+
let h2 = this._executableDir || "";
|
135007
|
+
if (this._scriptPath) {
|
135008
|
+
let t4;
|
135009
|
+
try {
|
135010
|
+
t4 = o.realpathSync(this._scriptPath);
|
135011
|
+
} catch (e4) {
|
135012
|
+
t4 = this._scriptPath;
|
135013
|
+
}
|
135014
|
+
h2 = r.resolve(r.dirname(t4), h2);
|
134996
135015
|
}
|
134997
|
-
|
134998
|
-
|
134999
|
-
|
135000
|
-
|
135001
|
-
|
135002
|
-
|
135003
|
-
u2 = `${c2}${e4}`;
|
135016
|
+
if (h2) {
|
135017
|
+
let e4 = findFile(h2, l2);
|
135018
|
+
if (!e4 && !t3._executableFile && this._scriptPath) {
|
135019
|
+
const i4 = r.basename(this._scriptPath, r.extname(this._scriptPath));
|
135020
|
+
if (i4 !== this._name) {
|
135021
|
+
e4 = findFile(h2, `${i4}-${t3._name}`);
|
135004
135022
|
}
|
135005
|
-
}
|
135023
|
+
}
|
135024
|
+
l2 = e4 || l2;
|
135006
135025
|
}
|
135007
|
-
i3 = n2.includes(r.extname(
|
135008
|
-
let
|
135009
|
-
if (
|
135026
|
+
i3 = n2.includes(r.extname(l2));
|
135027
|
+
let c2;
|
135028
|
+
if (a.platform !== "win32") {
|
135010
135029
|
if (i3) {
|
135011
|
-
|
135012
|
-
|
135013
|
-
|
135030
|
+
e3.unshift(l2);
|
135031
|
+
e3 = incrementNodeInspectorPort(a.execArgv).concat(e3);
|
135032
|
+
c2 = s.spawn(a.argv[0], e3, { stdio: "inherit" });
|
135014
135033
|
} else {
|
135015
|
-
|
135034
|
+
c2 = s.spawn(l2, e3, { stdio: "inherit" });
|
135016
135035
|
}
|
135017
135036
|
} else {
|
135018
|
-
|
135019
|
-
|
135020
|
-
|
135021
|
-
}
|
135022
|
-
|
135023
|
-
|
135024
|
-
|
135025
|
-
|
135026
|
-
|
135027
|
-
|
135037
|
+
e3.unshift(l2);
|
135038
|
+
e3 = incrementNodeInspectorPort(a.execArgv).concat(e3);
|
135039
|
+
c2 = s.spawn(a.execPath, e3, { stdio: "inherit" });
|
135040
|
+
}
|
135041
|
+
if (!c2.killed) {
|
135042
|
+
const t4 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
|
135043
|
+
t4.forEach((t5) => {
|
135044
|
+
a.on(t5, () => {
|
135045
|
+
if (c2.killed === false && c2.exitCode === null) {
|
135046
|
+
c2.kill(t5);
|
135047
|
+
}
|
135048
|
+
});
|
135028
135049
|
});
|
135029
|
-
}
|
135030
|
-
const
|
135031
|
-
if (!
|
135032
|
-
|
135050
|
+
}
|
135051
|
+
const p2 = this._exitCallback;
|
135052
|
+
if (!p2) {
|
135053
|
+
c2.on("close", a.exit.bind(a));
|
135033
135054
|
} else {
|
135034
|
-
|
135035
|
-
|
135055
|
+
c2.on("close", () => {
|
135056
|
+
p2(new u(a.exitCode || 0, "commander.executeSubCommandAsync", "(close)"));
|
135036
135057
|
});
|
135037
135058
|
}
|
135038
|
-
|
135039
|
-
if (
|
135040
|
-
const
|
135041
|
-
|
135042
|
-
- if
|
135043
|
-
|
135044
|
-
|
135045
|
-
throw new Error(
|
135046
|
-
}
|
135047
|
-
|
135048
|
-
|
135059
|
+
c2.on("error", (e4) => {
|
135060
|
+
if (e4.code === "ENOENT") {
|
135061
|
+
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";
|
135062
|
+
const i4 = `'${l2}' does not exist
|
135063
|
+
- if '${t3._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
135064
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
135065
|
+
- ${e5}`;
|
135066
|
+
throw new Error(i4);
|
135067
|
+
} else if (e4.code === "EACCES") {
|
135068
|
+
throw new Error(`'${l2}' not executable`);
|
135069
|
+
}
|
135070
|
+
if (!p2) {
|
135071
|
+
a.exit(1);
|
135049
135072
|
} else {
|
135050
|
-
const
|
135051
|
-
|
135052
|
-
|
135073
|
+
const t4 = new u(1, "commander.executeSubCommandAsync", "(error)");
|
135074
|
+
t4.nestedError = e4;
|
135075
|
+
p2(t4);
|
135053
135076
|
}
|
135054
135077
|
});
|
135055
|
-
this.runningCommand =
|
135078
|
+
this.runningCommand = c2;
|
135056
135079
|
}
|
135057
|
-
_dispatchSubcommand(
|
135058
|
-
const n2 = this._findCommand(
|
135080
|
+
_dispatchSubcommand(t3, e3, i3) {
|
135081
|
+
const n2 = this._findCommand(t3);
|
135059
135082
|
if (!n2)
|
135060
135083
|
this.help({ error: true });
|
135061
|
-
|
135062
|
-
|
135063
|
-
|
135064
|
-
|
135065
|
-
|
135084
|
+
let s2;
|
135085
|
+
s2 = this._chainOrCallSubCommandHook(s2, n2, "preSubcommand");
|
135086
|
+
s2 = this._chainOrCall(s2, () => {
|
135087
|
+
if (n2._executableHandler) {
|
135088
|
+
this._executeSubCommand(n2, e3.concat(i3));
|
135089
|
+
} else {
|
135090
|
+
return n2._parseCommand(e3, i3);
|
135091
|
+
}
|
135092
|
+
});
|
135093
|
+
return s2;
|
135066
135094
|
}
|
135067
135095
|
_checkNumberOfArguments() {
|
135068
|
-
this._args.forEach((
|
135069
|
-
if (
|
135070
|
-
this.missingArgument(
|
135096
|
+
this._args.forEach((t3, e3) => {
|
135097
|
+
if (t3.required && this.args[e3] == null) {
|
135098
|
+
this.missingArgument(t3.name());
|
135071
135099
|
}
|
135072
135100
|
});
|
135073
135101
|
if (this._args.length > 0 && this._args[this._args.length - 1].variadic) {
|
@@ -135078,15 +135106,15 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135078
135106
|
}
|
135079
135107
|
}
|
135080
135108
|
_processArguments() {
|
135081
|
-
const myParseArg = (
|
135082
|
-
let n2 =
|
135083
|
-
if (
|
135109
|
+
const myParseArg = (t4, e3, i3) => {
|
135110
|
+
let n2 = e3;
|
135111
|
+
if (e3 !== null && t4.parseArg) {
|
135084
135112
|
try {
|
135085
|
-
n2 =
|
135113
|
+
n2 = t4.parseArg(e3, i3);
|
135086
135114
|
} catch (i4) {
|
135087
135115
|
if (i4.code === "commander.invalidArgument") {
|
135088
|
-
const n3 = `error: command-argument value '${
|
135089
|
-
this.
|
135116
|
+
const n3 = `error: command-argument value '${e3}' is invalid for argument '${t4.name()}'. ${i4.message}`;
|
135117
|
+
this.error(n3, { exitCode: i4.exitCode, code: i4.code });
|
135090
135118
|
}
|
135091
135119
|
throw i4;
|
135092
135120
|
}
|
@@ -135094,74 +135122,85 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135094
135122
|
return n2;
|
135095
135123
|
};
|
135096
135124
|
this._checkNumberOfArguments();
|
135097
|
-
const
|
135098
|
-
this._args.forEach((
|
135099
|
-
let n2 =
|
135100
|
-
if (
|
135125
|
+
const t3 = [];
|
135126
|
+
this._args.forEach((e3, i3) => {
|
135127
|
+
let n2 = e3.defaultValue;
|
135128
|
+
if (e3.variadic) {
|
135101
135129
|
if (i3 < this.args.length) {
|
135102
135130
|
n2 = this.args.slice(i3);
|
135103
|
-
if (
|
135104
|
-
n2 = n2.reduce((
|
135131
|
+
if (e3.parseArg) {
|
135132
|
+
n2 = n2.reduce((t4, i4) => myParseArg(e3, i4, t4), e3.defaultValue);
|
135105
135133
|
}
|
135106
135134
|
} else if (n2 === void 0) {
|
135107
135135
|
n2 = [];
|
135108
135136
|
}
|
135109
135137
|
} else if (i3 < this.args.length) {
|
135110
135138
|
n2 = this.args[i3];
|
135111
|
-
if (
|
135112
|
-
n2 = myParseArg(
|
135139
|
+
if (e3.parseArg) {
|
135140
|
+
n2 = myParseArg(e3, n2, e3.defaultValue);
|
135113
135141
|
}
|
135114
135142
|
}
|
135115
|
-
|
135143
|
+
t3[i3] = n2;
|
135116
135144
|
});
|
135117
|
-
this.processedArgs =
|
135145
|
+
this.processedArgs = t3;
|
135118
135146
|
}
|
135119
|
-
_chainOrCall(
|
135120
|
-
if (
|
135121
|
-
return
|
135147
|
+
_chainOrCall(t3, e3) {
|
135148
|
+
if (t3 && t3.then && typeof t3.then === "function") {
|
135149
|
+
return t3.then(() => e3());
|
135122
135150
|
}
|
135123
|
-
return
|
135151
|
+
return e3();
|
135124
135152
|
}
|
135125
|
-
_chainOrCallHooks(
|
135126
|
-
let i3 =
|
135153
|
+
_chainOrCallHooks(t3, e3) {
|
135154
|
+
let i3 = t3;
|
135127
135155
|
const n2 = [];
|
135128
|
-
getCommandAndParents(this).reverse().filter((
|
135129
|
-
|
135130
|
-
n2.push({ hookedCommand:
|
135156
|
+
getCommandAndParents(this).reverse().filter((t4) => t4._lifeCycleHooks[e3] !== void 0).forEach((t4) => {
|
135157
|
+
t4._lifeCycleHooks[e3].forEach((e4) => {
|
135158
|
+
n2.push({ hookedCommand: t4, callback: e4 });
|
135131
135159
|
});
|
135132
135160
|
});
|
135133
|
-
if (
|
135161
|
+
if (e3 === "postAction") {
|
135134
135162
|
n2.reverse();
|
135135
135163
|
}
|
135136
|
-
n2.forEach((
|
135137
|
-
i3 = this._chainOrCall(i3, () =>
|
135164
|
+
n2.forEach((t4) => {
|
135165
|
+
i3 = this._chainOrCall(i3, () => t4.callback(t4.hookedCommand, this));
|
135138
135166
|
});
|
135139
135167
|
return i3;
|
135140
135168
|
}
|
135141
|
-
|
135142
|
-
|
135143
|
-
this.
|
135144
|
-
|
135145
|
-
|
135146
|
-
|
135147
|
-
if (e3 && this._findCommand(e3[0])) {
|
135148
|
-
return this._dispatchSubcommand(e3[0], e3.slice(1), t3);
|
135169
|
+
_chainOrCallSubCommandHook(t3, e3, i3) {
|
135170
|
+
let n2 = t3;
|
135171
|
+
if (this._lifeCycleHooks[i3] !== void 0) {
|
135172
|
+
this._lifeCycleHooks[i3].forEach((t4) => {
|
135173
|
+
n2 = this._chainOrCall(n2, () => t4(this, e3));
|
135174
|
+
});
|
135149
135175
|
}
|
135150
|
-
|
135151
|
-
|
135176
|
+
return n2;
|
135177
|
+
}
|
135178
|
+
_parseCommand(t3, e3) {
|
135179
|
+
const i3 = this.parseOptions(e3);
|
135180
|
+
this._parseOptionsEnv();
|
135181
|
+
this._parseOptionsImplied();
|
135182
|
+
t3 = t3.concat(i3.operands);
|
135183
|
+
e3 = i3.unknown;
|
135184
|
+
this.args = t3.concat(e3);
|
135185
|
+
if (t3 && this._findCommand(t3[0])) {
|
135186
|
+
return this._dispatchSubcommand(t3[0], t3.slice(1), e3);
|
135187
|
+
}
|
135188
|
+
if (this._hasImplicitHelpCommand() && t3[0] === this._helpCommandName) {
|
135189
|
+
if (t3.length === 1) {
|
135152
135190
|
this.help();
|
135153
135191
|
}
|
135154
|
-
return this._dispatchSubcommand(
|
135192
|
+
return this._dispatchSubcommand(t3[1], [], [this._helpLongFlag]);
|
135155
135193
|
}
|
135156
135194
|
if (this._defaultCommandName) {
|
135157
|
-
outputHelpIfRequested(this,
|
135158
|
-
return this._dispatchSubcommand(this._defaultCommandName,
|
135195
|
+
outputHelpIfRequested(this, e3);
|
135196
|
+
return this._dispatchSubcommand(this._defaultCommandName, t3, e3);
|
135159
135197
|
}
|
135160
135198
|
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
|
135161
135199
|
this.help({ error: true });
|
135162
135200
|
}
|
135163
135201
|
outputHelpIfRequested(this, i3.unknown);
|
135164
135202
|
this._checkForMissingMandatoryOptions();
|
135203
|
+
this._checkForConflictingOptions();
|
135165
135204
|
const checkForUnknownOptions = () => {
|
135166
135205
|
if (i3.unknown.length > 0) {
|
135167
135206
|
this.unknownOption(i3.unknown[0]);
|
@@ -135174,21 +135213,24 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135174
135213
|
let i4;
|
135175
135214
|
i4 = this._chainOrCallHooks(i4, "preAction");
|
135176
135215
|
i4 = this._chainOrCall(i4, () => this._actionHandler(this.processedArgs));
|
135177
|
-
if (this.parent)
|
135178
|
-
this.
|
135216
|
+
if (this.parent) {
|
135217
|
+
i4 = this._chainOrCall(i4, () => {
|
135218
|
+
this.parent.emit(n2, t3, e3);
|
135219
|
+
});
|
135220
|
+
}
|
135179
135221
|
i4 = this._chainOrCallHooks(i4, "postAction");
|
135180
135222
|
return i4;
|
135181
135223
|
}
|
135182
135224
|
if (this.parent && this.parent.listenerCount(n2)) {
|
135183
135225
|
checkForUnknownOptions();
|
135184
135226
|
this._processArguments();
|
135185
|
-
this.parent.emit(n2,
|
135186
|
-
} else if (
|
135227
|
+
this.parent.emit(n2, t3, e3);
|
135228
|
+
} else if (t3.length) {
|
135187
135229
|
if (this._findCommand("*")) {
|
135188
|
-
return this._dispatchSubcommand("*",
|
135230
|
+
return this._dispatchSubcommand("*", t3, e3);
|
135189
135231
|
}
|
135190
135232
|
if (this.listenerCount("command:*")) {
|
135191
|
-
this.emit("command:*",
|
135233
|
+
this.emit("command:*", t3, e3);
|
135192
135234
|
} else if (this.commands.length) {
|
135193
135235
|
this.unknownCommand();
|
135194
135236
|
} else {
|
@@ -135203,131 +135245,155 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135203
135245
|
this._processArguments();
|
135204
135246
|
}
|
135205
135247
|
}
|
135206
|
-
_findCommand(
|
135207
|
-
if (!
|
135248
|
+
_findCommand(t3) {
|
135249
|
+
if (!t3)
|
135208
135250
|
return void 0;
|
135209
|
-
return this.commands.find((
|
135251
|
+
return this.commands.find((e3) => e3._name === t3 || e3._aliases.includes(t3));
|
135210
135252
|
}
|
135211
|
-
_findOption(
|
135212
|
-
return this.options.find((
|
135253
|
+
_findOption(t3) {
|
135254
|
+
return this.options.find((e3) => e3.is(t3));
|
135213
135255
|
}
|
135214
135256
|
_checkForMissingMandatoryOptions() {
|
135215
|
-
for (let
|
135216
|
-
|
135217
|
-
if (
|
135218
|
-
|
135257
|
+
for (let t3 = this; t3; t3 = t3.parent) {
|
135258
|
+
t3.options.forEach((e3) => {
|
135259
|
+
if (e3.mandatory && t3.getOptionValue(e3.attributeName()) === void 0) {
|
135260
|
+
t3.missingMandatoryOptionValue(e3);
|
135219
135261
|
}
|
135220
135262
|
});
|
135221
135263
|
}
|
135222
135264
|
}
|
135223
|
-
|
135224
|
-
const t3 =
|
135265
|
+
_checkForConflictingLocalOptions() {
|
135266
|
+
const t3 = this.options.filter((t4) => {
|
135267
|
+
const e4 = t4.attributeName();
|
135268
|
+
if (this.getOptionValue(e4) === void 0) {
|
135269
|
+
return false;
|
135270
|
+
}
|
135271
|
+
return this.getOptionValueSource(e4) !== "default";
|
135272
|
+
});
|
135273
|
+
const e3 = t3.filter((t4) => t4.conflictsWith.length > 0);
|
135274
|
+
e3.forEach((e4) => {
|
135275
|
+
const i3 = t3.find((t4) => e4.conflictsWith.includes(t4.attributeName()));
|
135276
|
+
if (i3) {
|
135277
|
+
this._conflictingOption(e4, i3);
|
135278
|
+
}
|
135279
|
+
});
|
135280
|
+
}
|
135281
|
+
_checkForConflictingOptions() {
|
135282
|
+
for (let t3 = this; t3; t3 = t3.parent) {
|
135283
|
+
t3._checkForConflictingLocalOptions();
|
135284
|
+
}
|
135285
|
+
}
|
135286
|
+
parseOptions(t3) {
|
135287
|
+
const e3 = [];
|
135225
135288
|
const i3 = [];
|
135226
|
-
let n2 =
|
135227
|
-
const s2 =
|
135228
|
-
function maybeOption(
|
135229
|
-
return
|
135289
|
+
let n2 = e3;
|
135290
|
+
const s2 = t3.slice();
|
135291
|
+
function maybeOption(t4) {
|
135292
|
+
return t4.length > 1 && t4[0] === "-";
|
135230
135293
|
}
|
135231
135294
|
let r2 = null;
|
135232
135295
|
while (s2.length) {
|
135233
|
-
const
|
135234
|
-
if (
|
135296
|
+
const t4 = s2.shift();
|
135297
|
+
if (t4 === "--") {
|
135235
135298
|
if (n2 === i3)
|
135236
|
-
n2.push(
|
135299
|
+
n2.push(t4);
|
135237
135300
|
n2.push(...s2);
|
135238
135301
|
break;
|
135239
135302
|
}
|
135240
|
-
if (r2 && !maybeOption(
|
135241
|
-
this.emit(`option:${r2.name()}`,
|
135303
|
+
if (r2 && !maybeOption(t4)) {
|
135304
|
+
this.emit(`option:${r2.name()}`, t4);
|
135242
135305
|
continue;
|
135243
135306
|
}
|
135244
135307
|
r2 = null;
|
135245
|
-
if (maybeOption(
|
135246
|
-
const
|
135247
|
-
if (
|
135248
|
-
if (
|
135249
|
-
const
|
135250
|
-
if (
|
135251
|
-
this.optionMissingArgument(
|
135252
|
-
this.emit(`option:${
|
135253
|
-
} else if (
|
135254
|
-
let
|
135308
|
+
if (maybeOption(t4)) {
|
135309
|
+
const e4 = this._findOption(t4);
|
135310
|
+
if (e4) {
|
135311
|
+
if (e4.required) {
|
135312
|
+
const t5 = s2.shift();
|
135313
|
+
if (t5 === void 0)
|
135314
|
+
this.optionMissingArgument(e4);
|
135315
|
+
this.emit(`option:${e4.name()}`, t5);
|
135316
|
+
} else if (e4.optional) {
|
135317
|
+
let t5 = null;
|
135255
135318
|
if (s2.length > 0 && !maybeOption(s2[0])) {
|
135256
|
-
|
135319
|
+
t5 = s2.shift();
|
135257
135320
|
}
|
135258
|
-
this.emit(`option:${
|
135321
|
+
this.emit(`option:${e4.name()}`, t5);
|
135259
135322
|
} else {
|
135260
|
-
this.emit(`option:${
|
135323
|
+
this.emit(`option:${e4.name()}`);
|
135261
135324
|
}
|
135262
|
-
r2 =
|
135325
|
+
r2 = e4.variadic ? e4 : null;
|
135263
135326
|
continue;
|
135264
135327
|
}
|
135265
135328
|
}
|
135266
|
-
if (
|
135267
|
-
const
|
135268
|
-
if (
|
135269
|
-
if (
|
135270
|
-
this.emit(`option:${
|
135329
|
+
if (t4.length > 2 && t4[0] === "-" && t4[1] !== "-") {
|
135330
|
+
const e4 = this._findOption(`-${t4[1]}`);
|
135331
|
+
if (e4) {
|
135332
|
+
if (e4.required || e4.optional && this._combineFlagAndOptionalValue) {
|
135333
|
+
this.emit(`option:${e4.name()}`, t4.slice(2));
|
135271
135334
|
} else {
|
135272
|
-
this.emit(`option:${
|
135273
|
-
s2.unshift(`-${
|
135335
|
+
this.emit(`option:${e4.name()}`);
|
135336
|
+
s2.unshift(`-${t4.slice(2)}`);
|
135274
135337
|
}
|
135275
135338
|
continue;
|
135276
135339
|
}
|
135277
135340
|
}
|
135278
|
-
if (/^--[^=]+=/.test(
|
135279
|
-
const
|
135280
|
-
const i4 = this._findOption(
|
135341
|
+
if (/^--[^=]+=/.test(t4)) {
|
135342
|
+
const e4 = t4.indexOf("=");
|
135343
|
+
const i4 = this._findOption(t4.slice(0, e4));
|
135281
135344
|
if (i4 && (i4.required || i4.optional)) {
|
135282
|
-
this.emit(`option:${i4.name()}`,
|
135345
|
+
this.emit(`option:${i4.name()}`, t4.slice(e4 + 1));
|
135283
135346
|
continue;
|
135284
135347
|
}
|
135285
135348
|
}
|
135286
|
-
if (maybeOption(
|
135349
|
+
if (maybeOption(t4)) {
|
135287
135350
|
n2 = i3;
|
135288
135351
|
}
|
135289
|
-
if ((this._enablePositionalOptions || this._passThroughOptions) &&
|
135290
|
-
if (this._findCommand(
|
135291
|
-
|
135352
|
+
if ((this._enablePositionalOptions || this._passThroughOptions) && e3.length === 0 && i3.length === 0) {
|
135353
|
+
if (this._findCommand(t4)) {
|
135354
|
+
e3.push(t4);
|
135292
135355
|
if (s2.length > 0)
|
135293
135356
|
i3.push(...s2);
|
135294
135357
|
break;
|
135295
|
-
} else if (
|
135296
|
-
|
135358
|
+
} else if (t4 === this._helpCommandName && this._hasImplicitHelpCommand()) {
|
135359
|
+
e3.push(t4);
|
135297
135360
|
if (s2.length > 0)
|
135298
|
-
|
135361
|
+
e3.push(...s2);
|
135299
135362
|
break;
|
135300
135363
|
} else if (this._defaultCommandName) {
|
135301
|
-
i3.push(
|
135364
|
+
i3.push(t4);
|
135302
135365
|
if (s2.length > 0)
|
135303
135366
|
i3.push(...s2);
|
135304
135367
|
break;
|
135305
135368
|
}
|
135306
135369
|
}
|
135307
135370
|
if (this._passThroughOptions) {
|
135308
|
-
n2.push(
|
135371
|
+
n2.push(t4);
|
135309
135372
|
if (s2.length > 0)
|
135310
135373
|
n2.push(...s2);
|
135311
135374
|
break;
|
135312
135375
|
}
|
135313
|
-
n2.push(
|
135376
|
+
n2.push(t4);
|
135314
135377
|
}
|
135315
|
-
return { operands:
|
135378
|
+
return { operands: e3, unknown: i3 };
|
135316
135379
|
}
|
135317
135380
|
opts() {
|
135318
135381
|
if (this._storeOptionsAsProperties) {
|
135319
|
-
const
|
135320
|
-
const
|
135321
|
-
for (let i3 = 0; i3 <
|
135322
|
-
const
|
135323
|
-
|
135382
|
+
const t3 = {};
|
135383
|
+
const e3 = this.options.length;
|
135384
|
+
for (let i3 = 0; i3 < e3; i3++) {
|
135385
|
+
const e4 = this.options[i3].attributeName();
|
135386
|
+
t3[e4] = e4 === this._versionOptionName ? this._version : this[e4];
|
135324
135387
|
}
|
135325
|
-
return
|
135388
|
+
return t3;
|
135326
135389
|
}
|
135327
135390
|
return this._optionValues;
|
135328
135391
|
}
|
135329
|
-
|
135330
|
-
this.
|
135392
|
+
optsWithGlobals() {
|
135393
|
+
return getCommandAndParents(this).reduce((t3, e3) => Object.assign(t3, e3.opts()), {});
|
135394
|
+
}
|
135395
|
+
error(t3, e3) {
|
135396
|
+
this._outputConfiguration.outputError(`${t3}
|
135331
135397
|
`, this._outputConfiguration.writeErr);
|
135332
135398
|
if (typeof this._showHelpAfterError === "string") {
|
135333
135399
|
this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
@@ -135336,166 +135402,217 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135336
135402
|
this._outputConfiguration.writeErr("\n");
|
135337
135403
|
this.outputHelp({ error: true });
|
135338
135404
|
}
|
135339
|
-
|
135405
|
+
const i3 = e3 || {};
|
135406
|
+
const n2 = i3.exitCode || 1;
|
135407
|
+
const s2 = i3.code || "commander.error";
|
135408
|
+
this._exit(n2, s2, t3);
|
135340
135409
|
}
|
135341
135410
|
_parseOptionsEnv() {
|
135342
|
-
this.options.forEach((
|
135343
|
-
if (
|
135344
|
-
const
|
135345
|
-
if (this.getOptionValue(
|
135346
|
-
if (
|
135347
|
-
this.emit(`optionEnv:${
|
135411
|
+
this.options.forEach((t3) => {
|
135412
|
+
if (t3.envVar && t3.envVar in a.env) {
|
135413
|
+
const e3 = t3.attributeName();
|
135414
|
+
if (this.getOptionValue(e3) === void 0 || ["default", "config", "env"].includes(this.getOptionValueSource(e3))) {
|
135415
|
+
if (t3.required || t3.optional) {
|
135416
|
+
this.emit(`optionEnv:${t3.name()}`, a.env[t3.envVar]);
|
135348
135417
|
} else {
|
135349
|
-
this.emit(`optionEnv:${
|
135418
|
+
this.emit(`optionEnv:${t3.name()}`);
|
135350
135419
|
}
|
135351
135420
|
}
|
135352
135421
|
}
|
135353
135422
|
});
|
135354
135423
|
}
|
135355
|
-
|
135356
|
-
const t3 =
|
135357
|
-
this.
|
135358
|
-
|
135359
|
-
|
135360
|
-
|
135361
|
-
|
135424
|
+
_parseOptionsImplied() {
|
135425
|
+
const t3 = new d(this.options);
|
135426
|
+
const hasCustomOptionValue = (t4) => this.getOptionValue(t4) !== void 0 && !["default", "implied"].includes(this.getOptionValueSource(t4));
|
135427
|
+
this.options.filter((e3) => e3.implied !== void 0 && hasCustomOptionValue(e3.attributeName()) && t3.valueFromOption(this.getOptionValue(e3.attributeName()), e3)).forEach((t4) => {
|
135428
|
+
Object.keys(t4.implied).filter((t5) => !hasCustomOptionValue(t5)).forEach((e3) => {
|
135429
|
+
this.setOptionValueWithSource(e3, t4.implied[e3], "implied");
|
135430
|
+
});
|
135431
|
+
});
|
135362
135432
|
}
|
135363
|
-
|
135364
|
-
const
|
135365
|
-
this.
|
135433
|
+
missingArgument(t3) {
|
135434
|
+
const e3 = `error: missing required argument '${t3}'`;
|
135435
|
+
this.error(e3, { code: "commander.missingArgument" });
|
135436
|
+
}
|
135437
|
+
optionMissingArgument(t3) {
|
135438
|
+
const e3 = `error: option '${t3.flags}' argument missing`;
|
135439
|
+
this.error(e3, { code: "commander.optionMissingArgument" });
|
135440
|
+
}
|
135441
|
+
missingMandatoryOptionValue(t3) {
|
135442
|
+
const e3 = `error: required option '${t3.flags}' not specified`;
|
135443
|
+
this.error(e3, { code: "commander.missingMandatoryOptionValue" });
|
135444
|
+
}
|
135445
|
+
_conflictingOption(t3, e3) {
|
135446
|
+
const findBestOptionFromValue = (t4) => {
|
135447
|
+
const e4 = t4.attributeName();
|
135448
|
+
const i4 = this.getOptionValue(e4);
|
135449
|
+
const n2 = this.options.find((t5) => t5.negate && e4 === t5.attributeName());
|
135450
|
+
const s2 = this.options.find((t5) => !t5.negate && e4 === t5.attributeName());
|
135451
|
+
if (n2 && (n2.presetArg === void 0 && i4 === false || n2.presetArg !== void 0 && i4 === n2.presetArg)) {
|
135452
|
+
return n2;
|
135453
|
+
}
|
135454
|
+
return s2 || t4;
|
135455
|
+
};
|
135456
|
+
const getErrorMessage = (t4) => {
|
135457
|
+
const e4 = findBestOptionFromValue(t4);
|
135458
|
+
const i4 = e4.attributeName();
|
135459
|
+
const n2 = this.getOptionValueSource(i4);
|
135460
|
+
if (n2 === "env") {
|
135461
|
+
return `environment variable '${e4.envVar}'`;
|
135462
|
+
}
|
135463
|
+
return `option '${e4.flags}'`;
|
135464
|
+
};
|
135465
|
+
const i3 = `error: ${getErrorMessage(t3)} cannot be used with ${getErrorMessage(e3)}`;
|
135466
|
+
this.error(i3, { code: "commander.conflictingOption" });
|
135366
135467
|
}
|
135367
|
-
unknownOption(
|
135468
|
+
unknownOption(t3) {
|
135368
135469
|
if (this._allowUnknownOption)
|
135369
135470
|
return;
|
135370
|
-
let
|
135371
|
-
if (
|
135471
|
+
let e3 = "";
|
135472
|
+
if (t3.startsWith("--") && this._showSuggestionAfterError) {
|
135372
135473
|
let i4 = [];
|
135373
135474
|
let n2 = this;
|
135374
135475
|
do {
|
135375
|
-
const
|
135376
|
-
i4 = i4.concat(
|
135476
|
+
const t4 = n2.createHelp().visibleOptions(n2).filter((t5) => t5.long).map((t5) => t5.long);
|
135477
|
+
i4 = i4.concat(t4);
|
135377
135478
|
n2 = n2.parent;
|
135378
135479
|
} while (n2 && !n2._enablePositionalOptions);
|
135379
|
-
|
135480
|
+
e3 = f(t3, i4);
|
135380
135481
|
}
|
135381
|
-
const i3 = `error: unknown option '${
|
135382
|
-
this.
|
135482
|
+
const i3 = `error: unknown option '${t3}'${e3}`;
|
135483
|
+
this.error(i3, { code: "commander.unknownOption" });
|
135383
135484
|
}
|
135384
|
-
_excessArguments(
|
135485
|
+
_excessArguments(t3) {
|
135385
135486
|
if (this._allowExcessArguments)
|
135386
135487
|
return;
|
135387
|
-
const
|
135388
|
-
const i3 =
|
135488
|
+
const e3 = this._args.length;
|
135489
|
+
const i3 = e3 === 1 ? "" : "s";
|
135389
135490
|
const n2 = this.parent ? ` for '${this.name()}'` : "";
|
135390
|
-
const s2 = `error: too many arguments${n2}. Expected ${
|
135391
|
-
this.
|
135491
|
+
const s2 = `error: too many arguments${n2}. Expected ${e3} argument${i3} but got ${t3.length}.`;
|
135492
|
+
this.error(s2, { code: "commander.excessArguments" });
|
135392
135493
|
}
|
135393
135494
|
unknownCommand() {
|
135394
|
-
const
|
135395
|
-
let
|
135495
|
+
const t3 = this.args[0];
|
135496
|
+
let e3 = "";
|
135396
135497
|
if (this._showSuggestionAfterError) {
|
135397
135498
|
const i4 = [];
|
135398
|
-
this.createHelp().visibleCommands(this).forEach((
|
135399
|
-
i4.push(
|
135400
|
-
if (
|
135401
|
-
i4.push(
|
135499
|
+
this.createHelp().visibleCommands(this).forEach((t4) => {
|
135500
|
+
i4.push(t4.name());
|
135501
|
+
if (t4.alias())
|
135502
|
+
i4.push(t4.alias());
|
135402
135503
|
});
|
135403
|
-
|
135504
|
+
e3 = f(t3, i4);
|
135404
135505
|
}
|
135405
|
-
const i3 = `error: unknown command '${
|
135406
|
-
this.
|
135506
|
+
const i3 = `error: unknown command '${t3}'${e3}`;
|
135507
|
+
this.error(i3, { code: "commander.unknownCommand" });
|
135407
135508
|
}
|
135408
|
-
version(
|
135409
|
-
if (
|
135509
|
+
version(t3, e3, i3) {
|
135510
|
+
if (t3 === void 0)
|
135410
135511
|
return this._version;
|
135411
|
-
this._version =
|
135412
|
-
|
135512
|
+
this._version = t3;
|
135513
|
+
e3 = e3 || "-V, --version";
|
135413
135514
|
i3 = i3 || "output the version number";
|
135414
|
-
const n2 = this.createOption(
|
135515
|
+
const n2 = this.createOption(e3, i3);
|
135415
135516
|
this._versionOptionName = n2.attributeName();
|
135416
135517
|
this.options.push(n2);
|
135417
135518
|
this.on("option:" + n2.name(), () => {
|
135418
|
-
this._outputConfiguration.writeOut(`${
|
135519
|
+
this._outputConfiguration.writeOut(`${t3}
|
135419
135520
|
`);
|
135420
|
-
this._exit(0, "commander.version",
|
135521
|
+
this._exit(0, "commander.version", t3);
|
135421
135522
|
});
|
135422
135523
|
return this;
|
135423
135524
|
}
|
135424
|
-
description(
|
135425
|
-
if (
|
135525
|
+
description(t3, e3) {
|
135526
|
+
if (t3 === void 0 && e3 === void 0)
|
135426
135527
|
return this._description;
|
135427
|
-
this._description =
|
135428
|
-
if (
|
135429
|
-
this._argsDescription =
|
135528
|
+
this._description = t3;
|
135529
|
+
if (e3) {
|
135530
|
+
this._argsDescription = e3;
|
135430
135531
|
}
|
135431
135532
|
return this;
|
135432
135533
|
}
|
135433
|
-
|
135434
|
-
if (
|
135534
|
+
summary(t3) {
|
135535
|
+
if (t3 === void 0)
|
135536
|
+
return this._summary;
|
135537
|
+
this._summary = t3;
|
135538
|
+
return this;
|
135539
|
+
}
|
135540
|
+
alias(t3) {
|
135541
|
+
if (t3 === void 0)
|
135435
135542
|
return this._aliases[0];
|
135436
|
-
let
|
135543
|
+
let e3 = this;
|
135437
135544
|
if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
|
135438
|
-
|
135545
|
+
e3 = this.commands[this.commands.length - 1];
|
135439
135546
|
}
|
135440
|
-
if (
|
135547
|
+
if (t3 === e3._name)
|
135441
135548
|
throw new Error("Command alias can't be the same as its name");
|
135442
|
-
|
135549
|
+
e3._aliases.push(t3);
|
135443
135550
|
return this;
|
135444
135551
|
}
|
135445
|
-
aliases(
|
135446
|
-
if (
|
135552
|
+
aliases(t3) {
|
135553
|
+
if (t3 === void 0)
|
135447
135554
|
return this._aliases;
|
135448
|
-
|
135555
|
+
t3.forEach((t4) => this.alias(t4));
|
135449
135556
|
return this;
|
135450
135557
|
}
|
135451
|
-
usage(
|
135452
|
-
if (
|
135558
|
+
usage(t3) {
|
135559
|
+
if (t3 === void 0) {
|
135453
135560
|
if (this._usage)
|
135454
135561
|
return this._usage;
|
135455
|
-
const
|
135456
|
-
return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this._args.length ?
|
135562
|
+
const t4 = this._args.map((t5) => h(t5));
|
135563
|
+
return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this._args.length ? t4 : []).join(" ");
|
135457
135564
|
}
|
135458
|
-
this._usage =
|
135565
|
+
this._usage = t3;
|
135459
135566
|
return this;
|
135460
135567
|
}
|
135461
|
-
name(
|
135462
|
-
if (
|
135568
|
+
name(t3) {
|
135569
|
+
if (t3 === void 0)
|
135463
135570
|
return this._name;
|
135464
|
-
this._name =
|
135571
|
+
this._name = t3;
|
135465
135572
|
return this;
|
135466
135573
|
}
|
135467
|
-
|
135468
|
-
|
135469
|
-
|
135470
|
-
|
135574
|
+
nameFromFilename(t3) {
|
135575
|
+
this._name = r.basename(t3, r.extname(t3));
|
135576
|
+
return this;
|
135577
|
+
}
|
135578
|
+
executableDir(t3) {
|
135579
|
+
if (t3 === void 0)
|
135580
|
+
return this._executableDir;
|
135581
|
+
this._executableDir = t3;
|
135582
|
+
return this;
|
135583
|
+
}
|
135584
|
+
helpInformation(t3) {
|
135585
|
+
const e3 = this.createHelp();
|
135586
|
+
if (e3.helpWidth === void 0) {
|
135587
|
+
e3.helpWidth = t3 && t3.error ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
|
135471
135588
|
}
|
135472
|
-
return
|
135589
|
+
return e3.formatHelp(this, e3);
|
135473
135590
|
}
|
135474
|
-
_getHelpContext(
|
135475
|
-
|
135476
|
-
const
|
135591
|
+
_getHelpContext(t3) {
|
135592
|
+
t3 = t3 || {};
|
135593
|
+
const e3 = { error: !!t3.error };
|
135477
135594
|
let i3;
|
135478
|
-
if (
|
135479
|
-
i3 = (
|
135595
|
+
if (e3.error) {
|
135596
|
+
i3 = (t4) => this._outputConfiguration.writeErr(t4);
|
135480
135597
|
} else {
|
135481
|
-
i3 = (
|
135598
|
+
i3 = (t4) => this._outputConfiguration.writeOut(t4);
|
135482
135599
|
}
|
135483
|
-
|
135484
|
-
|
135485
|
-
return
|
135600
|
+
e3.write = t3.write || i3;
|
135601
|
+
e3.command = this;
|
135602
|
+
return e3;
|
135486
135603
|
}
|
135487
|
-
outputHelp(
|
135488
|
-
let
|
135489
|
-
if (typeof
|
135490
|
-
|
135491
|
-
|
135604
|
+
outputHelp(t3) {
|
135605
|
+
let e3;
|
135606
|
+
if (typeof t3 === "function") {
|
135607
|
+
e3 = t3;
|
135608
|
+
t3 = void 0;
|
135492
135609
|
}
|
135493
|
-
const i3 = this._getHelpContext(
|
135494
|
-
getCommandAndParents(this).reverse().forEach((
|
135610
|
+
const i3 = this._getHelpContext(t3);
|
135611
|
+
getCommandAndParents(this).reverse().forEach((t4) => t4.emit("beforeAllHelp", i3));
|
135495
135612
|
this.emit("beforeHelp", i3);
|
135496
135613
|
let n2 = this.helpInformation(i3);
|
135497
|
-
if (
|
135498
|
-
n2 =
|
135614
|
+
if (e3) {
|
135615
|
+
n2 = e3(n2);
|
135499
135616
|
if (typeof n2 !== "string" && !Buffer.isBuffer(n2)) {
|
135500
135617
|
throw new Error("outputHelp callback must return a string or a Buffer");
|
135501
135618
|
}
|
@@ -135503,306 +135620,342 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135503
135620
|
i3.write(n2);
|
135504
135621
|
this.emit(this._helpLongFlag);
|
135505
135622
|
this.emit("afterHelp", i3);
|
135506
|
-
getCommandAndParents(this).forEach((
|
135623
|
+
getCommandAndParents(this).forEach((t4) => t4.emit("afterAllHelp", i3));
|
135507
135624
|
}
|
135508
|
-
helpOption(
|
135509
|
-
if (typeof
|
135510
|
-
this._hasHelpOption =
|
135625
|
+
helpOption(t3, e3) {
|
135626
|
+
if (typeof t3 === "boolean") {
|
135627
|
+
this._hasHelpOption = t3;
|
135511
135628
|
return this;
|
135512
135629
|
}
|
135513
|
-
this._helpFlags =
|
135514
|
-
this._helpDescription =
|
135515
|
-
const i3 =
|
135630
|
+
this._helpFlags = t3 || this._helpFlags;
|
135631
|
+
this._helpDescription = e3 || this._helpDescription;
|
135632
|
+
const i3 = m(this._helpFlags);
|
135516
135633
|
this._helpShortFlag = i3.shortFlag;
|
135517
135634
|
this._helpLongFlag = i3.longFlag;
|
135518
135635
|
return this;
|
135519
135636
|
}
|
135520
|
-
help(
|
135521
|
-
this.outputHelp(
|
135522
|
-
let
|
135523
|
-
if (
|
135524
|
-
|
135637
|
+
help(t3) {
|
135638
|
+
this.outputHelp(t3);
|
135639
|
+
let e3 = a.exitCode || 0;
|
135640
|
+
if (e3 === 0 && t3 && typeof t3 !== "function" && t3.error) {
|
135641
|
+
e3 = 1;
|
135525
135642
|
}
|
135526
|
-
this._exit(
|
135643
|
+
this._exit(e3, "commander.help", "(outputHelp)");
|
135527
135644
|
}
|
135528
|
-
addHelpText(
|
135645
|
+
addHelpText(t3, e3) {
|
135529
135646
|
const i3 = ["beforeAll", "before", "after", "afterAll"];
|
135530
|
-
if (!i3.includes(
|
135647
|
+
if (!i3.includes(t3)) {
|
135531
135648
|
throw new Error(`Unexpected value for position to addHelpText.
|
135532
135649
|
Expecting one of '${i3.join("', '")}'`);
|
135533
135650
|
}
|
135534
|
-
const n2 = `${
|
135535
|
-
this.on(n2, (
|
135651
|
+
const n2 = `${t3}Help`;
|
135652
|
+
this.on(n2, (t4) => {
|
135536
135653
|
let i4;
|
135537
|
-
if (typeof
|
135538
|
-
i4 =
|
135654
|
+
if (typeof e3 === "function") {
|
135655
|
+
i4 = e3({ error: t4.error, command: t4.command });
|
135539
135656
|
} else {
|
135540
|
-
i4 =
|
135657
|
+
i4 = e3;
|
135541
135658
|
}
|
135542
135659
|
if (i4) {
|
135543
|
-
|
135660
|
+
t4.write(`${i4}
|
135544
135661
|
`);
|
135545
135662
|
}
|
135546
135663
|
});
|
135547
135664
|
return this;
|
135548
135665
|
}
|
135549
135666
|
}
|
135550
|
-
function outputHelpIfRequested(
|
135551
|
-
const i3 =
|
135667
|
+
function outputHelpIfRequested(t3, e3) {
|
135668
|
+
const i3 = t3._hasHelpOption && e3.find((e4) => e4 === t3._helpLongFlag || e4 === t3._helpShortFlag);
|
135552
135669
|
if (i3) {
|
135553
|
-
|
135554
|
-
|
135670
|
+
t3.outputHelp();
|
135671
|
+
t3._exit(0, "commander.helpDisplayed", "(outputHelp)");
|
135555
135672
|
}
|
135556
135673
|
}
|
135557
|
-
function incrementNodeInspectorPort(
|
135558
|
-
return
|
135559
|
-
if (!
|
135560
|
-
return
|
135674
|
+
function incrementNodeInspectorPort(t3) {
|
135675
|
+
return t3.map((t4) => {
|
135676
|
+
if (!t4.startsWith("--inspect")) {
|
135677
|
+
return t4;
|
135561
135678
|
}
|
135562
|
-
let
|
135679
|
+
let e3;
|
135563
135680
|
let i3 = "127.0.0.1";
|
135564
135681
|
let n2 = "9229";
|
135565
135682
|
let s2;
|
135566
|
-
if ((s2 =
|
135567
|
-
|
135568
|
-
} else if ((s2 =
|
135569
|
-
|
135683
|
+
if ((s2 = t4.match(/^(--inspect(-brk)?)$/)) !== null) {
|
135684
|
+
e3 = s2[1];
|
135685
|
+
} else if ((s2 = t4.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
|
135686
|
+
e3 = s2[1];
|
135570
135687
|
if (/^\d+$/.test(s2[3])) {
|
135571
135688
|
n2 = s2[3];
|
135572
135689
|
} else {
|
135573
135690
|
i3 = s2[3];
|
135574
135691
|
}
|
135575
|
-
} else if ((s2 =
|
135576
|
-
|
135692
|
+
} else if ((s2 = t4.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
|
135693
|
+
e3 = s2[1];
|
135577
135694
|
i3 = s2[3];
|
135578
135695
|
n2 = s2[4];
|
135579
135696
|
}
|
135580
|
-
if (
|
135581
|
-
return `${
|
135697
|
+
if (e3 && n2 !== "0") {
|
135698
|
+
return `${e3}=${i3}:${parseInt(n2) + 1}`;
|
135582
135699
|
}
|
135583
|
-
return
|
135700
|
+
return t4;
|
135584
135701
|
});
|
135585
135702
|
}
|
135586
|
-
function getCommandAndParents(
|
135587
|
-
const
|
135588
|
-
for (let i3 =
|
135589
|
-
|
135703
|
+
function getCommandAndParents(t3) {
|
135704
|
+
const e3 = [];
|
135705
|
+
for (let i3 = t3; i3; i3 = i3.parent) {
|
135706
|
+
e3.push(i3);
|
135590
135707
|
}
|
135591
|
-
return
|
135708
|
+
return e3;
|
135592
135709
|
}
|
135593
|
-
|
135594
|
-
},
|
135710
|
+
e2.Command = Command2;
|
135711
|
+
}, 796: (t2, e2) => {
|
135595
135712
|
class CommanderError extends Error {
|
135596
|
-
constructor(
|
135713
|
+
constructor(t3, e3, i2) {
|
135597
135714
|
super(i2);
|
135598
135715
|
Error.captureStackTrace(this, this.constructor);
|
135599
135716
|
this.name = this.constructor.name;
|
135600
|
-
this.code =
|
135601
|
-
this.exitCode =
|
135717
|
+
this.code = e3;
|
135718
|
+
this.exitCode = t3;
|
135602
135719
|
this.nestedError = void 0;
|
135603
135720
|
}
|
135604
135721
|
}
|
135605
135722
|
class InvalidArgumentError extends CommanderError {
|
135606
|
-
constructor(
|
135607
|
-
super(1, "commander.invalidArgument",
|
135723
|
+
constructor(t3) {
|
135724
|
+
super(1, "commander.invalidArgument", t3);
|
135608
135725
|
Error.captureStackTrace(this, this.constructor);
|
135609
135726
|
this.name = this.constructor.name;
|
135610
135727
|
}
|
135611
135728
|
}
|
135612
|
-
|
135613
|
-
|
135614
|
-
},
|
135615
|
-
const { humanReadableArgName: n } = i2(
|
135729
|
+
e2.CommanderError = CommanderError;
|
135730
|
+
e2.InvalidArgumentError = InvalidArgumentError;
|
135731
|
+
}, 519: (t2, e2, i2) => {
|
135732
|
+
const { humanReadableArgName: n } = i2(535);
|
135616
135733
|
class Help {
|
135617
135734
|
constructor() {
|
135618
135735
|
this.helpWidth = void 0;
|
135619
135736
|
this.sortSubcommands = false;
|
135620
135737
|
this.sortOptions = false;
|
135621
|
-
|
135622
|
-
|
135623
|
-
|
135624
|
-
|
135625
|
-
|
135626
|
-
const
|
135627
|
-
s.
|
135738
|
+
this.showGlobalOptions = false;
|
135739
|
+
}
|
135740
|
+
visibleCommands(t3) {
|
135741
|
+
const e3 = t3.commands.filter((t4) => !t4._hidden);
|
135742
|
+
if (t3._hasImplicitHelpCommand()) {
|
135743
|
+
const [, i3, n2] = t3._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);
|
135744
|
+
const s = t3.createCommand(i3).helpOption(false);
|
135745
|
+
s.description(t3._helpCommandDescription);
|
135628
135746
|
if (n2)
|
135629
135747
|
s.arguments(n2);
|
135630
|
-
|
135748
|
+
e3.push(s);
|
135631
135749
|
}
|
135632
135750
|
if (this.sortSubcommands) {
|
135633
|
-
|
135751
|
+
e3.sort((t4, e4) => t4.name().localeCompare(e4.name()));
|
135634
135752
|
}
|
135635
|
-
return
|
135753
|
+
return e3;
|
135636
135754
|
}
|
135637
|
-
|
135638
|
-
const
|
135639
|
-
|
135640
|
-
|
135755
|
+
compareOptions(t3, e3) {
|
135756
|
+
const getSortKey = (t4) => t4.short ? t4.short.replace(/^-/, "") : t4.long.replace(/^--/, "");
|
135757
|
+
return getSortKey(t3).localeCompare(getSortKey(e3));
|
135758
|
+
}
|
135759
|
+
visibleOptions(t3) {
|
135760
|
+
const e3 = t3.options.filter((t4) => !t4.hidden);
|
135761
|
+
const i3 = t3._hasHelpOption && t3._helpShortFlag && !t3._findOption(t3._helpShortFlag);
|
135762
|
+
const n2 = t3._hasHelpOption && !t3._findOption(t3._helpLongFlag);
|
135641
135763
|
if (i3 || n2) {
|
135642
135764
|
let s;
|
135643
135765
|
if (!i3) {
|
135644
|
-
s =
|
135766
|
+
s = t3.createOption(t3._helpLongFlag, t3._helpDescription);
|
135645
135767
|
} else if (!n2) {
|
135646
|
-
s =
|
135768
|
+
s = t3.createOption(t3._helpShortFlag, t3._helpDescription);
|
135647
135769
|
} else {
|
135648
|
-
s =
|
135770
|
+
s = t3.createOption(t3._helpFlags, t3._helpDescription);
|
135649
135771
|
}
|
135650
|
-
|
135772
|
+
e3.push(s);
|
135651
135773
|
}
|
135652
135774
|
if (this.sortOptions) {
|
135653
|
-
|
135654
|
-
t3.sort((e4, t4) => getSortKey(e4).localeCompare(getSortKey(t4)));
|
135775
|
+
e3.sort(this.compareOptions);
|
135655
135776
|
}
|
135656
|
-
return
|
135777
|
+
return e3;
|
135657
135778
|
}
|
135658
|
-
|
135659
|
-
if (
|
135660
|
-
|
135661
|
-
|
135779
|
+
visibleGlobalOptions(t3) {
|
135780
|
+
if (!this.showGlobalOptions)
|
135781
|
+
return [];
|
135782
|
+
const e3 = [];
|
135783
|
+
for (let i3 = t3.parent; i3; i3 = i3.parent) {
|
135784
|
+
const t4 = i3.options.filter((t5) => !t5.hidden);
|
135785
|
+
e3.push(...t4);
|
135786
|
+
}
|
135787
|
+
if (this.sortOptions) {
|
135788
|
+
e3.sort(this.compareOptions);
|
135789
|
+
}
|
135790
|
+
return e3;
|
135791
|
+
}
|
135792
|
+
visibleArguments(t3) {
|
135793
|
+
if (t3._argsDescription) {
|
135794
|
+
t3._args.forEach((e3) => {
|
135795
|
+
e3.description = e3.description || t3._argsDescription[e3.name()] || "";
|
135662
135796
|
});
|
135663
135797
|
}
|
135664
|
-
if (
|
135665
|
-
return
|
135798
|
+
if (t3._args.find((t4) => t4.description)) {
|
135799
|
+
return t3._args;
|
135666
135800
|
}
|
135667
135801
|
return [];
|
135668
135802
|
}
|
135669
|
-
subcommandTerm(
|
135670
|
-
const
|
135671
|
-
return
|
135803
|
+
subcommandTerm(t3) {
|
135804
|
+
const e3 = t3._args.map((t4) => n(t4)).join(" ");
|
135805
|
+
return t3._name + (t3._aliases[0] ? "|" + t3._aliases[0] : "") + (t3.options.length ? " [options]" : "") + (e3 ? " " + e3 : "");
|
135672
135806
|
}
|
135673
|
-
optionTerm(
|
135674
|
-
return
|
135807
|
+
optionTerm(t3) {
|
135808
|
+
return t3.flags;
|
135675
135809
|
}
|
135676
|
-
argumentTerm(
|
135677
|
-
return
|
135810
|
+
argumentTerm(t3) {
|
135811
|
+
return t3.name();
|
135678
135812
|
}
|
135679
|
-
longestSubcommandTermLength(
|
135680
|
-
return
|
135813
|
+
longestSubcommandTermLength(t3, e3) {
|
135814
|
+
return e3.visibleCommands(t3).reduce((t4, i3) => Math.max(t4, e3.subcommandTerm(i3).length), 0);
|
135681
135815
|
}
|
135682
|
-
longestOptionTermLength(
|
135683
|
-
return
|
135816
|
+
longestOptionTermLength(t3, e3) {
|
135817
|
+
return e3.visibleOptions(t3).reduce((t4, i3) => Math.max(t4, e3.optionTerm(i3).length), 0);
|
135684
135818
|
}
|
135685
|
-
|
135686
|
-
return
|
135819
|
+
longestGlobalOptionTermLength(t3, e3) {
|
135820
|
+
return e3.visibleGlobalOptions(t3).reduce((t4, i3) => Math.max(t4, e3.optionTerm(i3).length), 0);
|
135687
135821
|
}
|
135688
|
-
|
135689
|
-
|
135690
|
-
|
135691
|
-
|
135822
|
+
longestArgumentTermLength(t3, e3) {
|
135823
|
+
return e3.visibleArguments(t3).reduce((t4, i3) => Math.max(t4, e3.argumentTerm(i3).length), 0);
|
135824
|
+
}
|
135825
|
+
commandUsage(t3) {
|
135826
|
+
let e3 = t3._name;
|
135827
|
+
if (t3._aliases[0]) {
|
135828
|
+
e3 = e3 + "|" + t3._aliases[0];
|
135692
135829
|
}
|
135693
135830
|
let i3 = "";
|
135694
|
-
for (let
|
135695
|
-
i3 =
|
135831
|
+
for (let e4 = t3.parent; e4; e4 = e4.parent) {
|
135832
|
+
i3 = e4.name() + " " + i3;
|
135696
135833
|
}
|
135697
|
-
return i3 +
|
135834
|
+
return i3 + e3 + " " + t3.usage();
|
135698
135835
|
}
|
135699
|
-
commandDescription(
|
135700
|
-
return
|
135836
|
+
commandDescription(t3) {
|
135837
|
+
return t3.description();
|
135701
135838
|
}
|
135702
|
-
subcommandDescription(
|
135703
|
-
return
|
135839
|
+
subcommandDescription(t3) {
|
135840
|
+
return t3.summary() || t3.description();
|
135704
135841
|
}
|
135705
|
-
optionDescription(
|
135706
|
-
const
|
135707
|
-
if (
|
135708
|
-
|
135842
|
+
optionDescription(t3) {
|
135843
|
+
const e3 = [];
|
135844
|
+
if (t3.argChoices) {
|
135845
|
+
e3.push(`choices: ${t3.argChoices.map((t4) => JSON.stringify(t4)).join(", ")}`);
|
135709
135846
|
}
|
135710
|
-
if (
|
135711
|
-
t3.
|
135847
|
+
if (t3.defaultValue !== void 0) {
|
135848
|
+
const i3 = t3.required || t3.optional || t3.isBoolean() && typeof t3.defaultValue === "boolean";
|
135849
|
+
if (i3) {
|
135850
|
+
e3.push(`default: ${t3.defaultValueDescription || JSON.stringify(t3.defaultValue)}`);
|
135851
|
+
}
|
135712
135852
|
}
|
135713
|
-
if (
|
135714
|
-
|
135853
|
+
if (t3.presetArg !== void 0 && t3.optional) {
|
135854
|
+
e3.push(`preset: ${JSON.stringify(t3.presetArg)}`);
|
135715
135855
|
}
|
135716
|
-
if (t3.
|
135717
|
-
|
135856
|
+
if (t3.envVar !== void 0) {
|
135857
|
+
e3.push(`env: ${t3.envVar}`);
|
135718
135858
|
}
|
135719
|
-
|
135720
|
-
|
135721
|
-
argumentDescription(e3) {
|
135722
|
-
const t3 = [];
|
135723
|
-
if (e3.argChoices) {
|
135724
|
-
t3.push(`choices: ${e3.argChoices.map((e4) => JSON.stringify(e4)).join(", ")}`);
|
135859
|
+
if (e3.length > 0) {
|
135860
|
+
return `${t3.description} (${e3.join(", ")})`;
|
135725
135861
|
}
|
135726
|
-
|
135727
|
-
|
135728
|
-
|
135729
|
-
|
135730
|
-
|
135731
|
-
|
135732
|
-
|
135862
|
+
return t3.description;
|
135863
|
+
}
|
135864
|
+
argumentDescription(t3) {
|
135865
|
+
const e3 = [];
|
135866
|
+
if (t3.argChoices) {
|
135867
|
+
e3.push(`choices: ${t3.argChoices.map((t4) => JSON.stringify(t4)).join(", ")}`);
|
135868
|
+
}
|
135869
|
+
if (t3.defaultValue !== void 0) {
|
135870
|
+
e3.push(`default: ${t3.defaultValueDescription || JSON.stringify(t3.defaultValue)}`);
|
135871
|
+
}
|
135872
|
+
if (e3.length > 0) {
|
135873
|
+
const i3 = `(${e3.join(", ")})`;
|
135874
|
+
if (t3.description) {
|
135875
|
+
return `${t3.description} ${i3}`;
|
135733
135876
|
}
|
135734
135877
|
return i3;
|
135735
135878
|
}
|
135736
|
-
return
|
135879
|
+
return t3.description;
|
135737
135880
|
}
|
135738
|
-
formatHelp(
|
135739
|
-
const i3 =
|
135740
|
-
const n2 =
|
135881
|
+
formatHelp(t3, e3) {
|
135882
|
+
const i3 = e3.padWidth(t3, e3);
|
135883
|
+
const n2 = e3.helpWidth || 80;
|
135741
135884
|
const s = 2;
|
135742
135885
|
const r = 2;
|
135743
|
-
function formatItem(
|
135886
|
+
function formatItem(t4, o2) {
|
135744
135887
|
if (o2) {
|
135745
|
-
const a2 = `${
|
135746
|
-
return
|
135888
|
+
const a2 = `${t4.padEnd(i3 + r)}${o2}`;
|
135889
|
+
return e3.wrap(a2, n2 - s, i3 + r);
|
135747
135890
|
}
|
135748
|
-
return
|
135891
|
+
return t4;
|
135749
135892
|
}
|
135750
|
-
function formatList(
|
135751
|
-
return
|
135893
|
+
function formatList(t4) {
|
135894
|
+
return t4.join("\n").replace(/^/gm, " ".repeat(s));
|
135752
135895
|
}
|
135753
|
-
let o = [`Usage: ${
|
135754
|
-
const a =
|
135896
|
+
let o = [`Usage: ${e3.commandUsage(t3)}`, ""];
|
135897
|
+
const a = e3.commandDescription(t3);
|
135755
135898
|
if (a.length > 0) {
|
135756
|
-
o = o.concat([a, ""]);
|
135899
|
+
o = o.concat([e3.wrap(a, n2, 0), ""]);
|
135757
135900
|
}
|
135758
|
-
const
|
135901
|
+
const l = e3.visibleArguments(t3).map((t4) => formatItem(e3.argumentTerm(t4), e3.argumentDescription(t4)));
|
135902
|
+
if (l.length > 0) {
|
135903
|
+
o = o.concat(["Arguments:", formatList(l), ""]);
|
135904
|
+
}
|
135905
|
+
const h = e3.visibleOptions(t3).map((t4) => formatItem(e3.optionTerm(t4), e3.optionDescription(t4)));
|
135759
135906
|
if (h.length > 0) {
|
135760
|
-
o = o.concat(["
|
135907
|
+
o = o.concat(["Options:", formatList(h), ""]);
|
135761
135908
|
}
|
135762
|
-
|
135763
|
-
|
135764
|
-
|
135909
|
+
if (this.showGlobalOptions) {
|
135910
|
+
const i4 = e3.visibleGlobalOptions(t3).map((t4) => formatItem(e3.optionTerm(t4), e3.optionDescription(t4)));
|
135911
|
+
if (i4.length > 0) {
|
135912
|
+
o = o.concat(["Global Options:", formatList(i4), ""]);
|
135913
|
+
}
|
135765
135914
|
}
|
135766
|
-
const u =
|
135915
|
+
const u = e3.visibleCommands(t3).map((t4) => formatItem(e3.subcommandTerm(t4), e3.subcommandDescription(t4)));
|
135767
135916
|
if (u.length > 0) {
|
135768
135917
|
o = o.concat(["Commands:", formatList(u), ""]);
|
135769
135918
|
}
|
135770
135919
|
return o.join("\n");
|
135771
135920
|
}
|
135772
|
-
padWidth(
|
135773
|
-
return Math.max(
|
135921
|
+
padWidth(t3, e3) {
|
135922
|
+
return Math.max(e3.longestOptionTermLength(t3, e3), e3.longestGlobalOptionTermLength(t3, e3), e3.longestSubcommandTermLength(t3, e3), e3.longestArgumentTermLength(t3, e3));
|
135774
135923
|
}
|
135775
|
-
wrap(
|
135776
|
-
|
135777
|
-
|
135778
|
-
|
135779
|
-
|
135780
|
-
|
135781
|
-
|
135782
|
-
|
135783
|
-
const a =
|
135784
|
-
const
|
135785
|
-
const
|
135786
|
-
|
135787
|
-
|
135788
|
-
|
135789
|
-
|
135790
|
-
|
135924
|
+
wrap(t3, e3, i3, n2 = 40) {
|
135925
|
+
const s = " \\f\\t\\v - \uFEFF";
|
135926
|
+
const r = new RegExp(`[\\n][${s}]+`);
|
135927
|
+
if (t3.match(r))
|
135928
|
+
return t3;
|
135929
|
+
const o = e3 - i3;
|
135930
|
+
if (o < n2)
|
135931
|
+
return t3;
|
135932
|
+
const a = t3.slice(0, i3);
|
135933
|
+
const l = t3.slice(i3).replace("\r\n", "\n");
|
135934
|
+
const h = " ".repeat(i3);
|
135935
|
+
const u = "";
|
135936
|
+
const c = `\\s${u}`;
|
135937
|
+
const p = new RegExp(`
|
135938
|
+
|.{1,${o - 1}}([${c}]|$)|[^${c}]+?([${c}]|$)`, "g");
|
135939
|
+
const m = l.match(p) || [];
|
135940
|
+
return a + m.map((t4, e4) => {
|
135941
|
+
if (t4 === "\n")
|
135942
|
+
return "";
|
135943
|
+
return (e4 > 0 ? h : "") + t4.trimEnd();
|
135791
135944
|
}).join("\n");
|
135792
135945
|
}
|
135793
135946
|
}
|
135794
|
-
|
135795
|
-
},
|
135796
|
-
const { InvalidArgumentError: n } = i2(
|
135947
|
+
e2.Help = Help;
|
135948
|
+
}, 437: (t2, e2, i2) => {
|
135949
|
+
const { InvalidArgumentError: n } = i2(796);
|
135797
135950
|
class Option {
|
135798
|
-
constructor(
|
135799
|
-
this.flags =
|
135800
|
-
this.description =
|
135801
|
-
this.required =
|
135802
|
-
this.optional =
|
135803
|
-
this.variadic = /\w\.\.\.[>\]]$/.test(
|
135951
|
+
constructor(t3, e3) {
|
135952
|
+
this.flags = t3;
|
135953
|
+
this.description = e3 || "";
|
135954
|
+
this.required = t3.includes("<");
|
135955
|
+
this.optional = t3.includes("[");
|
135956
|
+
this.variadic = /\w\.\.\.[>\]]$/.test(t3);
|
135804
135957
|
this.mandatory = false;
|
135805
|
-
const i3 = splitOptionFlags(
|
135958
|
+
const i3 = splitOptionFlags(t3);
|
135806
135959
|
this.short = i3.shortFlag;
|
135807
135960
|
this.long = i3.longFlag;
|
135808
135961
|
this.negate = false;
|
@@ -135811,48 +135964,63 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135811
135964
|
}
|
135812
135965
|
this.defaultValue = void 0;
|
135813
135966
|
this.defaultValueDescription = void 0;
|
135967
|
+
this.presetArg = void 0;
|
135814
135968
|
this.envVar = void 0;
|
135815
135969
|
this.parseArg = void 0;
|
135816
135970
|
this.hidden = false;
|
135817
135971
|
this.argChoices = void 0;
|
135972
|
+
this.conflictsWith = [];
|
135973
|
+
this.implied = void 0;
|
135818
135974
|
}
|
135819
|
-
default(
|
135820
|
-
this.defaultValue =
|
135821
|
-
this.defaultValueDescription =
|
135975
|
+
default(t3, e3) {
|
135976
|
+
this.defaultValue = t3;
|
135977
|
+
this.defaultValueDescription = e3;
|
135822
135978
|
return this;
|
135823
135979
|
}
|
135824
|
-
|
135825
|
-
this.
|
135980
|
+
preset(t3) {
|
135981
|
+
this.presetArg = t3;
|
135826
135982
|
return this;
|
135827
135983
|
}
|
135828
|
-
|
135829
|
-
this.
|
135984
|
+
conflicts(t3) {
|
135985
|
+
this.conflictsWith = this.conflictsWith.concat(t3);
|
135830
135986
|
return this;
|
135831
135987
|
}
|
135832
|
-
|
135833
|
-
this.
|
135988
|
+
implies(t3) {
|
135989
|
+
this.implied = Object.assign(this.implied || {}, t3);
|
135834
135990
|
return this;
|
135835
135991
|
}
|
135836
|
-
|
135837
|
-
this.
|
135992
|
+
env(t3) {
|
135993
|
+
this.envVar = t3;
|
135838
135994
|
return this;
|
135839
135995
|
}
|
135840
|
-
|
135841
|
-
|
135842
|
-
|
135996
|
+
argParser(t3) {
|
135997
|
+
this.parseArg = t3;
|
135998
|
+
return this;
|
135999
|
+
}
|
136000
|
+
makeOptionMandatory(t3 = true) {
|
136001
|
+
this.mandatory = !!t3;
|
136002
|
+
return this;
|
136003
|
+
}
|
136004
|
+
hideHelp(t3 = true) {
|
136005
|
+
this.hidden = !!t3;
|
136006
|
+
return this;
|
136007
|
+
}
|
136008
|
+
_concatValue(t3, e3) {
|
136009
|
+
if (e3 === this.defaultValue || !Array.isArray(e3)) {
|
136010
|
+
return [t3];
|
135843
136011
|
}
|
135844
|
-
return
|
136012
|
+
return e3.concat(t3);
|
135845
136013
|
}
|
135846
|
-
choices(
|
135847
|
-
this.argChoices =
|
135848
|
-
this.parseArg = (
|
135849
|
-
if (!
|
135850
|
-
throw new n(`Allowed choices are ${
|
136014
|
+
choices(t3) {
|
136015
|
+
this.argChoices = t3.slice();
|
136016
|
+
this.parseArg = (t4, e3) => {
|
136017
|
+
if (!this.argChoices.includes(t4)) {
|
136018
|
+
throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
135851
136019
|
}
|
135852
136020
|
if (this.variadic) {
|
135853
|
-
return this._concatValue(
|
136021
|
+
return this._concatValue(t4, e3);
|
135854
136022
|
}
|
135855
|
-
return
|
136023
|
+
return t4;
|
135856
136024
|
};
|
135857
136025
|
return this;
|
135858
136026
|
}
|
@@ -135865,86 +136033,117 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135865
136033
|
attributeName() {
|
135866
136034
|
return camelcase(this.name().replace(/^no-/, ""));
|
135867
136035
|
}
|
135868
|
-
is(
|
135869
|
-
return this.short ===
|
136036
|
+
is(t3) {
|
136037
|
+
return this.short === t3 || this.long === t3;
|
136038
|
+
}
|
136039
|
+
isBoolean() {
|
136040
|
+
return !this.required && !this.optional && !this.negate;
|
135870
136041
|
}
|
135871
136042
|
}
|
135872
|
-
|
135873
|
-
|
136043
|
+
class DualOptions {
|
136044
|
+
constructor(t3) {
|
136045
|
+
this.positiveOptions = /* @__PURE__ */ new Map();
|
136046
|
+
this.negativeOptions = /* @__PURE__ */ new Map();
|
136047
|
+
this.dualOptions = /* @__PURE__ */ new Set();
|
136048
|
+
t3.forEach((t4) => {
|
136049
|
+
if (t4.negate) {
|
136050
|
+
this.negativeOptions.set(t4.attributeName(), t4);
|
136051
|
+
} else {
|
136052
|
+
this.positiveOptions.set(t4.attributeName(), t4);
|
136053
|
+
}
|
136054
|
+
});
|
136055
|
+
this.negativeOptions.forEach((t4, e3) => {
|
136056
|
+
if (this.positiveOptions.has(e3)) {
|
136057
|
+
this.dualOptions.add(e3);
|
136058
|
+
}
|
136059
|
+
});
|
136060
|
+
}
|
136061
|
+
valueFromOption(t3, e3) {
|
136062
|
+
const i3 = e3.attributeName();
|
136063
|
+
if (!this.dualOptions.has(i3))
|
136064
|
+
return true;
|
136065
|
+
const n2 = this.negativeOptions.get(i3).presetArg;
|
136066
|
+
const s = n2 !== void 0 ? n2 : false;
|
136067
|
+
return e3.negate === (s === t3);
|
136068
|
+
}
|
135874
136069
|
}
|
135875
|
-
function
|
135876
|
-
|
136070
|
+
function camelcase(t3) {
|
136071
|
+
return t3.split("-").reduce((t4, e3) => t4 + e3[0].toUpperCase() + e3.slice(1));
|
136072
|
+
}
|
136073
|
+
function splitOptionFlags(t3) {
|
136074
|
+
let e3;
|
135877
136075
|
let i3;
|
135878
|
-
const n2 =
|
136076
|
+
const n2 = t3.split(/[ |,]+/);
|
135879
136077
|
if (n2.length > 1 && !/^[[<]/.test(n2[1]))
|
135880
|
-
|
136078
|
+
e3 = n2.shift();
|
135881
136079
|
i3 = n2.shift();
|
135882
|
-
if (!
|
135883
|
-
|
136080
|
+
if (!e3 && /^-[^-]$/.test(i3)) {
|
136081
|
+
e3 = i3;
|
135884
136082
|
i3 = void 0;
|
135885
136083
|
}
|
135886
|
-
return { shortFlag:
|
136084
|
+
return { shortFlag: e3, longFlag: i3 };
|
135887
136085
|
}
|
135888
|
-
|
135889
|
-
|
135890
|
-
|
136086
|
+
e2.Option = Option;
|
136087
|
+
e2.splitOptionFlags = splitOptionFlags;
|
136088
|
+
e2.DualOptions = DualOptions;
|
136089
|
+
}, 860: (t2, e2) => {
|
135891
136090
|
const i2 = 3;
|
135892
|
-
function editDistance(
|
135893
|
-
if (Math.abs(
|
135894
|
-
return Math.max(
|
136091
|
+
function editDistance(t3, e3) {
|
136092
|
+
if (Math.abs(t3.length - e3.length) > i2)
|
136093
|
+
return Math.max(t3.length, e3.length);
|
135895
136094
|
const n = [];
|
135896
|
-
for (let t4 = 0; t4 <= e3.length; t4++) {
|
135897
|
-
n[t4] = [t4];
|
135898
|
-
}
|
135899
136095
|
for (let e4 = 0; e4 <= t3.length; e4++) {
|
135900
|
-
n[
|
136096
|
+
n[e4] = [e4];
|
135901
136097
|
}
|
135902
|
-
for (let
|
135903
|
-
|
136098
|
+
for (let t4 = 0; t4 <= e3.length; t4++) {
|
136099
|
+
n[0][t4] = t4;
|
136100
|
+
}
|
136101
|
+
for (let i3 = 1; i3 <= e3.length; i3++) {
|
136102
|
+
for (let s = 1; s <= t3.length; s++) {
|
135904
136103
|
let r = 1;
|
135905
|
-
if (
|
136104
|
+
if (t3[s - 1] === e3[i3 - 1]) {
|
135906
136105
|
r = 0;
|
135907
136106
|
} else {
|
135908
136107
|
r = 1;
|
135909
136108
|
}
|
135910
136109
|
n[s][i3] = Math.min(n[s - 1][i3] + 1, n[s][i3 - 1] + 1, n[s - 1][i3 - 1] + r);
|
135911
|
-
if (s > 1 && i3 > 1 &&
|
136110
|
+
if (s > 1 && i3 > 1 && t3[s - 1] === e3[i3 - 2] && t3[s - 2] === e3[i3 - 1]) {
|
135912
136111
|
n[s][i3] = Math.min(n[s][i3], n[s - 2][i3 - 2] + 1);
|
135913
136112
|
}
|
135914
136113
|
}
|
135915
136114
|
}
|
135916
|
-
return n[
|
136115
|
+
return n[t3.length][e3.length];
|
135917
136116
|
}
|
135918
|
-
function suggestSimilar(
|
135919
|
-
if (!
|
136117
|
+
function suggestSimilar(t3, e3) {
|
136118
|
+
if (!e3 || e3.length === 0)
|
135920
136119
|
return "";
|
135921
|
-
|
135922
|
-
const n =
|
136120
|
+
e3 = Array.from(new Set(e3));
|
136121
|
+
const n = t3.startsWith("--");
|
135923
136122
|
if (n) {
|
135924
|
-
|
135925
|
-
|
136123
|
+
t3 = t3.slice(2);
|
136124
|
+
e3 = e3.map((t4) => t4.slice(2));
|
135926
136125
|
}
|
135927
136126
|
let s = [];
|
135928
136127
|
let r = i2;
|
135929
136128
|
const o = 0.4;
|
135930
|
-
|
135931
|
-
if (
|
136129
|
+
e3.forEach((e4) => {
|
136130
|
+
if (e4.length <= 1)
|
135932
136131
|
return;
|
135933
|
-
const i3 = editDistance(
|
135934
|
-
const n2 = Math.max(
|
136132
|
+
const i3 = editDistance(t3, e4);
|
136133
|
+
const n2 = Math.max(t3.length, e4.length);
|
135935
136134
|
const a = (n2 - i3) / n2;
|
135936
136135
|
if (a > o) {
|
135937
136136
|
if (i3 < r) {
|
135938
136137
|
r = i3;
|
135939
|
-
s = [
|
136138
|
+
s = [e4];
|
135940
136139
|
} else if (i3 === r) {
|
135941
|
-
s.push(
|
136140
|
+
s.push(e4);
|
135942
136141
|
}
|
135943
136142
|
}
|
135944
136143
|
});
|
135945
|
-
s.sort((
|
136144
|
+
s.sort((t4, e4) => t4.localeCompare(e4));
|
135946
136145
|
if (n) {
|
135947
|
-
s = s.map((
|
136146
|
+
s = s.map((t4) => `--${t4}`);
|
135948
136147
|
}
|
135949
136148
|
if (s.length > 1) {
|
135950
136149
|
return `
|
@@ -135956,28 +136155,28 @@ Expecting one of '${i3.join("', '")}'`);
|
|
135956
136155
|
}
|
135957
136156
|
return "";
|
135958
136157
|
}
|
135959
|
-
|
136158
|
+
e2.suggestSimilar = suggestSimilar;
|
135960
136159
|
} };
|
135961
|
-
var
|
136160
|
+
var e = {};
|
135962
136161
|
function __nccwpck_require__(i2) {
|
135963
|
-
var n =
|
136162
|
+
var n = e[i2];
|
135964
136163
|
if (n !== void 0) {
|
135965
136164
|
return n.exports;
|
135966
136165
|
}
|
135967
|
-
var s =
|
136166
|
+
var s = e[i2] = { exports: {} };
|
135968
136167
|
var r = true;
|
135969
136168
|
try {
|
135970
|
-
|
136169
|
+
t[i2](s, s.exports, __nccwpck_require__);
|
135971
136170
|
r = false;
|
135972
136171
|
} finally {
|
135973
136172
|
if (r)
|
135974
|
-
delete
|
136173
|
+
delete e[i2];
|
135975
136174
|
}
|
135976
136175
|
return s.exports;
|
135977
136176
|
}
|
135978
136177
|
if (typeof __nccwpck_require__ !== "undefined")
|
135979
136178
|
__nccwpck_require__.ab = __dirname + "/";
|
135980
|
-
var i = __nccwpck_require__(
|
136179
|
+
var i = __nccwpck_require__(632);
|
135981
136180
|
module2.exports = i;
|
135982
136181
|
})();
|
135983
136182
|
}
|
@@ -136117,12 +136316,17 @@ var require_commands = __commonJS({
|
|
136117
136316
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
136118
136317
|
var commands_exports = {};
|
136119
136318
|
__export2(commands_exports, {
|
136319
|
+
getArgv: () => getArgv,
|
136120
136320
|
getCommand: () => getCommand,
|
136121
136321
|
isDevCommand: () => isDevCommand
|
136122
136322
|
});
|
136123
136323
|
module2.exports = __toCommonJS2(commands_exports);
|
136324
|
+
var getArgv = () => {
|
136325
|
+
var _a2;
|
136326
|
+
return (((_a2 = process.env.MODERN_ARGV) == null ? void 0 : _a2.split(" ")) || process.argv).slice(2);
|
136327
|
+
};
|
136124
136328
|
var getCommand = () => {
|
136125
|
-
const args =
|
136329
|
+
const args = getArgv();
|
136126
136330
|
const command = args[0];
|
136127
136331
|
return command;
|
136128
136332
|
};
|
@@ -136133,108 +136337,6 @@ var require_commands = __commonJS({
|
|
136133
136337
|
}
|
136134
136338
|
});
|
136135
136339
|
|
136136
|
-
// ../../../toolkit/utils/dist/format.js
|
136137
|
-
var require_format2 = __commonJS({
|
136138
|
-
"../../../toolkit/utils/dist/format.js"(exports, module2) {
|
136139
|
-
var __defProp2 = Object.defineProperty;
|
136140
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
136141
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
136142
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
136143
|
-
var __export2 = (target, all) => {
|
136144
|
-
for (var name in all)
|
136145
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
136146
|
-
};
|
136147
|
-
var __copyProps2 = (to, from, except, desc) => {
|
136148
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
136149
|
-
for (let key of __getOwnPropNames2(from))
|
136150
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
136151
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
136152
|
-
}
|
136153
|
-
return to;
|
136154
|
-
};
|
136155
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
136156
|
-
var format_exports = {};
|
136157
|
-
__export2(format_exports, {
|
136158
|
-
formatWebpackMessages: () => formatWebpackMessages
|
136159
|
-
});
|
136160
|
-
module2.exports = __toCommonJS2(format_exports);
|
136161
|
-
var friendlySyntaxErrorLabel = "SyntaxError:";
|
136162
|
-
function isLikelyASyntaxError(message) {
|
136163
|
-
return message.includes(friendlySyntaxErrorLabel);
|
136164
|
-
}
|
136165
|
-
function formatMessage(stats) {
|
136166
|
-
let lines = [];
|
136167
|
-
let message;
|
136168
|
-
if (typeof stats === "object") {
|
136169
|
-
const fileName = stats.moduleName ? `File: ${stats.moduleName}
|
136170
|
-
` : "";
|
136171
|
-
const mainMessage = typeof stats.formatted === "string" ? stats.formatted : stats.message;
|
136172
|
-
const details = stats.details ? `
|
136173
|
-
Details: ${stats.details}
|
136174
|
-
` : "";
|
136175
|
-
const stack = stats.stack ? `
|
136176
|
-
${stats.stack}` : "";
|
136177
|
-
message = `${fileName}${mainMessage}${details}${stack}`;
|
136178
|
-
} else {
|
136179
|
-
message = stats;
|
136180
|
-
}
|
136181
|
-
lines = message.split("\n");
|
136182
|
-
lines = lines.map((line) => {
|
136183
|
-
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
|
136184
|
-
line
|
136185
|
-
);
|
136186
|
-
if (!parsingError) {
|
136187
|
-
return line;
|
136188
|
-
}
|
136189
|
-
const [, errorLine, errorColumn, errorMessage] = parsingError;
|
136190
|
-
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
|
136191
|
-
});
|
136192
|
-
message = lines.join("\n");
|
136193
|
-
message = message.replace(
|
136194
|
-
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
|
136195
|
-
`${friendlySyntaxErrorLabel} $3 ($1:$2)
|
136196
|
-
`
|
136197
|
-
);
|
136198
|
-
lines = message.split("\n");
|
136199
|
-
if (lines.length > 2 && lines[1].trim() === "") {
|
136200
|
-
lines.splice(1, 1);
|
136201
|
-
}
|
136202
|
-
lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, "$1");
|
136203
|
-
if (lines[1] && lines[1].indexOf("Module not found:") !== -1) {
|
136204
|
-
lines[1] = lines[1].replace("Error: ", "");
|
136205
|
-
}
|
136206
|
-
message = lines.join("\n");
|
136207
|
-
message = message.replace(
|
136208
|
-
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
|
136209
|
-
""
|
136210
|
-
);
|
136211
|
-
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, "");
|
136212
|
-
lines = message.split("\n");
|
136213
|
-
lines = lines.filter(
|
136214
|
-
(line, index, arr) => index === 0 || line.trim() !== "" || line.trim() !== arr[index - 1].trim()
|
136215
|
-
);
|
136216
|
-
message = lines.join("\n");
|
136217
|
-
return message.trim();
|
136218
|
-
}
|
136219
|
-
function formatWebpackMessages(json) {
|
136220
|
-
var _a2, _b, _c;
|
136221
|
-
const formattedErrors = (_a2 = json == null ? void 0 : json.errors) == null ? void 0 : _a2.map(formatMessage);
|
136222
|
-
const formattedWarnings = (_b = json == null ? void 0 : json.warnings) == null ? void 0 : _b.map(formatMessage);
|
136223
|
-
const result = {
|
136224
|
-
errors: formattedErrors || [],
|
136225
|
-
warnings: formattedWarnings || []
|
136226
|
-
};
|
136227
|
-
if ((_c = result.errors) == null ? void 0 : _c.some(isLikelyASyntaxError)) {
|
136228
|
-
result.errors = result.errors.filter(isLikelyASyntaxError);
|
136229
|
-
}
|
136230
|
-
if (result.errors.length > 1) {
|
136231
|
-
result.errors.length = 1;
|
136232
|
-
}
|
136233
|
-
return result;
|
136234
|
-
}
|
136235
|
-
}
|
136236
|
-
});
|
136237
|
-
|
136238
136340
|
// ../../../toolkit/utils/dist/logger.js
|
136239
136341
|
var require_logger4 = __commonJS({
|
136240
136342
|
"../../../toolkit/utils/dist/logger.js"(exports, module2) {
|
@@ -137019,10 +137121,10 @@ var require_constants6 = __commonJS({
|
|
137019
137121
|
API_DIR: () => API_DIR,
|
137020
137122
|
CONFIG_CACHE_DIR: () => CONFIG_CACHE_DIR,
|
137021
137123
|
CONFIG_FILE_EXTENSIONS: () => CONFIG_FILE_EXTENSIONS,
|
137124
|
+
DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: () => DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS,
|
137022
137125
|
DEFAULT_DEV_HOST: () => DEFAULT_DEV_HOST,
|
137023
137126
|
DEFAULT_SERVER_CONFIG: () => DEFAULT_SERVER_CONFIG,
|
137024
137127
|
ENTRY_NAME_PATTERN: () => ENTRY_NAME_PATTERN,
|
137025
|
-
HMR_SOCK_PATH: () => HMR_SOCK_PATH,
|
137026
137128
|
INTERNAL_APP_TOOLS_PLUGINS: () => INTERNAL_APP_TOOLS_PLUGINS,
|
137027
137129
|
INTERNAL_APP_TOOLS_RUNTIME_PLUGINS: () => INTERNAL_APP_TOOLS_RUNTIME_PLUGINS,
|
137028
137130
|
INTERNAL_CLI_PLUGINS: () => INTERNAL_CLI_PLUGINS,
|
@@ -137036,8 +137138,7 @@ var require_constants6 = __commonJS({
|
|
137036
137138
|
MAIN_ENTRY_NAME: () => MAIN_ENTRY_NAME,
|
137037
137139
|
OUTPUT_CONFIG_FILE: () => OUTPUT_CONFIG_FILE,
|
137038
137140
|
PLUGIN_SCHEMAS: () => PLUGIN_SCHEMAS,
|
137039
|
-
|
137040
|
-
ROUTE_MINIFEST_FILE: () => ROUTE_MINIFEST_FILE,
|
137141
|
+
ROUTE_MANIFEST_FILE: () => ROUTE_MANIFEST_FILE,
|
137041
137142
|
ROUTE_SPEC_FILE: () => ROUTE_SPEC_FILE,
|
137042
137143
|
SERVER_BUNDLE_DIRECTORY: () => SERVER_BUNDLE_DIRECTORY,
|
137043
137144
|
SERVER_DIR: () => SERVER_DIR,
|
@@ -137053,7 +137154,6 @@ var require_constants6 = __commonJS({
|
|
137053
137154
|
SHARED_DIR: () => SHARED_DIR
|
137054
137155
|
});
|
137055
137156
|
module2.exports = __toCommonJS2(constants_exports);
|
137056
|
-
var HMR_SOCK_PATH = "/webpack-hmr";
|
137057
137157
|
var ROUTE_SPEC_FILE = "route.json";
|
137058
137158
|
var MAIN_ENTRY_NAME = "main";
|
137059
137159
|
var LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
|
@@ -137069,8 +137169,7 @@ var require_constants6 = __commonJS({
|
|
137069
137169
|
var CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
|
137070
137170
|
var OUTPUT_CONFIG_FILE = "modern.config.json";
|
137071
137171
|
var DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
137072
|
-
var
|
137073
|
-
var ROUTE_MANIFEST = `_MODERNJS_ROUTE_MANIFEST`;
|
137172
|
+
var ROUTE_MANIFEST_FILE = "routes-manifest.json";
|
137074
137173
|
var LOADER_ROUTES_DIR = `loader-routes`;
|
137075
137174
|
var DEFAULT_DEV_HOST = "0.0.0.0";
|
137076
137175
|
var INTERNAL_APP_TOOLS_PLUGINS = {
|
@@ -137274,6 +137373,15 @@ var require_constants6 = __commonJS({
|
|
137274
137373
|
],
|
137275
137374
|
"@modern-js/plugin-nocode": []
|
137276
137375
|
};
|
137376
|
+
var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
|
137377
|
+
allowNamespaces: true,
|
137378
|
+
allExtensions: true,
|
137379
|
+
allowDeclareFields: true,
|
137380
|
+
// aligns Babel's behavior with TypeScript's default behavior.
|
137381
|
+
// https://babeljs.io/docs/en/babel-preset-typescript#optimizeconstenums
|
137382
|
+
optimizeConstEnums: true,
|
137383
|
+
isTSX: true
|
137384
|
+
};
|
137277
137385
|
}
|
137278
137386
|
});
|
137279
137387
|
|
@@ -138795,9 +138903,9 @@ var require_getServerConfig2 = __commonJS({
|
|
138795
138903
|
}
|
138796
138904
|
});
|
138797
138905
|
|
138798
|
-
// ../../../toolkit/utils/dist/
|
138799
|
-
var
|
138800
|
-
"../../../toolkit/utils/dist/
|
138906
|
+
// ../../../toolkit/utils/dist/resolve.js
|
138907
|
+
var require_resolve = __commonJS({
|
138908
|
+
"../../../toolkit/utils/dist/resolve.js"(exports, module2) {
|
138801
138909
|
var __defProp2 = Object.defineProperty;
|
138802
138910
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
138803
138911
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
@@ -138815,12 +138923,13 @@ var require_tryResolve2 = __commonJS({
|
|
138815
138923
|
return to;
|
138816
138924
|
};
|
138817
138925
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
138818
|
-
var
|
138819
|
-
__export2(
|
138926
|
+
var resolve_exports = {};
|
138927
|
+
__export2(resolve_exports, {
|
138928
|
+
getAntdMajorVersion: () => getAntdMajorVersion,
|
138820
138929
|
isPackageInstalled: () => isPackageInstalled,
|
138821
138930
|
tryResolve: () => tryResolve
|
138822
138931
|
});
|
138823
|
-
module2.exports = __toCommonJS2(
|
138932
|
+
module2.exports = __toCommonJS2(resolve_exports);
|
138824
138933
|
var import_ensureArray = require_ensureArray2();
|
138825
138934
|
var tryResolve = (name, resolvePath) => {
|
138826
138935
|
let filePath = "";
|
@@ -138843,6 +138952,17 @@ var require_tryResolve2 = __commonJS({
|
|
138843
138952
|
return false;
|
138844
138953
|
}
|
138845
138954
|
};
|
138955
|
+
var getAntdMajorVersion = (appDirectory) => {
|
138956
|
+
try {
|
138957
|
+
const pkgJsonPath = require.resolve("antd/package.json", {
|
138958
|
+
paths: [appDirectory]
|
138959
|
+
});
|
138960
|
+
const { version } = require(pkgJsonPath);
|
138961
|
+
return Number(version.split(".")[0]);
|
138962
|
+
} catch (err) {
|
138963
|
+
return null;
|
138964
|
+
}
|
138965
|
+
};
|
138846
138966
|
}
|
138847
138967
|
});
|
138848
138968
|
|
@@ -138903,15 +139023,16 @@ var require_analyzeProject2 = __commonJS({
|
|
138903
139023
|
});
|
138904
139024
|
module2.exports = __toCommonJS2(analyzeProject_exports);
|
138905
139025
|
var path3 = __toESM2(require("path"));
|
139026
|
+
var import_commands = require_commands();
|
138906
139027
|
var import_compiled = require_compiled2();
|
138907
139028
|
var isApiOnly = (appDirectory, entryDir) => __async2(void 0, null, function* () {
|
138908
139029
|
const srcDir = path3.join(appDirectory, entryDir != null ? entryDir : "src");
|
138909
139030
|
const existSrc = yield import_compiled.fs.pathExists(srcDir);
|
138910
|
-
const options = (0, import_compiled.minimist)(
|
139031
|
+
const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
|
138911
139032
|
return !existSrc || Boolean(options["api-only"]);
|
138912
139033
|
});
|
138913
139034
|
var isWebOnly = () => __async2(void 0, null, function* () {
|
138914
|
-
const options = (0, import_compiled.minimist)(
|
139035
|
+
const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
|
138915
139036
|
return Boolean(options["web-only"]);
|
138916
139037
|
});
|
138917
139038
|
}
|
@@ -138982,27 +139103,10 @@ var require_chainId2 = __commonJS({
|
|
138982
139103
|
},
|
138983
139104
|
/** Predefined rule groups */
|
138984
139105
|
ONE_OF: {
|
138985
|
-
JS: "js",
|
138986
|
-
TS: "ts",
|
138987
|
-
CSS: "css",
|
138988
|
-
LESS: "less",
|
138989
|
-
SASS: "sass",
|
138990
|
-
YAML: "yml",
|
138991
|
-
TOML: "toml",
|
138992
|
-
FALLBACK: "fallback",
|
138993
|
-
MARKDOWN: "markdown",
|
138994
|
-
BFF_CLIENT: "bff-client",
|
138995
|
-
CSS_MODULES: "css-modules",
|
138996
|
-
LESS_MODULES: "less-modules",
|
138997
|
-
SASS_MODULES: "sass-modules",
|
138998
139106
|
SVG: "svg",
|
138999
139107
|
SVG_URL: "svg-url",
|
139000
139108
|
SVG_ASSET: "svg-asset",
|
139001
|
-
SVG_INLINE: "svg-inline"
|
139002
|
-
ASSETS: "assets",
|
139003
|
-
ASSETS_URL: "assets-url",
|
139004
|
-
ASSETS_INLINE: "assets-inline",
|
139005
|
-
IMAGE_COMPRESS: "image-compress"
|
139109
|
+
SVG_INLINE: "svg-inline"
|
139006
139110
|
},
|
139007
139111
|
/** Predefined loaders */
|
139008
139112
|
USE: {
|
@@ -139687,7 +139791,6 @@ var require_dist3 = __commonJS({
|
|
139687
139791
|
module2.exports = __toCommonJS2(src_exports2);
|
139688
139792
|
__reExport(src_exports2, require_compiled2(), module2.exports);
|
139689
139793
|
__reExport(src_exports2, require_commands(), module2.exports);
|
139690
|
-
__reExport(src_exports2, require_format2(), module2.exports);
|
139691
139794
|
__reExport(src_exports2, require_FileSizeReporter2(), module2.exports);
|
139692
139795
|
__reExport(src_exports2, require_printBuildError2(), module2.exports);
|
139693
139796
|
__reExport(src_exports2, require_debug5(), module2.exports);
|
@@ -139719,7 +139822,7 @@ var require_dist3 = __commonJS({
|
|
139719
139822
|
__reExport(src_exports2, require_wait2(), module2.exports);
|
139720
139823
|
__reExport(src_exports2, require_emptyDir2(), module2.exports);
|
139721
139824
|
__reExport(src_exports2, require_getServerConfig2(), module2.exports);
|
139722
|
-
__reExport(src_exports2,
|
139825
|
+
__reExport(src_exports2, require_resolve(), module2.exports);
|
139723
139826
|
__reExport(src_exports2, require_analyzeProject2(), module2.exports);
|
139724
139827
|
__reExport(src_exports2, require_chainId2(), module2.exports);
|
139725
139828
|
__reExport(src_exports2, require_version2(), module2.exports);
|