storybook 10.2.0-alpha.1 → 10.2.0-alpha.10

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 (120) hide show
  1. package/dist/_browser-chunks/{Color-TNPFN3FC.js → Color-XESOIGZP.js} +9 -568
  2. package/dist/_browser-chunks/{WithTooltip-IO6J4KBT.js → WithTooltip-65CFNBJE.js} +70 -70
  3. package/dist/_browser-chunks/{chunk-45UGUKRX.js → chunk-242VQQM5.js} +1 -1
  4. package/dist/_browser-chunks/{chunk-JP7NCOJX.js → chunk-3LY4VQVK.js} +1 -1
  5. package/dist/_browser-chunks/{chunk-VYJQ7RU5.js → chunk-G4M6MXF4.js} +31 -27
  6. package/dist/_browser-chunks/{chunk-BRX2HXH7.js → chunk-IH6QJILI.js} +1 -1
  7. package/dist/_browser-chunks/{chunk-AS2HQEYC.js → chunk-IWQGIXJS.js} +1 -1
  8. package/dist/_browser-chunks/{chunk-3IAH5M2U.js → chunk-IYCKG66Y.js} +5 -5
  9. package/dist/_browser-chunks/{chunk-UD6FQLAF.js → chunk-JK6U3MQW.js} +3 -3
  10. package/dist/_browser-chunks/{chunk-FQ7SLVLR.js → chunk-JVRDBUUP.js} +20 -1
  11. package/dist/_browser-chunks/{chunk-GFLS4VP3.js → chunk-LCHBOIHN.js} +6 -6
  12. package/dist/_browser-chunks/{chunk-CHUV5WSW.js → chunk-LE2LTDW3.js} +1 -1
  13. package/dist/_browser-chunks/{chunk-IPA5A322.js → chunk-MEXTPDJG.js} +1 -1
  14. package/dist/_browser-chunks/{chunk-XJNX76GA.js → chunk-NQJGOFZV.js} +4 -4
  15. package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
  16. package/dist/_browser-chunks/{chunk-2XZMBGTA.js → chunk-POMIZRJL.js} +3 -3
  17. package/dist/_browser-chunks/{chunk-RP5RXKFU.js → chunk-Q5RYDXT3.js} +38 -30
  18. package/dist/_browser-chunks/{chunk-SS2NHR7W.js → chunk-RBABWY22.js} +18 -18
  19. package/dist/_browser-chunks/{chunk-AXG2BOBL.js → chunk-S6TK43XQ.js} +10 -10
  20. package/dist/_browser-chunks/{chunk-AIOS4NGK.js → chunk-SWJP5COI.js} +11 -11
  21. package/dist/_browser-chunks/{chunk-H6XK3RSC.js → chunk-UAYGIC3L.js} +6 -6
  22. package/dist/_browser-chunks/{chunk-YKE5S47A.js → chunk-V2VKKSMQ.js} +18 -18
  23. package/dist/_browser-chunks/{chunk-GFY5R5EY.js → chunk-V5NV5R37.js} +1 -1
  24. package/dist/_browser-chunks/chunk-VIJ7SQRO.js +568 -0
  25. package/dist/_browser-chunks/{chunk-3OXGAGBE.js → chunk-XLJZ7AOP.js} +14 -14
  26. package/dist/_browser-chunks/{chunk-P4F4UVXX.js → chunk-YKABRMAI.js} +15 -15
  27. package/dist/_browser-chunks/{chunk-WJYERY3R.js → chunk-ZCFV7BZB.js} +2 -2
  28. package/dist/_browser-chunks/{formatter-QJ4M4OGQ.js → formatter-EIJCOSYU.js} +2 -2
  29. package/dist/_browser-chunks/{syntaxhighlighter-IQDEPFLK.js → syntaxhighlighter-ED5Y7EFY.js} +119 -119
  30. package/dist/_node-chunks/{builder-manager-LXL5N6M5.js → builder-manager-IL56SHZF.js} +23 -22
  31. package/dist/_node-chunks/camelcase-P3NIWBZX.js +62 -0
  32. package/dist/_node-chunks/{chunk-SR5ZYD7K.js → chunk-BP66TAYC.js} +8 -8
  33. package/dist/_node-chunks/{chunk-R3WYNAT5.js → chunk-D3YJHXPC.js} +6 -6
  34. package/dist/_node-chunks/{chunk-5GNBLJKS.js → chunk-E2KSZELU.js} +8 -8
  35. package/dist/_node-chunks/{chunk-KXDU466E.js → chunk-EKU7ASGO.js} +31 -31
  36. package/dist/_node-chunks/chunk-GLYH3TSV.js +61 -0
  37. package/dist/_node-chunks/{chunk-GOOBGRAV.js → chunk-JXL37VS7.js} +34 -24
  38. package/dist/_node-chunks/{chunk-4BQMSZKI.js → chunk-KH2A547Y.js} +165 -191
  39. package/dist/_node-chunks/{chunk-77APSTTM.js → chunk-KP3IIE5P.js} +8 -9
  40. package/dist/_node-chunks/{chunk-5NWCBUGD.js → chunk-LZ5NNY6S.js} +6 -6
  41. package/dist/_node-chunks/{chunk-AJUO2ZU3.js → chunk-MLCI5FPI.js} +9 -9
  42. package/dist/_node-chunks/{chunk-CLNMK7MP.js → chunk-OVKHHS4W.js} +5434 -1625
  43. package/dist/_node-chunks/{chunk-ET4VMMZG.js → chunk-OZHIDIRL.js} +77 -16
  44. package/dist/_node-chunks/{chunk-TX77W2KY.js → chunk-POAHHCVK.js} +597 -593
  45. package/dist/_node-chunks/chunk-Q6PDB4Y6.js +126 -0
  46. package/dist/_node-chunks/{chunk-VFTNRF5X.js → chunk-QF3YWFYM.js} +17 -17
  47. package/dist/_node-chunks/{chunk-KMTK5W6O.js → chunk-RGJIQDLW.js} +48 -26
  48. package/dist/_node-chunks/{chunk-FTR6MHOX.js → chunk-SME7252C.js} +59 -147
  49. package/dist/_node-chunks/{chunk-LEDV47V2.js → chunk-TAETXAN6.js} +15 -15
  50. package/dist/_node-chunks/chunk-TPSZ4QDT.js +20 -0
  51. package/dist/_node-chunks/{chunk-PGFQADZC.js → chunk-WULYWBBT.js} +7 -7
  52. package/dist/_node-chunks/{chunk-JYMZJCZ7.js → chunk-XBDIQU4P.js} +62 -124
  53. package/dist/_node-chunks/chunk-XXOA6ULE.js +18 -0
  54. package/dist/_node-chunks/{chunk-ZI2RAI3I.js → chunk-YCQRVBE4.js} +26 -7
  55. package/dist/_node-chunks/{chunk-TP6ICLTL.js → chunk-YELE6V4D.js} +6 -6
  56. package/dist/_node-chunks/{chunk-GYZQMMTN.js → chunk-Z2CJCEHN.js} +9 -9
  57. package/dist/_node-chunks/{chunk-F7377GT2.js → chunk-Z2ETF7EI.js} +111 -38
  58. package/dist/_node-chunks/chunk-ZHSAQXJF.js +23 -0
  59. package/dist/_node-chunks/{dist-HGQ5R6JU.js → dist-5MXCD6KF.js} +10 -10
  60. package/dist/_node-chunks/{globby-5XJTXKUJ.js → globby-322GM5CY.js} +155 -164
  61. package/dist/_node-chunks/{lib-XNLTS2RI.js → lib-IXZT5UQX.js} +16 -16
  62. package/dist/_node-chunks/{mdx-N42X6CFJ-7WF3QWVO.js → mdx-N42X6CFJ-DBPHTSPN.js} +11 -11
  63. package/dist/_node-chunks/{p-limit-RBKYTJKF.js → p-limit-TLN4WCPA.js} +19 -15
  64. package/dist/babel/index.js +10 -10
  65. package/dist/bin/core.js +40 -34
  66. package/dist/bin/dispatcher.js +11 -11
  67. package/dist/bin/loader.js +14 -11
  68. package/dist/channels/index.js +3 -3
  69. package/dist/cli/index.d.ts +1330 -250
  70. package/dist/cli/index.js +18 -18
  71. package/dist/common/index.d.ts +1344 -289
  72. package/dist/common/index.js +22 -22
  73. package/dist/components/index.d.ts +9 -2
  74. package/dist/components/index.js +339 -317
  75. package/dist/core-events/index.d.ts +4 -2
  76. package/dist/core-events/index.js +4 -2
  77. package/dist/core-server/index.d.ts +71 -2
  78. package/dist/core-server/index.js +3381 -3529
  79. package/dist/core-server/presets/common-manager.css +2 -2
  80. package/dist/core-server/presets/common-manager.js +93 -65
  81. package/dist/core-server/presets/common-override-preset.js +9 -9
  82. package/dist/core-server/presets/common-preset.js +86 -118
  83. package/dist/csf/index.d.ts +41 -11
  84. package/dist/csf/index.js +46 -39
  85. package/dist/csf-tools/index.js +9 -9
  86. package/dist/docs-tools/index.js +5 -5
  87. package/dist/instrumenter/index.js +1 -1
  88. package/dist/manager/globals-runtime.js +9402 -7204
  89. package/dist/manager/runtime.js +186 -143
  90. package/dist/manager-api/index.js +34 -26
  91. package/dist/manager-errors.d.ts +24 -0
  92. package/dist/manager-errors.js +2 -2
  93. package/dist/mocking-utils/index.js +14 -14
  94. package/dist/node-logger/index.d.ts +1456 -111
  95. package/dist/node-logger/index.js +9 -9
  96. package/dist/preview/runtime.js +4608 -2436
  97. package/dist/preview-api/index.js +12 -12
  98. package/dist/preview-errors.d.ts +24 -0
  99. package/dist/preview-errors.js +3 -3
  100. package/dist/router/index.js +11 -11
  101. package/dist/server-errors.d.ts +59 -3
  102. package/dist/server-errors.js +22 -11
  103. package/dist/telemetry/index.d.ts +10 -3
  104. package/dist/telemetry/index.js +27 -25
  105. package/dist/test/index.js +3237 -1653
  106. package/dist/theming/create.js +3 -3
  107. package/dist/theming/index.d.ts +5 -5
  108. package/dist/theming/index.js +38 -38
  109. package/dist/types/index.d.ts +12 -6
  110. package/dist/viewport/index.d.ts +3 -3
  111. package/package.json +27 -33
  112. package/dist/_browser-chunks/chunk-EZSQOHRI.js +0 -18
  113. package/dist/_browser-chunks/chunk-QKODTO7K.js +0 -7
  114. package/dist/_node-chunks/camelcase-64II7H4U.js +0 -37
  115. package/dist/_node-chunks/chunk-4EZYJUAC.js +0 -70
  116. package/dist/_node-chunks/chunk-COQ27OZ3.js +0 -61
  117. package/dist/_node-chunks/chunk-MC2R4DSD.js +0 -20
  118. package/dist/_node-chunks/chunk-NEENMS4J.js +0 -18
  119. package/dist/_node-chunks/chunk-VR5LMO3F.js +0 -72
  120. package/dist/_node-chunks/chunk-XEPVDCRL.js +0 -23
@@ -1,43 +1,44 @@
1
- import CJS_COMPAT_NODE_URL_2297kyafub from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_2297kyafub from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_2297kyafub from "node:module";
1
+ import CJS_COMPAT_NODE_URL_1qalasm8z9n from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_1qalasm8z9n from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_1qalasm8z9n from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_2297kyafub.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_2297kyafub.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_2297kyafub.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_1qalasm8z9n.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_1qalasm8z9n.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_1qalasm8z9n.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
  any,
14
+ detectIndent,
14
15
  invariant,
15
16
  up2 as up
16
- } from "./chunk-4EZYJUAC.js";
17
+ } from "./chunk-Q6PDB4Y6.js";
17
18
  import {
18
19
  resolvePackageDir
19
- } from "./chunk-SR5ZYD7K.js";
20
+ } from "./chunk-BP66TAYC.js";
20
21
  import {
21
22
  require_dist
22
- } from "./chunk-AJUO2ZU3.js";
23
+ } from "./chunk-MLCI5FPI.js";
23
24
  import {
24
25
  babelParse,
25
26
  recast,
26
27
  traverse,
27
28
  types
28
- } from "./chunk-TX77W2KY.js";
29
+ } from "./chunk-POAHHCVK.js";
29
30
  import {
30
31
  require_picocolors
31
- } from "./chunk-GYZQMMTN.js";
32
+ } from "./chunk-Z2CJCEHN.js";
32
33
  import {
33
34
  __commonJS,
34
35
  __require,
35
36
  __toESM
36
- } from "./chunk-5NWCBUGD.js";
37
+ } from "./chunk-LZ5NNY6S.js";
37
38
 
38
- // ../node_modules/esprima/dist/esprima.js
39
+ // ../../node_modules/esprima/dist/esprima.js
39
40
  var require_esprima = __commonJS({
40
- "../node_modules/esprima/dist/esprima.js"(exports, module) {
41
+ "../../node_modules/esprima/dist/esprima.js"(exports, module) {
41
42
  (function(root, factory) {
42
43
  typeof exports == "object" && typeof module == "object" ? module.exports = factory() : typeof define == "function" && define.amd ? define([], factory) : typeof exports == "object" ? exports.esprima = factory() : root.esprima = factory();
43
44
  })(exports, function() {
@@ -3846,9 +3847,9 @@ var require_esprima = __commonJS({
3846
3847
  }
3847
3848
  });
3848
3849
 
3849
- // ../node_modules/core-util-is/lib/util.js
3850
+ // ../../node_modules/core-util-is/lib/util.js
3850
3851
  var require_util = __commonJS({
3851
- "../node_modules/core-util-is/lib/util.js"(exports) {
3852
+ "../../node_modules/core-util-is/lib/util.js"(exports) {
3852
3853
  function isArray(arg) {
3853
3854
  return Array.isArray ? Array.isArray(arg) : objectToString(arg) === "[object Array]";
3854
3855
  }
@@ -3913,9 +3914,9 @@ var require_util = __commonJS({
3913
3914
  }
3914
3915
  });
3915
3916
 
3916
- // ../node_modules/array-timsort/src/index.js
3917
+ // ../../node_modules/array-timsort/src/index.js
3917
3918
  var require_src = __commonJS({
3918
- "../node_modules/array-timsort/src/index.js"(exports, module) {
3919
+ "../../node_modules/array-timsort/src/index.js"(exports, module) {
3919
3920
  var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9], results, log10 = (x) => x < 1e5 ? x < 100 ? x < 10 ? 0 : 1 : x < 1e4 ? x < 1e3 ? 2 : 3 : 4 : x < 1e7 ? x < 1e6 ? 5 : 6 : x < 1e9 ? x < 1e8 ? 7 : 8 : 9;
3920
3921
  function alphabeticalCompare(a, b) {
3921
3922
  if (a === b)
@@ -4303,9 +4304,9 @@ var require_src = __commonJS({
4303
4304
  }
4304
4305
  });
4305
4306
 
4306
- // ../node_modules/comment-json/src/common.js
4307
+ // ../../node_modules/comment-json/src/common.js
4307
4308
  var require_common = __commonJS({
4308
- "../node_modules/comment-json/src/common.js"(exports, module) {
4309
+ "../../node_modules/comment-json/src/common.js"(exports, module) {
4309
4310
  var {
4310
4311
  isObject,
4311
4312
  isArray,
@@ -4401,9 +4402,9 @@ var require_common = __commonJS({
4401
4402
  }
4402
4403
  });
4403
4404
 
4404
- // ../node_modules/comment-json/src/array.js
4405
+ // ../../node_modules/comment-json/src/array.js
4405
4406
  var require_array = __commonJS({
4406
- "../node_modules/comment-json/src/array.js"(exports, module) {
4407
+ "../../node_modules/comment-json/src/array.js"(exports, module) {
4407
4408
  var { isArray } = require_util(), { sort } = require_src(), {
4408
4409
  SYMBOL_PREFIXES,
4409
4410
  UNDEFINED,
@@ -4502,9 +4503,9 @@ var require_array = __commonJS({
4502
4503
  }
4503
4504
  });
4504
4505
 
4505
- // ../node_modules/comment-json/src/parse.js
4506
+ // ../../node_modules/comment-json/src/parse.js
4506
4507
  var require_parse = __commonJS({
4507
- "../node_modules/comment-json/src/parse.js"(exports, module) {
4508
+ "../../node_modules/comment-json/src/parse.js"(exports, module) {
4508
4509
  var esprima = require_esprima(), {
4509
4510
  CommentArray
4510
4511
  } = require_array(), {
@@ -4643,9 +4644,9 @@ var require_parse = __commonJS({
4643
4644
  }
4644
4645
  });
4645
4646
 
4646
- // ../node_modules/comment-json/src/stringify.js
4647
+ // ../../node_modules/comment-json/src/stringify.js
4647
4648
  var require_stringify = __commonJS({
4648
- "../node_modules/comment-json/src/stringify.js"(exports, module) {
4649
+ "../../node_modules/comment-json/src/stringify.js"(exports, module) {
4649
4650
  var {
4650
4651
  isArray,
4651
4652
  isObject,
@@ -4775,9 +4776,9 @@ var require_stringify = __commonJS({
4775
4776
  }
4776
4777
  });
4777
4778
 
4778
- // ../node_modules/comment-json/src/index.js
4779
+ // ../../node_modules/comment-json/src/index.js
4779
4780
  var require_src2 = __commonJS({
4780
- "../node_modules/comment-json/src/index.js"(exports, module) {
4781
+ "../../node_modules/comment-json/src/index.js"(exports, module) {
4781
4782
  var { parse, tokenize } = require_parse(), stringify = require_stringify(), { CommentArray } = require_array(), {
4782
4783
  PREFIX_BEFORE,
4783
4784
  PREFIX_AFTER_PROP,
@@ -4820,7 +4821,7 @@ import {
4820
4821
  import { Feature } from "storybook/internal/types";
4821
4822
  import { coerce, satisfies } from "semver";
4822
4823
 
4823
- // ../node_modules/strip-json-comments/index.js
4824
+ // ../../node_modules/strip-json-comments/index.js
4824
4825
  var singleComment = Symbol("singleComment"), multiComment = Symbol("multiComment"), stripWithoutWhitespace = () => "", stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/[^ \t\r\n]/g, " "), isEscaped = (jsonString, quotePosition) => {
4825
4826
  let index = quotePosition - 1, backslashCount = 0;
4826
4827
  for (; jsonString[index] === "\\"; )
@@ -4861,10 +4862,14 @@ import { join as join2 } from "node:path";
4861
4862
  import { Readable as Readable2 } from "node:stream";
4862
4863
  import { pipeline as pipeline2 } from "node:stream/promises";
4863
4864
  import { createGunzip } from "node:zlib";
4864
- import { temporaryDirectory, versions } from "storybook/internal/common";
4865
- import { SupportedFramework } from "storybook/internal/types";
4865
+ import {
4866
+ frameworkPackages,
4867
+ rendererPackages,
4868
+ temporaryDirectory,
4869
+ versions
4870
+ } from "storybook/internal/common";
4866
4871
 
4867
- // ../node_modules/get-npm-tarball-url/lib/index.mjs
4872
+ // ../../node_modules/get-npm-tarball-url/lib/index.mjs
4868
4873
  function src_default(pkgName, pkgVersion, opts) {
4869
4874
  let registry;
4870
4875
  opts?.registry ? registry = opts.registry.endsWith("/") ? opts.registry : `${opts.registry}/` : registry = "https://registry.npmjs.org/";
@@ -4879,7 +4884,7 @@ function getScopelessName(name) {
4879
4884
  return name[0] !== "@" ? name : name.split("/")[1];
4880
4885
  }
4881
4886
 
4882
- // ../node_modules/modern-tar/dist/unpacker-BKKRRs7i.js
4887
+ // ../../node_modules/modern-tar/dist/unpacker-BKKRRs7i.js
4883
4888
  var FLAGTYPE = {
4884
4889
  0: "file",
4885
4890
  1: "link",
@@ -5168,7 +5173,7 @@ function isZeroBlock(block) {
5168
5173
  return !0;
5169
5174
  }
5170
5175
 
5171
- // ../node_modules/modern-tar/dist/fs/index.js
5176
+ // ../../node_modules/modern-tar/dist/fs/index.js
5172
5177
  import * as fs from "node:fs/promises";
5173
5178
  import { cpus } from "node:os";
5174
5179
  import * as path from "node:path";
@@ -5373,21 +5378,7 @@ function createFSHandler(directoryPath, options) {
5373
5378
  }
5374
5379
 
5375
5380
  // src/cli/dirs.ts
5376
- var externalFrameworks = [
5377
- { name: SupportedFramework.QWIK, packageName: "storybook-framework-qwik" },
5378
- {
5379
- name: SupportedFramework.SOLID,
5380
- packageName: "storybook-solidjs-vite",
5381
- frameworks: ["storybook-solidjs-vite"],
5382
- renderer: "storybook-solidjs-vite"
5383
- },
5384
- {
5385
- name: SupportedFramework.NUXT,
5386
- packageName: "@storybook-vue/nuxt",
5387
- frameworks: ["@storybook-vue/nuxt"],
5388
- renderer: "@storybook/vue3"
5389
- }
5390
- ], resolveUsingBranchInstall = async (packageManager, request) => {
5381
+ var resolveUsingBranchInstall = async (packageManager, request) => {
5391
5382
  let tempDirectory = await temporaryDirectory(), version = versions[request] || await packageManager.latestVersion(request), url = (src_default.default || src_default)(request, version, {
5392
5383
  registry: await packageManager.getRegistryURL()
5393
5384
  }), response = await fetch(url);
@@ -5400,14 +5391,19 @@ var externalFrameworks = [
5400
5391
  ), join2(tempDirectory, "package");
5401
5392
  };
5402
5393
  async function getRendererDir(packageManager, renderer) {
5403
- let externalFramework = externalFrameworks.find((framework) => framework.name === renderer), frameworkPackageName = externalFramework?.packageName || externalFramework?.renderer || `@storybook/${renderer}`, packageJsonPath = join2(frameworkPackageName, "package.json"), errors = [];
5394
+ let [externalFramework] = Object.entries({ ...frameworkPackages, ...rendererPackages }).find(
5395
+ ([key, value]) => value === renderer
5396
+ ) ?? [];
5397
+ if (!externalFramework)
5398
+ return null;
5399
+ let packageJsonPath = join2(externalFramework, "package.json"), errors = [];
5404
5400
  try {
5405
- return resolvePackageDir(frameworkPackageName, process.cwd());
5401
+ return resolvePackageDir(externalFramework, process.cwd());
5406
5402
  } catch (e) {
5407
5403
  invariant(e instanceof Error), errors.push(e);
5408
5404
  }
5409
5405
  try {
5410
- return await resolveUsingBranchInstall(packageManager, frameworkPackageName);
5406
+ return await resolveUsingBranchInstall(packageManager, externalFramework);
5411
5407
  } catch (e) {
5412
5408
  invariant(e instanceof Error), errors.push(e);
5413
5409
  }
@@ -5485,7 +5481,10 @@ async function copyTemplateFiles({
5485
5481
  [SupportedLanguage.JAVASCRIPT]: "js",
5486
5482
  [SupportedLanguage.TYPESCRIPT]: "ts"
5487
5483
  }, templatePath = async () => {
5488
- let baseDir = await getRendererDir(packageManager, templateLocation), assetsDir = join3(baseDir, "template", "cli"), assetsLanguage = join3(assetsDir, languageFolderMapping[language]), assetsJS = join3(assetsDir, languageFolderMapping[SupportedLanguage.JAVASCRIPT]), assetsTS = join3(assetsDir, languageFolderMapping.typescript);
5484
+ let baseDir = await getRendererDir(packageManager, templateLocation);
5485
+ if (!baseDir)
5486
+ return null;
5487
+ let assetsDir = join3(baseDir, "template", "cli"), assetsLanguage = join3(assetsDir, languageFolderMapping[language]), assetsJS = join3(assetsDir, languageFolderMapping[SupportedLanguage.JAVASCRIPT]), assetsTS = join3(assetsDir, languageFolderMapping.typescript);
5489
5488
  if (existsSync(assetsLanguage))
5490
5489
  return assetsLanguage;
5491
5490
  if (existsSync(assetsTS))
@@ -5496,7 +5495,9 @@ async function copyTemplateFiles({
5496
5495
  return assetsDir;
5497
5496
  throw new Error(`Unsupported renderer: ${templateLocation} (${baseDir})`);
5498
5497
  }, destinationPath = destination ?? await cliStoriesTargetPath(), filter = (file) => features.has(Feature.DOCS) || !file.endsWith(".mdx");
5499
- if (commonAssetsDir && await cp(commonAssetsDir, destinationPath, { recursive: !0, filter }), await cp(await templatePath(), destinationPath, { recursive: !0, filter }), commonAssetsDir && features.has(Feature.DOCS)) {
5498
+ commonAssetsDir && await cp(commonAssetsDir, destinationPath, { recursive: !0, filter });
5499
+ let tmpPath = await templatePath();
5500
+ if (tmpPath && await cp(tmpPath, destinationPath, { recursive: !0, filter }), commonAssetsDir && features.has(Feature.DOCS)) {
5500
5501
  let rendererType = frameworkToRenderer[templateLocation] || "react";
5501
5502
  await adjustTemplate(join3(destinationPath, "Configure.mdx"), { renderer: rendererType });
5502
5503
  }
@@ -5594,7 +5595,7 @@ var ANGULAR_JSON_PATH = "angular.json", AngularJSON = class {
5594
5595
  };
5595
5596
 
5596
5597
  // src/cli/projectTypes.ts
5597
- var ProjectType = /* @__PURE__ */ ((ProjectType2) => (ProjectType2.ANGULAR = "angular", ProjectType2.EMBER = "ember", ProjectType2.HTML = "html", ProjectType2.NEXTJS = "nextjs", ProjectType2.NUXT = "nuxt", ProjectType2.NX = "nx", ProjectType2.PREACT = "preact", ProjectType2.QWIK = "qwik", ProjectType2.REACT = "react", ProjectType2.REACT_NATIVE = "react_native", ProjectType2.REACT_NATIVE_AND_RNW = "react_native_and_rnw", ProjectType2.REACT_NATIVE_WEB = "react_native_web", ProjectType2.REACT_PROJECT = "react_project", ProjectType2.REACT_SCRIPTS = "react_scripts", ProjectType2.SERVER = "server", ProjectType2.SOLID = "solid", ProjectType2.SVELTE = "svelte", ProjectType2.SVELTEKIT = "sveltekit", ProjectType2.UNDETECTED = "undetected", ProjectType2.UNSUPPORTED = "unsupported", ProjectType2.VUE3 = "vue3", ProjectType2.WEB_COMPONENTS = "web_components", ProjectType2))(ProjectType || {});
5598
+ var ProjectType = /* @__PURE__ */ ((ProjectType2) => (ProjectType2.ANGULAR = "angular", ProjectType2.EMBER = "ember", ProjectType2.HTML = "html", ProjectType2.NEXTJS = "nextjs", ProjectType2.NUXT = "nuxt", ProjectType2.NX = "nx", ProjectType2.PREACT = "preact", ProjectType2.QWIK = "qwik", ProjectType2.REACT = "react", ProjectType2.REACT_NATIVE = "react_native", ProjectType2.REACT_NATIVE_AND_RNW = "react_native_and_rnw", ProjectType2.REACT_NATIVE_WEB = "react_native_web", ProjectType2.REACT_SCRIPTS = "react_scripts", ProjectType2.SERVER = "server", ProjectType2.SOLID = "solid", ProjectType2.SVELTE = "svelte", ProjectType2.SVELTEKIT = "sveltekit", ProjectType2.UNDETECTED = "undetected", ProjectType2.UNSUPPORTED = "unsupported", ProjectType2.VUE3 = "vue3", ProjectType2.WEB_COMPONENTS = "web_components", ProjectType2))(ProjectType || {});
5598
5599
 
5599
5600
  // src/cli/eslintPlugin.ts
5600
5601
  var import_comment_json = __toESM(require_src2(), 1);
@@ -5602,70 +5603,6 @@ import { readFile as readFile3, writeFile as writeFile2 } from "node:fs/promises
5602
5603
  import { getProjectRoot } from "storybook/internal/common";
5603
5604
  import { readConfig, writeConfig } from "storybook/internal/csf-tools";
5604
5605
  import { logger as logger2, prompt as prompt2 } from "storybook/internal/node-logger";
5605
-
5606
- // ../node_modules/detect-indent/index.js
5607
- var INDENT_REGEX = /^(?:( )+|\t+)/, INDENT_TYPE_SPACE = "space";
5608
- function shouldIgnoreSingleSpace(ignoreSingleSpaces, indentType, value) {
5609
- return ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && value === 1;
5610
- }
5611
- function makeIndentsMap(string, ignoreSingleSpaces) {
5612
- let indents = /* @__PURE__ */ new Map(), previousSize = 0, previousIndentType, key;
5613
- for (let line of string.split(/\n/g)) {
5614
- if (!line)
5615
- continue;
5616
- let matches = line.match(INDENT_REGEX);
5617
- if (matches === null)
5618
- previousSize = 0, previousIndentType = "";
5619
- else {
5620
- let indent = matches[0].length, indentType = matches[1] ? INDENT_TYPE_SPACE : "tab";
5621
- if (shouldIgnoreSingleSpace(ignoreSingleSpaces, indentType, indent))
5622
- continue;
5623
- indentType !== previousIndentType && (previousSize = 0), previousIndentType = indentType;
5624
- let use = 1, weight = 0, indentDifference = indent - previousSize;
5625
- if (previousSize = indent, indentDifference === 0)
5626
- use = 0, weight = 1;
5627
- else {
5628
- let absoluteIndentDifference = Math.abs(indentDifference);
5629
- if (shouldIgnoreSingleSpace(ignoreSingleSpaces, indentType, absoluteIndentDifference))
5630
- continue;
5631
- key = encodeIndentsKey(indentType, absoluteIndentDifference);
5632
- }
5633
- let entry = indents.get(key);
5634
- indents.set(key, entry === void 0 ? [1, 0] : [entry[0] + use, entry[1] + weight]);
5635
- }
5636
- }
5637
- return indents;
5638
- }
5639
- function encodeIndentsKey(indentType, indentAmount) {
5640
- return (indentType === INDENT_TYPE_SPACE ? "s" : "t") + String(indentAmount);
5641
- }
5642
- function decodeIndentsKey(indentsKey) {
5643
- let type = indentsKey[0] === "s" ? INDENT_TYPE_SPACE : "tab", amount = Number(indentsKey.slice(1));
5644
- return { type, amount };
5645
- }
5646
- function getMostUsedKey(indents) {
5647
- let result, maxUsed = 0, maxWeight = 0;
5648
- for (let [key, [usedCount, weight]] of indents)
5649
- (usedCount > maxUsed || usedCount === maxUsed && weight > maxWeight) && (maxUsed = usedCount, maxWeight = weight, result = key);
5650
- return result;
5651
- }
5652
- function makeIndentString(type, amount) {
5653
- return (type === INDENT_TYPE_SPACE ? " " : " ").repeat(amount);
5654
- }
5655
- function detectIndent(string) {
5656
- if (typeof string != "string")
5657
- throw new TypeError("Expected a string");
5658
- let indents = makeIndentsMap(string, !0);
5659
- indents.size === 0 && (indents = makeIndentsMap(string, !1));
5660
- let keyOfMostUsedIndent = getMostUsedKey(indents), type, amount = 0, indent = "";
5661
- return keyOfMostUsedIndent !== void 0 && ({ type, amount } = decodeIndentsKey(keyOfMostUsedIndent), indent = makeIndentString(type, amount)), {
5662
- amount,
5663
- type,
5664
- indent
5665
- };
5666
- }
5667
-
5668
- // src/cli/eslintPlugin.ts
5669
5606
  var import_picocolors2 = __toESM(require_picocolors(), 1), import_ts_dedent = __toESM(require_dist(), 1);
5670
5607
  var SUPPORTED_ESLINT_EXTENSIONS = ["ts", "mts", "cts", "mjs", "js", "cjs", "json"], UNSUPPORTED_ESLINT_EXTENSIONS = ["yaml", "yml"], findEslintFile = (instanceDir) => {
5671
5608
  let filePrefixes = ["eslint.config", ".eslintrc"];
@@ -5793,7 +5730,7 @@ async function configureEslintPlugin({
5793
5730
  var suggestESLintPlugin = async () => await prompt2.confirm({
5794
5731
  message: import_ts_dedent.dedent`
5795
5732
  We have detected that you're using ESLint. Storybook provides a plugin that gives the best experience with Storybook and helps follow best practices: ${import_picocolors2.default.yellow(
5796
- "https://storybook.js.org/docs/9/configure/integration/eslint-plugin"
5733
+ "https://storybook.js.org/docs/configure/integration/eslint-plugin"
5797
5734
  )}
5798
5735
 
5799
5736
  Would you like to install it?
@@ -5818,6 +5755,7 @@ var SUPPORTED_FRAMEWORKS = [
5818
5755
  "preact-vite" /* PREACT_VITE */,
5819
5756
  "react-native-web-vite" /* REACT_NATIVE_WEB_VITE */,
5820
5757
  "react-vite" /* REACT_VITE */,
5758
+ "solid" /* SOLID */,
5821
5759
  "svelte-vite" /* SVELTE_VITE */,
5822
5760
  "sveltekit" /* SVELTEKIT */,
5823
5761
  "vue3-vite" /* VUE3_VITE */,
@@ -5870,7 +5808,7 @@ var AddonVitestService = class {
5870
5808
  * @returns Array of error messages if installation fails
5871
5809
  */
5872
5810
  async installPlaywright(options = {}) {
5873
- let errors = [], playwrightCommand = ["playwright", "install", "chromium", "--with-deps"], playwrightCommandString = this.packageManager.getPackageCommand(playwrightCommand);
5811
+ let errors = [], playwrightCommand = ["playwright", "install", "chromium", "--with-deps"], playwrightCommandString = this.packageManager.getPackageCommand(playwrightCommand), result;
5874
5812
  try {
5875
5813
  (options.yes ? !0 : await (async () => (logger3.log(import_ts_dedent2.dedent`
5876
5814
  Playwright browser binaries are necessary for @storybook/addon-vitest. The download can take some time. If you don't want to wait, you can skip the installation and run the following command manually later:
@@ -5891,11 +5829,11 @@ var AddonVitestService = class {
5891
5829
  success: "Playwright browser binaries installed successfully",
5892
5830
  abortable: !0
5893
5831
  }
5894
- ) : logger3.warn("Playwright installation skipped");
5832
+ ) ? result = "aborted" : result = "installed" : (logger3.warn("Playwright installation skipped"), result = "skipped");
5895
5833
  } catch (e) {
5896
- ErrorCollector.addError(e), e instanceof Error ? errors.push(e.stack ?? e.message) : errors.push(String(e));
5834
+ result = "failed", ErrorCollector.addError(e), e instanceof Error ? errors.push(e.stack ?? e.message) : errors.push(String(e));
5897
5835
  }
5898
- return { errors };
5836
+ return { errors, result };
5899
5837
  }
5900
5838
  /**
5901
5839
  * Validate full compatibility for @storybook/addon-vitest
@@ -0,0 +1,18 @@
1
+ import CJS_COMPAT_NODE_URL_1qalasm8z9n from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_1qalasm8z9n from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_1qalasm8z9n from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_1qalasm8z9n.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_1qalasm8z9n.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_1qalasm8z9n.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // package.json
14
+ var version = "10.2.0-alpha.10";
15
+
16
+ export {
17
+ version
18
+ };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_2297kyafub from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_2297kyafub from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_2297kyafub from "node:module";
1
+ import CJS_COMPAT_NODE_URL_1qalasm8z9n from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_1qalasm8z9n from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_1qalasm8z9n from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_2297kyafub.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_2297kyafub.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_2297kyafub.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_1qalasm8z9n.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_1qalasm8z9n.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_1qalasm8z9n.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -43,7 +43,26 @@ var StorybookError = class _StorybookError extends Error {
43
43
  * user.
44
44
  */
45
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;
46
+ /**
47
+ * A collection of sub errors which relate to a parent error.
48
+ *
49
+ * Sub-errors are used to represent multiple related errors that occurred together. When a
50
+ * StorybookError with sub-errors is sent to telemetry, both the parent error and each sub-error
51
+ * are sent as separate telemetry events. This allows for better error tracking and debugging.
52
+ *
53
+ * @example
54
+ *
55
+ * ```ts
56
+ * const error1 = new SomeError();
57
+ * const error2 = new AnotherError();
58
+ * const parentError = new ParentError({
59
+ * // ... other props
60
+ * subErrors: [error1, error2],
61
+ * });
62
+ * ```
63
+ */
64
+ this.subErrors = [];
65
+ this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name, this.subErrors = props.subErrors ?? [];
47
66
  }
48
67
  get fullErrorCode() {
49
68
  return parseErrorCode({ code: this.code, category: this.category });
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_2297kyafub from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_2297kyafub from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_2297kyafub from "node:module";
1
+ import CJS_COMPAT_NODE_URL_1qalasm8z9n from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_1qalasm8z9n from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_1qalasm8z9n from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_2297kyafub.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_2297kyafub.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_2297kyafub.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_1qalasm8z9n.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_1qalasm8z9n.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_1qalasm8z9n.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 CJS_COMPAT_NODE_URL_2297kyafub from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_2297kyafub from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_2297kyafub from "node:module";
1
+ import CJS_COMPAT_NODE_URL_1qalasm8z9n from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_1qalasm8z9n from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_1qalasm8z9n from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_2297kyafub.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_2297kyafub.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_2297kyafub.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_1qalasm8z9n.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_1qalasm8z9n.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_1qalasm8z9n.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-5NWCBUGD.js";
14
+ } from "./chunk-LZ5NNY6S.js";
15
15
 
16
- // ../node_modules/picocolors/picocolors.js
16
+ // ../../node_modules/picocolors/picocolors.js
17
17
  var require_picocolors = __commonJS({
18
- "../node_modules/picocolors/picocolors.js"(exports, module) {
18
+ "../../node_modules/picocolors/picocolors.js"(exports, module) {
19
19
  var p = process || {}, argv = p.argv || [], env = p.env || {}, isColorSupported = !(env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI), formatter = (open, close, replace = open) => (input) => {
20
20
  let string = "" + input, index = string.indexOf(close, open.length);
21
21
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;