storybook 10.1.0-alpha.1 → 10.1.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 (90) hide show
  1. package/dist/_browser-chunks/{Color-7ZNS6F6B.js → Color-FQNEU7YS.js} +79 -60
  2. package/dist/_browser-chunks/{chunk-BOOOPFZF.js → WithTooltip-6NHN2GXF.js} +25 -17
  3. package/dist/_browser-chunks/{chunk-RNE2IUTB.js → chunk-AW46NMGV.js} +9 -1
  4. package/dist/_browser-chunks/{chunk-C4XOKMDU.js → chunk-QMY4G4R2.js} +49 -49
  5. package/dist/_browser-chunks/{syntaxhighlighter-DK2ODWXH.js → syntaxhighlighter-RJZASWHL.js} +5 -5
  6. package/dist/_node-chunks/{builder-manager-6UBDPV7P.js → builder-manager-HA7CYFCK.js} +32 -12
  7. package/dist/_node-chunks/camelcase-QALD4XFE.js +18 -0
  8. package/dist/_node-chunks/{chunk-6GD23U64.js → chunk-2XY53ALL.js} +8 -8
  9. package/dist/_node-chunks/{chunk-VYRFXLRO.js → chunk-3CBQMG2A.js} +7 -7
  10. package/dist/_node-chunks/{chunk-II4AFH3V.js → chunk-3WDAPZYQ.js} +7 -7
  11. package/dist/_node-chunks/{chunk-GD2FXWDF.js → chunk-4ZB555EJ.js} +7 -7
  12. package/dist/_node-chunks/{chunk-BCDHUXAJ.js → chunk-52DXKXY3.js} +8 -8
  13. package/dist/_node-chunks/{chunk-TUFWZUTO.js → chunk-5OVB4A6F.js} +7 -7
  14. package/dist/_node-chunks/chunk-AGHGNXGH.js +18 -0
  15. package/dist/_node-chunks/{chunk-4GE6Q4MX.js → chunk-B23X5ZCK.js} +7 -7
  16. package/dist/_node-chunks/{chunk-BYVQZ2HU.js → chunk-B2DAHWJK.js} +7 -7
  17. package/dist/_node-chunks/{chunk-WNOSTIYP.js → chunk-CC4PW5MJ.js} +7 -7
  18. package/dist/_node-chunks/{chunk-FY7XZPLY.js → chunk-D7NIZELR.js} +67 -59
  19. package/dist/_node-chunks/{chunk-X67VGZN4.js → chunk-DO5Q3H4L.js} +7 -7
  20. package/dist/_node-chunks/{chunk-2RIKHYCS.js → chunk-ECK7WVFX.js} +12 -12
  21. package/dist/_node-chunks/{chunk-TXHNWNH4.js → chunk-EUH3NHXA.js} +7 -7
  22. package/dist/_node-chunks/{chunk-LAU7VVPC.js → chunk-F3XOPI6H.js} +7 -7
  23. package/dist/_node-chunks/{chunk-3JCSHYSU.js → chunk-FOQHPHCV.js} +7 -7
  24. package/dist/_node-chunks/{chunk-XW7YMR7I.js → chunk-G6EL47NS.js} +7 -7
  25. package/dist/_node-chunks/{chunk-HORWITP7.js → chunk-GFLS4TJB.js} +7 -7
  26. package/dist/_node-chunks/{chunk-FEOC7OX2.js → chunk-J3XZKWHE.js} +8 -8
  27. package/dist/_node-chunks/{chunk-RVE4UTVQ.js → chunk-LE63EHJ5.js} +12 -12
  28. package/dist/_node-chunks/{chunk-7TNUMFKR.js → chunk-M47XA42S.js} +9 -9
  29. package/dist/_node-chunks/{chunk-XCEBYOA4.js → chunk-OOI74AL3.js} +6 -6
  30. package/dist/_node-chunks/{chunk-CJHAP7SE.js → chunk-OVXB5GGT.js} +7 -7
  31. package/dist/_node-chunks/chunk-PRJHT3GJ.js +61 -0
  32. package/dist/_node-chunks/{chunk-DAMVKHAC.js → chunk-Q52PVUSU.js} +7 -7
  33. package/dist/_node-chunks/{chunk-J7N7PD5Q.js → chunk-RMHAL25C.js} +9 -9
  34. package/dist/_node-chunks/{chunk-ULWNTI6M.js → chunk-SDCF5RNN.js} +15 -15
  35. package/dist/_node-chunks/{chunk-MF2PUEWG.js → chunk-UJ5SJ23M.js} +7 -7
  36. package/dist/_node-chunks/{chunk-5SEHHENC.js → chunk-UPHK4ETU.js} +19 -17
  37. package/dist/_node-chunks/{chunk-6OAXYS5T.js → chunk-V7VURIPB.js} +8 -8
  38. package/dist/_node-chunks/{chunk-3FPF5Y2F.js → chunk-VPR5IBMG.js} +6 -6
  39. package/dist/_node-chunks/{chunk-QNUGJO6L.js → chunk-X4XU27M6.js} +7 -7
  40. package/dist/_node-chunks/{chunk-SCTKVDWR.js → chunk-ZHSCUGNP.js} +1467 -148
  41. package/dist/_node-chunks/{dist-APCKHSY3.js → dist-6TXHNR5C.js} +9 -9
  42. package/dist/_node-chunks/{globby-TSGXGDA2.js → globby-PBTV6PX6.js} +9 -9
  43. package/dist/_node-chunks/{lib-DZ5TVIU5.js → lib-4RTDZVGX.js} +7 -7
  44. package/dist/_node-chunks/{mdx-N42X6CFJ-Z6BYQCPN.js → mdx-N42X6CFJ-COWEH7KR.js} +8 -8
  45. package/dist/_node-chunks/{p-limit-MLJNGG2K.js → p-limit-PBVZQOFY.js} +7 -7
  46. package/dist/_node-chunks/{plugin-HJLCLGNT.js → plugin-6ZPCS4LI.js} +10 -10
  47. package/dist/_node-chunks/{plugin-J3JI3ZKJ.js → plugin-EOZKYZAG.js} +10 -10
  48. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-3QHNTM5B.js → webpack-inject-mocker-runtime-plugin-35HMSMR5.js} +10 -10
  49. package/dist/_node-chunks/{webpack-mock-plugin-4Y3MWPJ6.js → webpack-mock-plugin-GT3MA5E2.js} +9 -9
  50. package/dist/babel/index.js +11 -11
  51. package/dist/bin/core.js +11 -11
  52. package/dist/bin/dispatcher.js +11 -11
  53. package/dist/bin/loader.js +9 -9
  54. package/dist/cli/index.js +50 -74
  55. package/dist/common/index.d.ts +210 -3
  56. package/dist/common/index.js +28 -20
  57. package/dist/components/index.d.ts +472 -280
  58. package/dist/components/index.js +20367 -75
  59. package/dist/core-server/index.js +1070 -188
  60. package/dist/core-server/presets/common-manager.js +1143 -2230
  61. package/dist/core-server/presets/common-override-preset.js +9 -9
  62. package/dist/core-server/presets/common-preset.js +23 -23
  63. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  64. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  65. package/dist/csf/index.js +13 -6
  66. package/dist/csf-tools/index.d.ts +15 -4
  67. package/dist/csf-tools/index.js +9 -9
  68. package/dist/manager/globals-runtime.js +40951 -26253
  69. package/dist/manager/runtime.js +1688 -2693
  70. package/dist/manager-api/index.d.ts +11 -3
  71. package/dist/manager-api/index.js +53 -6
  72. package/dist/node-logger/index.d.ts +1 -1
  73. package/dist/node-logger/index.js +473 -448
  74. package/dist/preview/runtime.js +903 -896
  75. package/dist/preview-api/index.js +5 -5
  76. package/dist/server-errors.js +10 -10
  77. package/dist/telemetry/index.js +24 -24
  78. package/dist/test/index.js +547 -547
  79. package/dist/theming/create.d.ts +4 -2
  80. package/dist/theming/create.js +1 -1
  81. package/dist/theming/index.d.ts +9 -6
  82. package/dist/theming/index.js +13 -6
  83. package/dist/types/index.d.ts +50 -5
  84. package/package.json +14 -6
  85. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  86. package/dist/_browser-chunks/chunk-I74EUU5O.js +0 -5809
  87. package/dist/_node-chunks/camelcase-WKJOVNPM.js +0 -18
  88. package/dist/_node-chunks/chunk-HM6B7FE5.js +0 -18
  89. package/dist/_node-chunks/chunk-ZRFYQ46H.js +0 -61
  90. package/dist/_browser-chunks/{chunk-W4QKLQSC.js → chunk-RW5PKMWM.js} +5 -5
package/dist/cli/index.js CHANGED
@@ -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_8vqew0zn9si from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8vqew0zn9si 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_8vqew0zn9si.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -42,45 +42,45 @@ import {
42
42
  supportedTemplates,
43
43
  unsupportedTemplate,
44
44
  writeFileAsJson
45
- } from "../_node-chunks/chunk-RVE4UTVQ.js";
45
+ } from "../_node-chunks/chunk-LE63EHJ5.js";
46
46
  import {
47
47
  boxen
48
- } from "../_node-chunks/chunk-FEOC7OX2.js";
49
- import "../_node-chunks/chunk-DAMVKHAC.js";
48
+ } from "../_node-chunks/chunk-J3XZKWHE.js";
49
+ import "../_node-chunks/chunk-Q52PVUSU.js";
50
50
  import {
51
51
  Settings,
52
52
  _clearGlobalSettings,
53
53
  globalSettings
54
- } from "../_node-chunks/chunk-BCDHUXAJ.js";
54
+ } from "../_node-chunks/chunk-52DXKXY3.js";
55
55
  import {
56
56
  up2 as up
57
- } from "../_node-chunks/chunk-TXHNWNH4.js";
58
- import "../_node-chunks/chunk-WNOSTIYP.js";
59
- import "../_node-chunks/chunk-6OAXYS5T.js";
60
- import "../_node-chunks/chunk-BYVQZ2HU.js";
57
+ } from "../_node-chunks/chunk-EUH3NHXA.js";
58
+ import "../_node-chunks/chunk-CC4PW5MJ.js";
59
+ import "../_node-chunks/chunk-V7VURIPB.js";
60
+ import "../_node-chunks/chunk-B2DAHWJK.js";
61
61
  import {
62
62
  require_prompts
63
- } from "../_node-chunks/chunk-MF2PUEWG.js";
63
+ } from "../_node-chunks/chunk-UJ5SJ23M.js";
64
64
  import {
65
65
  require_dist
66
- } from "../_node-chunks/chunk-TUFWZUTO.js";
66
+ } from "../_node-chunks/chunk-5OVB4A6F.js";
67
67
  import {
68
68
  babelParse,
69
69
  recast,
70
70
  traverse,
71
71
  types
72
- } from "../_node-chunks/chunk-5SEHHENC.js";
73
- import "../_node-chunks/chunk-3JCSHYSU.js";
74
- import "../_node-chunks/chunk-LAU7VVPC.js";
72
+ } from "../_node-chunks/chunk-UPHK4ETU.js";
73
+ import "../_node-chunks/chunk-FOQHPHCV.js";
74
+ import "../_node-chunks/chunk-F3XOPI6H.js";
75
75
  import {
76
76
  require_picocolors
77
- } from "../_node-chunks/chunk-QNUGJO6L.js";
77
+ } from "../_node-chunks/chunk-X4XU27M6.js";
78
78
  import {
79
79
  __commonJS,
80
80
  __name,
81
81
  __require,
82
82
  __toESM
83
- } from "../_node-chunks/chunk-XCEBYOA4.js";
83
+ } from "../_node-chunks/chunk-OOI74AL3.js";
84
84
 
85
85
  // ../node_modules/esprima/dist/esprima.js
86
86
  var require_esprima = __commonJS({
@@ -7228,19 +7228,9 @@ var require_src = __commonJS({
7228
7228
  }
7229
7229
  });
7230
7230
 
7231
- // ../node_modules/has-own-prop/index.js
7232
- var require_has_own_prop = __commonJS({
7233
- "../node_modules/has-own-prop/index.js"(exports, module) {
7234
- "use strict";
7235
- var hasOwnProp = Object.prototype.hasOwnProperty;
7236
- module.exports = (object, property) => hasOwnProp.call(object, property);
7237
- }
7238
- });
7239
-
7240
7231
  // ../node_modules/comment-json/src/common.js
7241
7232
  var require_common = __commonJS({
7242
7233
  "../node_modules/comment-json/src/common.js"(exports, module) {
7243
- var hasOwnProperty = require_has_own_prop();
7244
7234
  var {
7245
7235
  isObject,
7246
7236
  isArray,
@@ -7283,7 +7273,7 @@ var require_common = __commonJS({
7283
7273
  }), "define");
7284
7274
  var copy_comments_by_kind = /* @__PURE__ */ __name((target, source, target_key, source_key, prefix, remove_source) => {
7285
7275
  const source_prop = symbol(prefix, source_key);
7286
- if (!hasOwnProperty(source, source_prop)) {
7276
+ if (!Object.hasOwn(source, source_prop)) {
7287
7277
  return;
7288
7278
  }
7289
7279
  const target_prop = target_key === source_key ? source_prop : symbol(prefix, target_key);
@@ -7310,7 +7300,7 @@ var require_common = __commonJS({
7310
7300
  }
7311
7301
  SYMBOL_PREFIXES.forEach((prefix) => {
7312
7302
  const target_prop = symbol(prefix, to);
7313
- if (!hasOwnProperty(array, target_prop)) {
7303
+ if (!Object.hasOwn(array, target_prop)) {
7314
7304
  copy_comments_by_kind(array, array, to, from, prefix, true);
7315
7305
  return;
7316
7306
  }
@@ -7333,7 +7323,7 @@ var require_common = __commonJS({
7333
7323
  if (!isString(key) && !isNumber(key)) {
7334
7324
  return;
7335
7325
  }
7336
- if (!hasOwnProperty(source, key)) {
7326
+ if (!Object.hasOwn(source, key)) {
7337
7327
  return;
7338
7328
  }
7339
7329
  target[key] = source[key];
@@ -7587,6 +7577,7 @@ var require_parse = __commonJS({
7587
7577
  comment: true,
7588
7578
  loc: true
7589
7579
  }), "tokenize");
7580
+ var current_code;
7590
7581
  var previous_hosts = [];
7591
7582
  var comments_host = null;
7592
7583
  var unassigned_comments = null;
@@ -7600,6 +7591,7 @@ var require_parse = __commonJS({
7600
7591
  var index;
7601
7592
  var reviver = null;
7602
7593
  var clean = /* @__PURE__ */ __name(() => {
7594
+ current_code = UNDEFINED;
7603
7595
  previous_props.length = previous_hosts.length = 0;
7604
7596
  last = null;
7605
7597
  last_prop = UNDEFINED;
@@ -7608,14 +7600,16 @@ var require_parse = __commonJS({
7608
7600
  clean();
7609
7601
  tokens.length = 0;
7610
7602
  unassigned_comments = comments_host = tokens = last = current = reviver = null;
7603
+ current_code = UNDEFINED;
7611
7604
  }, "free");
7612
7605
  var symbolFor = /* @__PURE__ */ __name((prefix) => Symbol.for(
7613
7606
  last_prop !== UNDEFINED ? prefix + COLON + last_prop : prefix
7614
7607
  ), "symbolFor");
7615
7608
  var transform = /* @__PURE__ */ __name((k, v) => reviver ? reviver(k, v) : v, "transform");
7616
7609
  var unexpected = /* @__PURE__ */ __name(() => {
7617
- const error = new SyntaxError(`Unexpected token ${current.value.slice(0, 1)}`);
7610
+ const error = new SyntaxError(`Unexpected token '${current.value.slice(0, 1)}', "${current_code}" is not valid JSON`);
7618
7611
  Object.assign(error, current.loc.start);
7612
+ free();
7619
7613
  throw error;
7620
7614
  }, "unexpected");
7621
7615
  var unexpected_end = /* @__PURE__ */ __name(() => {
@@ -7624,6 +7618,7 @@ var require_parse = __commonJS({
7624
7618
  line: 1,
7625
7619
  column: 0
7626
7620
  });
7621
+ free();
7627
7622
  throw error;
7628
7623
  }, "unexpected_end");
7629
7624
  var next = /* @__PURE__ */ __name(() => {
@@ -7824,6 +7819,7 @@ var require_parse = __commonJS({
7824
7819
  var isObject = /* @__PURE__ */ __name((subject) => Object(subject) === subject, "isObject");
7825
7820
  var parse = /* @__PURE__ */ __name((code, rev, no_comments) => {
7826
7821
  clean();
7822
+ current_code = code;
7827
7823
  tokens = tokenize(code);
7828
7824
  reviver = rev;
7829
7825
  remove_comments = no_comments;
@@ -7857,41 +7853,6 @@ var require_parse = __commonJS({
7857
7853
  }
7858
7854
  });
7859
7855
 
7860
- // ../node_modules/repeat-string/index.js
7861
- var require_repeat_string = __commonJS({
7862
- "../node_modules/repeat-string/index.js"(exports, module) {
7863
- "use strict";
7864
- var res = "";
7865
- var cache;
7866
- module.exports = repeat;
7867
- function repeat(str, num) {
7868
- if (typeof str !== "string") {
7869
- throw new TypeError("expected a string");
7870
- }
7871
- if (num === 1) return str;
7872
- if (num === 2) return str + str;
7873
- var max = str.length * num;
7874
- if (cache !== str || typeof cache === "undefined") {
7875
- cache = str;
7876
- res = "";
7877
- } else if (res.length >= max) {
7878
- return res.substr(0, max);
7879
- }
7880
- while (max > res.length && num > 1) {
7881
- if (num & 1) {
7882
- res += str;
7883
- }
7884
- num >>= 1;
7885
- str += str;
7886
- }
7887
- res += str;
7888
- res = res.substr(0, max);
7889
- return res;
7890
- }
7891
- __name(repeat, "repeat");
7892
- }
7893
- });
7894
-
7895
7856
  // ../node_modules/comment-json/src/stringify.js
7896
7857
  var require_stringify = __commonJS({
7897
7858
  "../node_modules/comment-json/src/stringify.js"(exports, module) {
@@ -7902,7 +7863,6 @@ var require_stringify = __commonJS({
7902
7863
  isNumber,
7903
7864
  isString
7904
7865
  } = require_util();
7905
- var repeat = require_repeat_string();
7906
7866
  var {
7907
7867
  PREFIX_BEFORE_ALL,
7908
7868
  PREFIX_BEFORE,
@@ -8064,7 +8024,7 @@ var require_stringify = __commonJS({
8064
8024
  }
8065
8025
  }
8066
8026
  __name(stringify, "stringify");
8067
- var get_indent = /* @__PURE__ */ __name((space) => isString(space) ? space : isNumber(space) ? repeat(SPACE, space) : EMPTY, "get_indent");
8027
+ var get_indent = /* @__PURE__ */ __name((space) => isString(space) ? space : isNumber(space) ? SPACE.repeat(space) : EMPTY, "get_indent");
8068
8028
  var { toString } = Object.prototype;
8069
8029
  var PRIMITIVE_OBJECT_TYPES = [
8070
8030
  "[object Number]",
@@ -8090,7 +8050,7 @@ var require_stringify = __commonJS({
8090
8050
  indent = indent_;
8091
8051
  const str = is_primitive_object(value) ? JSON.stringify(value) : stringify("", { "": value }, EMPTY);
8092
8052
  clean();
8093
- return isObject(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str;
8053
+ return isObject(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY, true).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str;
8094
8054
  };
8095
8055
  }
8096
8056
  });
@@ -8101,8 +8061,24 @@ var require_src2 = __commonJS({
8101
8061
  var { parse, tokenize } = require_parse();
8102
8062
  var stringify = require_stringify();
8103
8063
  var { CommentArray } = require_array();
8104
- var { assign } = require_common();
8064
+ var {
8065
+ PREFIX_BEFORE,
8066
+ PREFIX_AFTER_PROP,
8067
+ PREFIX_AFTER_COLON,
8068
+ PREFIX_AFTER_VALUE,
8069
+ PREFIX_AFTER,
8070
+ PREFIX_BEFORE_ALL,
8071
+ PREFIX_AFTER_ALL,
8072
+ assign
8073
+ } = require_common();
8105
8074
  module.exports = {
8075
+ PREFIX_BEFORE,
8076
+ PREFIX_AFTER_PROP,
8077
+ PREFIX_AFTER_COLON,
8078
+ PREFIX_AFTER_VALUE,
8079
+ PREFIX_AFTER,
8080
+ PREFIX_BEFORE_ALL,
8081
+ PREFIX_AFTER_ALL,
8106
8082
  parse,
8107
8083
  stringify,
8108
8084
  tokenize,
@@ -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_8vqew0zn9si from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8vqew0zn9si 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_8vqew0zn9si.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.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-ZHSCUGNP.js";
91
+ import "../_node-chunks/chunk-B23X5ZCK.js";
88
92
  import {
89
93
  versions_default
90
- } from "../_node-chunks/chunk-ZRFYQ46H.js";
94
+ } from "../_node-chunks/chunk-PRJHT3GJ.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-M47XA42S.js";
107
+ import "../_node-chunks/chunk-EUH3NHXA.js";
108
+ import "../_node-chunks/chunk-CC4PW5MJ.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-V7VURIPB.js";
115
+ import "../_node-chunks/chunk-B2DAHWJK.js";
116
+ import "../_node-chunks/chunk-UJ5SJ23M.js";
117
+ import "../_node-chunks/chunk-3CBQMG2A.js";
118
+ import "../_node-chunks/chunk-3WDAPZYQ.js";
119
+ import "../_node-chunks/chunk-5OVB4A6F.js";
120
+ import "../_node-chunks/chunk-X4XU27M6.js";
121
+ import "../_node-chunks/chunk-OOI74AL3.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,