storybook 10.2.0-alpha.2 → 10.2.0-alpha.4

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 (75) hide show
  1. package/dist/_browser-chunks/{chunk-Y6HZAT53.js → chunk-HX32VQZR.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-FQ7SLVLR.js → chunk-JVRDBUUP.js} +20 -1
  3. package/dist/_browser-chunks/{chunk-MOYJJEXA.js → chunk-Q5RYDXT3.js} +3 -4
  4. package/dist/_browser-chunks/{chunk-DOSERVNW.js → chunk-UXVP56J6.js} +1 -1
  5. package/dist/_browser-chunks/{chunk-GFY5R5EY.js → chunk-V5NV5R37.js} +1 -1
  6. package/dist/_node-chunks/{builder-manager-ZK4QXZNX.js → builder-manager-UYH5WXWQ.js} +12 -12
  7. package/dist/_node-chunks/{camelcase-QWQG7I72.js → camelcase-VC2MI4D3.js} +7 -7
  8. package/dist/_node-chunks/{chunk-TOXVUAH2.js → chunk-2LVUTXDF.js} +6 -6
  9. package/dist/_node-chunks/chunk-2ZQ6Y2UX.js +18 -0
  10. package/dist/_node-chunks/{chunk-QFSK4B7R.js → chunk-3SB46FMB.js} +8 -8
  11. package/dist/_node-chunks/{chunk-WUKWNPSQ.js → chunk-5IKN22PK.js} +9 -9
  12. package/dist/_node-chunks/{chunk-UWJ4BOOL.js → chunk-5Y2B5Y2I.js} +9 -9
  13. package/dist/_node-chunks/{chunk-2AFVBCGF.js → chunk-6DSSKDEB.js} +6 -6
  14. package/dist/_node-chunks/{chunk-I5TOD3AY.js → chunk-6RZ6ESPF.js} +12 -12
  15. package/dist/_node-chunks/{chunk-WOS3OQVT.js → chunk-6XCE5DKF.js} +26 -7
  16. package/dist/_node-chunks/{chunk-XFU23B4C.js → chunk-AEF4OCMB.js} +7 -7
  17. package/dist/_node-chunks/chunk-ATFXKLVA.js +61 -0
  18. package/dist/_node-chunks/{chunk-RGQC4G3L.js → chunk-BRVASHE4.js} +21 -17
  19. package/dist/_node-chunks/{chunk-GKEAARBQ.js → chunk-BXGPI53U.js} +6 -6
  20. package/dist/_node-chunks/{chunk-OV2CP4VV.js → chunk-CSLYLE5Z.js} +6 -6
  21. package/dist/_node-chunks/{chunk-6OZRMRVO.js → chunk-EGGWMXFM.js} +7 -7
  22. package/dist/_node-chunks/{chunk-FZFZ5TOM.js → chunk-HATD2DIT.js} +6 -6
  23. package/dist/_node-chunks/{chunk-DWVHBQGR.js → chunk-I6C74YGE.js} +8 -8
  24. package/dist/_node-chunks/chunk-IXZ54TG6.js +20 -0
  25. package/dist/_node-chunks/chunk-JUQFZI7H.js +23 -0
  26. package/dist/_node-chunks/{chunk-KVNLJSAB.js → chunk-KLBUL53W.js} +7 -7
  27. package/dist/_node-chunks/{chunk-URBB5EGY.js → chunk-NCENIJPW.js} +7 -7
  28. package/dist/_node-chunks/{chunk-NKOHF7TQ.js → chunk-OBFKPAHB.js} +72 -11
  29. package/dist/_node-chunks/{chunk-5VZMCPTH.js → chunk-OW656GJO.js} +43 -27
  30. package/dist/_node-chunks/{chunk-Q5ZQH2OQ.js → chunk-S3WG5D7I.js} +7 -7
  31. package/dist/_node-chunks/{chunk-CW7HJRCY.js → chunk-THYQIUTI.js} +7 -7
  32. package/dist/_node-chunks/{chunk-EXZXVBZO.js → chunk-VHJPAZFZ.js} +7 -7
  33. package/dist/_node-chunks/{chunk-VJPI73BB.js → chunk-VJ5C7NTM.js} +59 -26
  34. package/dist/_node-chunks/{chunk-HMFROKHU.js → chunk-WI5ZJAAJ.js} +7 -7
  35. package/dist/_node-chunks/{chunk-R2J3OB3H.js → chunk-X6TQDZZW.js} +6 -6
  36. package/dist/_node-chunks/{dist-UBFMIJZC.js → dist-ZK2DO62Y.js} +9 -9
  37. package/dist/_node-chunks/{globby-VD3CGPVI.js → globby-3NVGNGRX.js} +9 -9
  38. package/dist/_node-chunks/{lib-MMJB47J3.js → lib-ALOTNL3B.js} +7 -7
  39. package/dist/_node-chunks/{mdx-N42X6CFJ-3J2G7NZZ.js → mdx-N42X6CFJ-AVHGVFIO.js} +8 -8
  40. package/dist/_node-chunks/{p-limit-SOBWTEVH.js → p-limit-JMHEGI5E.js} +7 -7
  41. package/dist/babel/index.js +10 -10
  42. package/dist/bin/core.js +24 -18
  43. package/dist/bin/dispatcher.js +11 -11
  44. package/dist/bin/loader.js +9 -9
  45. package/dist/cli/index.js +18 -18
  46. package/dist/common/index.d.ts +25 -18
  47. package/dist/common/index.js +19 -19
  48. package/dist/core-server/index.d.ts +68 -1
  49. package/dist/core-server/index.js +35 -35
  50. package/dist/core-server/presets/common-override-preset.js +9 -9
  51. package/dist/core-server/presets/common-preset.js +25 -25
  52. package/dist/csf/index.js +1 -1
  53. package/dist/csf-tools/index.js +9 -9
  54. package/dist/instrumenter/index.js +1 -1
  55. package/dist/manager/globals-runtime.js +3122 -3018
  56. package/dist/manager-api/index.js +4 -4
  57. package/dist/manager-errors.d.ts +24 -0
  58. package/dist/manager-errors.js +2 -2
  59. package/dist/mocking-utils/index.js +8 -8
  60. package/dist/node-logger/index.d.ts +1 -1
  61. package/dist/node-logger/index.js +9 -9
  62. package/dist/preview/runtime.js +727 -623
  63. package/dist/preview-api/index.js +1 -1
  64. package/dist/preview-errors.d.ts +24 -0
  65. package/dist/preview-errors.js +2 -2
  66. package/dist/server-errors.d.ts +59 -3
  67. package/dist/server-errors.js +22 -11
  68. package/dist/telemetry/index.js +23 -23
  69. package/dist/test/index.js +370 -286
  70. package/dist/types/index.d.ts +3 -1
  71. package/package.json +1 -1
  72. package/dist/_node-chunks/chunk-CLCLRZYL.js +0 -61
  73. package/dist/_node-chunks/chunk-DF3QP62W.js +0 -18
  74. package/dist/_node-chunks/chunk-EVBCPGQO.js +0 -20
  75. package/dist/_node-chunks/chunk-PCMFKXWQ.js +0 -23
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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_wtqlduo6et.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __require
15
- } from "./chunk-TOXVUAH2.js";
15
+ } from "./chunk-2LVUTXDF.js";
16
16
 
17
17
  // ../../node_modules/ms/index.js
18
18
  var require_ms = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,23 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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_picocolors
14
- } from "./chunk-XFU23B4C.js";
14
+ } from "./chunk-AEF4OCMB.js";
15
15
  import {
16
16
  __commonJS,
17
17
  __export,
18
18
  __require,
19
19
  __toESM
20
- } from "./chunk-TOXVUAH2.js";
20
+ } from "./chunk-2LVUTXDF.js";
21
21
 
22
22
  // ../../node_modules/are-we-there-yet/lib/tracker-base.js
23
23
  var require_tracker_base = __commonJS({
@@ -0,0 +1,20 @@
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // ../../node_modules/slash/index.js
14
+ function slash(path) {
15
+ return path.startsWith("\\\\?\\") ? path : path.replace(/\\/g, "/");
16
+ }
17
+
18
+ export {
19
+ slash
20
+ };
@@ -0,0 +1,23 @@
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ any
14
+ } from "./chunk-BXGPI53U.js";
15
+
16
+ // src/cli/detect.ts
17
+ async function detectPnp() {
18
+ return !!any([".pnp.js", ".pnp.cjs"]);
19
+ }
20
+
21
+ export {
22
+ detectPnp
23
+ };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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_wtqlduo6et.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __toESM
15
- } from "./chunk-TOXVUAH2.js";
15
+ } from "./chunk-2LVUTXDF.js";
16
16
 
17
17
  // ../../node_modules/balanced-match/index.js
18
18
  var require_balanced_match = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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_wtqlduo6et.createRequire(import.meta.url);
12
12
  import {
13
13
  dirname,
14
14
  join
15
- } from "./chunk-OV2CP4VV.js";
15
+ } from "./chunk-CSLYLE5Z.js";
16
16
 
17
17
  // ../../node_modules/exsolve/dist/index.mjs
18
18
  import fs, { lstatSync, realpathSync, statSync } from "node:fs";
@@ -1,26 +1,26 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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
  StorybookError
14
- } from "./chunk-WOS3OQVT.js";
14
+ } from "./chunk-6XCE5DKF.js";
15
15
  import {
16
16
  require_dist
17
- } from "./chunk-CW7HJRCY.js";
17
+ } from "./chunk-THYQIUTI.js";
18
18
  import {
19
19
  require_picocolors
20
- } from "./chunk-XFU23B4C.js";
20
+ } from "./chunk-AEF4OCMB.js";
21
21
  import {
22
22
  __toESM
23
- } from "./chunk-TOXVUAH2.js";
23
+ } from "./chunk-2LVUTXDF.js";
24
24
 
25
25
  // src/server-errors.ts
26
26
  var import_picocolors = __toESM(require_picocolors(), 1), import_ts_dedent = __toESM(require_dist(), 1);
@@ -365,6 +365,62 @@ var WebpackCompilationError = class extends StorybookError {
365
365
  });
366
366
  this.data = data;
367
367
  }
368
+ }, AddonVitestPostinstallFailedAddonA11yError = class extends StorybookError {
369
+ constructor(data) {
370
+ super({
371
+ name: "AddonVitestPostinstallFailedAddonA11yError",
372
+ message: "The @storybook/addon-a11y couldn't be set up for the Vitest addon",
373
+ category: "CLI_INIT" /* CLI_INIT */,
374
+ isHandledError: !0,
375
+ code: 6
376
+ });
377
+ this.data = data;
378
+ }
379
+ }, AddonVitestPostinstallExistingSetupFileError = class extends StorybookError {
380
+ constructor(data) {
381
+ super({
382
+ name: "AddonVitestPostinstallExistingSetupFileError",
383
+ category: "CLI_INIT" /* CLI_INIT */,
384
+ isHandledError: !0,
385
+ code: 7,
386
+ documentation: "https://storybook.js.org/docs/writing-tests/integrations/vitest-addon#manual-setup",
387
+ message: import_ts_dedent.dedent`
388
+ Found an existing Vitest setup file: ${data.filePath}
389
+ Please refer to the documentation to complete the setup manually.
390
+ `
391
+ });
392
+ this.data = data;
393
+ }
394
+ }, AddonVitestPostinstallWorkspaceUpdateError = class extends StorybookError {
395
+ constructor(data) {
396
+ super({
397
+ name: "AddonVitestPostinstallWorkspaceUpdateError",
398
+ category: "CLI_INIT" /* CLI_INIT */,
399
+ isHandledError: !0,
400
+ code: 8,
401
+ documentation: "https://storybook.js.org/docs/writing-tests/integrations/vitest-addon#manual-setup",
402
+ message: import_ts_dedent.dedent`
403
+ Could not update existing Vitest workspace file: ${data.filePath}
404
+ Please refer to the documentation to complete the setup manually.
405
+ `
406
+ });
407
+ this.data = data;
408
+ }
409
+ }, AddonVitestPostinstallConfigUpdateError = class extends StorybookError {
410
+ constructor(data) {
411
+ super({
412
+ name: "AddonVitestPostinstallConfigUpdateError",
413
+ category: "CLI_INIT" /* CLI_INIT */,
414
+ isHandledError: !0,
415
+ code: 9,
416
+ documentation: "https://storybook.js.org/docs/writing-tests/integrations/vitest-addon#manual-setup",
417
+ message: import_ts_dedent.dedent`
418
+ Unable to update existing Vitest config file: ${data.filePath}
419
+ Please refer to the documentation to complete the setup manually.
420
+ `
421
+ });
422
+ this.data = data;
423
+ }
368
424
  }, AddonVitestPostinstallError = class extends StorybookError {
369
425
  constructor(data) {
370
426
  super({
@@ -372,7 +428,8 @@ var WebpackCompilationError = class extends StorybookError {
372
428
  category: "CLI_INIT" /* CLI_INIT */,
373
429
  isHandledError: !0,
374
430
  code: 5,
375
- message: "The Vitest addon setup failed."
431
+ message: "The Vitest addon setup failed.",
432
+ subErrors: data.errors
376
433
  });
377
434
  this.data = data;
378
435
  }
@@ -528,6 +585,10 @@ export {
528
585
  StatusTypeIdMismatchError,
529
586
  GenerateNewProjectOnInitError,
530
587
  AddonVitestPostinstallPrerequisiteCheckError,
588
+ AddonVitestPostinstallFailedAddonA11yError,
589
+ AddonVitestPostinstallExistingSetupFileError,
590
+ AddonVitestPostinstallWorkspaceUpdateError,
591
+ AddonVitestPostinstallConfigUpdateError,
531
592
  AddonVitestPostinstallError,
532
593
  UpgradeStorybookToLowerVersionError,
533
594
  UpgradeStorybookUnknownCurrentVersionError,
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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 "./chunk-DF3QP62W.js";
14
+ } from "./chunk-2ZQ6Y2UX.js";
15
15
  import {
16
16
  createFileSystemCache,
17
17
  execa,
@@ -19,25 +19,25 @@ import {
19
19
  getProjectRoot,
20
20
  resolvePathInStorybookCache,
21
21
  up
22
- } from "./chunk-VJPI73BB.js";
22
+ } from "./chunk-VJ5C7NTM.js";
23
23
  import {
24
24
  getSessionId,
25
25
  nanoid,
26
26
  set
27
- } from "./chunk-FZFZ5TOM.js";
27
+ } from "./chunk-HATD2DIT.js";
28
28
  import {
29
29
  globalSettings
30
- } from "./chunk-WUKWNPSQ.js";
30
+ } from "./chunk-5IKN22PK.js";
31
31
  import {
32
32
  resolvePackageDir
33
- } from "./chunk-URBB5EGY.js";
33
+ } from "./chunk-NCENIJPW.js";
34
34
  import {
35
35
  slash
36
- } from "./chunk-EVBCPGQO.js";
36
+ } from "./chunk-IXZ54TG6.js";
37
37
  import {
38
38
  __commonJS,
39
39
  __toESM
40
- } from "./chunk-TOXVUAH2.js";
40
+ } from "./chunk-2LVUTXDF.js";
41
41
 
42
42
  // ../../node_modules/fetch-retry/index.js
43
43
  var require_fetch_retry = __commonJS({
@@ -76,22 +76,22 @@ var require_fetch_retry = __commonJS({
76
76
  retryOn = init.retryOn;
77
77
  else
78
78
  throw new ArgumentError("retryOn property expects an array or function");
79
- return new Promise(function(resolve, reject) {
79
+ return new Promise(function(resolve2, reject) {
80
80
  var wrappedFetch = function(attempt) {
81
81
  var _input = typeof Request < "u" && input instanceof Request ? input.clone() : input;
82
82
  fetch2(_input, init).then(function(response) {
83
83
  if (Array.isArray(retryOn) && retryOn.indexOf(response.status) === -1)
84
- resolve(response);
84
+ resolve2(response);
85
85
  else if (typeof retryOn == "function")
86
86
  try {
87
87
  return Promise.resolve(retryOn(attempt, null, response)).then(function(retryOnResponse) {
88
- retryOnResponse ? retry2(attempt, null, response) : resolve(response);
88
+ retryOnResponse ? retry2(attempt, null, response) : resolve2(response);
89
89
  }).catch(reject);
90
90
  } catch (error) {
91
91
  reject(error);
92
92
  }
93
93
  else
94
- attempt < retries ? retry2(attempt, null, response) : resolve(response);
94
+ attempt < retries ? retry2(attempt, null, response) : resolve2(response);
95
95
  }).catch(function(error) {
96
96
  if (typeof retryOn == "function")
97
97
  try {
@@ -174,8 +174,10 @@ function sanitizeError(error, pathSeparator = path.sep) {
174
174
  }
175
175
 
176
176
  // src/telemetry/storybook-metadata.ts
177
+ import { createHash } from "node:crypto";
178
+ import { existsSync as existsSync2 } from "node:fs";
177
179
  import { readFile } from "node:fs/promises";
178
- import { dirname } from "node:path";
180
+ import { dirname, resolve } from "node:path";
179
181
  import {
180
182
  getStorybookConfiguration,
181
183
  getStorybookInfo as getStorybookInfo2,
@@ -183,6 +185,7 @@ import {
183
185
  loadMainConfig,
184
186
  versions
185
187
  } from "storybook/internal/common";
188
+ import { getInterpretedFile } from "storybook/internal/common";
186
189
  import { readConfig } from "storybook/internal/csf-tools";
187
190
 
188
191
  // src/telemetry/get-application-file-count.ts
@@ -753,21 +756,34 @@ async function getPackageJsonDetails() {
753
756
  packageJson: {}
754
757
  };
755
758
  }
756
- var cachedMetadata, getStorybookMetadata = async (_configDir) => {
757
- if (cachedMetadata)
758
- return cachedMetadata;
759
+ var metadataCache = /* @__PURE__ */ new Map();
760
+ async function hashMainConfig(configDir) {
761
+ try {
762
+ let mainPath = getInterpretedFile(resolve(configDir, "main"));
763
+ if (!mainPath || !existsSync2(mainPath))
764
+ return "missing";
765
+ let content = await readFile(mainPath);
766
+ return createHash("sha256").update(new Uint8Array(content)).digest("hex");
767
+ } catch {
768
+ return "unknown";
769
+ }
770
+ }
771
+ var getStorybookMetadata = async (_configDir) => {
759
772
  let { packageJson, packageJsonPath } = await getPackageJsonDetails(), configDir = (_configDir || getStorybookConfiguration(
760
773
  String(packageJson?.scripts?.storybook || ""),
761
774
  "-c",
762
775
  "--config-dir"
763
- )) ?? ".storybook", mainConfig = await loadMainConfig({ configDir }).catch(() => {
764
- });
765
- return cachedMetadata = await computeStorybookMetadata({
776
+ )) ?? ".storybook", contentHash = await hashMainConfig(configDir), cacheKey = `${configDir}::${contentHash}`, cached = metadataCache.get(cacheKey);
777
+ if (cached)
778
+ return cached;
779
+ let mainConfig = await loadMainConfig({ configDir }).catch(() => {
780
+ }), computed = await computeStorybookMetadata({
766
781
  mainConfig,
767
782
  packageJson,
768
783
  packageJsonPath,
769
784
  configDir
770
- }), cachedMetadata;
785
+ });
786
+ return metadataCache.set(cacheKey, computed), computed;
771
787
  };
772
788
 
773
789
  // src/telemetry/telemetry.ts
@@ -783,9 +799,9 @@ import { getProjectRoot as getProjectRoot3 } from "storybook/internal/common";
783
799
  import { execSync } from "child_process";
784
800
 
785
801
  // src/telemetry/one-way-hash.ts
786
- import { createHash } from "crypto";
802
+ import { createHash as createHash2 } from "crypto";
787
803
  var oneWayHash = (payload) => {
788
- let hash = createHash("sha256");
804
+ let hash = createHash2("sha256");
789
805
  return hash.update("storybook-telemetry-salt"), hash.update(payload), hash.digest("hex");
790
806
  };
791
807
 
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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_wtqlduo6et.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __require
15
- } from "./chunk-TOXVUAH2.js";
15
+ } from "./chunk-2LVUTXDF.js";
16
16
 
17
17
  // ../../node_modules/totalist/sync/index.js
18
18
  var require_sync = __commonJS({
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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
  __commonJS
14
- } from "./chunk-TOXVUAH2.js";
14
+ } from "./chunk-2LVUTXDF.js";
15
15
 
16
16
  // ../../node_modules/ts-dedent/dist/index.js
17
17
  var require_dist = __commonJS({
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_wtqlduo6et from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_wtqlduo6et from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_wtqlduo6et from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uzmhoq39aog from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uzmhoq39aog from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uzmhoq39aog from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_wtqlduo6et.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_wtqlduo6et.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_wtqlduo6et.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uzmhoq39aog.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uzmhoq39aog.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uzmhoq39aog.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
14
- } from "./chunk-TOXVUAH2.js";
14
+ } from "./chunk-2LVUTXDF.js";
15
15
 
16
16
  // ../../node_modules/@storybook/docs-mdx/dist/chunk-H6DQNFQR.js
17
17
  var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __require2 = ((x) => typeof __require < "u" ? __require : typeof Proxy < "u" ? new Proxy(x, {