storybook 10.1.0-alpha.1 → 10.1.0-alpha.11

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 (202) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  5. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  6. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  7. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  8. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  9. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-74YHFU5B.js} +44 -109
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/chunk-BE2DAXKJ.js +2966 -0
  15. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  16. package/dist/_browser-chunks/chunk-EBHB6RPS.js +61 -0
  17. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  18. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  19. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  20. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/chunk-L4RMQ7D7.js +223 -0
  26. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  27. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  28. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  29. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  30. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  31. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  32. package/dist/_browser-chunks/chunk-WXP2XJ3O.js +950 -0
  33. package/dist/_browser-chunks/chunk-X3DUQ5RA.js +47 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-DK2ODWXH.js → syntaxhighlighter-WKBQ5RC7.js} +707 -1851
  39. package/dist/_node-chunks/{builder-manager-6UBDPV7P.js → builder-manager-PMPHOSM2.js} +495 -1013
  40. package/dist/_node-chunks/camelcase-K3IOOFQW.js +18 -0
  41. package/dist/_node-chunks/{chunk-QNUGJO6L.js → chunk-32NE3UE3.js} +15 -24
  42. package/dist/_node-chunks/chunk-4GZCFQFG.js +58 -0
  43. package/dist/_node-chunks/chunk-5QK5MSOI.js +943 -0
  44. package/dist/_node-chunks/{chunk-3FPF5Y2F.js → chunk-6ZOLETQK.js} +8 -10
  45. package/dist/_node-chunks/chunk-7I22Y76Z.js +1047 -0
  46. package/dist/_node-chunks/chunk-AKTRSR3O.js +72 -0
  47. package/dist/_node-chunks/chunk-BBOP3XCK.js +119 -0
  48. package/dist/_node-chunks/chunk-C2GQVDWI.js +34 -0
  49. package/dist/_node-chunks/{chunk-SCTKVDWR.js → chunk-GG2WQZSG.js} +4619 -7350
  50. package/dist/_node-chunks/chunk-GQJOWVVR.js +3214 -0
  51. package/dist/_node-chunks/chunk-JCRM2YVK.js +3009 -0
  52. package/dist/_node-chunks/chunk-KK4AT5F3.js +1029 -0
  53. package/dist/_node-chunks/chunk-L7MYXJUM.js +1114 -0
  54. package/dist/_node-chunks/{chunk-LAU7VVPC.js → chunk-LCZO45L7.js} +469 -983
  55. package/dist/_node-chunks/chunk-LR3QITDI.js +209 -0
  56. package/dist/_node-chunks/chunk-LXG4DK35.js +3171 -0
  57. package/dist/_node-chunks/chunk-MJ3WOS6F.js +37 -0
  58. package/dist/_node-chunks/chunk-PHOZWZZO.js +61 -0
  59. package/dist/_node-chunks/chunk-QECOQWRJ.js +936 -0
  60. package/dist/_node-chunks/chunk-QH4V5YDB.js +20 -0
  61. package/dist/_node-chunks/chunk-R6HWGZWD.js +26 -0
  62. package/dist/_node-chunks/chunk-SPQXMU2Q.js +759 -0
  63. package/dist/_node-chunks/chunk-TXZY6V6O.js +1564 -0
  64. package/dist/_node-chunks/chunk-UGDPX5LE.js +756 -0
  65. package/dist/_node-chunks/chunk-UY26MQLT.js +603 -0
  66. package/dist/_node-chunks/chunk-WK3EMYK6.js +61 -0
  67. package/dist/_node-chunks/{chunk-CJHAP7SE.js → chunk-WLHMN7AP.js} +292 -688
  68. package/dist/_node-chunks/chunk-XGVLB4UJ.js +54 -0
  69. package/dist/_node-chunks/{chunk-J7N7PD5Q.js → chunk-YHRFI6BE.js} +87 -227
  70. package/dist/_node-chunks/chunk-YK4KVMFW.js +18 -0
  71. package/dist/_node-chunks/chunk-ZZALGOA6.js +4523 -0
  72. package/dist/_node-chunks/chunk-ZZPBSYA5.js +301 -0
  73. package/dist/_node-chunks/chunk-ZZSRFAC6.js +45571 -0
  74. package/dist/_node-chunks/dist-4DWOCZUD.js +121 -0
  75. package/dist/_node-chunks/globby-AAARUKEU.js +3452 -0
  76. package/dist/_node-chunks/lib-HEUKGL62.js +366 -0
  77. package/dist/_node-chunks/mdx-N42X6CFJ-DCVRPS6N.js +14329 -0
  78. package/dist/_node-chunks/p-limit-F5ZKJ6WZ.js +116 -0
  79. package/dist/_node-chunks/plugin-7YY7JXCH.js +123 -0
  80. package/dist/_node-chunks/{plugin-HJLCLGNT.js → plugin-SZP3CW6W.js} +36 -56
  81. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-TGKNDPO6.js +46623 -0
  82. package/dist/_node-chunks/webpack-mock-plugin-LNTZZFBE.js +92 -0
  83. package/dist/actions/decorator.js +21 -42
  84. package/dist/actions/index.js +3 -3
  85. package/dist/babel/index.d.ts +671 -335
  86. package/dist/babel/index.js +11 -11
  87. package/dist/bin/core.js +592 -1546
  88. package/dist/bin/dispatcher.js +26 -37
  89. package/dist/bin/loader.js +23 -34
  90. package/dist/channels/index.js +98 -234
  91. package/dist/cli/index.js +1966 -5347
  92. package/dist/client-logger/index.js +31 -61
  93. package/dist/common/index.d.ts +210 -3
  94. package/dist/common/index.js +28 -20
  95. package/dist/components/index.d.ts +472 -280
  96. package/dist/components/index.js +15992 -75
  97. package/dist/core-events/index.js +2 -66
  98. package/dist/core-server/index.js +3837 -7191
  99. package/dist/core-server/presets/common-manager.css +2 -2
  100. package/dist/core-server/presets/common-manager.js +2511 -5219
  101. package/dist/core-server/presets/common-override-preset.js +31 -60
  102. package/dist/core-server/presets/common-preset.js +434 -924
  103. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +15 -19
  104. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +12 -17
  105. package/dist/csf/index.js +534 -1172
  106. package/dist/csf-tools/index.d.ts +15 -4
  107. package/dist/csf-tools/index.js +9 -9
  108. package/dist/docs-tools/index.js +6 -6
  109. package/dist/highlight/index.js +2 -2
  110. package/dist/instrumenter/index.js +199 -415
  111. package/dist/manager/globals-runtime.js +47968 -56484
  112. package/dist/manager/globals.js +2 -3
  113. package/dist/manager/runtime.js +4901 -10318
  114. package/dist/manager-api/index.d.ts +11 -3
  115. package/dist/manager-api/index.js +1250 -2397
  116. package/dist/manager-errors.d.ts +3 -0
  117. package/dist/manager-errors.js +3 -3
  118. package/dist/node-logger/index.d.ts +1 -1
  119. package/dist/node-logger/index.js +1270 -2593
  120. package/dist/preview/globals.js +2 -3
  121. package/dist/preview/runtime.js +10767 -22386
  122. package/dist/preview-api/index.d.ts +67 -68
  123. package/dist/preview-api/index.js +15 -15
  124. package/dist/preview-errors.d.ts +3 -0
  125. package/dist/preview-errors.js +4 -4
  126. package/dist/router/index.js +347 -899
  127. package/dist/server-errors.d.ts +3 -0
  128. package/dist/server-errors.js +10 -10
  129. package/dist/telemetry/index.js +24 -24
  130. package/dist/test/index.js +6129 -11914
  131. package/dist/theming/create.d.ts +4 -2
  132. package/dist/theming/create.js +4 -4
  133. package/dist/theming/index.d.ts +3397 -2628
  134. package/dist/theming/index.js +502 -1091
  135. package/dist/types/index.d.ts +50 -5
  136. package/dist/types/index.js +2 -11
  137. package/dist/viewport/index.js +3 -3
  138. package/package.json +17 -9
  139. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  140. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  141. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  142. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  143. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  144. package/dist/_browser-chunks/chunk-C4XOKMDU.js +0 -270
  145. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  146. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  147. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  148. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  149. package/dist/_browser-chunks/chunk-I74EUU5O.js +0 -5809
  150. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  151. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  152. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  153. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  154. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  155. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  156. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  157. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  158. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  159. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  160. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  161. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  162. package/dist/_browser-chunks/chunk-W4QKLQSC.js +0 -4182
  163. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  164. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  165. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  166. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  167. package/dist/_node-chunks/camelcase-WKJOVNPM.js +0 -18
  168. package/dist/_node-chunks/chunk-2RIKHYCS.js +0 -304
  169. package/dist/_node-chunks/chunk-3JCSHYSU.js +0 -1657
  170. package/dist/_node-chunks/chunk-4GE6Q4MX.js +0 -1531
  171. package/dist/_node-chunks/chunk-5SEHHENC.js +0 -64656
  172. package/dist/_node-chunks/chunk-6GD23U64.js +0 -420
  173. package/dist/_node-chunks/chunk-6OAXYS5T.js +0 -1544
  174. package/dist/_node-chunks/chunk-7TNUMFKR.js +0 -4741
  175. package/dist/_node-chunks/chunk-BCDHUXAJ.js +0 -4272
  176. package/dist/_node-chunks/chunk-BYVQZ2HU.js +0 -220
  177. package/dist/_node-chunks/chunk-DAMVKHAC.js +0 -101
  178. package/dist/_node-chunks/chunk-FEOC7OX2.js +0 -1586
  179. package/dist/_node-chunks/chunk-FY7XZPLY.js +0 -2248
  180. package/dist/_node-chunks/chunk-GD2FXWDF.js +0 -697
  181. package/dist/_node-chunks/chunk-HM6B7FE5.js +0 -18
  182. package/dist/_node-chunks/chunk-HORWITP7.js +0 -90
  183. package/dist/_node-chunks/chunk-II4AFH3V.js +0 -28
  184. package/dist/_node-chunks/chunk-MF2PUEWG.js +0 -5029
  185. package/dist/_node-chunks/chunk-RVE4UTVQ.js +0 -1518
  186. package/dist/_node-chunks/chunk-TUFWZUTO.js +0 -69
  187. package/dist/_node-chunks/chunk-TXHNWNH4.js +0 -79
  188. package/dist/_node-chunks/chunk-ULWNTI6M.js +0 -1198
  189. package/dist/_node-chunks/chunk-VYRFXLRO.js +0 -6712
  190. package/dist/_node-chunks/chunk-WNOSTIYP.js +0 -34
  191. package/dist/_node-chunks/chunk-X67VGZN4.js +0 -1250
  192. package/dist/_node-chunks/chunk-XCEBYOA4.js +0 -61
  193. package/dist/_node-chunks/chunk-XW7YMR7I.js +0 -111
  194. package/dist/_node-chunks/chunk-ZRFYQ46H.js +0 -61
  195. package/dist/_node-chunks/dist-APCKHSY3.js +0 -175
  196. package/dist/_node-chunks/globby-TSGXGDA2.js +0 -5222
  197. package/dist/_node-chunks/lib-DZ5TVIU5.js +0 -518
  198. package/dist/_node-chunks/mdx-N42X6CFJ-Z6BYQCPN.js +0 -22017
  199. package/dist/_node-chunks/p-limit-MLJNGG2K.js +0 -168
  200. package/dist/_node-chunks/plugin-J3JI3ZKJ.js +0 -159
  201. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-3QHNTM5B.js +0 -69102
  202. package/dist/_node-chunks/webpack-mock-plugin-4Y3MWPJ6.js +0 -124
@@ -1,60 +1,37 @@
1
- import {
2
- __name
3
- } from "../_browser-chunks/chunk-MM7DTO55.js";
1
+ import "../_browser-chunks/chunk-A242L54C.js";
4
2
 
5
3
  // src/client-logger/index.ts
6
4
  import { global } from "@storybook/global";
7
- var { LOGLEVEL } = global;
8
- var levels = {
5
+ var { LOGLEVEL } = global, levels = {
9
6
  trace: 1,
10
7
  debug: 2,
11
8
  info: 3,
12
9
  warn: 4,
13
10
  error: 5,
14
11
  silent: 10
15
- };
16
- var currentLogLevelString = LOGLEVEL;
17
- var currentLogLevelNumber = levels[currentLogLevelString] || levels.info;
18
- var logger = {
19
- trace: /* @__PURE__ */ __name((message, ...rest) => {
20
- if (currentLogLevelNumber <= levels.trace) {
21
- console.trace(message, ...rest);
22
- }
23
- }, "trace"),
24
- debug: /* @__PURE__ */ __name((message, ...rest) => {
25
- if (currentLogLevelNumber <= levels.debug) {
26
- console.debug(message, ...rest);
27
- }
28
- }, "debug"),
29
- info: /* @__PURE__ */ __name((message, ...rest) => {
30
- if (currentLogLevelNumber <= levels.info) {
31
- console.info(message, ...rest);
32
- }
33
- }, "info"),
34
- warn: /* @__PURE__ */ __name((message, ...rest) => {
35
- if (currentLogLevelNumber <= levels.warn) {
36
- console.warn(message, ...rest);
37
- }
38
- }, "warn"),
39
- error: /* @__PURE__ */ __name((message, ...rest) => {
40
- if (currentLogLevelNumber <= levels.error) {
41
- console.error(message, ...rest);
42
- }
43
- }, "error"),
44
- log: /* @__PURE__ */ __name((message, ...rest) => {
45
- if (currentLogLevelNumber < levels.silent) {
46
- console.log(message, ...rest);
47
- }
48
- }, "log")
49
- };
50
- var logged = /* @__PURE__ */ new Set();
51
- var once = /* @__PURE__ */ __name((type) => (message, ...rest) => {
52
- if (logged.has(message)) {
53
- return void 0;
12
+ }, currentLogLevelString = LOGLEVEL, currentLogLevelNumber = levels[currentLogLevelString] || levels.info, logger = {
13
+ trace: (message, ...rest) => {
14
+ currentLogLevelNumber <= levels.trace && console.trace(message, ...rest);
15
+ },
16
+ debug: (message, ...rest) => {
17
+ currentLogLevelNumber <= levels.debug && console.debug(message, ...rest);
18
+ },
19
+ info: (message, ...rest) => {
20
+ currentLogLevelNumber <= levels.info && console.info(message, ...rest);
21
+ },
22
+ warn: (message, ...rest) => {
23
+ currentLogLevelNumber <= levels.warn && console.warn(message, ...rest);
24
+ },
25
+ error: (message, ...rest) => {
26
+ currentLogLevelNumber <= levels.error && console.error(message, ...rest);
27
+ },
28
+ log: (message, ...rest) => {
29
+ currentLogLevelNumber < levels.silent && console.log(message, ...rest);
54
30
  }
55
- logged.add(message);
56
- return logger[type](message, ...rest);
57
- }, "once");
31
+ }, logged = /* @__PURE__ */ new Set(), once = (type) => (message, ...rest) => {
32
+ if (!logged.has(message))
33
+ return logged.add(message), logger[type](message, ...rest);
34
+ };
58
35
  once.clear = () => logged.clear();
59
36
  once.trace = once("trace");
60
37
  once.debug = once("debug");
@@ -62,24 +39,17 @@ once.info = once("info");
62
39
  once.warn = once("warn");
63
40
  once.error = once("error");
64
41
  once.log = once("log");
65
- var deprecate = once("warn");
66
- var pretty = /* @__PURE__ */ __name((type) => (...args) => {
67
- const argArray = [];
42
+ var deprecate = once("warn"), pretty = (type) => (...args) => {
43
+ let argArray = [];
68
44
  if (args.length) {
69
- const startTagRe = /<span\s+style=(['"])([^'"]*)\1\s*>/gi;
70
- const endTagRe = /<\/span>/gi;
71
- let reResultArray;
72
- argArray.push(args[0].replace(startTagRe, "%c").replace(endTagRe, "%c"));
73
- while (reResultArray = startTagRe.exec(args[0])) {
74
- argArray.push(reResultArray[2]);
75
- argArray.push("");
76
- }
77
- for (let j = 1; j < args.length; j++) {
45
+ let startTagRe = /<span\s+style=(['"])([^'"]*)\1\s*>/gi, endTagRe = /<\/span>/gi, reResultArray;
46
+ for (argArray.push(args[0].replace(startTagRe, "%c").replace(endTagRe, "%c")); reResultArray = startTagRe.exec(args[0]); )
47
+ argArray.push(reResultArray[2]), argArray.push("");
48
+ for (let j = 1; j < args.length; j++)
78
49
  argArray.push(args[j]);
79
- }
80
50
  }
81
51
  logger[type].apply(logger, argArray);
82
- }, "pretty");
52
+ };
83
53
  pretty.trace = pretty("trace");
84
54
  pretty.debug = pretty("debug");
85
55
  pretty.info = pretty("info");
@@ -1,10 +1,11 @@
1
1
  import * as storybook_internal_types from 'storybook/internal/types';
2
- import { PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, LoadedPreset, Presets, PackageJson, CoreCommon_AddonInfo, SupportedFrameworks, SupportedRenderers, Options as Options$1, CoreCommon_StorybookInfo, Ref, StorybookConfig, StoriesEntry, NormalizedStoriesSpecifier } from 'storybook/internal/types';
2
+ import { CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, Presets, PackageJson, CoreCommon_AddonInfo, SupportedFrameworks, SupportedRenderers, Options as Options$1, CoreCommon_StorybookInfo, Ref, StorybookConfig, StoriesEntry, NormalizedStoriesSpecifier } from 'storybook/internal/types';
3
3
  export { PackageJson } from 'storybook/internal/types';
4
4
  import { WriteStream } from 'node:fs';
5
5
  import { Buffer } from 'node:buffer';
6
6
  import { ChildProcess } from 'node:child_process';
7
7
  import { Readable, Writable, Stream } from 'node:stream';
8
+ import * as prettier from 'prettier';
8
9
  import { ConfigFile } from 'storybook/internal/csf-tools';
9
10
 
10
11
  declare const _default: {
@@ -1100,8 +1101,193 @@ declare class HandledError extends Error {
1100
1101
  */
1101
1102
  declare const interpolate: (template: string, bindings: Record<string, string>) => string;
1102
1103
 
1103
- declare const supportedExtensions: readonly [".js", ".mjs", ".cjs", ".jsx", ".ts", ".mts", ".cts", ".tsx"];
1104
+ interface PackageMeta {
1105
+ name: string;
1106
+ version: string;
1107
+ [key: string]: any;
1108
+ }
1109
+
1110
+ interface ToString {
1111
+ toString(): string;
1112
+ }
1113
+
1114
+ type StringOrToString = string | ToString;
1115
+
1116
+ /**
1117
+ * Callback invoked when resolving asynchronously
1118
+ *
1119
+ * @param error
1120
+ * @param resolved Absolute path to resolved identifier
1121
+ */
1122
+ type resolveCallback = (err: Error | null, resolved?: string, pkg?: PackageMeta) => void;
1123
+
1124
+ /**
1125
+ * Callback invoked when checking if a file or directory exists
1126
+ *
1127
+ * @param error
1128
+ * @param exists If the given file or directory exists
1129
+ */
1130
+ type existsCallback = (err: Error | null, isFile?: boolean) => void;
1131
+
1132
+ /**
1133
+ * Callback invoked when reading a file
1134
+ *
1135
+ * @param error
1136
+ * @param isFile If the given file exists
1137
+ */
1138
+ type readFileCallback = (err: Error | null, file?: StringOrToString) => void;
1139
+
1140
+ /**
1141
+ * Callback invoked when resolving a potential symlink
1142
+ *
1143
+ * @param error
1144
+ * @param resolved Absolute path to the resolved file
1145
+ */
1146
+ type realpathCallback = (err: Error | null, resolved?: string) => void;
1147
+
1148
+ /**
1149
+ * Callback invoked when reading and parsing a package.json file
1150
+ *
1151
+ * @param error
1152
+ * @param resolved Absolute path to the resolved file
1153
+ */
1154
+ type readPackageCallback = (err: Error | null, package?: Record<string, unknown>) => void;
1155
+
1156
+ /**
1157
+ * Synchronously resolve the module path string id, returning the result and throwing an error when id can't be resolved.
1158
+ *
1159
+ * @param id Identifier to resolve
1160
+ * @param options Options to use for resolving, optional.
1161
+ */
1162
+ declare function resolveSync(id: string, opts?: resolve.SyncOpts): string;
1163
+
1164
+ /**
1165
+ * Return whether a package is in core
1166
+ */
1167
+ declare function resolveIsCore(id: string): boolean | undefined;
1168
+
1169
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
1170
+ type JSONValue = string | number | boolean | JSONObject | JSONArray;
1171
+ interface JSONObject {
1172
+ [x: string]: JSONValue;
1173
+ }
1174
+ interface JSONArray extends Array<JSONValue> {}
1175
+
1176
+ /**
1177
+ * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
1178
+ *
1179
+ * @param id Identifier to resolve
1180
+ * @param callback
1181
+ */
1182
+ declare function resolve(id: string, cb: resolveCallback): void;
1183
+
1184
+ /**
1185
+ * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
1186
+ *
1187
+ * @param id Identifier to resolve
1188
+ * @param options Options to use for resolving, optional.
1189
+ * @param callback
1190
+ */
1191
+ declare function resolve(id: string, opts: resolve.AsyncOpts, cb: resolveCallback): void;
1192
+
1193
+ declare namespace resolve {
1194
+ export type PackageJSON = JSONObject;
1195
+
1196
+ interface Opts {
1197
+ /** directory to begin resolving from (defaults to __dirname) */
1198
+ basedir?: string | undefined;
1199
+ /** package.json data applicable to the module being loaded */
1200
+ package?: any;
1201
+ /** set to false to exclude node core modules (e.g. fs) from the search */
1202
+ includeCoreModules?: boolean | undefined;
1203
+ /** array of file extensions to search in order (defaults to ['.js']) */
1204
+ extensions?: string | readonly string[] | undefined;
1205
+ /** transform the parsed package.json contents before looking at the "main" field */
1206
+ packageFilter?: ((pkg: PackageJSON, pkgFile: string, dir: string) => PackageJSON) | undefined;
1207
+ /** transform a path within a package */
1208
+ pathFilter?: ((pkg: PackageJSON, path: string, relativePath: string) => string) | undefined;
1209
+ /** require.paths array to use if nothing is found on the normal node_modules recursive walk (probably don't use this) */
1210
+ paths?: string | readonly string[] | undefined;
1211
+ /** return the list of candidate paths where the packages sources may be found (probably don't use this) */
1212
+ packageIterator?:
1213
+ | ((request: string, start: string, getPackageCandidates: () => string[], opts: Opts) => string[])
1214
+ | undefined;
1215
+ /** directory (or directories) in which to recursively look for modules. (default to 'node_modules') */
1216
+ moduleDirectory?: string | readonly string[] | undefined;
1217
+ /**
1218
+ * if true, doesn't resolve `basedir` to real path before resolving.
1219
+ * This is the way Node resolves dependencies when executed with the --preserve-symlinks flag.
1220
+ *
1221
+ * Note: this property is currently true by default but it will be changed to false in the next major version because Node's resolution
1222
+ * algorithm does not preserve symlinks by default.
1223
+ */
1224
+ preserveSymlinks?: boolean | undefined;
1225
+ }
1226
+
1227
+ interface BaseAsyncOpts extends Opts {
1228
+ /** function to asynchronously test whether a file exists */
1229
+ isFile?: ((file: string, cb: existsCallback) => void) | undefined;
1230
+ /** function to asynchronously test whether a directory exists */
1231
+ isDirectory?: ((directory: string, cb: existsCallback) => void) | undefined;
1232
+ /** function to asynchronously resolve a potential symlink to its real path */
1233
+ realpath?: ((file: string, cb: realpathCallback) => void) | undefined;
1234
+ }
1235
+
1236
+ export type AsyncOpts =
1237
+ & BaseAsyncOpts
1238
+ & ({
1239
+ /** how to read files asynchronously (defaults to fs.readFile) */
1240
+ readFile?: ((file: string, cb: readFileCallback) => void) | undefined;
1241
+ /** function to asynchronously read and parse a package.json file */
1242
+ readPackage?: never | undefined;
1243
+ } | {
1244
+ /** how to read files asynchronously (defaults to fs.readFile) */
1245
+ readFile?: never | undefined;
1246
+ /** function to asynchronously read and parse a package.json file */
1247
+ readPackage?:
1248
+ | ((
1249
+ readFile: (file: string, cb: readFileCallback) => void,
1250
+ pkgfile: string,
1251
+ cb: readPackageCallback,
1252
+ ) => void)
1253
+ | undefined;
1254
+ });
1255
+
1256
+ interface BaseSyncOpts extends Opts {
1257
+ /** function to synchronously test whether a file exists */
1258
+ isFile?: ((file: string) => boolean) | undefined;
1259
+ /** function to synchronously test whether a directory exists */
1260
+ isDirectory?: ((directory: string) => boolean) | undefined;
1261
+ /** function to synchronously resolve a potential symlink to its real path */
1262
+ realpathSync?: ((file: string) => string) | undefined;
1263
+ }
1264
+
1265
+ export type SyncOpts =
1266
+ & BaseSyncOpts
1267
+ & ({
1268
+ /** how to read files synchronously (defaults to fs.readFileSync) */
1269
+ readFileSync?: ((file: string) => StringOrToString) | undefined;
1270
+ /** function to synchronously read and parse a package.json file */
1271
+ readPackageSync?: never | undefined;
1272
+ } | {
1273
+ /** how to read files synchronously (defaults to fs.readFileSync) */
1274
+ readFileSync?: never | undefined;
1275
+ /** function to synchronously read and parse a package.json file */
1276
+ readPackageSync?:
1277
+ | ((
1278
+ readFileSync: (file: string) => StringOrToString,
1279
+ pkgfile: string,
1280
+ ) => Record<string, unknown> | undefined)
1281
+ | undefined;
1282
+ });
1283
+
1284
+ export var sync: typeof resolveSync;
1285
+ export var isCore: typeof resolveIsCore;
1286
+ }
1287
+
1288
+ declare const supportedExtensions: readonly [".js", ".ts", ".jsx", ".tsx", ".mjs", ".mts", ".mtsx", ".cjs", ".cts", ".ctsx"];
1104
1289
  declare function getInterpretedFile(pathToFile: string): string | undefined;
1290
+ declare function resolveImport(id: string, options: resolve.SyncOpts): string;
1105
1291
 
1106
1292
  declare function serverRequire(filePath: string | string[]): Promise<any> | null;
1107
1293
 
@@ -1187,6 +1373,24 @@ declare function validateConfigurationFiles(configDir: string, cwd?: string): Pr
1187
1373
  /** Mimicking the satisfies operator until we can upgrade to TS4.9 */
1188
1374
  declare function satisfies<A>(): <T extends A>(x: T) => T;
1189
1375
 
1376
+ declare function getPrettier(): Promise<{
1377
+ resolveConfig: () => Promise<null>;
1378
+ format: (content: string) => string;
1379
+ } | {
1380
+ default: typeof prettier;
1381
+ format(source: string, options?: prettier.Options): Promise<string>;
1382
+ check(source: string, options?: prettier.Options): Promise<boolean>;
1383
+ formatWithCursor(source: string, options: prettier.CursorOptions): Promise<prettier.CursorResult>;
1384
+ resolveConfig(fileUrlOrPath: string | URL, options?: prettier.ResolveConfigOptions): Promise<prettier.Options | null>;
1385
+ resolveConfigFile(fileUrlOrPath?: string | URL): Promise<string | null>;
1386
+ clearConfigCache(): Promise<void>;
1387
+ getFileInfo(file: string | URL, options?: prettier.FileInfoOptions): Promise<prettier.FileInfoResult>;
1388
+ getSupportInfo(options?: prettier.SupportInfoOptions): Promise<prettier.SupportInfo>;
1389
+ doc: typeof prettier.doc;
1390
+ AstPath: typeof prettier.AstPath;
1391
+ version: string;
1392
+ util: typeof prettier.util;
1393
+ }>;
1190
1394
  /**
1191
1395
  * Format the content of a file using prettier. If prettier is not available in the user's project,
1192
1396
  * it will fallback to use editorconfig settings if available and formats the file by a
@@ -1305,4 +1509,7 @@ declare const safeResolveModule: ({ specifier, parent, extensions, }: {
1305
1509
  extensions?: string[];
1306
1510
  }) => string | undefined;
1307
1511
 
1308
- export { COMMON_ENV_VARS, DEFAULT_FILES_PATTERN, type FileOptions, FileSystemCache, HandledError, type InstallationMetadata, JsPackageManager, JsPackageManagerFactory, type PackageJsonInfo, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, type PackageManagerName, type PackageMetadata, type RemoveAddonOptions, builderPackages, cache, checkAddonOrder, codeLog, commandLog, commonGlobOptions, createFileSystemCache, createLogStream, extractProperFrameworkName, extractProperRendererNameFromFramework, filterPresetsConfig, findConfigFile, findFilesUp, formatFileContent, frameworkPackages, frameworkToRenderer, getAddonNames, getAutoRefs, getBuilderOptions, getChars, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFrameworkName, getInterpretedFile, getPackageDetails, getPresets, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, getSyncedStorybookAddons, globToRegexp, importMetaResolve, importModule, interpolate, invalidateProjectRootCache, isCI, isCorePackage, isPreservingSymlinks, isSatelliteAddon, loadAllPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, optionalEnvToBoolean, paddedLog, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolvePackageDir, resolvePathInStorybookCache, safeResolveModule, satisfies, scanAndTransformFiles, serverRequire, stringifyEnvs, stringifyProcessEnvs, supportedExtensions, syncStorybookAddons, temporaryDirectory, temporaryFile, transformImportFiles, validateConfigurationFiles, validateFrameworkName, _default as versions };
1512
+ declare const groupBy: <K extends PropertyKey, T>(items: T[], keySelector: (item: T, index: number) => K) => Record<K, T[]>;
1513
+ declare function invariant(condition: unknown, message?: string | (() => string)): asserts condition;
1514
+
1515
+ export { COMMON_ENV_VARS, DEFAULT_FILES_PATTERN, type FileOptions, FileSystemCache, HandledError, type InstallationMetadata, type InterPresetOptions, JsPackageManager, JsPackageManagerFactory, type PackageJsonInfo, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, type PackageManagerName, type PackageMetadata, type RemoveAddonOptions, builderPackages, cache, checkAddonOrder, codeLog, commandLog, commonGlobOptions, createFileSystemCache, createLogStream, extractProperFrameworkName, extractProperRendererNameFromFramework, filterPresetsConfig, findConfigFile, findFilesUp, formatFileContent, frameworkPackages, frameworkToRenderer, getAddonNames, getAutoRefs, getBuilderOptions, getChars, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFrameworkName, getInterpretedFile, getPackageDetails, getPresets, getPrettier, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, getSyncedStorybookAddons, globToRegexp, groupBy, importMetaResolve, importModule, interpolate, invalidateProjectRootCache, invariant, isCI, isCorePackage, isPreservingSymlinks, isSatelliteAddon, loadAllPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, optionalEnvToBoolean, paddedLog, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolveImport, resolvePackageDir, resolvePathInStorybookCache, safeResolveModule, satisfies, scanAndTransformFiles, serverRequire, stringifyEnvs, stringifyProcessEnvs, supportedExtensions, syncStorybookAddons, temporaryDirectory, temporaryFile, transformImportFiles, validateConfigurationFiles, validateFrameworkName, _default as versions };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_in4hyfgp7kn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_in4hyfgp7kn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_in4hyfgp7kn from "node:module";
1
+ import CJS_COMPAT_NODE_URL_843v2rliy1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_843v2rliy1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_843v2rliy1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_in4hyfgp7kn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_in4hyfgp7kn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_in4hyfgp7kn.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_843v2rliy1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_843v2rliy1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_843v2rliy1.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -43,6 +43,7 @@ import {
43
43
  getInterpretedFile,
44
44
  getPackageDetails,
45
45
  getPresets,
46
+ getPrettier,
46
47
  getPreviewBodyTemplate,
47
48
  getPreviewHeadTemplate,
48
49
  getRefs,
@@ -53,7 +54,9 @@ import {
53
54
  getStorybookInfo,
54
55
  getSyncedStorybookAddons,
55
56
  globToRegexp,
57
+ groupBy,
56
58
  interpolate,
59
+ invariant,
57
60
  isCorePackage,
58
61
  isPreservingSymlinks,
59
62
  isSatelliteAddon,
@@ -72,6 +75,7 @@ import {
72
75
  removeAddon,
73
76
  rendererPackages,
74
77
  resolveAddonName,
78
+ resolveImport,
75
79
  resolvePathInStorybookCache,
76
80
  satisfies,
77
81
  scanAndTransformFiles,
@@ -83,11 +87,11 @@ import {
83
87
  transformImportFiles,
84
88
  validateConfigurationFiles,
85
89
  validateFrameworkName
86
- } from "../_node-chunks/chunk-SCTKVDWR.js";
87
- import "../_node-chunks/chunk-4GE6Q4MX.js";
90
+ } from "../_node-chunks/chunk-GG2WQZSG.js";
91
+ import "../_node-chunks/chunk-5QK5MSOI.js";
88
92
  import {
89
93
  versions_default
90
- } from "../_node-chunks/chunk-ZRFYQ46H.js";
94
+ } from "../_node-chunks/chunk-WK3EMYK6.js";
91
95
  import {
92
96
  findFilesUp,
93
97
  getProjectRoot,
@@ -99,22 +103,22 @@ import {
99
103
  optionalEnvToBoolean,
100
104
  stringifyEnvs,
101
105
  stringifyProcessEnvs
102
- } from "../_node-chunks/chunk-7TNUMFKR.js";
103
- import "../_node-chunks/chunk-TXHNWNH4.js";
104
- import "../_node-chunks/chunk-WNOSTIYP.js";
106
+ } from "../_node-chunks/chunk-LXG4DK35.js";
107
+ import "../_node-chunks/chunk-4GZCFQFG.js";
108
+ import "../_node-chunks/chunk-R6HWGZWD.js";
105
109
  import {
106
110
  importMetaResolve,
107
111
  importModule,
108
112
  resolvePackageDir,
109
113
  safeResolveModule
110
- } from "../_node-chunks/chunk-6OAXYS5T.js";
111
- import "../_node-chunks/chunk-BYVQZ2HU.js";
112
- import "../_node-chunks/chunk-MF2PUEWG.js";
113
- import "../_node-chunks/chunk-VYRFXLRO.js";
114
- import "../_node-chunks/chunk-II4AFH3V.js";
115
- import "../_node-chunks/chunk-TUFWZUTO.js";
116
- import "../_node-chunks/chunk-QNUGJO6L.js";
117
- import "../_node-chunks/chunk-XCEBYOA4.js";
114
+ } from "../_node-chunks/chunk-SPQXMU2Q.js";
115
+ import "../_node-chunks/chunk-BBOP3XCK.js";
116
+ import "../_node-chunks/chunk-GQJOWVVR.js";
117
+ import "../_node-chunks/chunk-ZZALGOA6.js";
118
+ import "../_node-chunks/chunk-QH4V5YDB.js";
119
+ import "../_node-chunks/chunk-PHOZWZZO.js";
120
+ import "../_node-chunks/chunk-32NE3UE3.js";
121
+ import "../_node-chunks/chunk-XGVLB4UJ.js";
118
122
  export {
119
123
  COMMON_ENV_VARS,
120
124
  DEFAULT_FILES_PATTERN,
@@ -150,6 +154,7 @@ export {
150
154
  getInterpretedFile,
151
155
  getPackageDetails,
152
156
  getPresets,
157
+ getPrettier,
153
158
  getPreviewBodyTemplate,
154
159
  getPreviewHeadTemplate,
155
160
  getProjectRoot,
@@ -161,10 +166,12 @@ export {
161
166
  getStorybookInfo,
162
167
  getSyncedStorybookAddons,
163
168
  globToRegexp,
169
+ groupBy,
164
170
  importMetaResolve,
165
171
  importModule,
166
172
  interpolate,
167
173
  invalidateProjectRootCache,
174
+ invariant,
168
175
  isCI,
169
176
  isCorePackage,
170
177
  isPreservingSymlinks,
@@ -188,6 +195,7 @@ export {
188
195
  removeAddon,
189
196
  rendererPackages,
190
197
  resolveAddonName,
198
+ resolveImport,
191
199
  resolvePackageDir,
192
200
  resolvePathInStorybookCache,
193
201
  safeResolveModule,