storybook 9.0.0-alpha.8 → 9.0.0-beta.0
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/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/server/base-preview-head.html +1 -3
- package/bin/index.cjs +2 -2
- package/dist/actions/decorator.js +67 -72
- package/dist/actions/index.cjs +27 -31
- package/dist/actions/index.d.ts +0 -3
- package/dist/actions/index.js +27 -31
- package/dist/actions/preview.cjs +23 -27
- package/dist/actions/preview.d.ts +0 -1
- package/dist/actions/preview.js +19 -23
- package/dist/babel/index.cjs +822 -816
- package/dist/babel/index.js +822 -816
- 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 +73 -92
- package/dist/bin/index.js +66 -85
- package/dist/builder-manager/index.cjs +316 -296
- package/dist/builder-manager/index.js +567 -547
- package/dist/channels/index.cjs +1020 -950
- package/dist/channels/index.js +1256 -1201
- package/dist/cli/bin/index.cjs +198 -198
- package/dist/cli/bin/index.js +204 -204
- package/dist/cli/index.cjs +61734 -7589
- package/dist/cli/index.d.ts +24 -20
- package/dist/cli/index.js +61775 -7630
- package/dist/common/index.cjs +16175 -9123
- package/dist/common/index.d.ts +34 -25
- package/dist/common/index.js +16270 -9212
- package/dist/component-testing/index.cjs +23 -0
- package/dist/component-testing/index.d.ts +3 -0
- package/dist/component-testing/index.js +5 -0
- package/dist/component-testing/preview.cjs +40 -0
- package/dist/component-testing/preview.d.ts +5 -0
- package/dist/component-testing/preview.js +25 -0
- package/dist/components/index.cjs +6479 -13005
- package/dist/components/index.d.ts +8 -257
- package/dist/components/index.js +6160 -18689
- package/dist/controls/decorator.d.ts +5 -0
- package/dist/controls/decorator.js +8 -0
- package/dist/controls/index.cjs +26 -0
- package/dist/controls/index.d.ts +39 -0
- package/dist/controls/index.js +6 -0
- package/dist/controls/preview.cjs +26 -0
- package/dist/controls/preview.d.ts +54 -0
- package/dist/controls/preview.js +9 -0
- package/dist/core-events/index.cjs +91 -106
- package/dist/core-events/index.d.ts +2 -80
- package/dist/core-events/index.js +79 -94
- package/dist/core-server/index.cjs +12314 -12114
- package/dist/core-server/index.d.ts +32 -23
- package/dist/core-server/index.js +12495 -12296
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +12153 -12
- package/dist/core-server/presets/common-preset.cjs +3004 -3151
- package/dist/core-server/presets/common-preset.js +2833 -2981
- package/dist/csf/index.d.ts +1 -3
- package/dist/csf-tools/index.cjs +412 -403
- package/dist/csf-tools/index.d.ts +0 -4
- package/dist/csf-tools/index.js +410 -401
- package/dist/docs-tools/index.cjs +2569 -575
- package/dist/docs-tools/index.js +2565 -564
- package/dist/highlight/index.cjs +27 -0
- package/dist/highlight/index.d.ts +61 -0
- package/dist/highlight/index.js +7 -0
- package/dist/highlight/preview.cjs +535 -0
- package/dist/highlight/preview.d.ts +54 -0
- package/dist/highlight/preview.js +519 -0
- package/dist/instrumenter/index.cjs +1417 -1761
- package/dist/instrumenter/index.d.ts +8 -7
- package/dist/instrumenter/index.js +1332 -1667
- package/dist/manager/globals-module-info.cjs +22 -33
- package/dist/manager/globals-module-info.js +7 -18
- package/dist/manager/globals-runtime.js +45449 -49535
- package/dist/manager/runtime.js +4392 -3774
- package/dist/manager-api/index.cjs +2622 -2529
- package/dist/manager-api/index.d.ts +109 -114
- package/dist/manager-api/index.js +2603 -2475
- package/dist/manager-errors.js +41 -37
- package/dist/measure/index.cjs +476 -0
- package/dist/measure/index.d.ts +66 -0
- package/dist/measure/index.js +464 -0
- package/dist/measure/preview.cjs +466 -0
- package/dist/measure/preview.d.ts +59 -0
- package/dist/measure/preview.js +450 -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 +42328 -38511
- package/dist/preview-api/index.cjs +1204 -1293
- package/dist/preview-api/index.d.ts +126 -178
- package/dist/preview-api/index.js +1614 -1685
- package/dist/preview-errors.cjs +65 -51
- package/dist/preview-errors.d.ts +6 -2
- package/dist/preview-errors.js +176 -142
- package/dist/server-errors.cjs +160 -113
- package/dist/server-errors.d.ts +12 -2
- package/dist/server-errors.js +157 -110
- package/dist/telemetry/index.cjs +407 -403
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +493 -489
- package/dist/test/index.cjs +1553 -1552
- package/dist/test/index.js +9603 -9514
- package/dist/test/preview.cjs +1906 -1905
- package/dist/test/preview.d.ts +0 -6
- package/dist/test/preview.js +3664 -3603
- package/dist/test/spy.cjs +65 -64
- package/dist/test/spy.js +59 -58
- package/dist/types/index.cjs +11 -12
- package/dist/types/index.d.ts +601 -338
- package/dist/types/index.js +1 -2
- package/dist/viewport/index.cjs +310 -0
- package/dist/viewport/index.d.ts +320 -0
- package/dist/viewport/index.js +290 -0
- package/dist/viewport/preview.cjs +35 -0
- package/dist/viewport/preview.d.ts +68 -0
- package/dist/viewport/preview.js +19 -0
- package/package.json +207 -12
- package/dist/actions/manager.js +0 -1196
package/dist/cli/bin/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var L = Object.defineProperty;
|
|
|
4
4
|
var Le = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var We = Object.getOwnPropertyNames;
|
|
6
6
|
var Re = Object.getPrototypeOf, Ge = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
7
|
+
var l = (n, e) => L(n, "name", { value: e, configurable: !0 });
|
|
8
8
|
var b = (n, e) => () => (e || n((e = { exports: {} }).exports, e), e.exports);
|
|
9
9
|
var Ue = (n, e, t, i) => {
|
|
10
10
|
if (e && typeof e == "object" || typeof e == "function")
|
|
@@ -12,7 +12,7 @@ var Ue = (n, e, t, i) => {
|
|
|
12
12
|
!Ge.call(n, s) && s !== t && L(n, s, { get: () => e[s], enumerable: !(i = Le(e, s)) || i.enumerable });
|
|
13
13
|
return n;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
15
|
+
var q = (n, e, t) => (t = n != null ? Me(Re(n)) : {}, Ue(
|
|
16
16
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
17
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
18
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -22,10 +22,10 @@ var $ = (n, e, t) => (t = n != null ? Me(Re(n)) : {}, Ue(
|
|
|
22
22
|
));
|
|
23
23
|
|
|
24
24
|
// ../node_modules/commander/lib/error.js
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var j = b((R) => {
|
|
26
|
+
var $ = class extends Error {
|
|
27
27
|
static {
|
|
28
|
-
|
|
28
|
+
l(this, "CommanderError");
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Constructs the CommanderError class
|
|
@@ -37,9 +37,9 @@ var k = b((R) => {
|
|
|
37
37
|
super(i), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = t, this.exitCode = e, this.nestedError =
|
|
38
38
|
void 0;
|
|
39
39
|
}
|
|
40
|
-
}, W = class extends
|
|
40
|
+
}, W = class extends $ {
|
|
41
41
|
static {
|
|
42
|
-
|
|
42
|
+
l(this, "InvalidArgumentError");
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Constructs the InvalidArgumentError class
|
|
@@ -49,15 +49,15 @@ var k = b((R) => {
|
|
|
49
49
|
super(1, "commander.invalidArgument", e), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
R.CommanderError =
|
|
52
|
+
R.CommanderError = $;
|
|
53
53
|
R.InvalidArgumentError = W;
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
// ../node_modules/commander/lib/argument.js
|
|
57
57
|
var V = b((U) => {
|
|
58
|
-
var { InvalidArgumentError: Je } =
|
|
58
|
+
var { InvalidArgumentError: Je } = j(), G = class {
|
|
59
59
|
static {
|
|
60
|
-
|
|
60
|
+
l(this, "Argument");
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Initialize a new command argument with the given name and description.
|
|
@@ -151,7 +151,7 @@ var V = b((U) => {
|
|
|
151
151
|
let e = n.name() + (n.variadic === !0 ? "..." : "");
|
|
152
152
|
return n.required ? "<" + e + ">" : "[" + e + "]";
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
l(Ye, "humanReadableArgName");
|
|
155
155
|
U.Argument = G;
|
|
156
156
|
U.humanReadableArgName = Ye;
|
|
157
157
|
});
|
|
@@ -160,7 +160,7 @@ var V = b((U) => {
|
|
|
160
160
|
var Y = b((ce) => {
|
|
161
161
|
var { humanReadableArgName: ze } = V(), J = class {
|
|
162
162
|
static {
|
|
163
|
-
|
|
163
|
+
l(this, "Help");
|
|
164
164
|
}
|
|
165
165
|
constructor() {
|
|
166
166
|
this.helpWidth = void 0, this.sortSubcommands = !1, this.sortOptions = !1, this.showGlobalOptions = !1;
|
|
@@ -183,7 +183,7 @@ var Y = b((ce) => {
|
|
|
183
183
|
* @returns {number}
|
|
184
184
|
*/
|
|
185
185
|
compareOptions(e, t) {
|
|
186
|
-
let i = /* @__PURE__ */
|
|
186
|
+
let i = /* @__PURE__ */ l((s) => s.short ? s.short.replace(/^-/, "") : s.long.replace(/^--/, ""), "getSortKey");
|
|
187
187
|
return i(e).localeCompare(i(t));
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
@@ -378,53 +378,53 @@ var Y = b((ce) => {
|
|
|
378
378
|
*/
|
|
379
379
|
formatHelp(e, t) {
|
|
380
380
|
let i = t.padWidth(e, t), s = t.helpWidth || 80, r = 2, o = 2;
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
let M = `${
|
|
381
|
+
function d(g, w) {
|
|
382
|
+
if (w) {
|
|
383
|
+
let M = `${g.padEnd(i + o)}${w}`;
|
|
384
384
|
return t.wrap(
|
|
385
385
|
M,
|
|
386
386
|
s - r,
|
|
387
387
|
i + o
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
|
-
return
|
|
390
|
+
return g;
|
|
391
391
|
}
|
|
392
|
-
d
|
|
393
|
-
function a(
|
|
394
|
-
return
|
|
392
|
+
l(d, "formatItem");
|
|
393
|
+
function a(g) {
|
|
394
|
+
return g.join(`
|
|
395
395
|
`).replace(/^/gm, " ".repeat(r));
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
l(a, "formatList");
|
|
398
398
|
let c = [`Usage: ${t.commandUsage(e)}`, ""], u = t.commandDescription(e);
|
|
399
399
|
u.length > 0 && (c = c.concat([
|
|
400
400
|
t.wrap(u, s, 0),
|
|
401
401
|
""
|
|
402
402
|
]));
|
|
403
|
-
let p = t.visibleArguments(e).map((
|
|
404
|
-
t.argumentTerm(
|
|
405
|
-
t.argumentDescription(
|
|
403
|
+
let p = t.visibleArguments(e).map((g) => d(
|
|
404
|
+
t.argumentTerm(g),
|
|
405
|
+
t.argumentDescription(g)
|
|
406
406
|
));
|
|
407
407
|
p.length > 0 && (c = c.concat(["Arguments:", a(p), ""]));
|
|
408
|
-
let m = t.visibleOptions(e).map((
|
|
409
|
-
t.optionTerm(
|
|
410
|
-
t.optionDescription(
|
|
408
|
+
let m = t.visibleOptions(e).map((g) => d(
|
|
409
|
+
t.optionTerm(g),
|
|
410
|
+
t.optionDescription(g)
|
|
411
411
|
));
|
|
412
412
|
if (m.length > 0 && (c = c.concat(["Options:", a(m), ""])), this.showGlobalOptions) {
|
|
413
|
-
let
|
|
414
|
-
t.optionTerm(
|
|
415
|
-
t.optionDescription(
|
|
413
|
+
let g = t.visibleGlobalOptions(e).map((w) => d(
|
|
414
|
+
t.optionTerm(w),
|
|
415
|
+
t.optionDescription(w)
|
|
416
416
|
));
|
|
417
|
-
|
|
417
|
+
g.length > 0 && (c = c.concat([
|
|
418
418
|
"Global Options:",
|
|
419
|
-
a(
|
|
419
|
+
a(g),
|
|
420
420
|
""
|
|
421
421
|
]));
|
|
422
422
|
}
|
|
423
|
-
let
|
|
424
|
-
t.subcommandTerm(
|
|
425
|
-
t.subcommandDescription(
|
|
423
|
+
let v = t.visibleCommands(e).map((g) => d(
|
|
424
|
+
t.subcommandTerm(g),
|
|
425
|
+
t.subcommandDescription(g)
|
|
426
426
|
));
|
|
427
|
-
return
|
|
427
|
+
return v.length > 0 && (c = c.concat(["Commands:", a(v), ""])), c.join(`
|
|
428
428
|
`);
|
|
429
429
|
}
|
|
430
430
|
/**
|
|
@@ -456,17 +456,17 @@ var Y = b((ce) => {
|
|
|
456
456
|
wrap(e, t, i, s = 40) {
|
|
457
457
|
let r = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF", o = new RegExp(`[\\n][${r}]+`);
|
|
458
458
|
if (e.match(o)) return e;
|
|
459
|
-
let
|
|
460
|
-
if (
|
|
459
|
+
let d = t - i;
|
|
460
|
+
if (d < s) return e;
|
|
461
461
|
let a = e.slice(0, i), c = e.slice(i).replace(`\r
|
|
462
462
|
`, `
|
|
463
|
-
`), u = " ".repeat(i), m = "\\s\u200B",
|
|
463
|
+
`), u = " ".repeat(i), m = "\\s\u200B", v = new RegExp(
|
|
464
464
|
`
|
|
465
|
-
|.{1,${
|
|
465
|
+
|.{1,${d - 1}}([${m}]|$)|[^${m}]+?([${m}]|$)`,
|
|
466
466
|
"g"
|
|
467
|
-
),
|
|
468
|
-
return a +
|
|
469
|
-
` ? "" : (M > 0 ? u : "") +
|
|
467
|
+
), g = c.match(v) || [];
|
|
468
|
+
return a + g.map((w, M) => w === `
|
|
469
|
+
` ? "" : (M > 0 ? u : "") + w.trimEnd()).join(`
|
|
470
470
|
`);
|
|
471
471
|
}
|
|
472
472
|
};
|
|
@@ -475,9 +475,9 @@ var Y = b((ce) => {
|
|
|
475
475
|
|
|
476
476
|
// ../node_modules/commander/lib/option.js
|
|
477
477
|
var X = b((Q) => {
|
|
478
|
-
var { InvalidArgumentError: Ke } =
|
|
478
|
+
var { InvalidArgumentError: Ke } = j(), z = class {
|
|
479
479
|
static {
|
|
480
|
-
|
|
480
|
+
l(this, "Option");
|
|
481
481
|
}
|
|
482
482
|
/**
|
|
483
483
|
* Initialize a new `Option` with the given `flags` and `description`.
|
|
@@ -648,7 +648,7 @@ var X = b((Q) => {
|
|
|
648
648
|
}
|
|
649
649
|
}, K = class {
|
|
650
650
|
static {
|
|
651
|
-
|
|
651
|
+
l(this, "DualOptions");
|
|
652
652
|
}
|
|
653
653
|
/**
|
|
654
654
|
* @param {Option[]} options
|
|
@@ -678,13 +678,13 @@ var X = b((Q) => {
|
|
|
678
678
|
function Qe(n) {
|
|
679
679
|
return n.split("-").reduce((e, t) => e + t[0].toUpperCase() + t.slice(1));
|
|
680
680
|
}
|
|
681
|
-
|
|
681
|
+
l(Qe, "camelcase");
|
|
682
682
|
function Xe(n) {
|
|
683
683
|
let e, t, i = n.split(/[ |,]+/);
|
|
684
684
|
return i.length > 1 && !/^[[<]/.test(i[1]) && (e = i.shift()), t = i.shift(), !e && /^-[^-]$/.test(t) && (e = t, t = void 0), { shortFlag: e,
|
|
685
685
|
longFlag: t };
|
|
686
686
|
}
|
|
687
|
-
|
|
687
|
+
l(Xe, "splitOptionFlags");
|
|
688
688
|
Q.Option = z;
|
|
689
689
|
Q.DualOptions = K;
|
|
690
690
|
});
|
|
@@ -713,7 +713,7 @@ var pe = b((ue) => {
|
|
|
713
713
|
}
|
|
714
714
|
return t[n.length][e.length];
|
|
715
715
|
}
|
|
716
|
-
|
|
716
|
+
l(Ze, "editDistance");
|
|
717
717
|
function et(n, e) {
|
|
718
718
|
if (!e || e.length === 0) return "";
|
|
719
719
|
e = Array.from(new Set(e));
|
|
@@ -722,23 +722,23 @@ var pe = b((ue) => {
|
|
|
722
722
|
let i = [], s = 3, r = 0.4;
|
|
723
723
|
return e.forEach((o) => {
|
|
724
724
|
if (o.length <= 1) return;
|
|
725
|
-
let
|
|
726
|
-
(a -
|
|
727
|
-
}), i.sort((o,
|
|
725
|
+
let d = Ze(n, o), a = Math.max(n.length, o.length);
|
|
726
|
+
(a - d) / a > r && (d < s ? (s = d, i = [o]) : d === s && i.push(o));
|
|
727
|
+
}), i.sort((o, d) => o.localeCompare(d)), t && (i = i.map((o) => `--${o}`)), i.length > 1 ? `
|
|
728
728
|
(Did you mean one of ${i.join(", ")}?)` : i.length === 1 ? `
|
|
729
729
|
(Did you mean ${i[0]}?)` : "";
|
|
730
730
|
}
|
|
731
|
-
|
|
731
|
+
l(et, "suggestSimilar");
|
|
732
732
|
ue.suggestSimilar = et;
|
|
733
733
|
});
|
|
734
734
|
|
|
735
735
|
// ../node_modules/commander/lib/command.js
|
|
736
|
-
var be = b((
|
|
737
|
-
var tt = require("node:events").EventEmitter, Z = require("node:child_process"),
|
|
738
|
-
{ Argument: it, humanReadableArgName: st } = V(), { CommanderError: te } =
|
|
736
|
+
var be = b((fe) => {
|
|
737
|
+
var tt = require("node:events").EventEmitter, Z = require("node:child_process"), _ = require("node:path"), ee = require("node:fs"), h = require("node:process"),
|
|
738
|
+
{ Argument: it, humanReadableArgName: st } = V(), { CommanderError: te } = j(), { Help: rt } = Y(), { Option: he, DualOptions: nt } = X(),
|
|
739
739
|
{ suggestSimilar: me } = pe(), ie = class n extends tt {
|
|
740
740
|
static {
|
|
741
|
-
|
|
741
|
+
l(this, "Command");
|
|
742
742
|
}
|
|
743
743
|
/**
|
|
744
744
|
* Initialize a new `Command`.
|
|
@@ -753,11 +753,11 @@ var be = b((ge) => {
|
|
|
753
753
|
null, this._aliases = [], this._combineFlagAndOptionalValue = !0, this._description = "", this._summary = "", this._argsDescription = void 0,
|
|
754
754
|
this._enablePositionalOptions = !1, this._passThroughOptions = !1, this._lifeCycleHooks = {}, this._showHelpAfterError = !1, this._showSuggestionAfterError =
|
|
755
755
|
!0, this._outputConfiguration = {
|
|
756
|
-
writeOut: /* @__PURE__ */
|
|
757
|
-
writeErr: /* @__PURE__ */
|
|
758
|
-
getOutHelpWidth: /* @__PURE__ */
|
|
759
|
-
getErrHelpWidth: /* @__PURE__ */
|
|
760
|
-
outputError: /* @__PURE__ */
|
|
756
|
+
writeOut: /* @__PURE__ */ l((t) => h.stdout.write(t), "writeOut"),
|
|
757
|
+
writeErr: /* @__PURE__ */ l((t) => h.stderr.write(t), "writeErr"),
|
|
758
|
+
getOutHelpWidth: /* @__PURE__ */ l(() => h.stdout.isTTY ? h.stdout.columns : void 0, "getOutHelpWidth"),
|
|
759
|
+
getErrHelpWidth: /* @__PURE__ */ l(() => h.stderr.isTTY ? h.stderr.columns : void 0, "getErrHelpWidth"),
|
|
760
|
+
outputError: /* @__PURE__ */ l((t, i) => i(t), "outputError")
|
|
761
761
|
}, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration =
|
|
762
762
|
{};
|
|
763
763
|
}
|
|
@@ -813,9 +813,9 @@ var be = b((ge) => {
|
|
|
813
813
|
command(e, t, i) {
|
|
814
814
|
let s = t, r = i;
|
|
815
815
|
typeof s == "object" && s !== null && (r = s, s = null), r = r || {};
|
|
816
|
-
let [, o,
|
|
816
|
+
let [, o, d] = e.match(/([^ ]+) *(.*)/), a = this.createCommand(o);
|
|
817
817
|
return s && (a.description(s), a._executableHandler = !0), r.isDefault && (this._defaultCommandName = a._name), a._hidden = !!(r.noHelp ||
|
|
818
|
-
r.hidden), a._executableFile = r.executableFile || null,
|
|
818
|
+
r.hidden), a._executableFile = r.executableFile || null, d && a.arguments(d), this._registerCommand(a), a.parent = this, a.copyInheritedSettings(
|
|
819
819
|
this), s ? this : a;
|
|
820
820
|
}
|
|
821
821
|
/**
|
|
@@ -1064,7 +1064,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1064
1064
|
* @return {Command} `this` command for chaining
|
|
1065
1065
|
*/
|
|
1066
1066
|
action(e) {
|
|
1067
|
-
let t = /* @__PURE__ */
|
|
1067
|
+
let t = /* @__PURE__ */ l((i) => {
|
|
1068
1068
|
let s = this.registeredArguments.length, r = i.slice(0, s);
|
|
1069
1069
|
return this._storeOptionsAsProperties ? r[s] = this : r[s] = this.opts(), r.push(this), e.apply(this, r);
|
|
1070
1070
|
}, "listener");
|
|
@@ -1127,7 +1127,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1127
1127
|
* @private
|
|
1128
1128
|
*/
|
|
1129
1129
|
_registerCommand(e) {
|
|
1130
|
-
let t = /* @__PURE__ */
|
|
1130
|
+
let t = /* @__PURE__ */ l((s) => [s.name()].concat(s.aliases()), "knownBy"), i = t(e).find(
|
|
1131
1131
|
(s) => this._findCommand(s)
|
|
1132
1132
|
);
|
|
1133
1133
|
if (i) {
|
|
@@ -1155,11 +1155,11 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1155
1155
|
"default"
|
|
1156
1156
|
);
|
|
1157
1157
|
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(i, e.defaultValue, "default");
|
|
1158
|
-
let s = /* @__PURE__ */
|
|
1158
|
+
let s = /* @__PURE__ */ l((r, o, d) => {
|
|
1159
1159
|
r == null && e.presetArg !== void 0 && (r = e.presetArg);
|
|
1160
1160
|
let a = this.getOptionValue(i);
|
|
1161
1161
|
r !== null && e.parseArg ? r = this._callParseArg(e, r, a, o) : r !== null && e.variadic && (r = e._concatValue(r, a)), r == null &&
|
|
1162
|
-
(e.negate ? r = !1 : e.isBoolean() || e.optional ? r = !0 : r = ""), this.setOptionValueWithSource(i, r,
|
|
1162
|
+
(e.negate ? r = !1 : e.isBoolean() || e.optional ? r = !0 : r = ""), this.setOptionValueWithSource(i, r, d);
|
|
1163
1163
|
}, "handleOptionValue");
|
|
1164
1164
|
return this.on("option:" + t, (r) => {
|
|
1165
1165
|
let o = `error: option '${e.flags}' argument '${r}' is invalid.`;
|
|
@@ -1184,9 +1184,9 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1184
1184
|
if (o.makeOptionMandatory(!!e.mandatory), typeof s == "function")
|
|
1185
1185
|
o.default(r).argParser(s);
|
|
1186
1186
|
else if (s instanceof RegExp) {
|
|
1187
|
-
let
|
|
1188
|
-
s = /* @__PURE__ */
|
|
1189
|
-
let u =
|
|
1187
|
+
let d = s;
|
|
1188
|
+
s = /* @__PURE__ */ l((a, c) => {
|
|
1189
|
+
let u = d.exec(a);
|
|
1190
1190
|
return u ? u[0] : c;
|
|
1191
1191
|
}, "fn"), o.default(r).argParser(s);
|
|
1192
1192
|
} else
|
|
@@ -1467,16 +1467,16 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1467
1467
|
t = t.slice();
|
|
1468
1468
|
let i = !1, s = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1469
1469
|
function r(u, p) {
|
|
1470
|
-
let m =
|
|
1470
|
+
let m = _.resolve(u, p);
|
|
1471
1471
|
if (ee.existsSync(m)) return m;
|
|
1472
|
-
if (s.includes(
|
|
1473
|
-
let
|
|
1474
|
-
(
|
|
1472
|
+
if (s.includes(_.extname(p))) return;
|
|
1473
|
+
let v = s.find(
|
|
1474
|
+
(g) => ee.existsSync(`${m}${g}`)
|
|
1475
1475
|
);
|
|
1476
|
-
if (
|
|
1476
|
+
if (v) return `${m}${v}`;
|
|
1477
1477
|
}
|
|
1478
|
-
|
|
1479
|
-
let o = e._executableFile || `${this._name}-${e._name}`,
|
|
1478
|
+
l(r, "findFile"), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1479
|
+
let o = e._executableFile || `${this._name}-${e._name}`, d = this._executableDir || "";
|
|
1480
1480
|
if (this._scriptPath) {
|
|
1481
1481
|
let u;
|
|
1482
1482
|
try {
|
|
@@ -1484,29 +1484,29 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1484
1484
|
} catch {
|
|
1485
1485
|
u = this._scriptPath;
|
|
1486
1486
|
}
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1487
|
+
d = _.resolve(
|
|
1488
|
+
_.dirname(u),
|
|
1489
|
+
d
|
|
1490
1490
|
);
|
|
1491
1491
|
}
|
|
1492
|
-
if (
|
|
1493
|
-
let u = r(
|
|
1492
|
+
if (d) {
|
|
1493
|
+
let u = r(d, o);
|
|
1494
1494
|
if (!u && !e._executableFile && this._scriptPath) {
|
|
1495
|
-
let p =
|
|
1495
|
+
let p = _.basename(
|
|
1496
1496
|
this._scriptPath,
|
|
1497
|
-
|
|
1497
|
+
_.extname(this._scriptPath)
|
|
1498
1498
|
);
|
|
1499
1499
|
p !== this._name && (u = r(
|
|
1500
|
-
|
|
1500
|
+
d,
|
|
1501
1501
|
`${p}-${e._name}`
|
|
1502
1502
|
));
|
|
1503
1503
|
}
|
|
1504
1504
|
o = u || o;
|
|
1505
1505
|
}
|
|
1506
|
-
i = s.includes(
|
|
1506
|
+
i = s.includes(_.extname(o));
|
|
1507
1507
|
let a;
|
|
1508
|
-
h.platform !== "win32" ? i ? (t.unshift(o), t =
|
|
1509
|
-
o, t, { stdio: "inherit" }) : (t.unshift(o), t =
|
|
1508
|
+
h.platform !== "win32" ? i ? (t.unshift(o), t = ge(h.execArgv).concat(t), a = Z.spawn(h.argv[0], t, { stdio: "inherit" })) : a = Z.spawn(
|
|
1509
|
+
o, t, { stdio: "inherit" }) : (t.unshift(o), t = ge(h.execArgv).concat(t), a = Z.spawn(h.execPath, t, { stdio: "inherit" })), a.killed ||
|
|
1510
1510
|
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((p) => {
|
|
1511
1511
|
h.on(p, () => {
|
|
1512
1512
|
a.killed === !1 && a.exitCode === null && a.kill(p);
|
|
@@ -1523,7 +1523,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
1523
1523
|
) : h.exit(u);
|
|
1524
1524
|
}), a.on("error", (u) => {
|
|
1525
1525
|
if (u.code === "ENOENT") {
|
|
1526
|
-
let p =
|
|
1526
|
+
let p = d ? `searched for local subcommand relative to directory '${d}'` : "no directory for search for local subcommand, use .exe\
|
|
1527
1527
|
cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
1528
1528
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\
|
|
1529
1529
|
|
|
@@ -1594,15 +1594,15 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1594
1594
|
* @private
|
|
1595
1595
|
*/
|
|
1596
1596
|
_processArguments() {
|
|
1597
|
-
let e = /* @__PURE__ */
|
|
1597
|
+
let e = /* @__PURE__ */ l((i, s, r) => {
|
|
1598
1598
|
let o = s;
|
|
1599
1599
|
if (s !== null && i.parseArg) {
|
|
1600
|
-
let
|
|
1600
|
+
let d = `error: command-argument value '${s}' is invalid for argument '${i.name()}'.`;
|
|
1601
1601
|
o = this._callParseArg(
|
|
1602
1602
|
i,
|
|
1603
1603
|
s,
|
|
1604
1604
|
r,
|
|
1605
|
-
|
|
1605
|
+
d
|
|
1606
1606
|
);
|
|
1607
1607
|
}
|
|
1608
1608
|
return o;
|
|
@@ -1611,7 +1611,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1611
1611
|
let t = [];
|
|
1612
1612
|
this.registeredArguments.forEach((i, s) => {
|
|
1613
1613
|
let r = i.defaultValue;
|
|
1614
|
-
i.variadic ? s < this.args.length ? (r = this.args.slice(s), i.parseArg && (r = r.reduce((o,
|
|
1614
|
+
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 ===
|
|
1615
1615
|
void 0 && (r = []) : s < this.args.length && (r = this.args[s], i.parseArg && (r = e(i, r, i.defaultValue))), t[s] = r;
|
|
1616
1616
|
}), this.processedArgs = t;
|
|
1617
1617
|
}
|
|
@@ -1678,7 +1678,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1678
1678
|
);
|
|
1679
1679
|
this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: !0 }), this.
|
|
1680
1680
|
_outputHelpIfRequested(i.unknown), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1681
|
-
let s = /* @__PURE__ */
|
|
1681
|
+
let s = /* @__PURE__ */ l(() => {
|
|
1682
1682
|
i.unknown.length > 0 && this.unknownOption(i.unknown[0]);
|
|
1683
1683
|
}, "checkForUnknownOptions"), r = `command:${this.name()}`;
|
|
1684
1684
|
if (this._actionHandler) {
|
|
@@ -1784,19 +1784,19 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1784
1784
|
function o(a) {
|
|
1785
1785
|
return a.length > 1 && a[0] === "-";
|
|
1786
1786
|
}
|
|
1787
|
-
|
|
1788
|
-
let
|
|
1787
|
+
l(o, "maybeOption");
|
|
1788
|
+
let d = null;
|
|
1789
1789
|
for (; r.length; ) {
|
|
1790
1790
|
let a = r.shift();
|
|
1791
1791
|
if (a === "--") {
|
|
1792
1792
|
s === i && s.push(a), s.push(...r);
|
|
1793
1793
|
break;
|
|
1794
1794
|
}
|
|
1795
|
-
if (
|
|
1796
|
-
this.emit(`option:${
|
|
1795
|
+
if (d && !o(a)) {
|
|
1796
|
+
this.emit(`option:${d.name()}`, a);
|
|
1797
1797
|
continue;
|
|
1798
1798
|
}
|
|
1799
|
-
if (
|
|
1799
|
+
if (d = null, o(a)) {
|
|
1800
1800
|
let c = this._findOption(a);
|
|
1801
1801
|
if (c) {
|
|
1802
1802
|
if (c.required) {
|
|
@@ -1807,7 +1807,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1807
1807
|
r.length > 0 && !o(r[0]) && (u = r.shift()), this.emit(`option:${c.name()}`, u);
|
|
1808
1808
|
} else
|
|
1809
1809
|
this.emit(`option:${c.name()}`);
|
|
1810
|
-
|
|
1810
|
+
d = c.variadic ? c : null;
|
|
1811
1811
|
continue;
|
|
1812
1812
|
}
|
|
1813
1813
|
}
|
|
@@ -1914,7 +1914,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1914
1914
|
* @private
|
|
1915
1915
|
*/
|
|
1916
1916
|
_parseOptionsImplied() {
|
|
1917
|
-
let e = new nt(this.options), t = /* @__PURE__ */
|
|
1917
|
+
let e = new nt(this.options), t = /* @__PURE__ */ l((i) => this.getOptionValue(i) !== void 0 && !["default", "implied"].includes(this.
|
|
1918
1918
|
getOptionValueSource(i)), "hasCustomOptionValue");
|
|
1919
1919
|
this.options.filter(
|
|
1920
1920
|
(i) => i.implied !== void 0 && t(i.attributeName()) && e.valueFromOption(
|
|
@@ -1969,16 +1969,16 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1969
1969
|
* @private
|
|
1970
1970
|
*/
|
|
1971
1971
|
_conflictingOption(e, t) {
|
|
1972
|
-
let i = /* @__PURE__ */
|
|
1973
|
-
let
|
|
1974
|
-
(p) => p.negate &&
|
|
1972
|
+
let i = /* @__PURE__ */ l((o) => {
|
|
1973
|
+
let d = o.attributeName(), a = this.getOptionValue(d), c = this.options.find(
|
|
1974
|
+
(p) => p.negate && d === p.attributeName()
|
|
1975
1975
|
), u = this.options.find(
|
|
1976
|
-
(p) => !p.negate &&
|
|
1976
|
+
(p) => !p.negate && d === p.attributeName()
|
|
1977
1977
|
);
|
|
1978
1978
|
return c && (c.presetArg === void 0 && a === !1 || c.presetArg !== void 0 && a === c.presetArg) ? c : u || o;
|
|
1979
|
-
}, "findBestOptionFromValue"), s = /* @__PURE__ */
|
|
1980
|
-
let
|
|
1981
|
-
return this.getOptionValueSource(a) === "env" ? `environment variable '${
|
|
1979
|
+
}, "findBestOptionFromValue"), s = /* @__PURE__ */ l((o) => {
|
|
1980
|
+
let d = i(o), a = d.attributeName();
|
|
1981
|
+
return this.getOptionValueSource(a) === "env" ? `environment variable '${d.envVar}'` : `option '${d.flags}'`;
|
|
1982
1982
|
}, "getErrorMessage"), r = `error: ${s(e)} cannot be used with ${s(t)}`;
|
|
1983
1983
|
this.error(r, { code: "commander.conflictingOption" });
|
|
1984
1984
|
}
|
|
@@ -1994,7 +1994,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
1994
1994
|
if (e.startsWith("--") && this._showSuggestionAfterError) {
|
|
1995
1995
|
let s = [], r = this;
|
|
1996
1996
|
do {
|
|
1997
|
-
let o = r.createHelp().visibleOptions(r).filter((
|
|
1997
|
+
let o = r.createHelp().visibleOptions(r).filter((d) => d.long).map((d) => d.long);
|
|
1998
1998
|
s = s.concat(o), r = r.parent;
|
|
1999
1999
|
} while (r && !r._enablePositionalOptions);
|
|
2000
2000
|
t = me(e, s);
|
|
@@ -2144,7 +2144,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
2144
2144
|
* @return {Command}
|
|
2145
2145
|
*/
|
|
2146
2146
|
nameFromFilename(e) {
|
|
2147
|
-
return this._name =
|
|
2147
|
+
return this._name = _.basename(e, _.extname(e)), this;
|
|
2148
2148
|
}
|
|
2149
2149
|
/**
|
|
2150
2150
|
* Get or set the directory for searching for executable subcommands of this command.
|
|
@@ -2177,7 +2177,7 @@ cutableDir() to supply a custom directory", m = `'${o}' does not exist
|
|
|
2177
2177
|
_getHelpContext(e) {
|
|
2178
2178
|
e = e || {};
|
|
2179
2179
|
let t = { error: !!e.error }, i;
|
|
2180
|
-
return t.error ? i = /* @__PURE__ */
|
|
2180
|
+
return t.error ? i = /* @__PURE__ */ l((s) => this._outputConfiguration.writeErr(s), "write") : i = /* @__PURE__ */ l((s) => this._outputConfiguration.
|
|
2181
2181
|
writeOut(s), "write"), t.write = e.write || i, t.command = this, t;
|
|
2182
2182
|
}
|
|
2183
2183
|
/**
|
|
@@ -2281,7 +2281,7 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
2281
2281
|
t && e.find((s) => t.is(s)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
|
|
2282
2282
|
}
|
|
2283
2283
|
};
|
|
2284
|
-
function
|
|
2284
|
+
function ge(n) {
|
|
2285
2285
|
return n.map((e) => {
|
|
2286
2286
|
if (!e.startsWith("--inspect"))
|
|
2287
2287
|
return e;
|
|
@@ -2291,24 +2291,24 @@ Expecting one of '${i.join("', '")}'`);
|
|
|
2291
2291
|
r[3], s = r[4]), t && s !== "0" ? `${t}=${i}:${parseInt(s) + 1}` : e;
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
2294
|
-
|
|
2295
|
-
|
|
2294
|
+
l(ge, "incrementNodeInspectorPort");
|
|
2295
|
+
fe.Command = ie;
|
|
2296
2296
|
});
|
|
2297
2297
|
|
|
2298
2298
|
// ../node_modules/commander/index.js
|
|
2299
|
-
var
|
|
2300
|
-
var { Argument:
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2299
|
+
var we = b((f) => {
|
|
2300
|
+
var { Argument: xe } = V(), { Command: se } = be(), { CommanderError: ot, InvalidArgumentError: ve } = j(), { Help: at } = Y(), { Option: _e } = X();
|
|
2301
|
+
f.program = new se();
|
|
2302
|
+
f.createCommand = (n) => new se(n);
|
|
2303
|
+
f.createOption = (n, e) => new _e(n, e);
|
|
2304
|
+
f.createArgument = (n, e) => new xe(n, e);
|
|
2305
|
+
f.Command = se;
|
|
2306
|
+
f.Option = _e;
|
|
2307
|
+
f.Argument = xe;
|
|
2308
|
+
f.Help = at;
|
|
2309
|
+
f.CommanderError = ot;
|
|
2310
|
+
f.InvalidArgumentError = ve;
|
|
2311
|
+
f.InvalidOptionArgumentError = ve;
|
|
2312
2312
|
});
|
|
2313
2313
|
|
|
2314
2314
|
// ../node_modules/walk-up-path/dist/cjs/index.js
|
|
@@ -2316,31 +2316,31 @@ var Oe = b((H) => {
|
|
|
2316
2316
|
"use strict";
|
|
2317
2317
|
Object.defineProperty(H, "__esModule", { value: !0 });
|
|
2318
2318
|
H.walkUp = void 0;
|
|
2319
|
-
var
|
|
2320
|
-
for (n = (0,
|
|
2319
|
+
var ye = require("path"), dt = /* @__PURE__ */ l(function* (n) {
|
|
2320
|
+
for (n = (0, ye.resolve)(n); n; ) {
|
|
2321
2321
|
yield n;
|
|
2322
|
-
let e = (0,
|
|
2322
|
+
let e = (0, ye.dirname)(n);
|
|
2323
2323
|
if (e === n)
|
|
2324
2324
|
break;
|
|
2325
2325
|
n = e;
|
|
2326
2326
|
}
|
|
2327
2327
|
}, "walkUp");
|
|
2328
|
-
H.walkUp =
|
|
2328
|
+
H.walkUp = dt;
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
2331
|
// ../node_modules/picocolors/picocolors.js
|
|
2332
|
-
var
|
|
2332
|
+
var qe = b((Nt, oe) => {
|
|
2333
2333
|
var I = process || {}, Ee = I.argv || [], P = I.env || {}, ut = !(P.NO_COLOR || Ee.includes("--no-color")) && (!!P.FORCE_COLOR || Ee.includes(
|
|
2334
|
-
"--color") || I.platform === "win32" || (I.stdout || {}).isTTY && P.TERM !== "dumb" || !!P.CI), pt = /* @__PURE__ */
|
|
2334
|
+
"--color") || I.platform === "win32" || (I.stdout || {}).isTTY && P.TERM !== "dumb" || !!P.CI), pt = /* @__PURE__ */ l((n, e, t = n) => (i) => {
|
|
2335
2335
|
let s = "" + i, r = s.indexOf(e, n.length);
|
|
2336
2336
|
return ~r ? n + ht(s, e, t, r) + e : n + s + e;
|
|
2337
|
-
}, "formatter"), ht = /* @__PURE__ */
|
|
2337
|
+
}, "formatter"), ht = /* @__PURE__ */ l((n, e, t, i) => {
|
|
2338
2338
|
let s = "", r = 0;
|
|
2339
2339
|
do
|
|
2340
2340
|
s += n.substring(r, i) + t, r = i + e.length, i = n.indexOf(e, r);
|
|
2341
2341
|
while (~i);
|
|
2342
2342
|
return s + n.substring(r);
|
|
2343
|
-
}, "replaceClose"), Se = /* @__PURE__ */
|
|
2343
|
+
}, "replaceClose"), Se = /* @__PURE__ */ l((n = ut) => {
|
|
2344
2344
|
let e = n ? pt : () => String;
|
|
2345
2345
|
return {
|
|
2346
2346
|
isColorSupported: n,
|
|
@@ -2392,70 +2392,70 @@ var $e = b((Nt, oe) => {
|
|
|
2392
2392
|
});
|
|
2393
2393
|
|
|
2394
2394
|
// ../node_modules/ts-dedent/dist/index.js
|
|
2395
|
-
var Ne = b((
|
|
2395
|
+
var Ne = b((k) => {
|
|
2396
2396
|
"use strict";
|
|
2397
|
-
Object.defineProperty(
|
|
2398
|
-
|
|
2397
|
+
Object.defineProperty(k, "__esModule", { value: !0 });
|
|
2398
|
+
k.dedent = void 0;
|
|
2399
2399
|
function Ie(n) {
|
|
2400
2400
|
for (var e = [], t = 1; t < arguments.length; t++)
|
|
2401
2401
|
e[t - 1] = arguments[t];
|
|
2402
2402
|
var i = Array.from(typeof n == "string" ? [n] : n);
|
|
2403
2403
|
i[i.length - 1] = i[i.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
2404
|
-
var s = i.reduce(function(
|
|
2404
|
+
var s = i.reduce(function(d, a) {
|
|
2405
2405
|
var c = a.match(/\n([\t ]+|(?!\s).)/g);
|
|
2406
|
-
return c ?
|
|
2406
|
+
return c ? d.concat(c.map(function(u) {
|
|
2407
2407
|
var p, m;
|
|
2408
2408
|
return (m = (p = u.match(/[\t ]/g)) === null || p === void 0 ? void 0 : p.length) !== null && m !== void 0 ? m : 0;
|
|
2409
|
-
})) :
|
|
2409
|
+
})) : d;
|
|
2410
2410
|
}, []);
|
|
2411
2411
|
if (s.length) {
|
|
2412
2412
|
var r = new RegExp(`
|
|
2413
2413
|
[ ]{` + Math.min.apply(Math, s) + "}", "g");
|
|
2414
|
-
i = i.map(function(
|
|
2415
|
-
return
|
|
2414
|
+
i = i.map(function(d) {
|
|
2415
|
+
return d.replace(r, `
|
|
2416
2416
|
`);
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
2419
|
i[0] = i[0].replace(/^\r?\n/, "");
|
|
2420
2420
|
var o = i[0];
|
|
2421
|
-
return e.forEach(function(
|
|
2422
|
-
var c = o.match(/(?:^|\n)( *)$/), u = c ? c[1] : "", p =
|
|
2423
|
-
typeof
|
|
2424
|
-
`) && (p = String(
|
|
2425
|
-
`).map(function(m,
|
|
2426
|
-
return
|
|
2421
|
+
return e.forEach(function(d, a) {
|
|
2422
|
+
var c = o.match(/(?:^|\n)( *)$/), u = c ? c[1] : "", p = d;
|
|
2423
|
+
typeof d == "string" && d.includes(`
|
|
2424
|
+
`) && (p = String(d).split(`
|
|
2425
|
+
`).map(function(m, v) {
|
|
2426
|
+
return v === 0 ? m : "" + u + m;
|
|
2427
2427
|
}).join(`
|
|
2428
2428
|
`)), o += p + i[a + 1];
|
|
2429
2429
|
}), o;
|
|
2430
2430
|
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2431
|
+
l(Ie, "dedent");
|
|
2432
|
+
k.dedent = Ie;
|
|
2433
|
+
k.default = Ie;
|
|
2434
2434
|
});
|
|
2435
2435
|
|
|
2436
2436
|
// src/cli/bin/index.ts
|
|
2437
|
-
var C = require("storybook/internal/common"), B = require("storybook/internal/node-logger"), Be = require("storybook/internal/telemetry"),
|
|
2437
|
+
var C = require("storybook/internal/common"), B = require("storybook/internal/node-logger"), Be = require("storybook/internal/telemetry"), A = q(we(), 1);
|
|
2438
2438
|
|
|
2439
2439
|
// ../node_modules/fd-package-json/dist/esm/main.js
|
|
2440
|
-
var Ce =
|
|
2441
|
-
async function
|
|
2440
|
+
var Ce = q(Oe(), 1), je = require("node:path"), D = require("node:fs/promises"), ke = require("node:fs");
|
|
2441
|
+
async function lt(n) {
|
|
2442
2442
|
try {
|
|
2443
2443
|
return (await (0, D.stat)(n)).isFile();
|
|
2444
2444
|
} catch {
|
|
2445
2445
|
return !1;
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
|
|
2448
|
+
l(lt, "fileExists");
|
|
2449
2449
|
async function ct(n) {
|
|
2450
2450
|
for (let e of (0, Ce.walkUp)(n)) {
|
|
2451
|
-
let t = (0,
|
|
2452
|
-
if (await
|
|
2451
|
+
let t = (0, je.resolve)(e, "package.json");
|
|
2452
|
+
if (await lt(t))
|
|
2453
2453
|
return t;
|
|
2454
2454
|
}
|
|
2455
2455
|
return null;
|
|
2456
2456
|
}
|
|
2457
|
-
|
|
2458
|
-
async function
|
|
2457
|
+
l(ct, "findPackagePath");
|
|
2458
|
+
async function y(n) {
|
|
2459
2459
|
let e = await ct(n);
|
|
2460
2460
|
if (!e)
|
|
2461
2461
|
return null;
|
|
@@ -2466,10 +2466,10 @@ async function w(n) {
|
|
|
2466
2466
|
return null;
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
-
|
|
2469
|
+
l(y, "findPackage");
|
|
2470
2470
|
|
|
2471
2471
|
// node_modules/leven/index.js
|
|
2472
|
-
var re = [],
|
|
2472
|
+
var re = [], Ae = [];
|
|
2473
2473
|
function ne(n, e) {
|
|
2474
2474
|
if (n === e)
|
|
2475
2475
|
return 0;
|
|
@@ -2483,18 +2483,18 @@ function ne(n, e) {
|
|
|
2483
2483
|
r++;
|
|
2484
2484
|
if (i -= r, s -= r, i === 0)
|
|
2485
2485
|
return s;
|
|
2486
|
-
let o,
|
|
2486
|
+
let o, d, a, c, u = 0, p = 0;
|
|
2487
2487
|
for (; u < i; )
|
|
2488
|
-
|
|
2488
|
+
Ae[u] = n.charCodeAt(r + u), re[u] = ++u;
|
|
2489
2489
|
for (; p < s; )
|
|
2490
|
-
for (o = e.charCodeAt(r + p), a = p++,
|
|
2491
|
-
c = o ===
|
|
2492
|
-
return
|
|
2490
|
+
for (o = e.charCodeAt(r + p), a = p++, d = p, u = 0; u < i; u++)
|
|
2491
|
+
c = o === Ae[u] ? a : a + 1, a = re[u], d = re[u] = a > d ? c > d ? d + 1 : c : c > a ? a + 1 : c;
|
|
2492
|
+
return d;
|
|
2493
2493
|
}
|
|
2494
|
-
|
|
2494
|
+
l(ne, "leven");
|
|
2495
2495
|
|
|
2496
2496
|
// src/cli/bin/index.ts
|
|
2497
|
-
var E =
|
|
2497
|
+
var E = q(qe(), 1);
|
|
2498
2498
|
|
|
2499
2499
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
2500
2500
|
var mt = process.env.NODE_ENV === "production", ae = "Invariant failed";
|
|
@@ -2506,15 +2506,15 @@ function O(n, e) {
|
|
|
2506
2506
|
throw new Error(i);
|
|
2507
2507
|
}
|
|
2508
2508
|
}
|
|
2509
|
-
|
|
2509
|
+
l(O, "invariant");
|
|
2510
2510
|
|
|
2511
2511
|
// package.json
|
|
2512
|
-
var
|
|
2512
|
+
var $e = "9.0.0-beta.0";
|
|
2513
2513
|
|
|
2514
2514
|
// src/cli/build.ts
|
|
2515
2515
|
var Ve = require("storybook/internal/common"), N = require("storybook/internal/core-server");
|
|
2516
|
-
var He = /* @__PURE__ */
|
|
2517
|
-
let e = await
|
|
2516
|
+
var He = /* @__PURE__ */ l(async (n) => {
|
|
2517
|
+
let e = await y(__dirname);
|
|
2518
2518
|
O(e, "Failed to find the closest package.json file.");
|
|
2519
2519
|
let t = {
|
|
2520
2520
|
...n,
|
|
@@ -2534,7 +2534,7 @@ var He = /* @__PURE__ */ d(async (n) => {
|
|
|
2534
2534
|
|
|
2535
2535
|
// src/cli/buildIndex.ts
|
|
2536
2536
|
var De = require("storybook/internal/common"), T = require("storybook/internal/core-server");
|
|
2537
|
-
var Pe = /* @__PURE__ */
|
|
2537
|
+
var Pe = /* @__PURE__ */ l(async (n) => {
|
|
2538
2538
|
let e = {
|
|
2539
2539
|
...n,
|
|
2540
2540
|
configDir: n.configDir || ".storybook",
|
|
@@ -2552,26 +2552,26 @@ var Pe = /* @__PURE__ */ d(async (n) => {
|
|
|
2552
2552
|
}, "buildIndex");
|
|
2553
2553
|
|
|
2554
2554
|
// src/cli/dev.ts
|
|
2555
|
-
var Te = require("storybook/internal/common"), F = require("storybook/internal/core-server"),
|
|
2556
|
-
var
|
|
2557
|
-
function
|
|
2558
|
-
|
|
2559
|
-
errors.forEach((e) =>
|
|
2560
|
-
e)),
|
|
2561
|
-
n.close ?
|
|
2555
|
+
var Te = require("storybook/internal/common"), F = require("storybook/internal/core-server"), x = require("storybook/internal/node-logger");
|
|
2556
|
+
var de = q(Ne(), 1);
|
|
2557
|
+
function ft(n) {
|
|
2558
|
+
x.instance.heading = "", n instanceof Error ? n.error ? x.logger.error(n.error) : n.stats && n.stats.compilation.errors ? n.stats.compilation.
|
|
2559
|
+
errors.forEach((e) => x.logger.plain(e)) : x.logger.error(n) : n.compilation?.errors && n.compilation.errors.forEach((e) => x.logger.plain(
|
|
2560
|
+
e)), x.logger.line(), x.logger.warn(
|
|
2561
|
+
n.close ? de.dedent`
|
|
2562
2562
|
FATAL broken build!, will close the process,
|
|
2563
2563
|
Fix the error below and restart storybook.
|
|
2564
|
-
` :
|
|
2564
|
+
` : de.dedent`
|
|
2565
2565
|
Broken build, fix the error above.
|
|
2566
2566
|
You may need to refresh the browser.
|
|
2567
2567
|
`
|
|
2568
|
-
),
|
|
2568
|
+
), x.logger.line();
|
|
2569
2569
|
}
|
|
2570
|
-
|
|
2571
|
-
var Fe = /* @__PURE__ */
|
|
2570
|
+
l(ft, "printError");
|
|
2571
|
+
var Fe = /* @__PURE__ */ l(async (n) => {
|
|
2572
2572
|
let { env: e } = process;
|
|
2573
2573
|
e.NODE_ENV = e.NODE_ENV || "development";
|
|
2574
|
-
let t = await
|
|
2574
|
+
let t = await y(__dirname);
|
|
2575
2575
|
O(t, "Failed to find the closest package.json file.");
|
|
2576
2576
|
let i = {
|
|
2577
2577
|
...n,
|
|
@@ -2586,7 +2586,7 @@ var Fe = /* @__PURE__ */ d(async (n) => {
|
|
|
2586
2586
|
{
|
|
2587
2587
|
cliOptions: n,
|
|
2588
2588
|
presetOptions: i,
|
|
2589
|
-
printError:
|
|
2589
|
+
printError: ft
|
|
2590
2590
|
},
|
|
2591
2591
|
() => (0, F.buildDevStandalone)(i)
|
|
2592
2592
|
);
|
|
@@ -2594,14 +2594,14 @@ var Fe = /* @__PURE__ */ d(async (n) => {
|
|
|
2594
2594
|
|
|
2595
2595
|
// src/cli/bin/index.ts
|
|
2596
2596
|
(0, Be.addToGlobalContext)("cliVersion", C.versions.storybook);
|
|
2597
|
-
var S = console,
|
|
2597
|
+
var S = console, le = /* @__PURE__ */ l((n) => A.program.command(n).option(
|
|
2598
2598
|
"--disable-telemetry",
|
|
2599
2599
|
"Disable sending telemetry data",
|
|
2600
2600
|
// default value is false, but if the user sets STORYBOOK_DISABLE_TELEMETRY, it can be true
|
|
2601
2601
|
process.env.STORYBOOK_DISABLE_TELEMETRY && process.env.STORYBOOK_DISABLE_TELEMETRY !== "false"
|
|
2602
2602
|
).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data"), "\
|
|
2603
2603
|
command");
|
|
2604
|
-
|
|
2604
|
+
le("dev").option("-p, --port <number>", "Port to run Storybook", (n) => parseInt(n, 10)).option("-h, --host <string>", "Host to run Storyboo\
|
|
2605
2605
|
k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option(
|
|
2606
2606
|
"--https",
|
|
2607
2607
|
"Serve Storybook over HTTPS. Note: You must provide your own certificate information."
|
|
@@ -2625,7 +2625,7 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
|
|
|
2625
2625
|
"URL path to be appended when visiting Storybook for the first time"
|
|
2626
2626
|
).action(async (n) => {
|
|
2627
2627
|
B.logger.setLevel(n.loglevel);
|
|
2628
|
-
let e = await
|
|
2628
|
+
let e = await y(__dirname);
|
|
2629
2629
|
O(e, "Failed to find the closest package.json file."), S.log(E.default.bold(`${e.name} v${e.version}`) + E.default.reset(`
|
|
2630
2630
|
`)), (0, C.getEnvConfig)(n, {
|
|
2631
2631
|
port: "SBCONFIG_PORT",
|
|
@@ -2635,7 +2635,7 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
|
|
|
2635
2635
|
ci: "CI"
|
|
2636
2636
|
}), parseInt(`${n.port}`, 10) && (n.port = parseInt(`${n.port}`, 10)), await Fe({ ...n, packageJson: e }).catch(() => process.exit(1));
|
|
2637
2637
|
});
|
|
2638
|
-
|
|
2638
|
+
le("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
|
|
2639
2639
|
here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level \
|
|
2640
2640
|
of logging during build").option("--debug-webpack", "Display final webpack configurations for debugging purposes").option(
|
|
2641
2641
|
"--webpack-stats-json [directory]",
|
|
@@ -2647,7 +2647,7 @@ of logging during build").option("--debug-webpack", "Display final webpack confi
|
|
|
2647
2647
|
ly site using addon-docs").option("--test", "Build stories optimized for testing purposes.").action(async (n) => {
|
|
2648
2648
|
let { env: e } = process;
|
|
2649
2649
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
2650
|
-
let t = await
|
|
2650
|
+
let t = await y(__dirname);
|
|
2651
2651
|
O(t, "Failed to find the closest package.json file."), B.logger.setLevel(n.loglevel), S.log(E.default.bold(`${t.name} v${t.version}
|
|
2652
2652
|
`)), (0, C.getEnvConfig)(n, {
|
|
2653
2653
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
@@ -2659,12 +2659,12 @@ ly site using addon-docs").option("--test", "Build stories optimized for testing
|
|
|
2659
2659
|
test: !!n.test || process.env.SB_TESTBUILD === "true"
|
|
2660
2660
|
}).catch(() => process.exit(1));
|
|
2661
2661
|
});
|
|
2662
|
-
|
|
2662
|
+
le("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to l\
|
|
2663
2663
|
oad Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level of loggin\
|
|
2664
2664
|
g during build").action(async (n) => {
|
|
2665
2665
|
let { env: e } = process;
|
|
2666
2666
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
2667
|
-
let t = await
|
|
2667
|
+
let t = await y(__dirname);
|
|
2668
2668
|
O(t, "Failed to find the closest package.json file."), B.logger.setLevel(n.loglevel), S.log(E.default.bold(`${t.name} v${t.version}
|
|
2669
2669
|
`)), (0, C.getEnvConfig)(n, {
|
|
2670
2670
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
@@ -2674,14 +2674,14 @@ g during build").action(async (n) => {
|
|
|
2674
2674
|
packageJson: t
|
|
2675
2675
|
}).catch(() => process.exit(1));
|
|
2676
2676
|
});
|
|
2677
|
-
|
|
2677
|
+
A.program.on("command:*", ([n]) => {
|
|
2678
2678
|
S.error(
|
|
2679
2679
|
` Invalid command: %s.
|
|
2680
2680
|
See --help for a list of available commands.`,
|
|
2681
2681
|
n
|
|
2682
2682
|
);
|
|
2683
|
-
let t =
|
|
2683
|
+
let t = A.program.commands.map((i) => i.name()).find((i) => ne(i, n) < 3);
|
|
2684
2684
|
t && S.info(`
|
|
2685
2685
|
Did you mean ${t}?`), process.exit(1);
|
|
2686
2686
|
});
|
|
2687
|
-
|
|
2687
|
+
A.program.usage("<command> [options]").version(String($e)).parse(process.argv);
|