storybook 9.0.0-alpha.12 → 9.0.0-alpha.14
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/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/dist/actions/decorator.js +46 -47
- package/dist/actions/index.cjs +28 -29
- package/dist/actions/index.d.ts +0 -3
- package/dist/actions/index.js +27 -28
- package/dist/actions/preview.cjs +22 -23
- package/dist/actions/preview.js +18 -19
- package/dist/backgrounds/index.cjs +148 -0
- package/dist/backgrounds/index.d.ts +91 -0
- package/dist/backgrounds/index.js +130 -0
- package/dist/backgrounds/preview.cjs +143 -0
- package/dist/backgrounds/preview.d.ts +54 -0
- package/dist/backgrounds/preview.js +127 -0
- package/dist/bin/index.cjs +62 -73
- package/dist/bin/index.js +57 -68
- package/dist/builder-manager/index.cjs +390 -380
- package/dist/builder-manager/index.js +489 -479
- package/dist/channels/index.cjs +1018 -948
- package/dist/channels/index.js +1194 -1161
- package/dist/cli/bin/index.cjs +225 -225
- package/dist/cli/bin/index.js +234 -234
- package/dist/cli/index.cjs +1860 -1873
- package/dist/cli/index.js +308 -321
- package/dist/common/index.cjs +2396 -2380
- package/dist/common/index.d.ts +0 -11
- package/dist/common/index.js +2604 -2588
- package/dist/components/index.cjs +6393 -12704
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.js +4665 -10778
- package/dist/core-events/index.cjs +72 -84
- package/dist/core-events/index.d.ts +2 -77
- package/dist/core-events/index.js +61 -73
- package/dist/core-server/index.cjs +13484 -13318
- package/dist/core-server/index.js +13652 -13486
- package/dist/core-server/presets/common-manager.js +9815 -12
- package/dist/core-server/presets/common-preset.cjs +2809 -3005
- package/dist/core-server/presets/common-preset.js +2891 -3087
- package/dist/docs-tools/index.cjs +626 -600
- package/dist/docs-tools/index.js +613 -587
- package/dist/highlight/index.cjs +27 -0
- package/dist/highlight/index.d.ts +17 -0
- package/dist/highlight/index.js +7 -0
- package/dist/highlight/preview.cjs +81 -0
- package/dist/highlight/preview.d.ts +54 -0
- package/dist/highlight/preview.js +67 -0
- package/dist/instrumenter/index.cjs +70 -60
- package/dist/instrumenter/index.d.ts +8 -7
- package/dist/instrumenter/index.js +98 -88
- package/dist/manager/globals-module-info.cjs +12 -22
- package/dist/manager/globals-module-info.js +2 -12
- package/dist/manager/globals-runtime.js +31295 -33999
- package/dist/manager/runtime.js +3419 -3522
- package/dist/manager-api/index.cjs +2521 -2445
- package/dist/manager-api/index.d.ts +7 -21
- package/dist/manager-api/index.js +2431 -2349
- package/dist/measure/index.cjs +474 -0
- package/dist/measure/index.d.ts +66 -0
- package/dist/measure/index.js +462 -0
- package/dist/measure/preview.cjs +464 -0
- package/dist/measure/preview.d.ts +59 -0
- package/dist/measure/preview.js +448 -0
- package/dist/outline/index.cjs +528 -0
- package/dist/outline/index.d.ts +66 -0
- package/dist/outline/index.js +500 -0
- package/dist/outline/preview.cjs +518 -0
- package/dist/outline/preview.d.ts +59 -0
- package/dist/outline/preview.js +486 -0
- package/dist/preview/runtime.js +20735 -17220
- package/dist/preview-api/index.cjs +1069 -1057
- package/dist/preview-api/index.d.ts +384 -157
- package/dist/preview-api/index.js +1123 -1109
- package/dist/server-errors.cjs +66 -67
- package/dist/server-errors.d.ts +0 -1
- package/dist/server-errors.js +68 -69
- package/dist/test/index.cjs +1547 -1546
- package/dist/test/index.js +2308 -2307
- package/dist/test/preview.cjs +1906 -1905
- package/dist/test/preview.js +1439 -1438
- package/dist/test/spy.cjs +65 -64
- package/dist/test/spy.js +59 -58
- package/dist/types/index.cjs +10 -10
- package/dist/types/index.d.ts +203 -243
- package/package.json +122 -17
- package/dist/actions/manager.js +0 -1195
- package/dist/component-testing/manager.js +0 -3126
- package/dist/controls/manager.js +0 -5593
- package/dist/viewport/manager.js +0 -400
- /package/dist/{component-testing/manager.css → core-server/presets/common-manager.css} +0 -0
package/dist/cli/bin/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var N = Object.defineProperty;
|
|
|
9
9
|
var He = Object.getOwnPropertyDescriptor;
|
|
10
10
|
var De = Object.getOwnPropertyNames;
|
|
11
11
|
var Pe = Object.getPrototypeOf, Ie = Object.prototype.hasOwnProperty;
|
|
12
|
-
var
|
|
12
|
+
var l = (n, e) => N(n, "name", { value: e, configurable: !0 }), C = /* @__PURE__ */ ((n) => typeof require < "u" ? require : typeof Proxy < "\
|
|
13
13
|
u" ? new Proxy(n, {
|
|
14
14
|
get: (e, t) => (typeof require < "u" ? require : e)[t]
|
|
15
15
|
}) : n)(function(n) {
|
|
@@ -23,7 +23,7 @@ var Ne = (n, e, t, i) => {
|
|
|
23
23
|
!Ie.call(n, s) && s !== t && N(n, s, { get: () => e[s], enumerable: !(i = He(e, s)) || i.enumerable });
|
|
24
24
|
return n;
|
|
25
25
|
};
|
|
26
|
-
var
|
|
26
|
+
var q = (n, e, t) => (t = n != null ? Ve(Pe(n)) : {}, Ne(
|
|
27
27
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
28
|
// file that has been converted to a CommonJS file using a Babel-
|
|
29
29
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -34,9 +34,9 @@ var $ = (n, e, t) => (t = n != null ? Ve(Pe(n)) : {}, Ne(
|
|
|
34
34
|
|
|
35
35
|
// ../node_modules/commander/lib/error.js
|
|
36
36
|
var j = b((F) => {
|
|
37
|
-
var
|
|
37
|
+
var $ = class extends Error {
|
|
38
38
|
static {
|
|
39
|
-
|
|
39
|
+
l(this, "CommanderError");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Constructs the CommanderError class
|
|
@@ -48,9 +48,9 @@ var j = b((F) => {
|
|
|
48
48
|
super(i), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = t, this.exitCode = e, this.nestedError =
|
|
49
49
|
void 0;
|
|
50
50
|
}
|
|
51
|
-
}, T = class extends
|
|
51
|
+
}, T = class extends $ {
|
|
52
52
|
static {
|
|
53
|
-
|
|
53
|
+
l(this, "InvalidArgumentError");
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Constructs the InvalidArgumentError class
|
|
@@ -60,7 +60,7 @@ var j = b((F) => {
|
|
|
60
60
|
super(1, "commander.invalidArgument", e), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
F.CommanderError =
|
|
63
|
+
F.CommanderError = $;
|
|
64
64
|
F.InvalidArgumentError = T;
|
|
65
65
|
});
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ var j = b((F) => {
|
|
|
68
68
|
var V = b((M) => {
|
|
69
69
|
var { InvalidArgumentError: Te } = j(), B = class {
|
|
70
70
|
static {
|
|
71
|
-
|
|
71
|
+
l(this, "Argument");
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Initialize a new command argument with the given name and description.
|
|
@@ -162,7 +162,7 @@ var V = b((M) => {
|
|
|
162
162
|
let e = n.name() + (n.variadic === !0 ? "..." : "");
|
|
163
163
|
return n.required ? "<" + e + ">" : "[" + e + "]";
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
l(Fe, "humanReadableArgName");
|
|
166
166
|
M.Argument = B;
|
|
167
167
|
M.humanReadableArgName = Fe;
|
|
168
168
|
});
|
|
@@ -171,7 +171,7 @@ var V = b((M) => {
|
|
|
171
171
|
var W = b((ae) => {
|
|
172
172
|
var { humanReadableArgName: Be } = V(), L = class {
|
|
173
173
|
static {
|
|
174
|
-
|
|
174
|
+
l(this, "Help");
|
|
175
175
|
}
|
|
176
176
|
constructor() {
|
|
177
177
|
this.helpWidth = void 0, this.sortSubcommands = !1, this.sortOptions = !1, this.showGlobalOptions = !1;
|
|
@@ -194,7 +194,7 @@ var W = b((ae) => {
|
|
|
194
194
|
* @returns {number}
|
|
195
195
|
*/
|
|
196
196
|
compareOptions(e, t) {
|
|
197
|
-
let i = /* @__PURE__ */
|
|
197
|
+
let i = /* @__PURE__ */ l((s) => s.short ? s.short.replace(/^-/, "") : s.long.replace(/^--/, ""), "getSortKey");
|
|
198
198
|
return i(e).localeCompare(i(t));
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
@@ -389,51 +389,51 @@ var W = b((ae) => {
|
|
|
389
389
|
*/
|
|
390
390
|
formatHelp(e, t) {
|
|
391
391
|
let i = t.padWidth(e, t), s = t.helpWidth || 80, r = 2, o = 2;
|
|
392
|
-
function
|
|
393
|
-
if (
|
|
394
|
-
let I = `${
|
|
392
|
+
function d(g, _) {
|
|
393
|
+
if (_) {
|
|
394
|
+
let I = `${g.padEnd(i + o)}${_}`;
|
|
395
395
|
return t.wrap(
|
|
396
396
|
I,
|
|
397
397
|
s - r,
|
|
398
398
|
i + o
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
|
-
return
|
|
401
|
+
return g;
|
|
402
402
|
}
|
|
403
|
-
d
|
|
404
|
-
function a(
|
|
405
|
-
return
|
|
403
|
+
l(d, "formatItem");
|
|
404
|
+
function a(g) {
|
|
405
|
+
return g.join(`
|
|
406
406
|
`).replace(/^/gm, " ".repeat(r));
|
|
407
407
|
}
|
|
408
|
-
|
|
409
|
-
let c = [`Usage: ${t.commandUsage(e)}`, ""],
|
|
410
|
-
|
|
411
|
-
t.wrap(
|
|
408
|
+
l(a, "formatList");
|
|
409
|
+
let c = [`Usage: ${t.commandUsage(e)}`, ""], u = t.commandDescription(e);
|
|
410
|
+
u.length > 0 && (c = c.concat([
|
|
411
|
+
t.wrap(u, s, 0),
|
|
412
412
|
""
|
|
413
413
|
]));
|
|
414
|
-
let
|
|
415
|
-
t.argumentTerm(
|
|
416
|
-
t.argumentDescription(
|
|
414
|
+
let p = t.visibleArguments(e).map((g) => d(
|
|
415
|
+
t.argumentTerm(g),
|
|
416
|
+
t.argumentDescription(g)
|
|
417
417
|
));
|
|
418
|
-
|
|
419
|
-
let m = t.visibleOptions(e).map((
|
|
420
|
-
t.optionTerm(
|
|
421
|
-
t.optionDescription(
|
|
418
|
+
p.length > 0 && (c = c.concat(["Arguments:", a(p), ""]));
|
|
419
|
+
let m = t.visibleOptions(e).map((g) => d(
|
|
420
|
+
t.optionTerm(g),
|
|
421
|
+
t.optionDescription(g)
|
|
422
422
|
));
|
|
423
423
|
if (m.length > 0 && (c = c.concat(["Options:", a(m), ""])), this.showGlobalOptions) {
|
|
424
|
-
let
|
|
425
|
-
t.optionTerm(
|
|
426
|
-
t.optionDescription(
|
|
424
|
+
let g = t.visibleGlobalOptions(e).map((_) => d(
|
|
425
|
+
t.optionTerm(_),
|
|
426
|
+
t.optionDescription(_)
|
|
427
427
|
));
|
|
428
|
-
|
|
428
|
+
g.length > 0 && (c = c.concat([
|
|
429
429
|
"Global Options:",
|
|
430
|
-
a(
|
|
430
|
+
a(g),
|
|
431
431
|
""
|
|
432
432
|
]));
|
|
433
433
|
}
|
|
434
|
-
let x = t.visibleCommands(e).map((
|
|
435
|
-
t.subcommandTerm(
|
|
436
|
-
t.subcommandDescription(
|
|
434
|
+
let x = t.visibleCommands(e).map((g) => d(
|
|
435
|
+
t.subcommandTerm(g),
|
|
436
|
+
t.subcommandDescription(g)
|
|
437
437
|
));
|
|
438
438
|
return x.length > 0 && (c = c.concat(["Commands:", a(x), ""])), c.join(`
|
|
439
439
|
`);
|
|
@@ -467,17 +467,17 @@ var W = b((ae) => {
|
|
|
467
467
|
wrap(e, t, i, s = 40) {
|
|
468
468
|
let r = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF", o = new RegExp(`[\\n][${r}]+`);
|
|
469
469
|
if (e.match(o)) return e;
|
|
470
|
-
let
|
|
471
|
-
if (
|
|
470
|
+
let d = t - i;
|
|
471
|
+
if (d < s) return e;
|
|
472
472
|
let a = e.slice(0, i), c = e.slice(i).replace(`\r
|
|
473
473
|
`, `
|
|
474
|
-
`),
|
|
474
|
+
`), u = " ".repeat(i), m = "\\s\u200B", x = new RegExp(
|
|
475
475
|
`
|
|
476
|
-
|.{1,${
|
|
476
|
+
|.{1,${d - 1}}([${m}]|$)|[^${m}]+?([${m}]|$)`,
|
|
477
477
|
"g"
|
|
478
|
-
),
|
|
479
|
-
return a +
|
|
480
|
-
` ? "" : (I > 0 ?
|
|
478
|
+
), g = c.match(x) || [];
|
|
479
|
+
return a + g.map((_, I) => _ === `
|
|
480
|
+
` ? "" : (I > 0 ? u : "") + _.trimEnd()).join(`
|
|
481
481
|
`);
|
|
482
482
|
}
|
|
483
483
|
};
|
|
@@ -488,7 +488,7 @@ var W = b((ae) => {
|
|
|
488
488
|
var J = b((U) => {
|
|
489
489
|
var { InvalidArgumentError: Me } = j(), R = class {
|
|
490
490
|
static {
|
|
491
|
-
|
|
491
|
+
l(this, "Option");
|
|
492
492
|
}
|
|
493
493
|
/**
|
|
494
494
|
* Initialize a new `Option` with the given `flags` and `description`.
|
|
@@ -659,7 +659,7 @@ var J = b((U) => {
|
|
|
659
659
|
}
|
|
660
660
|
}, G = class {
|
|
661
661
|
static {
|
|
662
|
-
|
|
662
|
+
l(this, "DualOptions");
|
|
663
663
|
}
|
|
664
664
|
/**
|
|
665
665
|
* @param {Option[]} options
|
|
@@ -689,19 +689,19 @@ var J = b((U) => {
|
|
|
689
689
|
function Le(n) {
|
|
690
690
|
return n.split("-").reduce((e, t) => e + t[0].toUpperCase() + t.slice(1));
|
|
691
691
|
}
|
|
692
|
-
|
|
692
|
+
l(Le, "camelcase");
|
|
693
693
|
function We(n) {
|
|
694
694
|
let e, t, i = n.split(/[ |,]+/);
|
|
695
695
|
return i.length > 1 && !/^[[<]/.test(i[1]) && (e = i.shift()), t = i.shift(), !e && /^-[^-]$/.test(t) && (e = t, t = void 0), { shortFlag: e,
|
|
696
696
|
longFlag: t };
|
|
697
697
|
}
|
|
698
|
-
|
|
698
|
+
l(We, "splitOptionFlags");
|
|
699
699
|
U.Option = R;
|
|
700
700
|
U.DualOptions = G;
|
|
701
701
|
});
|
|
702
702
|
|
|
703
703
|
// ../node_modules/commander/lib/suggestSimilar.js
|
|
704
|
-
var
|
|
704
|
+
var le = b((de) => {
|
|
705
705
|
function Re(n, e) {
|
|
706
706
|
if (Math.abs(n.length - e.length) > 3)
|
|
707
707
|
return Math.max(n.length, e.length);
|
|
@@ -724,7 +724,7 @@ var de = b((le) => {
|
|
|
724
724
|
}
|
|
725
725
|
return t[n.length][e.length];
|
|
726
726
|
}
|
|
727
|
-
|
|
727
|
+
l(Re, "editDistance");
|
|
728
728
|
function Ge(n, e) {
|
|
729
729
|
if (!e || e.length === 0) return "";
|
|
730
730
|
e = Array.from(new Set(e));
|
|
@@ -733,23 +733,23 @@ var de = b((le) => {
|
|
|
733
733
|
let i = [], s = 3, r = 0.4;
|
|
734
734
|
return e.forEach((o) => {
|
|
735
735
|
if (o.length <= 1) return;
|
|
736
|
-
let
|
|
737
|
-
(a -
|
|
738
|
-
}), i.sort((o,
|
|
736
|
+
let d = Re(n, o), a = Math.max(n.length, o.length);
|
|
737
|
+
(a - d) / a > r && (d < s ? (s = d, i = [o]) : d === s && i.push(o));
|
|
738
|
+
}), i.sort((o, d) => o.localeCompare(d)), t && (i = i.map((o) => `--${o}`)), i.length > 1 ? `
|
|
739
739
|
(Did you mean one of ${i.join(", ")}?)` : i.length === 1 ? `
|
|
740
740
|
(Did you mean ${i[0]}?)` : "";
|
|
741
741
|
}
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
l(Ge, "suggestSimilar");
|
|
743
|
+
de.suggestSimilar = Ge;
|
|
744
744
|
});
|
|
745
745
|
|
|
746
746
|
// ../node_modules/commander/lib/command.js
|
|
747
747
|
var me = b((he) => {
|
|
748
|
-
var Ue = C("node:events").EventEmitter, Y = C("node:child_process"),
|
|
749
|
-
humanReadableArgName: Ye } = V(), { CommanderError: K } = j(), { Help: ze } = W(), { Option: ce, DualOptions: Ke } = J(), { suggestSimilar:
|
|
748
|
+
var Ue = C("node:events").EventEmitter, Y = C("node:child_process"), v = C("node:path"), z = C("node:fs"), h = C("node:process"), { Argument: Je,
|
|
749
|
+
humanReadableArgName: Ye } = V(), { CommanderError: K } = j(), { Help: ze } = W(), { Option: ce, DualOptions: Ke } = J(), { suggestSimilar: ue } = le(),
|
|
750
750
|
Q = class n extends Ue {
|
|
751
751
|
static {
|
|
752
|
-
|
|
752
|
+
l(this, "Command");
|
|
753
753
|
}
|
|
754
754
|
/**
|
|
755
755
|
* Initialize a new `Command`.
|
|
@@ -764,11 +764,11 @@ var me = b((he) => {
|
|
|
764
764
|
null, this._aliases = [], this._combineFlagAndOptionalValue = !0, this._description = "", this._summary = "", this._argsDescription = void 0,
|
|
765
765
|
this._enablePositionalOptions = !1, this._passThroughOptions = !1, this._lifeCycleHooks = {}, this._showHelpAfterError = !1, this._showSuggestionAfterError =
|
|
766
766
|
!0, this._outputConfiguration = {
|
|
767
|
-
writeOut: /* @__PURE__ */
|
|
768
|
-
writeErr: /* @__PURE__ */
|
|
769
|
-
getOutHelpWidth: /* @__PURE__ */
|
|
770
|
-
getErrHelpWidth: /* @__PURE__ */
|
|
771
|
-
outputError: /* @__PURE__ */
|
|
767
|
+
writeOut: /* @__PURE__ */ l((t) => h.stdout.write(t), "writeOut"),
|
|
768
|
+
writeErr: /* @__PURE__ */ l((t) => h.stderr.write(t), "writeErr"),
|
|
769
|
+
getOutHelpWidth: /* @__PURE__ */ l(() => h.stdout.isTTY ? h.stdout.columns : void 0, "getOutHelpWidth"),
|
|
770
|
+
getErrHelpWidth: /* @__PURE__ */ l(() => h.stderr.isTTY ? h.stderr.columns : void 0, "getErrHelpWidth"),
|
|
771
|
+
outputError: /* @__PURE__ */ l((t, i) => i(t), "outputError")
|
|
772
772
|
}, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration =
|
|
773
773
|
{};
|
|
774
774
|
}
|
|
@@ -824,9 +824,9 @@ var me = b((he) => {
|
|
|
824
824
|
command(e, t, i) {
|
|
825
825
|
let s = t, r = i;
|
|
826
826
|
typeof s == "object" && s !== null && (r = s, s = null), r = r || {};
|
|
827
|
-
let [, o,
|
|
827
|
+
let [, o, d] = e.match(/([^ ]+) *(.*)/), a = this.createCommand(o);
|
|
828
828
|
return s && (a.description(s), a._executableHandler = !0), r.isDefault && (this._defaultCommandName = a._name), a._hidden = !!(r.noHelp ||
|
|
829
|
-
r.hidden), a._executableFile = r.executableFile || null,
|
|
829
|
+
r.hidden), a._executableFile = r.executableFile || null, d && a.arguments(d), this._registerCommand(a), a.parent = this, a.copyInheritedSettings(
|
|
830
830
|
this), s ? this : a;
|
|
831
831
|
}
|
|
832
832
|
/**
|
|
@@ -1075,7 +1075,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1075
1075
|
* @return {Command} `this` command for chaining
|
|
1076
1076
|
*/
|
|
1077
1077
|
action(e) {
|
|
1078
|
-
let t = /* @__PURE__ */
|
|
1078
|
+
let t = /* @__PURE__ */ l((i) => {
|
|
1079
1079
|
let s = this.registeredArguments.length, r = i.slice(0, s);
|
|
1080
1080
|
return this._storeOptionsAsProperties ? r[s] = this : r[s] = this.opts(), r.push(this), e.apply(this, r);
|
|
1081
1081
|
}, "listener");
|
|
@@ -1138,7 +1138,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1138
1138
|
* @private
|
|
1139
1139
|
*/
|
|
1140
1140
|
_registerCommand(e) {
|
|
1141
|
-
let t = /* @__PURE__ */
|
|
1141
|
+
let t = /* @__PURE__ */ l((s) => [s.name()].concat(s.aliases()), "knownBy"), i = t(e).find(
|
|
1142
1142
|
(s) => this._findCommand(s)
|
|
1143
1143
|
);
|
|
1144
1144
|
if (i) {
|
|
@@ -1166,11 +1166,11 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1166
1166
|
"default"
|
|
1167
1167
|
);
|
|
1168
1168
|
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(i, e.defaultValue, "default");
|
|
1169
|
-
let s = /* @__PURE__ */
|
|
1169
|
+
let s = /* @__PURE__ */ l((r, o, d) => {
|
|
1170
1170
|
r == null && e.presetArg !== void 0 && (r = e.presetArg);
|
|
1171
1171
|
let a = this.getOptionValue(i);
|
|
1172
1172
|
r !== null && e.parseArg ? r = this._callParseArg(e, r, a, o) : r !== null && e.variadic && (r = e._concatValue(r, a)), r == null &&
|
|
1173
|
-
(e.negate ? r = !1 : e.isBoolean() || e.optional ? r = !0 : r = ""), this.setOptionValueWithSource(i, r,
|
|
1173
|
+
(e.negate ? r = !1 : e.isBoolean() || e.optional ? r = !0 : r = ""), this.setOptionValueWithSource(i, r, d);
|
|
1174
1174
|
}, "handleOptionValue");
|
|
1175
1175
|
return this.on("option:" + t, (r) => {
|
|
1176
1176
|
let o = `error: option '${e.flags}' argument '${r}' is invalid.`;
|
|
@@ -1195,10 +1195,10 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1195
1195
|
if (o.makeOptionMandatory(!!e.mandatory), typeof s == "function")
|
|
1196
1196
|
o.default(r).argParser(s);
|
|
1197
1197
|
else if (s instanceof RegExp) {
|
|
1198
|
-
let
|
|
1199
|
-
s = /* @__PURE__ */
|
|
1200
|
-
let
|
|
1201
|
-
return
|
|
1198
|
+
let d = s;
|
|
1199
|
+
s = /* @__PURE__ */ l((a, c) => {
|
|
1200
|
+
let u = d.exec(a);
|
|
1201
|
+
return u ? u[0] : c;
|
|
1202
1202
|
}, "fn"), o.default(r).argParser(s);
|
|
1203
1203
|
} else
|
|
1204
1204
|
o.default(s);
|
|
@@ -1477,81 +1477,81 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1477
1477
|
_executeSubCommand(e, t) {
|
|
1478
1478
|
t = t.slice();
|
|
1479
1479
|
let i = !1, s = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1480
|
-
function r(
|
|
1481
|
-
let m =
|
|
1480
|
+
function r(u, p) {
|
|
1481
|
+
let m = v.resolve(u, p);
|
|
1482
1482
|
if (z.existsSync(m)) return m;
|
|
1483
|
-
if (s.includes(
|
|
1483
|
+
if (s.includes(v.extname(p))) return;
|
|
1484
1484
|
let x = s.find(
|
|
1485
|
-
(
|
|
1485
|
+
(g) => z.existsSync(`${m}${g}`)
|
|
1486
1486
|
);
|
|
1487
1487
|
if (x) return `${m}${x}`;
|
|
1488
1488
|
}
|
|
1489
|
-
|
|
1490
|
-
let o = e._executableFile || `${this._name}-${e._name}`,
|
|
1489
|
+
l(r, "findFile"), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1490
|
+
let o = e._executableFile || `${this._name}-${e._name}`, d = this._executableDir || "";
|
|
1491
1491
|
if (this._scriptPath) {
|
|
1492
|
-
let
|
|
1492
|
+
let u;
|
|
1493
1493
|
try {
|
|
1494
|
-
|
|
1494
|
+
u = z.realpathSync(this._scriptPath);
|
|
1495
1495
|
} catch {
|
|
1496
|
-
|
|
1496
|
+
u = this._scriptPath;
|
|
1497
1497
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1498
|
+
d = v.resolve(
|
|
1499
|
+
v.dirname(u),
|
|
1500
|
+
d
|
|
1501
1501
|
);
|
|
1502
1502
|
}
|
|
1503
|
-
if (
|
|
1504
|
-
let
|
|
1505
|
-
if (!
|
|
1506
|
-
let
|
|
1503
|
+
if (d) {
|
|
1504
|
+
let u = r(d, o);
|
|
1505
|
+
if (!u && !e._executableFile && this._scriptPath) {
|
|
1506
|
+
let p = v.basename(
|
|
1507
1507
|
this._scriptPath,
|
|
1508
|
-
|
|
1508
|
+
v.extname(this._scriptPath)
|
|
1509
1509
|
);
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
`${
|
|
1510
|
+
p !== this._name && (u = r(
|
|
1511
|
+
d,
|
|
1512
|
+
`${p}-${e._name}`
|
|
1513
1513
|
));
|
|
1514
1514
|
}
|
|
1515
|
-
o =
|
|
1515
|
+
o = u || o;
|
|
1516
1516
|
}
|
|
1517
|
-
i = s.includes(
|
|
1517
|
+
i = s.includes(v.extname(o));
|
|
1518
1518
|
let a;
|
|
1519
|
-
h.platform !== "win32" ? i ? (t.unshift(o), t =
|
|
1520
|
-
o, t, { stdio: "inherit" }) : (t.unshift(o), t =
|
|
1521
|
-
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((
|
|
1522
|
-
h.on(
|
|
1523
|
-
a.killed === !1 && a.exitCode === null && a.kill(
|
|
1519
|
+
h.platform !== "win32" ? i ? (t.unshift(o), t = pe(h.execArgv).concat(t), a = Y.spawn(h.argv[0], t, { stdio: "inherit" })) : a = Y.spawn(
|
|
1520
|
+
o, t, { stdio: "inherit" }) : (t.unshift(o), t = pe(h.execArgv).concat(t), a = Y.spawn(h.execPath, t, { stdio: "inherit" })), a.killed ||
|
|
1521
|
+
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((p) => {
|
|
1522
|
+
h.on(p, () => {
|
|
1523
|
+
a.killed === !1 && a.exitCode === null && a.kill(p);
|
|
1524
1524
|
});
|
|
1525
1525
|
});
|
|
1526
1526
|
let c = this._exitCallback;
|
|
1527
|
-
a.on("close", (
|
|
1528
|
-
|
|
1527
|
+
a.on("close", (u) => {
|
|
1528
|
+
u = u ?? 1, c ? c(
|
|
1529
1529
|
new K(
|
|
1530
|
-
|
|
1530
|
+
u,
|
|
1531
1531
|
"commander.executeSubCommandAsync",
|
|
1532
1532
|
"(close)"
|
|
1533
1533
|
)
|
|
1534
|
-
) : h.exit(
|
|
1535
|
-
}), a.on("error", (
|
|
1536
|
-
if (
|
|
1537
|
-
let
|
|
1534
|
+
) : h.exit(u);
|
|
1535
|
+
}), a.on("error", (u) => {
|
|
1536
|
+
if (u.code === "ENOENT") {
|
|
1537
|
+
let p = d ? `searched for local subcommand relative to directory '${d}'` : "no directory for search for local subcommand, use .exe\
|
|
1538
1538
|
cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
1539
1539
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\
|
|
1540
1540
|
|
|
1541
1541
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
1542
|
-
- ${
|
|
1542
|
+
- ${p}`;
|
|
1543
1543
|
throw new Error(m);
|
|
1544
|
-
} else if (
|
|
1544
|
+
} else if (u.code === "EACCES")
|
|
1545
1545
|
throw new Error(`'${o}' not executable`);
|
|
1546
1546
|
if (!c)
|
|
1547
1547
|
h.exit(1);
|
|
1548
1548
|
else {
|
|
1549
|
-
let
|
|
1549
|
+
let p = new K(
|
|
1550
1550
|
1,
|
|
1551
1551
|
"commander.executeSubCommandAsync",
|
|
1552
1552
|
"(error)"
|
|
1553
1553
|
);
|
|
1554
|
-
|
|
1554
|
+
p.nestedError = u, c(p);
|
|
1555
1555
|
}
|
|
1556
1556
|
}), this.runningCommand = a;
|
|
1557
1557
|
}
|
|
@@ -1605,15 +1605,15 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1605
1605
|
* @private
|
|
1606
1606
|
*/
|
|
1607
1607
|
_processArguments() {
|
|
1608
|
-
let e = /* @__PURE__ */
|
|
1608
|
+
let e = /* @__PURE__ */ l((i, s, r) => {
|
|
1609
1609
|
let o = s;
|
|
1610
1610
|
if (s !== null && i.parseArg) {
|
|
1611
|
-
let
|
|
1611
|
+
let d = `error: command-argument value '${s}' is invalid for argument '${i.name()}'.`;
|
|
1612
1612
|
o = this._callParseArg(
|
|
1613
1613
|
i,
|
|
1614
1614
|
s,
|
|
1615
1615
|
r,
|
|
1616
|
-
|
|
1616
|
+
d
|
|
1617
1617
|
);
|
|
1618
1618
|
}
|
|
1619
1619
|
return o;
|
|
@@ -1622,7 +1622,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1622
1622
|
let t = [];
|
|
1623
1623
|
this.registeredArguments.forEach((i, s) => {
|
|
1624
1624
|
let r = i.defaultValue;
|
|
1625
|
-
i.variadic ? s < this.args.length ? (r = this.args.slice(s), i.parseArg && (r = r.reduce((o,
|
|
1625
|
+
i.variadic ? s < this.args.length ? (r = this.args.slice(s), i.parseArg && (r = r.reduce((o, d) => e(i, d, o), i.defaultValue))) : r ===
|
|
1626
1626
|
void 0 && (r = []) : s < this.args.length && (r = this.args[s], i.parseArg && (r = e(i, r, i.defaultValue))), t[s] = r;
|
|
1627
1627
|
}), this.processedArgs = t;
|
|
1628
1628
|
}
|
|
@@ -1689,7 +1689,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1689
1689
|
);
|
|
1690
1690
|
this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: !0 }), this.
|
|
1691
1691
|
_outputHelpIfRequested(i.unknown), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1692
|
-
let s = /* @__PURE__ */
|
|
1692
|
+
let s = /* @__PURE__ */ l(() => {
|
|
1693
1693
|
i.unknown.length > 0 && this.unknownOption(i.unknown[0]);
|
|
1694
1694
|
}, "checkForUnknownOptions"), r = `command:${this.name()}`;
|
|
1695
1695
|
if (this._actionHandler) {
|
|
@@ -1795,30 +1795,30 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1795
1795
|
function o(a) {
|
|
1796
1796
|
return a.length > 1 && a[0] === "-";
|
|
1797
1797
|
}
|
|
1798
|
-
|
|
1799
|
-
let
|
|
1798
|
+
l(o, "maybeOption");
|
|
1799
|
+
let d = null;
|
|
1800
1800
|
for (; r.length; ) {
|
|
1801
1801
|
let a = r.shift();
|
|
1802
1802
|
if (a === "--") {
|
|
1803
1803
|
s === i && s.push(a), s.push(...r);
|
|
1804
1804
|
break;
|
|
1805
1805
|
}
|
|
1806
|
-
if (
|
|
1807
|
-
this.emit(`option:${
|
|
1806
|
+
if (d && !o(a)) {
|
|
1807
|
+
this.emit(`option:${d.name()}`, a);
|
|
1808
1808
|
continue;
|
|
1809
1809
|
}
|
|
1810
|
-
if (
|
|
1810
|
+
if (d = null, o(a)) {
|
|
1811
1811
|
let c = this._findOption(a);
|
|
1812
1812
|
if (c) {
|
|
1813
1813
|
if (c.required) {
|
|
1814
|
-
let
|
|
1815
|
-
|
|
1814
|
+
let u = r.shift();
|
|
1815
|
+
u === void 0 && this.optionMissingArgument(c), this.emit(`option:${c.name()}`, u);
|
|
1816
1816
|
} else if (c.optional) {
|
|
1817
|
-
let
|
|
1818
|
-
r.length > 0 && !o(r[0]) && (
|
|
1817
|
+
let u = null;
|
|
1818
|
+
r.length > 0 && !o(r[0]) && (u = r.shift()), this.emit(`option:${c.name()}`, u);
|
|
1819
1819
|
} else
|
|
1820
1820
|
this.emit(`option:${c.name()}`);
|
|
1821
|
-
|
|
1821
|
+
d = c.variadic ? c : null;
|
|
1822
1822
|
continue;
|
|
1823
1823
|
}
|
|
1824
1824
|
}
|
|
@@ -1831,9 +1831,9 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
1833
1833
|
if (/^--[^=]+=/.test(a)) {
|
|
1834
|
-
let c = a.indexOf("="),
|
|
1835
|
-
if (
|
|
1836
|
-
this.emit(`option:${
|
|
1834
|
+
let c = a.indexOf("="), u = this._findOption(a.slice(0, c));
|
|
1835
|
+
if (u && (u.required || u.optional)) {
|
|
1836
|
+
this.emit(`option:${u.name()}`, a.slice(c + 1));
|
|
1837
1837
|
continue;
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
@@ -1925,7 +1925,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1925
1925
|
* @private
|
|
1926
1926
|
*/
|
|
1927
1927
|
_parseOptionsImplied() {
|
|
1928
|
-
let e = new Ke(this.options), t = /* @__PURE__ */
|
|
1928
|
+
let e = new Ke(this.options), t = /* @__PURE__ */ l((i) => this.getOptionValue(i) !== void 0 && !["default", "implied"].includes(this.
|
|
1929
1929
|
getOptionValueSource(i)), "hasCustomOptionValue");
|
|
1930
1930
|
this.options.filter(
|
|
1931
1931
|
(i) => i.implied !== void 0 && t(i.attributeName()) && e.valueFromOption(
|
|
@@ -1980,16 +1980,16 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1980
1980
|
* @private
|
|
1981
1981
|
*/
|
|
1982
1982
|
_conflictingOption(e, t) {
|
|
1983
|
-
let i = /* @__PURE__ */
|
|
1984
|
-
let
|
|
1985
|
-
(
|
|
1986
|
-
),
|
|
1987
|
-
(
|
|
1983
|
+
let i = /* @__PURE__ */ l((o) => {
|
|
1984
|
+
let d = o.attributeName(), a = this.getOptionValue(d), c = this.options.find(
|
|
1985
|
+
(p) => p.negate && d === p.attributeName()
|
|
1986
|
+
), u = this.options.find(
|
|
1987
|
+
(p) => !p.negate && d === p.attributeName()
|
|
1988
1988
|
);
|
|
1989
|
-
return c && (c.presetArg === void 0 && a === !1 || c.presetArg !== void 0 && a === c.presetArg) ? c :
|
|
1990
|
-
}, "findBestOptionFromValue"), s = /* @__PURE__ */
|
|
1991
|
-
let
|
|
1992
|
-
return this.getOptionValueSource(a) === "env" ? `environment variable '${
|
|
1989
|
+
return c && (c.presetArg === void 0 && a === !1 || c.presetArg !== void 0 && a === c.presetArg) ? c : u || o;
|
|
1990
|
+
}, "findBestOptionFromValue"), s = /* @__PURE__ */ l((o) => {
|
|
1991
|
+
let d = i(o), a = d.attributeName();
|
|
1992
|
+
return this.getOptionValueSource(a) === "env" ? `environment variable '${d.envVar}'` : `option '${d.flags}'`;
|
|
1993
1993
|
}, "getErrorMessage"), r = `error: ${s(e)} cannot be used with ${s(t)}`;
|
|
1994
1994
|
this.error(r, { code: "commander.conflictingOption" });
|
|
1995
1995
|
}
|
|
@@ -2005,10 +2005,10 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
2005
2005
|
if (e.startsWith("--") && this._showSuggestionAfterError) {
|
|
2006
2006
|
let s = [], r = this;
|
|
2007
2007
|
do {
|
|
2008
|
-
let o = r.createHelp().visibleOptions(r).filter((
|
|
2008
|
+
let o = r.createHelp().visibleOptions(r).filter((d) => d.long).map((d) => d.long);
|
|
2009
2009
|
s = s.concat(o), r = r.parent;
|
|
2010
2010
|
} while (r && !r._enablePositionalOptions);
|
|
2011
|
-
t =
|
|
2011
|
+
t = ue(e, s);
|
|
2012
2012
|
}
|
|
2013
2013
|
let i = `error: unknown option '${e}'${t}`;
|
|
2014
2014
|
this.error(i, { code: "commander.unknownOption" });
|
|
@@ -2036,7 +2036,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
2036
2036
|
let s = [];
|
|
2037
2037
|
this.createHelp().visibleCommands(this).forEach((r) => {
|
|
2038
2038
|
s.push(r.name()), r.alias() && s.push(r.alias());
|
|
2039
|
-
}), t =
|
|
2039
|
+
}), t = ue(e, s);
|
|
2040
2040
|
}
|
|
2041
2041
|
let i = `error: unknown command '${e}'${t}`;
|
|
2042
2042
|
this.error(i, { code: "commander.unknownCommand" });
|
|
@@ -2155,7 +2155,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
2155
2155
|
* @return {Command}
|
|
2156
2156
|
*/
|
|
2157
2157
|
nameFromFilename(e) {
|
|
2158
|
-
return this._name =
|
|
2158
|
+
return this._name = v.basename(e, v.extname(e)), this;
|
|
2159
2159
|
}
|
|
2160
2160
|
/**
|
|
2161
2161
|
* Get or set the directory for searching for executable subcommands of this command.
|
|
@@ -2188,7 +2188,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
2188
2188
|
_getHelpContext(e) {
|
|
2189
2189
|
e = e || {};
|
|
2190
2190
|
let t = { error: !!e.error }, i;
|
|
2191
|
-
return t.error ? i = /* @__PURE__ */
|
|
2191
|
+
return t.error ? i = /* @__PURE__ */ l((s) => this._outputConfiguration.writeErr(s), "write") : i = /* @__PURE__ */ l((s) => this._outputConfiguration.
|
|
2192
2192
|
writeOut(s), "write"), t.write = e.write || i, t.command = this, t;
|
|
2193
2193
|
}
|
|
2194
2194
|
/**
|
|
@@ -2292,7 +2292,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
2292
2292
|
t && e.find((s) => t.is(s)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
|
|
2293
2293
|
}
|
|
2294
2294
|
};
|
|
2295
|
-
function
|
|
2295
|
+
function pe(n) {
|
|
2296
2296
|
return n.map((e) => {
|
|
2297
2297
|
if (!e.startsWith("--inspect"))
|
|
2298
2298
|
return e;
|
|
@@ -2302,35 +2302,35 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
2302
2302
|
r[3], s = r[4]), t && s !== "0" ? `${t}=${i}:${parseInt(s) + 1}` : e;
|
|
2303
2303
|
});
|
|
2304
2304
|
}
|
|
2305
|
-
|
|
2305
|
+
l(pe, "incrementNodeInspectorPort");
|
|
2306
2306
|
he.Command = Q;
|
|
2307
2307
|
});
|
|
2308
2308
|
|
|
2309
2309
|
// ../node_modules/commander/index.js
|
|
2310
|
-
var xe = b((
|
|
2311
|
-
var { Argument:
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2310
|
+
var xe = b((f) => {
|
|
2311
|
+
var { Argument: ge } = V(), { Command: X } = me(), { CommanderError: Qe, InvalidArgumentError: fe } = j(), { Help: Xe } = W(), { Option: be } = J();
|
|
2312
|
+
f.program = new X();
|
|
2313
|
+
f.createCommand = (n) => new X(n);
|
|
2314
|
+
f.createOption = (n, e) => new be(n, e);
|
|
2315
|
+
f.createArgument = (n, e) => new ge(n, e);
|
|
2316
|
+
f.Command = X;
|
|
2317
|
+
f.Option = be;
|
|
2318
|
+
f.Argument = ge;
|
|
2319
|
+
f.Help = Xe;
|
|
2320
|
+
f.CommanderError = Qe;
|
|
2321
|
+
f.InvalidArgumentError = fe;
|
|
2322
|
+
f.InvalidOptionArgumentError = fe;
|
|
2323
2323
|
});
|
|
2324
2324
|
|
|
2325
2325
|
// ../node_modules/walk-up-path/dist/cjs/index.js
|
|
2326
|
-
var
|
|
2326
|
+
var _e = b((H) => {
|
|
2327
2327
|
"use strict";
|
|
2328
2328
|
Object.defineProperty(H, "__esModule", { value: !0 });
|
|
2329
2329
|
H.walkUp = void 0;
|
|
2330
|
-
var
|
|
2331
|
-
for (n = (0,
|
|
2330
|
+
var ve = C("path"), Ze = /* @__PURE__ */ l(function* (n) {
|
|
2331
|
+
for (n = (0, ve.resolve)(n); n; ) {
|
|
2332
2332
|
yield n;
|
|
2333
|
-
let e = (0,
|
|
2333
|
+
let e = (0, ve.dirname)(n);
|
|
2334
2334
|
if (e === n)
|
|
2335
2335
|
break;
|
|
2336
2336
|
n = e;
|
|
@@ -2342,16 +2342,16 @@ var ye = b((H) => {
|
|
|
2342
2342
|
// ../node_modules/picocolors/picocolors.js
|
|
2343
2343
|
var je = b((zt, te) => {
|
|
2344
2344
|
var P = process || {}, Oe = P.argv || [], D = P.env || {}, nt = !(D.NO_COLOR || Oe.includes("--no-color")) && (!!D.FORCE_COLOR || Oe.includes(
|
|
2345
|
-
"--color") || P.platform === "win32" || (P.stdout || {}).isTTY && D.TERM !== "dumb" || !!D.CI), ot = /* @__PURE__ */
|
|
2345
|
+
"--color") || P.platform === "win32" || (P.stdout || {}).isTTY && D.TERM !== "dumb" || !!D.CI), ot = /* @__PURE__ */ l((n, e, t = n) => (i) => {
|
|
2346
2346
|
let s = "" + i, r = s.indexOf(e, n.length);
|
|
2347
2347
|
return ~r ? n + at(s, e, t, r) + e : n + s + e;
|
|
2348
|
-
}, "formatter"), at = /* @__PURE__ */
|
|
2348
|
+
}, "formatter"), at = /* @__PURE__ */ l((n, e, t, i) => {
|
|
2349
2349
|
let s = "", r = 0;
|
|
2350
2350
|
do
|
|
2351
2351
|
s += n.substring(r, i) + t, r = i + e.length, i = n.indexOf(e, r);
|
|
2352
2352
|
while (~i);
|
|
2353
2353
|
return s + n.substring(r);
|
|
2354
|
-
}, "replaceClose"), Ce = /* @__PURE__ */
|
|
2354
|
+
}, "replaceClose"), Ce = /* @__PURE__ */ l((n = nt) => {
|
|
2355
2355
|
let e = n ? ot : () => String;
|
|
2356
2356
|
return {
|
|
2357
2357
|
isColorSupported: n,
|
|
@@ -2403,7 +2403,7 @@ var je = b((zt, te) => {
|
|
|
2403
2403
|
});
|
|
2404
2404
|
|
|
2405
2405
|
// ../node_modules/ts-dedent/dist/index.js
|
|
2406
|
-
var
|
|
2406
|
+
var qe = b((k) => {
|
|
2407
2407
|
"use strict";
|
|
2408
2408
|
Object.defineProperty(k, "__esModule", { value: !0 });
|
|
2409
2409
|
k.dedent = void 0;
|
|
@@ -2412,46 +2412,46 @@ var $e = b((k) => {
|
|
|
2412
2412
|
e[t - 1] = arguments[t];
|
|
2413
2413
|
var i = Array.from(typeof n == "string" ? [n] : n);
|
|
2414
2414
|
i[i.length - 1] = i[i.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
2415
|
-
var s = i.reduce(function(
|
|
2415
|
+
var s = i.reduce(function(d, a) {
|
|
2416
2416
|
var c = a.match(/\n([\t ]+|(?!\s).)/g);
|
|
2417
|
-
return c ?
|
|
2418
|
-
var
|
|
2419
|
-
return (m = (
|
|
2420
|
-
})) :
|
|
2417
|
+
return c ? d.concat(c.map(function(u) {
|
|
2418
|
+
var p, m;
|
|
2419
|
+
return (m = (p = u.match(/[\t ]/g)) === null || p === void 0 ? void 0 : p.length) !== null && m !== void 0 ? m : 0;
|
|
2420
|
+
})) : d;
|
|
2421
2421
|
}, []);
|
|
2422
2422
|
if (s.length) {
|
|
2423
2423
|
var r = new RegExp(`
|
|
2424
2424
|
[ ]{` + Math.min.apply(Math, s) + "}", "g");
|
|
2425
|
-
i = i.map(function(
|
|
2426
|
-
return
|
|
2425
|
+
i = i.map(function(d) {
|
|
2426
|
+
return d.replace(r, `
|
|
2427
2427
|
`);
|
|
2428
2428
|
});
|
|
2429
2429
|
}
|
|
2430
2430
|
i[0] = i[0].replace(/^\r?\n/, "");
|
|
2431
2431
|
var o = i[0];
|
|
2432
|
-
return e.forEach(function(
|
|
2433
|
-
var c = o.match(/(?:^|\n)( *)$/),
|
|
2434
|
-
typeof
|
|
2435
|
-
`) && (
|
|
2432
|
+
return e.forEach(function(d, a) {
|
|
2433
|
+
var c = o.match(/(?:^|\n)( *)$/), u = c ? c[1] : "", p = d;
|
|
2434
|
+
typeof d == "string" && d.includes(`
|
|
2435
|
+
`) && (p = String(d).split(`
|
|
2436
2436
|
`).map(function(m, x) {
|
|
2437
|
-
return x === 0 ? m : "" +
|
|
2437
|
+
return x === 0 ? m : "" + u + m;
|
|
2438
2438
|
}).join(`
|
|
2439
|
-
`)), o +=
|
|
2439
|
+
`)), o += p + i[a + 1];
|
|
2440
2440
|
}), o;
|
|
2441
2441
|
}
|
|
2442
|
-
|
|
2442
|
+
l(Se, "dedent");
|
|
2443
2443
|
k.dedent = Se;
|
|
2444
2444
|
k.default = Se;
|
|
2445
2445
|
});
|
|
2446
2446
|
|
|
2447
2447
|
// src/cli/bin/index.ts
|
|
2448
|
-
var A =
|
|
2449
|
-
import { getEnvConfig as re, parseList as
|
|
2448
|
+
var A = q(xe(), 1);
|
|
2449
|
+
import { getEnvConfig as re, parseList as wt, versions as yt } from "storybook/internal/common";
|
|
2450
2450
|
import { logger as ne } from "storybook/internal/node-logger";
|
|
2451
2451
|
import { addToGlobalContext as Ot } from "storybook/internal/telemetry";
|
|
2452
2452
|
|
|
2453
2453
|
// ../node_modules/fd-package-json/dist/esm/main.js
|
|
2454
|
-
var
|
|
2454
|
+
var we = q(_e(), 1);
|
|
2455
2455
|
import { resolve as et } from "node:path";
|
|
2456
2456
|
import { stat as tt, readFile as it } from "node:fs/promises";
|
|
2457
2457
|
import { statSync as Wt, readFileSync as Rt } from "node:fs";
|
|
@@ -2462,17 +2462,17 @@ async function st(n) {
|
|
|
2462
2462
|
return !1;
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
|
-
|
|
2465
|
+
l(st, "fileExists");
|
|
2466
2466
|
async function rt(n) {
|
|
2467
|
-
for (let e of (0,
|
|
2467
|
+
for (let e of (0, we.walkUp)(n)) {
|
|
2468
2468
|
let t = et(e, "package.json");
|
|
2469
2469
|
if (await st(t))
|
|
2470
2470
|
return t;
|
|
2471
2471
|
}
|
|
2472
2472
|
return null;
|
|
2473
2473
|
}
|
|
2474
|
-
|
|
2475
|
-
async function
|
|
2474
|
+
l(rt, "findPackagePath");
|
|
2475
|
+
async function w(n) {
|
|
2476
2476
|
let e = await rt(n);
|
|
2477
2477
|
if (!e)
|
|
2478
2478
|
return null;
|
|
@@ -2483,10 +2483,10 @@ async function v(n) {
|
|
|
2483
2483
|
return null;
|
|
2484
2484
|
}
|
|
2485
2485
|
}
|
|
2486
|
-
|
|
2486
|
+
l(w, "findPackage");
|
|
2487
2487
|
|
|
2488
2488
|
// node_modules/leven/index.js
|
|
2489
|
-
var Z = [],
|
|
2489
|
+
var Z = [], ye = [];
|
|
2490
2490
|
function ee(n, e) {
|
|
2491
2491
|
if (n === e)
|
|
2492
2492
|
return 0;
|
|
@@ -2500,40 +2500,40 @@ function ee(n, e) {
|
|
|
2500
2500
|
r++;
|
|
2501
2501
|
if (i -= r, s -= r, i === 0)
|
|
2502
2502
|
return s;
|
|
2503
|
-
let o,
|
|
2504
|
-
for (;
|
|
2505
|
-
|
|
2506
|
-
for (;
|
|
2507
|
-
for (o = e.charCodeAt(r +
|
|
2508
|
-
c = o ===
|
|
2509
|
-
return
|
|
2503
|
+
let o, d, a, c, u = 0, p = 0;
|
|
2504
|
+
for (; u < i; )
|
|
2505
|
+
ye[u] = n.charCodeAt(r + u), Z[u] = ++u;
|
|
2506
|
+
for (; p < s; )
|
|
2507
|
+
for (o = e.charCodeAt(r + p), a = p++, d = p, u = 0; u < i; u++)
|
|
2508
|
+
c = o === ye[u] ? a : a + 1, a = Z[u], d = Z[u] = a > d ? c > d ? d + 1 : c : c > a ? a + 1 : c;
|
|
2509
|
+
return d;
|
|
2510
2510
|
}
|
|
2511
|
-
|
|
2511
|
+
l(ee, "leven");
|
|
2512
2512
|
|
|
2513
2513
|
// src/cli/bin/index.ts
|
|
2514
|
-
var E =
|
|
2514
|
+
var E = q(je(), 1);
|
|
2515
2515
|
|
|
2516
2516
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
2517
|
-
var
|
|
2518
|
-
function
|
|
2517
|
+
var dt = process.env.NODE_ENV === "production", ie = "Invariant failed";
|
|
2518
|
+
function y(n, e) {
|
|
2519
2519
|
if (!n) {
|
|
2520
|
-
if (
|
|
2520
|
+
if (dt)
|
|
2521
2521
|
throw new Error(ie);
|
|
2522
2522
|
var t = typeof e == "function" ? e() : e, i = t ? "".concat(ie, ": ").concat(t) : ie;
|
|
2523
2523
|
throw new Error(i);
|
|
2524
2524
|
}
|
|
2525
2525
|
}
|
|
2526
|
-
|
|
2526
|
+
l(y, "invariant");
|
|
2527
2527
|
|
|
2528
2528
|
// package.json
|
|
2529
|
-
var ke = "9.0.0-alpha.
|
|
2529
|
+
var ke = "9.0.0-alpha.14";
|
|
2530
2530
|
|
|
2531
2531
|
// src/cli/build.ts
|
|
2532
2532
|
import { cache as ct } from "storybook/internal/common";
|
|
2533
|
-
import { buildStaticStandalone as
|
|
2534
|
-
var Ae = /* @__PURE__ */
|
|
2535
|
-
let e = await
|
|
2536
|
-
|
|
2533
|
+
import { buildStaticStandalone as ut, withTelemetry as pt } from "storybook/internal/core-server";
|
|
2534
|
+
var Ae = /* @__PURE__ */ l(async (n) => {
|
|
2535
|
+
let e = await w(__dirname);
|
|
2536
|
+
y(e, "Failed to find the closest package.json file.");
|
|
2537
2537
|
let t = {
|
|
2538
2538
|
...n,
|
|
2539
2539
|
configDir: n.configDir || "./.storybook",
|
|
@@ -2543,17 +2543,17 @@ var Ae = /* @__PURE__ */ d(async (n) => {
|
|
|
2543
2543
|
cache: ct,
|
|
2544
2544
|
packageJson: e
|
|
2545
2545
|
};
|
|
2546
|
-
await
|
|
2546
|
+
await pt(
|
|
2547
2547
|
"build",
|
|
2548
2548
|
{ cliOptions: n, presetOptions: t },
|
|
2549
|
-
() =>
|
|
2549
|
+
() => ut(t)
|
|
2550
2550
|
);
|
|
2551
2551
|
}, "build");
|
|
2552
2552
|
|
|
2553
2553
|
// src/cli/buildIndex.ts
|
|
2554
2554
|
import { cache as ht } from "storybook/internal/common";
|
|
2555
|
-
import { buildIndexStandalone as mt, withTelemetry as
|
|
2556
|
-
var Ee = /* @__PURE__ */
|
|
2555
|
+
import { buildIndexStandalone as mt, withTelemetry as gt } from "storybook/internal/core-server";
|
|
2556
|
+
var Ee = /* @__PURE__ */ l(async (n) => {
|
|
2557
2557
|
let e = {
|
|
2558
2558
|
...n,
|
|
2559
2559
|
configDir: n.configDir || ".storybook",
|
|
@@ -2567,16 +2567,16 @@ var Ee = /* @__PURE__ */ d(async (n) => {
|
|
|
2567
2567
|
corePresets: [],
|
|
2568
2568
|
overridePresets: []
|
|
2569
2569
|
};
|
|
2570
|
-
await
|
|
2570
|
+
await gt("index", { cliOptions: n, presetOptions: t }, () => mt(e));
|
|
2571
2571
|
}, "buildIndex");
|
|
2572
2572
|
|
|
2573
2573
|
// src/cli/dev.ts
|
|
2574
|
-
import { cache as
|
|
2574
|
+
import { cache as ft } from "storybook/internal/common";
|
|
2575
2575
|
import { buildDevStandalone as bt, withTelemetry as xt } from "storybook/internal/core-server";
|
|
2576
|
-
import { logger as O, instance as
|
|
2577
|
-
var se =
|
|
2578
|
-
function
|
|
2579
|
-
|
|
2576
|
+
import { logger as O, instance as vt } from "storybook/internal/node-logger";
|
|
2577
|
+
var se = q(qe(), 1);
|
|
2578
|
+
function _t(n) {
|
|
2579
|
+
vt.heading = "", n instanceof Error ? n.error ? O.error(n.error) : n.stats && n.stats.compilation.errors ? n.stats.compilation.errors.forEach(
|
|
2580
2580
|
(e) => O.plain(e)) : O.error(n) : n.compilation?.errors && n.compilation.errors.forEach((e) => O.plain(e)), O.line(), O.warn(
|
|
2581
2581
|
n.close ? se.dedent`
|
|
2582
2582
|
FATAL broken build!, will close the process,
|
|
@@ -2587,18 +2587,18 @@ function yt(n) {
|
|
|
2587
2587
|
`
|
|
2588
2588
|
), O.line();
|
|
2589
2589
|
}
|
|
2590
|
-
|
|
2591
|
-
var
|
|
2590
|
+
l(_t, "printError");
|
|
2591
|
+
var $e = /* @__PURE__ */ l(async (n) => {
|
|
2592
2592
|
let { env: e } = process;
|
|
2593
2593
|
e.NODE_ENV = e.NODE_ENV || "development";
|
|
2594
|
-
let t = await
|
|
2595
|
-
|
|
2594
|
+
let t = await w(__dirname);
|
|
2595
|
+
y(t, "Failed to find the closest package.json file.");
|
|
2596
2596
|
let i = {
|
|
2597
2597
|
...n,
|
|
2598
2598
|
configDir: n.configDir || "./.storybook",
|
|
2599
2599
|
configType: "DEVELOPMENT",
|
|
2600
2600
|
ignorePreview: !!n.previewUrl && !n.forceBuildPreview,
|
|
2601
|
-
cache:
|
|
2601
|
+
cache: ft,
|
|
2602
2602
|
packageJson: t
|
|
2603
2603
|
};
|
|
2604
2604
|
await xt(
|
|
@@ -2606,15 +2606,15 @@ var qe = /* @__PURE__ */ d(async (n) => {
|
|
|
2606
2606
|
{
|
|
2607
2607
|
cliOptions: n,
|
|
2608
2608
|
presetOptions: i,
|
|
2609
|
-
printError:
|
|
2609
|
+
printError: _t
|
|
2610
2610
|
},
|
|
2611
2611
|
() => bt(i)
|
|
2612
2612
|
);
|
|
2613
2613
|
}, "dev");
|
|
2614
2614
|
|
|
2615
2615
|
// src/cli/bin/index.ts
|
|
2616
|
-
Ot("cliVersion",
|
|
2617
|
-
var S = console, oe = /* @__PURE__ */
|
|
2616
|
+
Ot("cliVersion", yt.storybook);
|
|
2617
|
+
var S = console, oe = /* @__PURE__ */ l((n) => A.program.command(n).option(
|
|
2618
2618
|
"--disable-telemetry",
|
|
2619
2619
|
"Disable sending telemetry data",
|
|
2620
2620
|
// default value is false, but if the user sets STORYBOOK_DISABLE_TELEMETRY, it can be true
|
|
@@ -2628,7 +2628,7 @@ k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook con
|
|
|
2628
2628
|
).option(
|
|
2629
2629
|
"--ssl-ca <ca>",
|
|
2630
2630
|
"Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)",
|
|
2631
|
-
|
|
2631
|
+
wt
|
|
2632
2632
|
).option("--ssl-cert <cert>", "Provide an SSL certificate. (Required with --https)").option("--ssl-key <key>", "Provide an SSL key. (Require\
|
|
2633
2633
|
d with --https)").option("--smoke-test", "Exit after successful start").option("--ci", "CI mode (skip interactive prompts, don't open browse\
|
|
2634
2634
|
r)").option("--no-open", "Do not open Storybook automatically in the browser").option("--loglevel <level>", "Control level of logging during\
|
|
@@ -2645,15 +2645,15 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
|
|
|
2645
2645
|
"URL path to be appended when visiting Storybook for the first time"
|
|
2646
2646
|
).action(async (n) => {
|
|
2647
2647
|
ne.setLevel(n.loglevel);
|
|
2648
|
-
let e = await
|
|
2649
|
-
|
|
2648
|
+
let e = await w(__dirname);
|
|
2649
|
+
y(e, "Failed to find the closest package.json file."), S.log(E.default.bold(`${e.name} v${e.version}`) + E.default.reset(`
|
|
2650
2650
|
`)), re(n, {
|
|
2651
2651
|
port: "SBCONFIG_PORT",
|
|
2652
2652
|
host: "SBCONFIG_HOSTNAME",
|
|
2653
2653
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
2654
2654
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
2655
2655
|
ci: "CI"
|
|
2656
|
-
}), parseInt(`${n.port}`, 10) && (n.port = parseInt(`${n.port}`, 10)), await
|
|
2656
|
+
}), parseInt(`${n.port}`, 10) && (n.port = parseInt(`${n.port}`, 10)), await $e({ ...n, packageJson: e }).catch(() => process.exit(1));
|
|
2657
2657
|
});
|
|
2658
2658
|
oe("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
|
|
2659
2659
|
here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level \
|
|
@@ -2667,8 +2667,8 @@ of logging during build").option("--debug-webpack", "Display final webpack confi
|
|
|
2667
2667
|
ly site using addon-docs").option("--test", "Build stories optimized for testing purposes.").action(async (n) => {
|
|
2668
2668
|
let { env: e } = process;
|
|
2669
2669
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
2670
|
-
let t = await
|
|
2671
|
-
|
|
2670
|
+
let t = await w(__dirname);
|
|
2671
|
+
y(t, "Failed to find the closest package.json file."), ne.setLevel(n.loglevel), S.log(E.default.bold(`${t.name} v${t.version}
|
|
2672
2672
|
`)), re(n, {
|
|
2673
2673
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
2674
2674
|
outputDir: "SBCONFIG_OUTPUT_DIR",
|
|
@@ -2684,8 +2684,8 @@ oad Storybook configurations from").option("--quiet", "Suppress verbose build ou
|
|
|
2684
2684
|
g during build").action(async (n) => {
|
|
2685
2685
|
let { env: e } = process;
|
|
2686
2686
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
2687
|
-
let t = await
|
|
2688
|
-
|
|
2687
|
+
let t = await w(__dirname);
|
|
2688
|
+
y(t, "Failed to find the closest package.json file."), ne.setLevel(n.loglevel), S.log(E.default.bold(`${t.name} v${t.version}
|
|
2689
2689
|
`)), re(n, {
|
|
2690
2690
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
2691
2691
|
outputFile: "SBCONFIG_OUTPUT_FILE"
|