storybook 10.1.0-alpha.12 → 10.1.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_browser-chunks/{chunk-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
- package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
- package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
- package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-DWDUVXZM.js} +27 -22
- package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-EETCRTJX.js} +8 -8
- package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-2W4GZCLE.js} +7 -7
- package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-447655DM.js} +6 -6
- package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-4EJUC2SD.js} +4998 -1685
- package/dist/_node-chunks/chunk-4ZJOH2UN.js +61 -0
- package/dist/_node-chunks/chunk-654SJIMS.js +23 -0
- package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-7IAVT2FU.js} +7 -7
- package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-7KFHRNOT.js} +7 -7
- package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-AZIPBEBK.js} +6 -6
- package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-B76FDKVB.js} +6 -6
- package/dist/_node-chunks/chunk-B7PGKETD.js +3781 -0
- package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-CLUBH2LP.js} +55 -36
- package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-CMYD2JNN.js} +7 -7
- package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-DIPKXLEP.js} +55 -32
- package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-DPFYWXEA.js} +6 -6
- package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-FCVNHU2F.js} +7 -7
- package/dist/_node-chunks/{chunk-QYQIZBS6.js → chunk-JQ7RQS5Q.js} +6 -6
- package/dist/_node-chunks/chunk-LEL5OSY3.js +18 -0
- package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-LPKSBF62.js} +6 -6
- package/dist/_node-chunks/chunk-LYEZOJ43.js +78 -0
- package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-MIA5324I.js} +7 -7
- package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-MJM4TEMP.js} +14 -8
- package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-OVVZIUHS.js} +7 -7
- package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-RUUNVQ6W.js} +1104 -13
- package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-URLNGLC2.js} +51 -71
- package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-WC2YEQHJ.js} +6 -6
- package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-XKRVQL2G.js} +8 -8
- package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-Z2OWEMX3.js} +8 -8
- package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-22CLJ4BC.js} +9 -9
- package/dist/_node-chunks/{globby-6THB7HVX.js → globby-GR24TGSK.js} +9 -9
- package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-G2LGVRPC.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-W6P6IDDW.js} +8 -8
- package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-K4FZHG2F.js} +7 -7
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +32 -26
- package/dist/bin/dispatcher.js +31 -20
- package/dist/bin/loader.js +10 -13
- package/dist/cli/index.d.ts +692 -133
- package/dist/cli/index.js +1005 -177
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +63 -49
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +96 -1413
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +25 -65
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +32 -3
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +4 -4
- package/dist/manager-errors.d.ts +6 -0
- package/dist/manager-errors.js +2 -2
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -3148
- package/dist/preview/runtime.js +31 -2
- package/dist/preview-api/index.d.ts +69 -68
- package/dist/preview-errors.d.ts +6 -0
- package/dist/preview-errors.js +2 -2
- package/dist/server-errors.d.ts +31 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +23 -2
- package/dist/telemetry/index.js +25 -24
- package/dist/types/index.d.ts +71 -8
- package/dist/types/index.js +25 -1
- package/package.json +7 -9
- package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
- package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
- package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
- package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
- package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
- package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
- package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
- package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
- package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
- package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
- package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
- package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
- package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
|
@@ -1,86 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
StorybookError
|
|
14
|
+
} from "./chunk-LYEZOJ43.js";
|
|
12
15
|
import {
|
|
13
16
|
require_dist
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CMYD2JNN.js";
|
|
15
18
|
import {
|
|
16
19
|
require_picocolors
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OVVZIUHS.js";
|
|
18
21
|
import {
|
|
19
22
|
__toESM
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
21
24
|
|
|
22
25
|
// src/server-errors.ts
|
|
23
26
|
var import_picocolors = __toESM(require_picocolors(), 1), import_ts_dedent = __toESM(require_dist(), 1);
|
|
24
|
-
|
|
25
|
-
// src/storybook-error.ts
|
|
26
|
-
function parseErrorCode({
|
|
27
|
-
code,
|
|
28
|
-
category
|
|
29
|
-
}) {
|
|
30
|
-
let paddedCode = String(code).padStart(4, "0");
|
|
31
|
-
return `SB_${category}_${paddedCode}`;
|
|
32
|
-
}
|
|
33
|
-
function appendErrorRef(url) {
|
|
34
|
-
if (/^(?!.*storybook\.js\.org)|[?&]ref=error\b/.test(url))
|
|
35
|
-
return url;
|
|
36
|
-
try {
|
|
37
|
-
let urlObj = new URL(url);
|
|
38
|
-
return urlObj.searchParams.set("ref", "error"), urlObj.toString();
|
|
39
|
-
} catch {
|
|
40
|
-
return url;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
var StorybookError = class _StorybookError extends Error {
|
|
44
|
-
constructor(props) {
|
|
45
|
-
super(_StorybookError.getFullMessage(props));
|
|
46
|
-
/**
|
|
47
|
-
* Data associated with the error. Used to provide additional information in the error message or
|
|
48
|
-
* to be passed to telemetry.
|
|
49
|
-
*/
|
|
50
|
-
this.data = {};
|
|
51
|
-
/** Flag used to easily determine if the error originates from Storybook. */
|
|
52
|
-
this.fromStorybook = !0;
|
|
53
|
-
this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.name = props.name;
|
|
54
|
-
}
|
|
55
|
-
get fullErrorCode() {
|
|
56
|
-
return parseErrorCode({ code: this.code, category: this.category });
|
|
57
|
-
}
|
|
58
|
-
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
59
|
-
get name() {
|
|
60
|
-
let errorName = this._name || this.constructor.name;
|
|
61
|
-
return `${this.fullErrorCode} (${errorName})`;
|
|
62
|
-
}
|
|
63
|
-
set name(name) {
|
|
64
|
-
this._name = name;
|
|
65
|
-
}
|
|
66
|
-
/** Generates the error message along with additional documentation link (if applicable). */
|
|
67
|
-
static getFullMessage({
|
|
68
|
-
documentation,
|
|
69
|
-
code,
|
|
70
|
-
category,
|
|
71
|
-
message
|
|
72
|
-
}) {
|
|
73
|
-
let page;
|
|
74
|
-
return documentation === !0 ? page = `https://storybook.js.org/error/${parseErrorCode({ code, category })}?ref=error` : typeof documentation == "string" ? page = appendErrorRef(documentation) : Array.isArray(documentation) && (page = `
|
|
75
|
-
${documentation.map((doc) => ` - ${appendErrorRef(doc)}`).join(`
|
|
76
|
-
`)}`), `${message}${page != null ? `
|
|
77
|
-
|
|
78
|
-
More info: ${page}
|
|
79
|
-
` : ""}`;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// src/server-errors.ts
|
|
84
27
|
var Category = /* @__PURE__ */ ((Category2) => (Category2.CLI = "CLI", Category2.CLI_INIT = "CLI_INIT", Category2.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", Category2.CLI_UPGRADE = "CLI_UPGRADE", Category2.CLI_ADD = "CLI_ADD", Category2.CODEMOD = "CODEMOD", Category2.CORE_SERVER = "CORE-SERVER", Category2.CSF_PLUGIN = "CSF-PLUGIN", Category2.CSF_TOOLS = "CSF-TOOLS", Category2.CORE_COMMON = "CORE-COMMON", Category2.NODE_LOGGER = "NODE-LOGGER", Category2.TELEMETRY = "TELEMETRY", Category2.BUILDER_MANAGER = "BUILDER-MANAGER", Category2.BUILDER_VITE = "BUILDER-VITE", Category2.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", Category2.SOURCE_LOADER = "SOURCE-LOADER", Category2.POSTINSTALL = "POSTINSTALL", Category2.DOCS_TOOLS = "DOCS-TOOLS", Category2.CORE_WEBPACK = "CORE-WEBPACK", Category2.FRAMEWORK_ANGULAR = "FRAMEWORK_ANGULAR", Category2.FRAMEWORK_EMBER = "FRAMEWORK_EMBER", Category2.FRAMEWORK_HTML_VITE = "FRAMEWORK_HTML-VITE", Category2.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", Category2.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", Category2.FRAMEWORK_PREACT_VITE = "FRAMEWORK_PREACT-VITE", Category2.FRAMEWORK_PREACT_WEBPACK5 = "FRAMEWORK_PREACT-WEBPACK5", Category2.FRAMEWORK_REACT_VITE = "FRAMEWORK_REACT-VITE", Category2.FRAMEWORK_REACT_WEBPACK5 = "FRAMEWORK_REACT-WEBPACK5", Category2.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", Category2.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", Category2.FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", Category2.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", Category2.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5", Category2.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", Category2.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", Category2.FRAMEWORK_WEB_COMPONENTS_VITE = "FRAMEWORK_WEB-COMPONENTS-VITE", Category2.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", Category2))(Category || {}), NxProjectDetectedError = class extends StorybookError {
|
|
85
28
|
constructor() {
|
|
86
29
|
super({
|
|
@@ -410,6 +353,29 @@ var WebpackCompilationError = class extends StorybookError {
|
|
|
410
353
|
});
|
|
411
354
|
this.data = data;
|
|
412
355
|
}
|
|
356
|
+
}, AddonVitestPostinstallPrerequisiteCheckError = class extends StorybookError {
|
|
357
|
+
constructor(data) {
|
|
358
|
+
super({
|
|
359
|
+
name: "AddonVitestPostinstallPrerequisiteCheckError",
|
|
360
|
+
category: "CLI_INIT" /* CLI_INIT */,
|
|
361
|
+
isHandledError: !0,
|
|
362
|
+
code: 4,
|
|
363
|
+
documentation: "",
|
|
364
|
+
message: "The prerequisite check for the Vitest addon failed."
|
|
365
|
+
});
|
|
366
|
+
this.data = data;
|
|
367
|
+
}
|
|
368
|
+
}, AddonVitestPostinstallError = class extends StorybookError {
|
|
369
|
+
constructor(data) {
|
|
370
|
+
super({
|
|
371
|
+
name: "AddonVitestPostinstallError",
|
|
372
|
+
category: "CLI_INIT" /* CLI_INIT */,
|
|
373
|
+
isHandledError: !0,
|
|
374
|
+
code: 5,
|
|
375
|
+
message: "The Vitest addon setup failed."
|
|
376
|
+
});
|
|
377
|
+
this.data = data;
|
|
378
|
+
}
|
|
413
379
|
}, UpgradeStorybookToLowerVersionError = class extends StorybookError {
|
|
414
380
|
constructor(data) {
|
|
415
381
|
super({
|
|
@@ -524,10 +490,21 @@ var WebpackCompilationError = class extends StorybookError {
|
|
|
524
490
|
Please convert your config to use ES modules (import/export syntax).`
|
|
525
491
|
});
|
|
526
492
|
}
|
|
493
|
+
}, AutomigrateError = class extends StorybookError {
|
|
494
|
+
constructor(data) {
|
|
495
|
+
super({
|
|
496
|
+
name: "AutomigrateError",
|
|
497
|
+
category: "CLI_AUTOMIGRATE" /* CLI_AUTOMIGRATE */,
|
|
498
|
+
code: 2,
|
|
499
|
+
message: import_ts_dedent.dedent`
|
|
500
|
+
An error occurred while running the automigrate command.
|
|
501
|
+
`
|
|
502
|
+
});
|
|
503
|
+
this.data = data;
|
|
504
|
+
}
|
|
527
505
|
};
|
|
528
506
|
|
|
529
507
|
export {
|
|
530
|
-
StorybookError,
|
|
531
508
|
Category,
|
|
532
509
|
NxProjectDetectedError,
|
|
533
510
|
MissingFrameworkFieldError,
|
|
@@ -550,11 +527,14 @@ export {
|
|
|
550
527
|
MainFileEvaluationError,
|
|
551
528
|
StatusTypeIdMismatchError,
|
|
552
529
|
GenerateNewProjectOnInitError,
|
|
530
|
+
AddonVitestPostinstallPrerequisiteCheckError,
|
|
531
|
+
AddonVitestPostinstallError,
|
|
553
532
|
UpgradeStorybookToLowerVersionError,
|
|
554
533
|
UpgradeStorybookUnknownCurrentVersionError,
|
|
555
534
|
NoStatsForViteDevError,
|
|
556
535
|
FindPackageVersionsError,
|
|
557
536
|
IncompatiblePostCssConfigError,
|
|
558
537
|
SavingGlobalSettingsFileError,
|
|
559
|
-
CommonJsConfigNotSupportedError
|
|
538
|
+
CommonJsConfigNotSupportedError,
|
|
539
|
+
AutomigrateError
|
|
560
540
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
require_dist
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CMYD2JNN.js";
|
|
15
15
|
import {
|
|
16
16
|
__export,
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/globalSettings.ts
|
|
21
21
|
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
require_dist
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CMYD2JNN.js";
|
|
15
15
|
import {
|
|
16
16
|
__toESM
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
18
18
|
|
|
19
19
|
// src/csf-tools/CsfFile.ts
|
|
20
20
|
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
toEstree
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-7KFHRNOT.js";
|
|
15
|
+
import "./chunk-WC2YEQHJ.js";
|
|
16
16
|
|
|
17
17
|
// ../node_modules/@storybook/docs-mdx/dist/index.js
|
|
18
18
|
var getAttr = (elt, what) => elt.attributes.find((n) => n.type === "JSXAttribute" && n.name.name === what), getAttrValue = (elt, what) => getAttr(elt, what)?.value, getAttrLiteral = (elt, what) => {
|
|
@@ -107,7 +107,7 @@ var getAttr = (elt, what) => elt.attributes.find((n) => n.type === "JSXAttribute
|
|
|
107
107
|
isTemplate: !1,
|
|
108
108
|
metaTags: void 0,
|
|
109
109
|
imports: void 0
|
|
110
|
-
}, { compile } = await import("./mdx-N42X6CFJ-
|
|
110
|
+
}, { compile } = await import("./mdx-N42X6CFJ-W6P6IDDW.js");
|
|
111
111
|
await compile(code, {
|
|
112
112
|
rehypePlugins: [[plugin, store]]
|
|
113
113
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,15 +12,15 @@ var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
require_picomatch,
|
|
14
14
|
require_utils
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7IAVT2FU.js";
|
|
16
16
|
import {
|
|
17
17
|
slash
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-447655DM.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__require,
|
|
22
22
|
__toESM
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
24
24
|
|
|
25
25
|
// ../node_modules/fast-glob/out/utils/array.js
|
|
26
26
|
var require_array = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require,
|
|
15
15
|
__toESM
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
17
17
|
|
|
18
18
|
// ../node_modules/app-root-dir/lib/index.js
|
|
19
19
|
var require_lib = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
position,
|
|
22
22
|
start,
|
|
23
23
|
toEstree
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-7KFHRNOT.js";
|
|
25
|
+
import "./chunk-WC2YEQHJ.js";
|
|
26
26
|
|
|
27
27
|
// ../node_modules/@storybook/docs-mdx/dist/mdx-N42X6CFJ.js
|
|
28
28
|
import { default as default2 } from "path";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-WC2YEQHJ.js";
|
|
13
13
|
|
|
14
14
|
// ../node_modules/yocto-queue/index.js
|
|
15
15
|
var Node = class {
|
package/dist/babel/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -22,11 +22,10 @@ import {
|
|
|
22
22
|
recast,
|
|
23
23
|
traverse,
|
|
24
24
|
types
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
26
|
-
import "../_node-chunks/chunk-
|
|
27
|
-
import "../_node-chunks/chunk-
|
|
28
|
-
import "../_node-chunks/chunk-
|
|
29
|
-
import "../_node-chunks/chunk-OP3INKUD.js";
|
|
25
|
+
} from "../_node-chunks/chunk-RUUNVQ6W.js";
|
|
26
|
+
import "../_node-chunks/chunk-FCVNHU2F.js";
|
|
27
|
+
import "../_node-chunks/chunk-OVVZIUHS.js";
|
|
28
|
+
import "../_node-chunks/chunk-WC2YEQHJ.js";
|
|
30
29
|
var export_transformSync = import_core.transformSync;
|
|
31
30
|
export {
|
|
32
31
|
BabelFileClass,
|
package/dist/bin/core.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
version
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-LEL5OSY3.js";
|
|
15
15
|
import {
|
|
16
16
|
globalSettings
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-XKRVQL2G.js";
|
|
18
18
|
import {
|
|
19
19
|
require_dist
|
|
20
|
-
} from "../_node-chunks/chunk-
|
|
20
|
+
} from "../_node-chunks/chunk-CMYD2JNN.js";
|
|
21
21
|
import {
|
|
22
22
|
require_picocolors
|
|
23
|
-
} from "../_node-chunks/chunk-
|
|
23
|
+
} from "../_node-chunks/chunk-OVVZIUHS.js";
|
|
24
24
|
import {
|
|
25
25
|
__commonJS,
|
|
26
26
|
__require,
|
|
27
27
|
__toESM
|
|
28
|
-
} from "../_node-chunks/chunk-
|
|
28
|
+
} from "../_node-chunks/chunk-WC2YEQHJ.js";
|
|
29
29
|
|
|
30
30
|
// ../node_modules/commander/lib/error.js
|
|
31
31
|
var require_error = __commonJS({
|
|
@@ -2708,7 +2708,7 @@ import { cache as cache3 } from "storybook/internal/common";
|
|
|
2708
2708
|
import { buildDevStandalone, withTelemetry as withTelemetry3 } from "storybook/internal/core-server";
|
|
2709
2709
|
import { logger, instance as npmLog } from "storybook/internal/node-logger";
|
|
2710
2710
|
function printError(error) {
|
|
2711
|
-
npmLog.heading = "", error instanceof Error ? error.error ? logger.error(error.error) : error.stats && error.stats.compilation.errors ? error.stats.compilation.errors.forEach((e) => logger.
|
|
2711
|
+
npmLog.heading = "", error instanceof Error ? error.error ? logger.error(error.error) : error.stats && error.stats.compilation.errors ? error.stats.compilation.errors.forEach((e) => logger.log(e)) : logger.error(error) : error.compilation?.errors && error.compilation.errors.forEach((e) => logger.log(e)), logger.warn(
|
|
2712
2712
|
error.close ? import_ts_dedent.dedent`
|
|
2713
2713
|
FATAL broken build!, will close the process,
|
|
2714
2714
|
Fix the error below and restart storybook.
|
|
@@ -2716,7 +2716,7 @@ function printError(error) {
|
|
|
2716
2716
|
Broken build, fix the error above.
|
|
2717
2717
|
You may need to refresh the browser.
|
|
2718
2718
|
`
|
|
2719
|
-
)
|
|
2719
|
+
);
|
|
2720
2720
|
}
|
|
2721
2721
|
var dev = async (cliOptions) => {
|
|
2722
2722
|
let { env } = process;
|
|
@@ -2743,21 +2743,27 @@ var dev = async (cliOptions) => {
|
|
|
2743
2743
|
|
|
2744
2744
|
// src/bin/core.ts
|
|
2745
2745
|
addToGlobalContext("cliVersion", version);
|
|
2746
|
-
var
|
|
2746
|
+
var handleCommandFailure = async (logFilePath) => {
|
|
2747
|
+
let logFile = await logTracker.writeToFile(logFilePath);
|
|
2748
|
+
logger2.log(`Storybook debug logs can be found at: ${logFile}`), logger2.outro("Storybook exited with an error"), process.exit(1);
|
|
2749
|
+
}, command = (name) => program.command(name).option(
|
|
2747
2750
|
"--disable-telemetry",
|
|
2748
2751
|
"Disable sending telemetry data",
|
|
2749
2752
|
optionalEnvToBoolean(process.env.STORYBOOK_DISABLE_TELEMETRY)
|
|
2750
|
-
).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").option("--loglevel <trace | debug | info | warn | error | silent>", "Define log level", "info").option(
|
|
2753
|
+
).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").option("--loglevel <trace | debug | info | warn | error | silent>", "Define log level", "info").option(
|
|
2754
|
+
"--logfile [path]",
|
|
2755
|
+
"Write all debug logs to the specified file at the end of the run. Defaults to debug-storybook.log when [path] is not provided"
|
|
2756
|
+
).hook("preAction", async (self) => {
|
|
2751
2757
|
try {
|
|
2752
2758
|
let options = self.opts();
|
|
2753
|
-
options.loglevel && logger2.setLogLevel(options.loglevel), options.
|
|
2759
|
+
options.loglevel && logger2.setLogLevel(options.loglevel), options.logfile && logTracker.enableLogWriting(), await globalSettings();
|
|
2754
2760
|
} catch (e) {
|
|
2755
2761
|
logger2.error(`Error loading global settings:
|
|
2756
2762
|
` + String(e));
|
|
2757
2763
|
}
|
|
2758
|
-
}).hook("postAction", async () => {
|
|
2764
|
+
}).hook("postAction", async ({ getOptionValue }) => {
|
|
2759
2765
|
if (logTracker.shouldWriteLogsToFile) {
|
|
2760
|
-
let logFile = await logTracker.writeToFile();
|
|
2766
|
+
let logFile = await logTracker.writeToFile(getOptionValue("logfile"));
|
|
2761
2767
|
logger2.outro(`Storybook debug logs can be found at: ${logFile}`);
|
|
2762
2768
|
}
|
|
2763
2769
|
});
|
|
@@ -2779,16 +2785,15 @@ command("dev").option("-p, --port <number>", "Port to run Storybook", (str) => p
|
|
|
2779
2785
|
"URL path to be appended when visiting Storybook for the first time"
|
|
2780
2786
|
).option("--preview-only", "Use the preview without the manager UI").action(async (options) => {
|
|
2781
2787
|
let { default: packageJson } = await import("storybook/package.json", { with: { type: "json" } });
|
|
2782
|
-
logger2.
|
|
2783
|
-
import_picocolors.default.bold(`${packageJson.name} v${packageJson.version}`) + import_picocolors.default.reset(`
|
|
2784
|
-
`)
|
|
2785
|
-
), getEnvConfig(options, {
|
|
2788
|
+
logger2.intro(`${packageJson.name} v${packageJson.version}`), getEnvConfig(options, {
|
|
2786
2789
|
port: "SBCONFIG_PORT",
|
|
2787
2790
|
host: "SBCONFIG_HOSTNAME",
|
|
2788
2791
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
2789
2792
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
2790
2793
|
ci: "CI"
|
|
2791
|
-
}), parseInt(`${options.port}`, 10) && (options.port = parseInt(`${options.port}`, 10)), await dev({ ...options, packageJson }).catch(() =>
|
|
2794
|
+
}), parseInt(`${options.port}`, 10) && (options.port = parseInt(`${options.port}`, 10)), await dev({ ...options, packageJson }).catch(() => {
|
|
2795
|
+
handleCommandFailure(options.logfile);
|
|
2796
|
+
});
|
|
2792
2797
|
});
|
|
2793
2798
|
command("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final webpack configurations for debugging purposes").option(
|
|
2794
2799
|
"--webpack-stats-json [directory]",
|
|
@@ -2800,8 +2805,7 @@ command("build").option("-o, --output-dir <dir-name>", "Directory where to store
|
|
|
2800
2805
|
let { env } = process;
|
|
2801
2806
|
env.NODE_ENV = env.NODE_ENV || "production";
|
|
2802
2807
|
let { default: packageJson } = await import("storybook/package.json", { with: { type: "json" } });
|
|
2803
|
-
logger2.
|
|
2804
|
-
`)), getEnvConfig(options, {
|
|
2808
|
+
logger2.intro(`Building ${packageJson.name} v${packageJson.version}`), getEnvConfig(options, {
|
|
2805
2809
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
2806
2810
|
outputDir: "SBCONFIG_OUTPUT_DIR",
|
|
2807
2811
|
configDir: "SBCONFIG_CONFIG_DIR"
|
|
@@ -2809,7 +2813,9 @@ command("build").option("-o, --output-dir <dir-name>", "Directory where to store
|
|
|
2809
2813
|
...options,
|
|
2810
2814
|
packageJson,
|
|
2811
2815
|
test: !!options.test || optionalEnvToBoolean(process.env.SB_TESTBUILD)
|
|
2812
|
-
}).catch(() =>
|
|
2816
|
+
}).catch(() => {
|
|
2817
|
+
logger2.outro("Storybook exited with an error"), process.exit(1);
|
|
2818
|
+
}), logger2.outro("Storybook build completed successfully");
|
|
2813
2819
|
});
|
|
2814
2820
|
command("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (options) => {
|
|
2815
2821
|
let { env } = process;
|