storybook 10.1.0-alpha.9 → 10.1.0-beta.1

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 (198) 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-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
  5. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  6. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  7. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  8. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  9. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  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-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  15. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  16. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  17. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  18. package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
  19. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  20. package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -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-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
  26. package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
  27. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  28. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  29. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  30. package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
  31. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  32. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  33. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -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-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-SM3UWERX.js → builder-manager-FTVC2JL7.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3SMT5WKC.js +37 -0
  41. package/dist/_node-chunks/chunk-2OVULPK3.js +54 -0
  42. package/dist/_node-chunks/chunk-3JJPSDXI.js +3043 -0
  43. package/dist/_node-chunks/chunk-54NMJ4II.js +1564 -0
  44. package/dist/_node-chunks/chunk-5V4A6MSI.js +943 -0
  45. package/dist/_node-chunks/chunk-6DEMT5VX.js +299 -0
  46. package/dist/_node-chunks/{chunk-HHSTA6QS.js → chunk-6L7FFBOW.js} +8 -10
  47. package/dist/_node-chunks/chunk-6ULDIDXV.js +46662 -0
  48. package/dist/_node-chunks/chunk-AREL5IXS.js +603 -0
  49. package/dist/_node-chunks/chunk-DWA53E73.js +23 -0
  50. package/dist/_node-chunks/chunk-FNYKBULZ.js +765 -0
  51. package/dist/_node-chunks/chunk-IUYZQKSX.js +70 -0
  52. package/dist/_node-chunks/{chunk-F6EFOEC7.js → chunk-K673CX4Q.js} +469 -983
  53. package/dist/_node-chunks/chunk-KJAFCNZ3.js +61 -0
  54. package/dist/_node-chunks/chunk-N3BJOOY5.js +78 -0
  55. package/dist/_node-chunks/{chunk-EBUEXRH5.js → chunk-O5FMCQHP.js} +116 -276
  56. package/dist/_node-chunks/chunk-RIKQZHV3.js +29 -0
  57. package/dist/_node-chunks/chunk-RURZIE3W.js +3780 -0
  58. package/dist/_node-chunks/chunk-RVII4SK6.js +919 -0
  59. package/dist/_node-chunks/chunk-S3PBHOVC.js +6024 -0
  60. package/dist/_node-chunks/chunk-SQSFX47N.js +61 -0
  61. package/dist/_node-chunks/{chunk-SGM3ZCCT.js → chunk-TURUTKVH.js} +292 -688
  62. package/dist/_node-chunks/chunk-VRICJPXY.js +72 -0
  63. package/dist/_node-chunks/chunk-WIWWMCEU.js +119 -0
  64. package/dist/_node-chunks/{chunk-ATDHMMIZ.js → chunk-XGNRK7QB.js} +15 -24
  65. package/dist/_node-chunks/chunk-Y2FOTPAE.js +4523 -0
  66. package/dist/_node-chunks/{chunk-GHIBZRKD.js → chunk-Y4UYN72K.js} +8133 -8887
  67. package/dist/_node-chunks/chunk-Z4BMBA5L.js +18 -0
  68. package/dist/_node-chunks/chunk-ZMCJS2GU.js +20 -0
  69. package/dist/_node-chunks/dist-TZLZ3T6L.js +121 -0
  70. package/dist/_node-chunks/globby-22GFCZQD.js +3452 -0
  71. package/dist/_node-chunks/lib-37NQ4ZIJ.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-2TRB7OEH.js +14329 -0
  73. package/dist/_node-chunks/p-limit-UD7TYFDW.js +116 -0
  74. package/dist/actions/decorator.js +21 -42
  75. package/dist/actions/index.js +3 -3
  76. package/dist/babel/index.d.ts +671 -335
  77. package/dist/babel/index.js +10 -11
  78. package/dist/bin/core.js +602 -1549
  79. package/dist/bin/dispatcher.js +36 -36
  80. package/dist/bin/loader.js +24 -38
  81. package/dist/channels/index.js +98 -234
  82. package/dist/cli/index.d.ts +1479 -133
  83. package/dist/cli/index.js +30 -8540
  84. package/dist/client-logger/index.js +31 -61
  85. package/dist/common/index.d.ts +139 -62
  86. package/dist/common/index.js +66 -51
  87. package/dist/components/index.d.ts +575 -273
  88. package/dist/components/index.js +14863 -4313
  89. package/dist/core-events/index.js +2 -66
  90. package/dist/core-server/index.d.ts +3 -2
  91. package/dist/core-server/index.js +2911 -8519
  92. package/dist/core-server/presets/common-manager.css +2 -2
  93. package/dist/core-server/presets/common-manager.js +2521 -5233
  94. package/dist/core-server/presets/common-override-preset.js +31 -60
  95. package/dist/core-server/presets/common-preset.js +663 -962
  96. package/dist/csf/index.js +534 -1179
  97. package/dist/csf-tools/index.js +9 -9
  98. package/dist/docs-tools/index.js +6 -6
  99. package/dist/highlight/index.js +2 -2
  100. package/dist/instrumenter/index.js +199 -415
  101. package/dist/manager/globals-runtime.js +59044 -67141
  102. package/dist/manager/globals.js +2 -3
  103. package/dist/manager/manager-stores.d.ts +1 -0
  104. package/dist/manager/manager-stores.js +23 -0
  105. package/dist/manager/runtime.js +11569 -10953
  106. package/dist/manager-api/index.d.ts +1813 -2
  107. package/dist/manager-api/index.js +1348 -2401
  108. package/dist/manager-errors.d.ts +9 -0
  109. package/dist/manager-errors.js +3 -3
  110. package/dist/mocking-utils/index.d.ts +1126 -0
  111. package/dist/mocking-utils/index.js +1181 -0
  112. package/dist/node-logger/index.d.ts +192 -24
  113. package/dist/node-logger/index.js +23 -4471
  114. package/dist/preview/globals.js +2 -3
  115. package/dist/preview/runtime.js +10799 -22393
  116. package/dist/preview-api/index.d.ts +1 -1
  117. package/dist/preview-api/index.js +13 -13
  118. package/dist/preview-errors.d.ts +9 -0
  119. package/dist/preview-errors.js +4 -4
  120. package/dist/router/index.js +347 -899
  121. package/dist/server-errors.d.ts +34 -1
  122. package/dist/server-errors.js +17 -10
  123. package/dist/telemetry/index.d.ts +24 -3
  124. package/dist/telemetry/index.js +25 -24
  125. package/dist/test/index.js +6131 -11916
  126. package/dist/theming/create.d.ts +1 -0
  127. package/dist/theming/create.js +4 -4
  128. package/dist/theming/index.d.ts +3366 -2599
  129. package/dist/theming/index.js +501 -1091
  130. package/dist/types/index.d.ts +72 -8
  131. package/dist/types/index.js +27 -12
  132. package/dist/viewport/index.js +3 -3
  133. package/package.json +26 -17
  134. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  135. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  136. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  137. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  138. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  139. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  140. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  141. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  142. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  143. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  144. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  145. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  146. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  147. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  148. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  149. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  150. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  151. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  152. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  153. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  154. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  155. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  156. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  157. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  158. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  159. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  160. package/dist/_node-chunks/camelcase-H5QSGQLK.js +0 -18
  161. package/dist/_node-chunks/chunk-3THWHQOC.js +0 -61
  162. package/dist/_node-chunks/chunk-45YUOLTU.js +0 -69
  163. package/dist/_node-chunks/chunk-4QSNCPAU.js +0 -64656
  164. package/dist/_node-chunks/chunk-744PQSOU.js +0 -79
  165. package/dist/_node-chunks/chunk-74Z2U7QG.js +0 -1544
  166. package/dist/_node-chunks/chunk-7MB7TFPO.js +0 -1198
  167. package/dist/_node-chunks/chunk-A7GS4RFT.js +0 -697
  168. package/dist/_node-chunks/chunk-BIA3A5UM.js +0 -61
  169. package/dist/_node-chunks/chunk-C5G7CLWX.js +0 -1657
  170. package/dist/_node-chunks/chunk-DLFUKMYJ.js +0 -1531
  171. package/dist/_node-chunks/chunk-EMRGRXKT.js +0 -111
  172. package/dist/_node-chunks/chunk-EX46EHHY.js +0 -420
  173. package/dist/_node-chunks/chunk-F76QKNOJ.js +0 -304
  174. package/dist/_node-chunks/chunk-HDCRUTEF.js +0 -220
  175. package/dist/_node-chunks/chunk-HUYAOIPH.js +0 -90
  176. package/dist/_node-chunks/chunk-IBJZQZJC.js +0 -101
  177. package/dist/_node-chunks/chunk-KZN2RDDT.js +0 -6712
  178. package/dist/_node-chunks/chunk-LYUNFU3F.js +0 -4741
  179. package/dist/_node-chunks/chunk-N44SIS6K.js +0 -28
  180. package/dist/_node-chunks/chunk-NILZM6KR.js +0 -18
  181. package/dist/_node-chunks/chunk-PC4ZRP6W.js +0 -34
  182. package/dist/_node-chunks/chunk-TJNGOQUH.js +0 -4272
  183. package/dist/_node-chunks/chunk-UBSYLHIL.js +0 -1250
  184. package/dist/_node-chunks/chunk-UTCLXPOC.js +0 -1518
  185. package/dist/_node-chunks/chunk-WOXXODXP.js +0 -5029
  186. package/dist/_node-chunks/chunk-XC4MEUA6.js +0 -1586
  187. package/dist/_node-chunks/chunk-YRXXMKRR.js +0 -2256
  188. package/dist/_node-chunks/dist-SL73W244.js +0 -175
  189. package/dist/_node-chunks/globby-ZSHAUQZ5.js +0 -5222
  190. package/dist/_node-chunks/lib-U2VIPUTI.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-ZLHD33JK.js +0 -22017
  192. package/dist/_node-chunks/p-limit-K5BS5MSV.js +0 -168
  193. package/dist/_node-chunks/plugin-5PD4YIUH.js +0 -129
  194. package/dist/_node-chunks/plugin-MONDT2WL.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-EUZJRG3W.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-T4LDXEHE.js +0 -124
  197. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
  198. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
@@ -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,5 +1,5 @@
1
1
  import * as storybook_internal_types 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';
2
+ import { CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, Presets, PackageJson, CoreCommon_AddonInfo, SupportedFramework, SupportedRenderer, SupportedBuilder, Options as Options$2, CoreWebpackCompiler, 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';
@@ -7,6 +7,7 @@ import { ChildProcess } from 'node:child_process';
7
7
  import { Readable, Writable, Stream } from 'node:stream';
8
8
  import * as prettier from 'prettier';
9
9
  import { ConfigFile } from 'storybook/internal/csf-tools';
10
+ import { types } from 'storybook/internal/babel';
10
11
 
11
12
  declare const _default: {
12
13
  '@storybook/addon-a11y': string;
@@ -441,6 +442,38 @@ type CommonOptions<EncodingType extends EncodingOption = DefaultEncodingOption>
441
442
  readonly verbose?: boolean;
442
443
  };
443
444
 
445
+ type Options$1<EncodingType extends EncodingOption = DefaultEncodingOption> = {
446
+ /**
447
+ Write some input to the `stdin` of your binary.
448
+
449
+ If the input is a file, use the `inputFile` option instead.
450
+ */
451
+ readonly input?: string | Buffer | Readable;
452
+
453
+ /**
454
+ Use a file as input to the the `stdin` of your binary.
455
+
456
+ If the input is not a file, use the `input` option instead.
457
+ */
458
+ readonly inputFile?: string;
459
+ } & CommonOptions<EncodingType>;
460
+
461
+ type NodeOptions<EncodingType extends EncodingOption = DefaultEncodingOption> = {
462
+ /**
463
+ The Node.js executable to use.
464
+
465
+ @default process.execPath
466
+ */
467
+ readonly nodePath?: string;
468
+
469
+ /**
470
+ List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.
471
+
472
+ @default process.execArgv
473
+ */
474
+ readonly nodeOptions?: string[];
475
+ } & Options$1<EncodingType>;
476
+
444
477
  type StdoutStderrAll = string | Buffer | undefined;
445
478
 
446
479
  type ExecaReturnBase<StdoutStderrType extends StdoutStderrAll> = {
@@ -646,6 +679,21 @@ type ExecaChildProcess<StdoutStderrType extends StdoutStderrAll = string> = Chil
646
679
  ExecaChildPromise<StdoutStderrType> &
647
680
  Promise<ExecaReturnValue<StdoutStderrType>>;
648
681
 
682
+ type ExecuteCommandOptions = CommonOptions<'utf8'> & {
683
+ command: string;
684
+ args?: string[];
685
+ cwd?: string;
686
+ ignoreError?: boolean;
687
+ env?: Record<string, any>;
688
+ };
689
+ declare function executeCommand(options: ExecuteCommandOptions): ExecaChildProcess;
690
+ declare function executeCommandSync(options: ExecuteCommandOptions): string;
691
+ declare function executeNodeCommand({ scriptPath, args, options, }: {
692
+ scriptPath: string;
693
+ args?: string[];
694
+ options?: NodeOptions;
695
+ }): ExecaChildProcess;
696
+
649
697
  type PackageJsonWithDepsAndDevDeps = PackageJson & Required<Pick<PackageJson, 'dependencies' | 'devDependencies'>>;
650
698
  type PackageJsonWithMaybeDeps = Partial<Pick<PackageJson, 'dependencies' | 'devDependencies' | 'peerDependencies' | 'files'>>;
651
699
 
@@ -661,12 +709,13 @@ type InstallationMetadata = {
661
709
  dedupeCommand: string;
662
710
  };
663
711
 
664
- type PackageManagerName = 'npm' | 'yarn1' | 'yarn2' | 'pnpm' | 'bun';
665
- declare const COMMON_ENV_VARS: {
666
- COREPACK_ENABLE_STRICT: string;
667
- COREPACK_ENABLE_AUTO_PIN: string;
668
- NO_UPDATE_NOTIFIER: string;
669
- };
712
+ declare enum PackageManagerName {
713
+ NPM = "npm",
714
+ YARN1 = "yarn1",
715
+ YARN2 = "yarn2",
716
+ PNPM = "pnpm",
717
+ BUN = "bun"
718
+ }
670
719
  /**
671
720
  * Extract package name and version from input
672
721
  *
@@ -702,14 +751,11 @@ declare abstract class JsPackageManager {
702
751
  static readonly latestVersionCache: Map<string, string | null>;
703
752
  /** Cache for installed version results to avoid repeated file system calls. */
704
753
  static readonly installedVersionCache: Map<string, string | null>;
754
+ /** Cache for package.json files to avoid repeated file system calls. */
755
+ static readonly packageJsonCache: Map<string, PackageJsonWithDepsAndDevDeps>;
705
756
  constructor(options?: JsPackageManagerOptions);
706
757
  /** Runs arbitrary package scripts. */
707
758
  abstract getRunCommand(command: string): string;
708
- /**
709
- * Run a command from a local or remote. Fetches a package from the registry without installing it
710
- * as a dependency, hotloads it, and runs whatever default command binary it exposes.
711
- */
712
- abstract getRemoteRunCommand(pkg: string, args: string[], specifier?: string): string;
713
759
  /** Get the package.json file for a given module. */
714
760
  abstract getModulePackageJSON(packageName: string): Promise<PackageJson | null>;
715
761
  isStorybookInMonorepo(): boolean;
@@ -841,33 +887,14 @@ declare abstract class JsPackageManager {
841
887
  protected abstract runGetVersions<T extends boolean>(packageName: string, fetchAllVersions: T): Promise<T extends true ? string[] : string>;
842
888
  abstract getRegistryURL(): Promise<string | undefined>;
843
889
  abstract runInternalCommand(command: string, args: string[], cwd?: string, stdio?: 'inherit' | 'pipe' | 'ignore'): ExecaChildProcess;
844
- abstract runPackageCommand(command: string, args: string[], cwd?: string, stdio?: 'inherit' | 'pipe' | 'ignore'): ExecaChildProcess;
845
- abstract runPackageCommandSync(command: string, args: string[], cwd?: string, stdio?: 'inherit' | 'pipe' | 'ignore'): string;
890
+ abstract runPackageCommand(options: Omit<ExecuteCommandOptions, 'command'> & {
891
+ args: string[];
892
+ }): ExecaChildProcess;
846
893
  abstract findInstallations(pattern?: string[]): Promise<InstallationMetadata | undefined>;
847
894
  abstract findInstallations(pattern?: string[], options?: {
848
895
  depth: number;
849
896
  }): Promise<InstallationMetadata | undefined>;
850
897
  abstract parseErrorFromLogs(logs?: string): string;
851
- executeCommandSync({ command, args, stdio, cwd, ignoreError, env, ...execaOptions }: CommonOptions<'utf8'> & {
852
- command: string;
853
- args: string[];
854
- cwd?: string;
855
- ignoreError?: boolean;
856
- }): string;
857
- /**
858
- * Execute a command asynchronously and return the execa process. This allows you to hook into
859
- * stdout/stderr streams and monitor the process.
860
- *
861
- * @example Const process = packageManager.executeCommand({ command: 'npm', args: ['install'] });
862
- * process.stdout?.on('data', (data) => console.log(data.toString())); const result = await
863
- * process;
864
- */
865
- executeCommand({ command, args, stdio, cwd, ignoreError, env, ...execaOptions }: CommonOptions<'utf8'> & {
866
- command: string;
867
- args: string[];
868
- cwd?: string;
869
- ignoreError?: boolean;
870
- }): ExecaChildProcess;
871
898
  /** Returns the installed (within node_modules or pnp zip) version of a specified package */
872
899
  getInstalledVersion(packageName: string): Promise<string | null>;
873
900
  isPackageInstalled(packageName: string): Promise<boolean>;
@@ -965,7 +992,7 @@ declare function getEnvConfig(program: Record<string, any>, configEnv: Record<st
965
992
  * // SCENARIO 2:
966
993
  * // or you can pass it to stdio and capture the output of that command
967
994
  * try {
968
- * await this.executeCommand({
995
+ * await executeCommand({
969
996
  * command: 'pnpm',
970
997
  * args: ['info', packageName, ...args],
971
998
  * // do not output to the user, and send stdio and stderr to log file
@@ -1022,16 +1049,17 @@ declare const commonGlobOptions: (glob: string) => {
1022
1049
  ignore: string[];
1023
1050
  };
1024
1051
 
1025
- declare const frameworkToRenderer: Record<SupportedFrameworks | SupportedRenderers, SupportedRenderers | 'vue'>;
1052
+ declare const frameworkToRenderer: Record<SupportedFramework | SupportedRenderer, SupportedRenderer>;
1053
+ declare const frameworkToBuilder: Record<SupportedFramework, SupportedBuilder>;
1026
1054
 
1027
1055
  /**
1028
1056
  * Builder options can be specified in `core.builder.options` or `framework.options.builder`.
1029
1057
  * Preference is given here to `framework.options.builder` if both are specified.
1030
1058
  */
1031
- declare function getBuilderOptions<T extends Record<string, any>>(options: Options$1): Promise<T | Record<string, never>>;
1059
+ declare function getBuilderOptions<T extends Record<string, any>>(options: Options$2): Promise<T | Record<string, never>>;
1032
1060
 
1033
1061
  /** Framework can be a string or an object. This utility always returns the string name. */
1034
- declare function getFrameworkName(options: Options$1): Promise<string>;
1062
+ declare function getFrameworkName(options: Options$2): Promise<string>;
1035
1063
  /**
1036
1064
  * Extracts the proper framework name from the given framework field. The framework field can be the
1037
1065
  * framework package name or a path to the framework package.
@@ -1039,38 +1067,39 @@ declare function getFrameworkName(options: Options$1): Promise<string>;
1039
1067
  * @example
1040
1068
  *
1041
1069
  * ```ts
1042
- * ExtractProperFrameworkName('/path/to/@storybook/angular'); // => '@storybook/angular'
1043
- * extractProperFrameworkName('@third-party/framework'); // => '@third-party/framework'
1070
+ * extractFrameworkPackageName('/path/to/@storybook/angular'); // => '@storybook/angular'
1071
+ * extractFrameworkPackageName('@third-party/framework'); // => '@third-party/framework'
1044
1072
  * ```
1045
1073
  */
1046
- declare const extractProperFrameworkName: (framework: string) => string;
1074
+ declare const extractFrameworkPackageName: (framework: string) => string;
1047
1075
 
1048
1076
  /**
1049
1077
  * Render is set as a string on core. It must be set by the framework It falls back to the framework
1050
1078
  * name if not set
1051
1079
  */
1052
- declare function getRendererName(options: Options$1): Promise<string>;
1080
+ declare function getRendererName(options: Options$2): Promise<string>;
1053
1081
  /**
1054
1082
  * Extracts the proper renderer name from the given framework name.
1055
1083
  *
1056
1084
  * @example
1057
1085
  *
1058
1086
  * ```ts
1059
- * extractProperRendererNameFromFramework('@storybook/react'); // => 'react'
1060
- * extractProperRendererNameFromFramework('@storybook/angular'); // => 'angular'
1061
- * extractProperRendererNameFromFramework('@third-party/framework'); // => null
1087
+ * extractRenderer('@storybook/react'); // => 'react'
1088
+ * extractRenderer('@storybook/angular'); // => 'angular'
1089
+ * extractRenderer('@third-party/framework'); // => null
1062
1090
  * ```
1063
1091
  *
1064
1092
  * @param frameworkName The name of the framework.
1065
1093
  * @returns The name of the renderer.
1066
1094
  */
1067
- declare function extractProperRendererNameFromFramework(frameworkName: string): Promise<"vue" | storybook_internal_types.SupportedRenderers | null>;
1095
+ declare function extractRenderer(frameworkName: string): Promise<storybook_internal_types.SupportedRenderer | null>;
1068
1096
 
1069
1097
  declare function getStorybookConfiguration(storybookScript: string, shortName: string, longName: string): string | null;
1070
1098
 
1071
- declare const rendererPackages: Record<string, string>;
1072
- declare const frameworkPackages: Record<string, SupportedFrameworks>;
1073
- declare const builderPackages: string[];
1099
+ declare const rendererPackages: Record<string, SupportedRenderer>;
1100
+ declare const frameworkPackages: Record<string, SupportedFramework>;
1101
+ declare const builderPackages: Record<string, SupportedBuilder>;
1102
+ declare const compilerPackages: Record<string, CoreWebpackCompiler>;
1074
1103
  declare const findConfigFile: (prefix: string, configDir: string) => string | null;
1075
1104
  declare const getConfigInfo: (configDir?: string) => {
1076
1105
  configDir: string;
@@ -1078,10 +1107,10 @@ declare const getConfigInfo: (configDir?: string) => {
1078
1107
  previewConfigPath: string | null;
1079
1108
  managerConfigPath: string | null;
1080
1109
  };
1081
- declare const getStorybookInfo: (configDir?: string) => CoreCommon_StorybookInfo;
1110
+ declare const getStorybookInfo: (configDir?: string, cwd?: string) => Promise<CoreCommon_StorybookInfo>;
1082
1111
 
1083
- declare const getAutoRefs: (options: Options$1) => Promise<Record<string, Ref>>;
1084
- declare function getRefs(options: Options$1): Promise<Record<string, Ref>>;
1112
+ declare const getAutoRefs: (options: Options$2) => Promise<Record<string, Ref>>;
1113
+ declare function getRefs(options: Options$2): Promise<Record<string, Ref>>;
1085
1114
 
1086
1115
  declare function globToRegexp(glob: string): RegExp;
1087
1116
 
@@ -1305,11 +1334,6 @@ declare function loadPreviewOrConfigFile({ configDir }: {
1305
1334
  configDir: string;
1306
1335
  }): string | undefined;
1307
1336
 
1308
- declare const commandLog: (message: string) => (errorMessage?: string | void | undefined, errorInfo?: string) => void;
1309
- declare function paddedLog(message: string): void;
1310
- declare function getChars(char: string, amount: number): string;
1311
- declare function codeLog(codeLines: string[], leftPadAmount?: number): void;
1312
-
1313
1337
  declare function logConfig(caption: unknown, config: unknown): void;
1314
1338
 
1315
1339
  declare const DEFAULT_FILES_PATTERN = "**/*.@(mdx|stories.@(js|jsx|mjs|ts|tsx))";
@@ -1409,7 +1433,7 @@ type GetStoryIdOptions = StoryIdData & {
1409
1433
  userTitle?: string;
1410
1434
  storyFilePath: string;
1411
1435
  };
1412
- declare function getStoryId(data: StoryIdData, options: Options$1): Promise<{
1436
+ declare function getStoryId(data: StoryIdData, options: Options$2): Promise<{
1413
1437
  storyId: string;
1414
1438
  kind: string;
1415
1439
  }>;
@@ -1418,10 +1442,61 @@ declare function getStoryTitle({ storyFilePath, configDir, stories, workingDir,
1418
1442
  /** Replaces the path separator with forward slashes */
1419
1443
  declare const posix: (localPath: string, seperator?: string) => string;
1420
1444
 
1421
- declare const getAddonNames: (mainConfig: StorybookConfig) => string[];
1422
-
1423
1445
  declare function syncStorybookAddons(mainConfig: StorybookConfig, previewConfigPath: string, configDir: string): Promise<void>;
1424
- declare function getSyncedStorybookAddons(mainConfig: StorybookConfig, previewConfig: ConfigFile, configDir: string): Promise<ConfigFile>;
1446
+ declare function syncPreviewAddonsWithMainConfig(mainConfig: StorybookConfig, previewConfig: ConfigFile, configDir: string): Promise<ConfigFile>;
1447
+
1448
+ interface SetupAddonInConfigOptions {
1449
+ addonName: string;
1450
+ mainConfigCSFFile: ConfigFile;
1451
+ previewConfigPath: string | undefined;
1452
+ configDir: string;
1453
+ }
1454
+ /**
1455
+ * Setup an addon in the Storybook configuration by adding it to the addons array in main config and
1456
+ * syncing it with preview config.
1457
+ *
1458
+ * @param options Configuration options for setting up the addon
1459
+ */
1460
+ declare function setupAddonInConfig({ addonName, previewConfigPath, configDir, mainConfigCSFFile, }: SetupAddonInConfigOptions): Promise<void>;
1461
+
1462
+ /**
1463
+ * Checks if the following node declarations exists in the main config file.
1464
+ *
1465
+ * @example
1466
+ *
1467
+ * ```ts
1468
+ * const <name> = () => {};
1469
+ * function <name>() {}
1470
+ * ```
1471
+ */
1472
+ declare function doesVariableOrFunctionDeclarationExist(node: types.Node, name: string): boolean;
1473
+ /**
1474
+ * Returns the name of the getAbsolutePath wrapper function if it exists in the main config file.
1475
+ *
1476
+ * @returns Name of the getAbsolutePath wrapper function (e.g. `getAbsolutePath`).
1477
+ */
1478
+ declare function getAbsolutePathWrapperName(config: ConfigFile): string | null;
1479
+ /** Check if the node needs to be wrapped with getAbsolutePath wrapper. */
1480
+ declare function isGetAbsolutePathWrapperNecessary(node: types.Node, cb?: (node: types.StringLiteral | types.ObjectProperty | types.ArrayExpression) => void): boolean;
1481
+ /**
1482
+ * Get all fields that need to be wrapped with getAbsolutePath wrapper.
1483
+ *
1484
+ * @returns Array of fields that need to be wrapped with getAbsolutePath wrapper.
1485
+ */
1486
+ declare function getFieldsForGetAbsolutePathWrapper(config: ConfigFile): types.Node[];
1487
+ /**
1488
+ * Returns AST for the following function
1489
+ *
1490
+ * @example
1491
+ *
1492
+ * ```ts
1493
+ * function getAbsolutePath(value) {
1494
+ * return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
1495
+ * }
1496
+ * ```
1497
+ */
1498
+ declare function getAbsolutePathWrapperAsCallExpression(isConfigTypescript: boolean): types.FunctionDeclaration;
1499
+ declare function wrapValueWithGetAbsolutePathWrapper(config: ConfigFile, node: types.Node): void;
1425
1500
 
1426
1501
  /**
1427
1502
  * Helper function to scan for files matching a glob pattern and transform them
@@ -1509,7 +1584,9 @@ declare const safeResolveModule: ({ specifier, parent, extensions, }: {
1509
1584
  extensions?: string[];
1510
1585
  }) => string | undefined;
1511
1586
 
1587
+ declare const getAddonNames: (mainConfig: StorybookConfig) => string[];
1588
+
1512
1589
  declare const groupBy: <K extends PropertyKey, T>(items: T[], keySelector: (item: T, index: number) => K) => Record<K, T[]>;
1513
1590
  declare function invariant(condition: unknown, message?: string | (() => string)): asserts condition;
1514
1591
 
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 };
1592
+ export { DEFAULT_FILES_PATTERN, type ExecuteCommandOptions, type FileOptions, FileSystemCache, HandledError, type InstallationMetadata, type InterPresetOptions, JsPackageManager, JsPackageManagerFactory, type PackageJsonInfo, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, PackageManagerName, type PackageMetadata, type RemoveAddonOptions, type SetupAddonInConfigOptions, builderPackages, cache, checkAddonOrder, commonGlobOptions, compilerPackages, createFileSystemCache, createLogStream, doesVariableOrFunctionDeclarationExist, executeCommand, executeCommandSync, executeNodeCommand, extractFrameworkPackageName, extractRenderer, filterPresetsConfig, findConfigFile, findFilesUp, formatFileContent, frameworkPackages, frameworkToBuilder, frameworkToRenderer, getAbsolutePathWrapperAsCallExpression, getAbsolutePathWrapperName, getAddonNames, getAutoRefs, getBuilderOptions, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFieldsForGetAbsolutePathWrapper, getFrameworkName, getInterpretedFile, getPackageDetails, getPresets, getPrettier, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, globToRegexp, groupBy, importMetaResolve, importModule, interpolate, invalidateProjectRootCache, invariant, isCI, isCorePackage, isGetAbsolutePathWrapperNecessary, isPreservingSymlinks, isSatelliteAddon, loadAllPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, optionalEnvToBoolean, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolveImport, resolvePackageDir, resolvePathInStorybookCache, safeResolveModule, satisfies, scanAndTransformFiles, serverRequire, setupAddonInConfig, stringifyEnvs, stringifyProcessEnvs, supportedExtensions, syncPreviewAddonsWithMainConfig, syncStorybookAddons, temporaryDirectory, temporaryFile, transformImportFiles, validateConfigurationFiles, validateFrameworkName, _default as versions, wrapValueWithGetAbsolutePathWrapper };