storybook 10.1.0-alpha.12 → 10.1.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.
Files changed (99) hide show
  1. package/dist/_browser-chunks/{chunk-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
  3. package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
  4. package/dist/_browser-chunks/{chunk-WXP2XJ3O.js → chunk-P4F4UVXX.js} +1 -0
  5. package/dist/_browser-chunks/{chunk-BE2DAXKJ.js → chunk-SS2NHR7W.js} +4 -1
  6. package/dist/_browser-chunks/{syntaxhighlighter-WKBQ5RC7.js → syntaxhighlighter-IQDEPFLK.js} +1 -1
  7. package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-FQ5J6V3U.js} +32 -22
  8. package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-VGUYV77Z.js} +8 -8
  9. package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-2JR3QBT2.js} +7 -7
  10. package/dist/_node-chunks/chunk-3EBH66BB.js +23 -0
  11. package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-4ZFHN3ZY.js} +6 -6
  12. package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-63PL4NNE.js} +1104 -13
  13. package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-A4KENTXT.js} +7 -7
  14. package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-ALIA3J6S.js} +44 -10
  15. package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-C2HKH2XQ.js} +5710 -2414
  16. package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-DQNBAQYT.js} +6 -6
  17. package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-F74UHHR6.js} +7 -7
  18. package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-H5XWXVWR.js} +6 -6
  19. package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-JMP7YFX2.js} +6 -6
  20. package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-JZR4DHG2.js} +19 -7
  21. package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-KEA7CVMZ.js} +122 -32
  22. package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-KF3WTAEP.js} +7 -7
  23. package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-LPPM7L5D.js} +51 -71
  24. package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-MJUDR7HQ.js} +7 -7
  25. package/dist/_node-chunks/chunk-NPB4THZQ.js +18 -0
  26. package/dist/_node-chunks/chunk-NZBK3DSJ.js +29 -0
  27. package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-Q2QUNQK6.js} +7 -7
  28. package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-TMCKISJR.js} +101 -118
  29. package/dist/_node-chunks/chunk-TWK7AR3U.js +6024 -0
  30. package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-V7CXWJXC.js} +7 -7
  31. package/dist/_node-chunks/chunk-W4F3T6CY.js +3781 -0
  32. package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-WACDSFMO.js} +9 -9
  33. package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-WVXZFQQU.js} +14 -8
  34. package/dist/_node-chunks/chunk-XBPE4PT7.js +78 -0
  35. package/dist/_node-chunks/chunk-YMM6BYF2.js +61 -0
  36. package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-ZGZKNZ5S.js} +6 -6
  37. package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-DR3AP3RJ.js} +9 -9
  38. package/dist/_node-chunks/{globby-6THB7HVX.js → globby-D4FPSHY2.js} +9 -9
  39. package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-ZEFOVNTK.js} +7 -7
  40. package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-PJF3ICCG.js} +8 -8
  41. package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-CYQOFYPV.js} +7 -7
  42. package/dist/babel/index.js +10 -11
  43. package/dist/bin/core.js +33 -26
  44. package/dist/bin/dispatcher.js +31 -20
  45. package/dist/bin/loader.js +10 -13
  46. package/dist/cli/index.d.ts +1479 -133
  47. package/dist/cli/index.js +30 -5159
  48. package/dist/common/index.d.ts +139 -62
  49. package/dist/common/index.js +66 -51
  50. package/dist/components/index.d.ts +136 -26
  51. package/dist/components/index.js +3163 -2859
  52. package/dist/core-server/index.d.ts +3 -2
  53. package/dist/core-server/index.js +112 -1486
  54. package/dist/core-server/presets/common-manager.js +5 -5
  55. package/dist/core-server/presets/common-override-preset.js +9 -9
  56. package/dist/core-server/presets/common-preset.js +272 -81
  57. package/dist/csf/index.js +2 -2
  58. package/dist/csf-tools/index.js +9 -9
  59. package/dist/manager/globals-runtime.js +21557 -21133
  60. package/dist/manager/manager-stores.d.ts +1 -0
  61. package/dist/manager/manager-stores.js +23 -0
  62. package/dist/manager/runtime.js +6695 -720
  63. package/dist/manager-api/index.d.ts +1802 -1
  64. package/dist/manager-api/index.js +105 -11
  65. package/dist/manager-errors.d.ts +6 -0
  66. package/dist/manager-errors.js +2 -2
  67. package/dist/mocking-utils/index.d.ts +1126 -0
  68. package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
  69. package/dist/node-logger/index.d.ts +192 -24
  70. package/dist/node-logger/index.js +23 -3148
  71. package/dist/preview/runtime.js +35 -3
  72. package/dist/preview-api/index.d.ts +69 -68
  73. package/dist/preview-api/index.js +2 -2
  74. package/dist/preview-errors.d.ts +6 -0
  75. package/dist/preview-errors.js +2 -2
  76. package/dist/server-errors.d.ts +31 -1
  77. package/dist/server-errors.js +17 -10
  78. package/dist/telemetry/index.d.ts +24 -3
  79. package/dist/telemetry/index.js +25 -24
  80. package/dist/types/index.d.ts +71 -8
  81. package/dist/types/index.js +25 -1
  82. package/package.json +11 -9
  83. package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
  84. package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
  85. package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
  86. package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
  87. package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
  88. package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
  89. package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
  90. package/dist/_node-chunks/chunk-QYQIZBS6.js +0 -26
  91. package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
  92. package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
  93. package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
  94. package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
  95. package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
  96. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
  97. package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
  98. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
  99. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
@@ -1,20 +1,20 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-DUXPWBOK.js";
14
+ } from "./chunk-KF3WTAEP.js";
15
15
  import {
16
16
  __toESM
17
- } from "./chunk-OP3INKUD.js";
17
+ } from "./chunk-JMP7YFX2.js";
18
18
 
19
19
  // src/csf-tools/CsfFile.ts
20
20
  var import_ts_dedent = __toESM(require_dist(), 1);
@@ -1137,7 +1137,7 @@ var getCsfParsingErrorMessage = ({
1137
1137
  if (!fname)
1138
1138
  throw new Error("Please specify a fileName for writeConfig");
1139
1139
  await writeFile2(fname, formatConfig(config));
1140
- }, isCsfFactoryPreview = (previewConfig) => !!previewConfig._ast.program.body.find((node) => t3.isImportDeclaration(node) && node.source.value.includes("@storybook") && node.specifiers.some((specifier) => t3.isImportSpecifier(specifier) && t3.isIdentifier(specifier.imported) && specifier.imported.name === "definePreview"));
1140
+ }, isCsfFactoryPreview = (previewConfig) => !!previewConfig._ast.program.body.find((node) => t3.isImportDeclaration(node) && node.source.value.includes("storybook") && node.specifiers.some((specifier) => t3.isImportSpecifier(specifier) && t3.isIdentifier(specifier.imported) && specifier.imported.name === "definePreview"));
1141
1141
 
1142
1142
  // src/csf-tools/getStorySortParameter.ts
1143
1143
  var import_ts_dedent3 = __toESM(require_dist(), 1);
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
12
12
  import {
13
13
  dirname,
14
14
  join
15
- } from "./chunk-WA6KZQZ2.js";
15
+ } from "./chunk-DQNBAQYT.js";
16
16
 
17
17
  // ../node_modules/exsolve/dist/index.mjs
18
18
  import fs, { lstatSync, realpathSync, statSync } from "node:fs";
@@ -714,7 +714,13 @@ import { win32 } from "node:path/win32";
714
714
  import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "node:url";
715
715
  var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
716
716
  "importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
717
- ), pathToFileURL2(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => dirname(fileURLToPath2(importMetaResolve(join(pkg, "package.json"), parent))), isTypescriptLoaderRegistered = !1;
717
+ ), pathToFileURL2(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
718
+ try {
719
+ return dirname(fileURLToPath2(importMetaResolve(join(pkg, "package.json"), parent)));
720
+ } catch {
721
+ return dirname(fileURLToPath2(importMetaResolve(join(pkg, "package.json"))));
722
+ }
723
+ }, isTypescriptLoaderRegistered = !1;
718
724
  async function importModule(path2, { skipCache = !1 } = {}) {
719
725
  if (!isTypescriptLoaderRegistered) {
720
726
  let typescriptLoaderUrl = importMetaResolve("storybook/internal/bin/loader");
@@ -0,0 +1,78 @@
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // src/storybook-error.ts
14
+ function parseErrorCode({
15
+ code,
16
+ category
17
+ }) {
18
+ let paddedCode = String(code).padStart(4, "0");
19
+ return `SB_${category}_${paddedCode}`;
20
+ }
21
+ function appendErrorRef(url) {
22
+ if (/^(?!.*storybook\.js\.org)|[?&]ref=error\b/.test(url))
23
+ return url;
24
+ try {
25
+ let urlObj = new URL(url);
26
+ return urlObj.searchParams.set("ref", "error"), urlObj.toString();
27
+ } catch {
28
+ return url;
29
+ }
30
+ }
31
+ var StorybookError = class _StorybookError extends Error {
32
+ constructor(props) {
33
+ super(_StorybookError.getFullMessage(props));
34
+ /**
35
+ * Data associated with the error. Used to provide additional information in the error message or
36
+ * to be passed to telemetry.
37
+ */
38
+ this.data = {};
39
+ /** Flag used to easily determine if the error originates from Storybook. */
40
+ this.fromStorybook = !0;
41
+ /**
42
+ * Flag used to determine if the error is handled by us and should therefore not be shown to the
43
+ * user.
44
+ */
45
+ this.isHandledError = !1;
46
+ this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name;
47
+ }
48
+ get fullErrorCode() {
49
+ return parseErrorCode({ code: this.code, category: this.category });
50
+ }
51
+ /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
52
+ get name() {
53
+ let errorName = this._name || this.constructor.name;
54
+ return `${this.fullErrorCode} (${errorName})`;
55
+ }
56
+ set name(name) {
57
+ this._name = name;
58
+ }
59
+ /** Generates the error message along with additional documentation link (if applicable). */
60
+ static getFullMessage({
61
+ documentation,
62
+ code,
63
+ category,
64
+ message
65
+ }) {
66
+ let page;
67
+ return documentation === !0 ? page = `https://storybook.js.org/error/${parseErrorCode({ code, category })}?ref=error` : typeof documentation == "string" ? page = appendErrorRef(documentation) : Array.isArray(documentation) && (page = `
68
+ ${documentation.map((doc) => ` - ${appendErrorRef(doc)}`).join(`
69
+ `)}`), `${message}${page != null ? `
70
+
71
+ More info: ${page}
72
+ ` : ""}`;
73
+ }
74
+ };
75
+
76
+ export {
77
+ StorybookError
78
+ };
@@ -0,0 +1,61 @@
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // src/common/versions.ts
14
+ var versions_default = {
15
+ "@storybook/addon-a11y": "10.1.0-alpha.14",
16
+ "@storybook/addon-docs": "10.1.0-alpha.14",
17
+ "@storybook/addon-links": "10.1.0-alpha.14",
18
+ "@storybook/addon-onboarding": "10.1.0-alpha.14",
19
+ "storybook-addon-pseudo-states": "10.1.0-alpha.14",
20
+ "@storybook/addon-themes": "10.1.0-alpha.14",
21
+ "@storybook/addon-vitest": "10.1.0-alpha.14",
22
+ "@storybook/builder-vite": "10.1.0-alpha.14",
23
+ "@storybook/builder-webpack5": "10.1.0-alpha.14",
24
+ storybook: "10.1.0-alpha.14",
25
+ "@storybook/angular": "10.1.0-alpha.14",
26
+ "@storybook/ember": "10.1.0-alpha.14",
27
+ "@storybook/html-vite": "10.1.0-alpha.14",
28
+ "@storybook/nextjs": "10.1.0-alpha.14",
29
+ "@storybook/nextjs-vite": "10.1.0-alpha.14",
30
+ "@storybook/preact-vite": "10.1.0-alpha.14",
31
+ "@storybook/react-native-web-vite": "10.1.0-alpha.14",
32
+ "@storybook/react-vite": "10.1.0-alpha.14",
33
+ "@storybook/react-webpack5": "10.1.0-alpha.14",
34
+ "@storybook/server-webpack5": "10.1.0-alpha.14",
35
+ "@storybook/svelte-vite": "10.1.0-alpha.14",
36
+ "@storybook/sveltekit": "10.1.0-alpha.14",
37
+ "@storybook/vue3-vite": "10.1.0-alpha.14",
38
+ "@storybook/web-components-vite": "10.1.0-alpha.14",
39
+ sb: "10.1.0-alpha.14",
40
+ "@storybook/cli": "10.1.0-alpha.14",
41
+ "@storybook/codemod": "10.1.0-alpha.14",
42
+ "@storybook/core-webpack": "10.1.0-alpha.14",
43
+ "create-storybook": "10.1.0-alpha.14",
44
+ "@storybook/csf-plugin": "10.1.0-alpha.14",
45
+ "eslint-plugin-storybook": "10.1.0-alpha.14",
46
+ "@storybook/react-dom-shim": "10.1.0-alpha.14",
47
+ "@storybook/preset-create-react-app": "10.1.0-alpha.14",
48
+ "@storybook/preset-react-webpack": "10.1.0-alpha.14",
49
+ "@storybook/preset-server-webpack": "10.1.0-alpha.14",
50
+ "@storybook/html": "10.1.0-alpha.14",
51
+ "@storybook/preact": "10.1.0-alpha.14",
52
+ "@storybook/react": "10.1.0-alpha.14",
53
+ "@storybook/server": "10.1.0-alpha.14",
54
+ "@storybook/svelte": "10.1.0-alpha.14",
55
+ "@storybook/vue3": "10.1.0-alpha.14",
56
+ "@storybook/web-components": "10.1.0-alpha.14"
57
+ };
58
+
59
+ export {
60
+ versions_default
61
+ };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,18 +1,18 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-5KLIDWFN.js";
15
- import "./chunk-OP3INKUD.js";
14
+ } from "./chunk-Q2QUNQK6.js";
15
+ import "./chunk-JMP7YFX2.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-ZLT3QOFF.js");
110
+ }, { compile } = await import("./mdx-N42X6CFJ-PJF3ICCG.js");
111
111
  await compile(code, {
112
112
  rehypePlugins: [[plugin, store]]
113
113
  });
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-2DMESZFJ.js";
15
+ } from "./chunk-MJUDR7HQ.js";
16
16
  import {
17
17
  slash
18
- } from "./chunk-E5FJS66Z.js";
18
+ } from "./chunk-4ZFHN3ZY.js";
19
19
  import {
20
20
  __commonJS,
21
21
  __require,
22
22
  __toESM
23
- } from "./chunk-OP3INKUD.js";
23
+ } from "./chunk-JMP7YFX2.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 CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-OP3INKUD.js";
16
+ } from "./chunk-JMP7YFX2.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 CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-5KLIDWFN.js";
25
- import "./chunk-OP3INKUD.js";
24
+ } from "./chunk-Q2QUNQK6.js";
25
+ import "./chunk-JMP7YFX2.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 CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-OP3INKUD.js";
12
+ import "./chunk-JMP7YFX2.js";
13
13
 
14
14
  // ../node_modules/yocto-queue/index.js
15
15
  var Node = class {
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-5HV3B5OP.js";
26
- import "../_node-chunks/chunk-FDXFVHIL.js";
27
- import "../_node-chunks/chunk-FZLRAH4N.js";
28
- import "../_node-chunks/chunk-NAOYEL54.js";
29
- import "../_node-chunks/chunk-OP3INKUD.js";
25
+ } from "../_node-chunks/chunk-63PL4NNE.js";
26
+ import "../_node-chunks/chunk-2JR3QBT2.js";
27
+ import "../_node-chunks/chunk-A4KENTXT.js";
28
+ import "../_node-chunks/chunk-JMP7YFX2.js";
30
29
  var export_transformSync = import_core.transformSync;
31
30
  export {
32
31
  BabelFileClass,
package/dist/bin/core.js CHANGED
@@ -1,31 +1,32 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-IXVYNBMD.js";
14
+ } from "../_node-chunks/chunk-NPB4THZQ.js";
15
15
  import {
16
16
  globalSettings
17
- } from "../_node-chunks/chunk-4FT2DHGE.js";
17
+ } from "../_node-chunks/chunk-ALIA3J6S.js";
18
+ import "../_node-chunks/chunk-NZBK3DSJ.js";
18
19
  import {
19
20
  require_dist
20
- } from "../_node-chunks/chunk-DUXPWBOK.js";
21
+ } from "../_node-chunks/chunk-KF3WTAEP.js";
21
22
  import {
22
23
  require_picocolors
23
- } from "../_node-chunks/chunk-NAOYEL54.js";
24
+ } from "../_node-chunks/chunk-A4KENTXT.js";
24
25
  import {
25
26
  __commonJS,
26
27
  __require,
27
28
  __toESM
28
- } from "../_node-chunks/chunk-OP3INKUD.js";
29
+ } from "../_node-chunks/chunk-JMP7YFX2.js";
29
30
 
30
31
  // ../node_modules/commander/lib/error.js
31
32
  var require_error = __commonJS({
@@ -2708,7 +2709,7 @@ import { cache as cache3 } from "storybook/internal/common";
2708
2709
  import { buildDevStandalone, withTelemetry as withTelemetry3 } from "storybook/internal/core-server";
2709
2710
  import { logger, instance as npmLog } from "storybook/internal/node-logger";
2710
2711
  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.plain(e)) : logger.error(error) : error.compilation?.errors && error.compilation.errors.forEach((e) => logger.plain(e)), logger.line(), logger.warn(
2712
+ 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
2713
  error.close ? import_ts_dedent.dedent`
2713
2714
  FATAL broken build!, will close the process,
2714
2715
  Fix the error below and restart storybook.
@@ -2716,7 +2717,7 @@ function printError(error) {
2716
2717
  Broken build, fix the error above.
2717
2718
  You may need to refresh the browser.
2718
2719
  `
2719
- ), logger.line();
2720
+ );
2720
2721
  }
2721
2722
  var dev = async (cliOptions) => {
2722
2723
  let { env } = process;
@@ -2743,21 +2744,27 @@ var dev = async (cliOptions) => {
2743
2744
 
2744
2745
  // src/bin/core.ts
2745
2746
  addToGlobalContext("cliVersion", version);
2746
- var command = (name) => program.command(name).option(
2747
+ var handleCommandFailure = async (logFilePath) => {
2748
+ let logFile = await logTracker.writeToFile(logFilePath);
2749
+ logger2.log(`Storybook debug logs can be found at: ${logFile}`), logger2.outro("Storybook exited with an error"), process.exit(1);
2750
+ }, command = (name) => program.command(name).option(
2747
2751
  "--disable-telemetry",
2748
2752
  "Disable sending telemetry data",
2749
2753
  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("--write-logs", "Write all debug logs to a file at the end of the run").hook("preAction", async (self) => {
2754
+ ).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(
2755
+ "--logfile [path]",
2756
+ "Write all debug logs to the specified file at the end of the run. Defaults to debug-storybook.log when [path] is not provided"
2757
+ ).hook("preAction", async (self) => {
2751
2758
  try {
2752
2759
  let options = self.opts();
2753
- options.loglevel && logger2.setLogLevel(options.loglevel), options.writeLogs && logTracker.enableLogWriting(), await globalSettings();
2760
+ options.loglevel && logger2.setLogLevel(options.loglevel), options.logfile && logTracker.enableLogWriting(), await globalSettings();
2754
2761
  } catch (e) {
2755
2762
  logger2.error(`Error loading global settings:
2756
2763
  ` + String(e));
2757
2764
  }
2758
- }).hook("postAction", async () => {
2765
+ }).hook("postAction", async ({ getOptionValue }) => {
2759
2766
  if (logTracker.shouldWriteLogsToFile) {
2760
- let logFile = await logTracker.writeToFile();
2767
+ let logFile = await logTracker.writeToFile(getOptionValue("logfile"));
2761
2768
  logger2.outro(`Storybook debug logs can be found at: ${logFile}`);
2762
2769
  }
2763
2770
  });
@@ -2779,16 +2786,15 @@ command("dev").option("-p, --port <number>", "Port to run Storybook", (str) => p
2779
2786
  "URL path to be appended when visiting Storybook for the first time"
2780
2787
  ).option("--preview-only", "Use the preview without the manager UI").action(async (options) => {
2781
2788
  let { default: packageJson } = await import("storybook/package.json", { with: { type: "json" } });
2782
- logger2.log(
2783
- import_picocolors.default.bold(`${packageJson.name} v${packageJson.version}`) + import_picocolors.default.reset(`
2784
- `)
2785
- ), getEnvConfig(options, {
2789
+ logger2.intro(`${packageJson.name} v${packageJson.version}`), getEnvConfig(options, {
2786
2790
  port: "SBCONFIG_PORT",
2787
2791
  host: "SBCONFIG_HOSTNAME",
2788
2792
  staticDir: "SBCONFIG_STATIC_DIR",
2789
2793
  configDir: "SBCONFIG_CONFIG_DIR",
2790
2794
  ci: "CI"
2791
- }), parseInt(`${options.port}`, 10) && (options.port = parseInt(`${options.port}`, 10)), await dev({ ...options, packageJson }).catch(() => process.exit(1));
2795
+ }), parseInt(`${options.port}`, 10) && (options.port = parseInt(`${options.port}`, 10)), await dev({ ...options, packageJson }).catch(() => {
2796
+ handleCommandFailure(options.logfile);
2797
+ });
2792
2798
  });
2793
2799
  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
2800
  "--webpack-stats-json [directory]",
@@ -2800,8 +2806,7 @@ command("build").option("-o, --output-dir <dir-name>", "Directory where to store
2800
2806
  let { env } = process;
2801
2807
  env.NODE_ENV = env.NODE_ENV || "production";
2802
2808
  let { default: packageJson } = await import("storybook/package.json", { with: { type: "json" } });
2803
- logger2.log(import_picocolors.default.bold(`${packageJson.name} v${packageJson.version}
2804
- `)), getEnvConfig(options, {
2809
+ logger2.intro(`Building ${packageJson.name} v${packageJson.version}`), getEnvConfig(options, {
2805
2810
  staticDir: "SBCONFIG_STATIC_DIR",
2806
2811
  outputDir: "SBCONFIG_OUTPUT_DIR",
2807
2812
  configDir: "SBCONFIG_CONFIG_DIR"
@@ -2809,7 +2814,9 @@ command("build").option("-o, --output-dir <dir-name>", "Directory where to store
2809
2814
  ...options,
2810
2815
  packageJson,
2811
2816
  test: !!options.test || optionalEnvToBoolean(process.env.SB_TESTBUILD)
2812
- }).catch(() => process.exit(1));
2817
+ }).catch(() => {
2818
+ logger2.outro("Storybook exited with an error"), process.exit(1);
2819
+ }), logger2.outro("Storybook build completed successfully");
2813
2820
  });
2814
2821
  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
2822
  let { env } = process;