storybook 9.0.0-beta.7 → 9.0.0-beta.9

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 (39) hide show
  1. package/dist/bin/index.cjs +44 -44
  2. package/dist/bin/index.js +44 -44
  3. package/dist/builder-manager/index.cjs +191 -186
  4. package/dist/builder-manager/index.js +476 -471
  5. package/dist/channels/index.js +919 -941
  6. package/dist/cli/bin/index.cjs +4184 -737
  7. package/dist/cli/bin/index.js +4198 -749
  8. package/dist/cli/index.cjs +25089 -21637
  9. package/dist/cli/index.d.ts +974 -1
  10. package/dist/cli/index.js +25329 -21875
  11. package/dist/common/index.cjs +4545 -4538
  12. package/dist/common/index.d.ts +6 -1
  13. package/dist/common/index.js +4545 -4538
  14. package/dist/components/index.js +2254 -2260
  15. package/dist/core-server/index.cjs +4689 -4659
  16. package/dist/core-server/index.js +3261 -3230
  17. package/dist/core-server/presets/common-manager.js +2279 -2288
  18. package/dist/core-server/presets/common-preset.cjs +1445 -1444
  19. package/dist/core-server/presets/common-preset.js +418 -417
  20. package/dist/docs-tools/index.js +596 -603
  21. package/dist/instrumenter/index.js +1105 -1110
  22. package/dist/manager/globals-runtime.js +19954 -20093
  23. package/dist/manager/runtime.js +1874 -1881
  24. package/dist/manager-api/index.cjs +1 -1
  25. package/dist/manager-api/index.js +1309 -1340
  26. package/dist/manager-errors.js +37 -41
  27. package/dist/preview/runtime.js +13100 -13251
  28. package/dist/preview-api/index.cjs +615 -614
  29. package/dist/preview-api/index.js +1107 -1122
  30. package/dist/preview-errors.js +152 -173
  31. package/dist/server-errors.cjs +186 -171
  32. package/dist/server-errors.d.ts +11 -1
  33. package/dist/server-errors.js +167 -152
  34. package/dist/telemetry/index.cjs +4887 -1403
  35. package/dist/telemetry/index.d.ts +2 -1
  36. package/dist/telemetry/index.js +4923 -1437
  37. package/dist/test/index.js +8269 -8357
  38. package/dist/test/preview.js +3508 -3568
  39. package/package.json +4 -2
@@ -4,85 +4,85 @@ import { dirname as ESM_COMPAT_dirname } from 'node:path';
4
4
  const __filename = ESM_COMPAT_fileURLToPath(import.meta.url);
5
5
  const __dirname = ESM_COMPAT_dirname(__filename);
6
6
  const require = ESM_COMPAT_Module.createRequire(import.meta.url);
7
- var ce = Object.create;
7
+ var ue = Object.create;
8
8
  var R = Object.defineProperty;
9
- var ue = Object.getOwnPropertyDescriptor;
10
- var le = Object.getOwnPropertyNames;
11
- var me = Object.getPrototypeOf, de = Object.prototype.hasOwnProperty;
12
- var r = (t, e) => R(t, "name", { value: e, configurable: !0 });
13
- var O = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
14
- var ge = (t, e, o, n) => {
15
- if (e && typeof e == "object" || typeof e == "function")
16
- for (let c of le(e))
17
- !de.call(t, c) && c !== o && R(t, c, { get: () => e[c], enumerable: !(n = ue(e, c)) || n.enumerable });
9
+ var le = Object.getOwnPropertyDescriptor;
10
+ var me = Object.getOwnPropertyNames;
11
+ var de = Object.getPrototypeOf, ge = Object.prototype.hasOwnProperty;
12
+ var r = (t, o) => R(t, "name", { value: o, configurable: !0 });
13
+ var O = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports);
14
+ var be = (t, o, e, n) => {
15
+ if (o && typeof o == "object" || typeof o == "function")
16
+ for (let c of me(o))
17
+ !ge.call(t, c) && c !== e && R(t, c, { get: () => o[c], enumerable: !(n = le(o, c)) || n.enumerable });
18
18
  return t;
19
19
  };
20
- var A = (t, e, o) => (o = t != null ? ce(me(t)) : {}, ge(
20
+ var A = (t, o, e) => (e = t != null ? ue(de(t)) : {}, be(
21
21
  // If the importer is in node compatibility mode or this is not an ESM
22
22
  // file that has been converted to a CommonJS file using a Babel-
23
23
  // compatible transform (i.e. "__esModule" has not been set), then set
24
24
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- e || !t || !t.__esModule ? R(o, "default", { value: t, enumerable: !0 }) : o,
25
+ o || !t || !t.__esModule ? R(e, "default", { value: t, enumerable: !0 }) : e,
26
26
  t
27
27
  ));
28
28
 
29
29
  // ../node_modules/picocolors/picocolors.js
30
- var C = O((fe, k) => {
31
- var E = process || {}, _ = E.argv || [], h = E.env || {}, be = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes(
32
- "--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), pe = /* @__PURE__ */ r((t, e, o = t) => (n) => {
33
- let c = "" + n, u = c.indexOf(e, t.length);
34
- return ~u ? t + ye(c, e, o, u) + e : t + c + e;
35
- }, "formatter"), ye = /* @__PURE__ */ r((t, e, o, n) => {
30
+ var C = O((xe, k) => {
31
+ var E = process || {}, _ = E.argv || [], h = E.env || {}, pe = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes(
32
+ "--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), ye = /* @__PURE__ */ r((t, o, e = t) => (n) => {
33
+ let c = "" + n, u = c.indexOf(o, t.length);
34
+ return ~u ? t + he(c, o, e, u) + o : t + c + o;
35
+ }, "formatter"), he = /* @__PURE__ */ r((t, o, e, n) => {
36
36
  let c = "", u = 0;
37
37
  do
38
- c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
38
+ c += t.substring(u, n) + e, u = n + o.length, n = t.indexOf(o, u);
39
39
  while (~n);
40
40
  return c + t.substring(u);
41
- }, "replaceClose"), w = /* @__PURE__ */ r((t = be) => {
42
- let e = t ? pe : () => String;
41
+ }, "replaceClose"), w = /* @__PURE__ */ r((t = pe) => {
42
+ let o = t ? ye : () => String;
43
43
  return {
44
44
  isColorSupported: t,
45
- reset: e("\x1B[0m", "\x1B[0m"),
46
- bold: e("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
47
- dim: e("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
48
- italic: e("\x1B[3m", "\x1B[23m"),
49
- underline: e("\x1B[4m", "\x1B[24m"),
50
- inverse: e("\x1B[7m", "\x1B[27m"),
51
- hidden: e("\x1B[8m", "\x1B[28m"),
52
- strikethrough: e("\x1B[9m", "\x1B[29m"),
53
- black: e("\x1B[30m", "\x1B[39m"),
54
- red: e("\x1B[31m", "\x1B[39m"),
55
- green: e("\x1B[32m", "\x1B[39m"),
56
- yellow: e("\x1B[33m", "\x1B[39m"),
57
- blue: e("\x1B[34m", "\x1B[39m"),
58
- magenta: e("\x1B[35m", "\x1B[39m"),
59
- cyan: e("\x1B[36m", "\x1B[39m"),
60
- white: e("\x1B[37m", "\x1B[39m"),
61
- gray: e("\x1B[90m", "\x1B[39m"),
62
- bgBlack: e("\x1B[40m", "\x1B[49m"),
63
- bgRed: e("\x1B[41m", "\x1B[49m"),
64
- bgGreen: e("\x1B[42m", "\x1B[49m"),
65
- bgYellow: e("\x1B[43m", "\x1B[49m"),
66
- bgBlue: e("\x1B[44m", "\x1B[49m"),
67
- bgMagenta: e("\x1B[45m", "\x1B[49m"),
68
- bgCyan: e("\x1B[46m", "\x1B[49m"),
69
- bgWhite: e("\x1B[47m", "\x1B[49m"),
70
- blackBright: e("\x1B[90m", "\x1B[39m"),
71
- redBright: e("\x1B[91m", "\x1B[39m"),
72
- greenBright: e("\x1B[92m", "\x1B[39m"),
73
- yellowBright: e("\x1B[93m", "\x1B[39m"),
74
- blueBright: e("\x1B[94m", "\x1B[39m"),
75
- magentaBright: e("\x1B[95m", "\x1B[39m"),
76
- cyanBright: e("\x1B[96m", "\x1B[39m"),
77
- whiteBright: e("\x1B[97m", "\x1B[39m"),
78
- bgBlackBright: e("\x1B[100m", "\x1B[49m"),
79
- bgRedBright: e("\x1B[101m", "\x1B[49m"),
80
- bgGreenBright: e("\x1B[102m", "\x1B[49m"),
81
- bgYellowBright: e("\x1B[103m", "\x1B[49m"),
82
- bgBlueBright: e("\x1B[104m", "\x1B[49m"),
83
- bgMagentaBright: e("\x1B[105m", "\x1B[49m"),
84
- bgCyanBright: e("\x1B[106m", "\x1B[49m"),
85
- bgWhiteBright: e("\x1B[107m", "\x1B[49m")
45
+ reset: o("\x1B[0m", "\x1B[0m"),
46
+ bold: o("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
47
+ dim: o("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
48
+ italic: o("\x1B[3m", "\x1B[23m"),
49
+ underline: o("\x1B[4m", "\x1B[24m"),
50
+ inverse: o("\x1B[7m", "\x1B[27m"),
51
+ hidden: o("\x1B[8m", "\x1B[28m"),
52
+ strikethrough: o("\x1B[9m", "\x1B[29m"),
53
+ black: o("\x1B[30m", "\x1B[39m"),
54
+ red: o("\x1B[31m", "\x1B[39m"),
55
+ green: o("\x1B[32m", "\x1B[39m"),
56
+ yellow: o("\x1B[33m", "\x1B[39m"),
57
+ blue: o("\x1B[34m", "\x1B[39m"),
58
+ magenta: o("\x1B[35m", "\x1B[39m"),
59
+ cyan: o("\x1B[36m", "\x1B[39m"),
60
+ white: o("\x1B[37m", "\x1B[39m"),
61
+ gray: o("\x1B[90m", "\x1B[39m"),
62
+ bgBlack: o("\x1B[40m", "\x1B[49m"),
63
+ bgRed: o("\x1B[41m", "\x1B[49m"),
64
+ bgGreen: o("\x1B[42m", "\x1B[49m"),
65
+ bgYellow: o("\x1B[43m", "\x1B[49m"),
66
+ bgBlue: o("\x1B[44m", "\x1B[49m"),
67
+ bgMagenta: o("\x1B[45m", "\x1B[49m"),
68
+ bgCyan: o("\x1B[46m", "\x1B[49m"),
69
+ bgWhite: o("\x1B[47m", "\x1B[49m"),
70
+ blackBright: o("\x1B[90m", "\x1B[39m"),
71
+ redBright: o("\x1B[91m", "\x1B[39m"),
72
+ greenBright: o("\x1B[92m", "\x1B[39m"),
73
+ yellowBright: o("\x1B[93m", "\x1B[39m"),
74
+ blueBright: o("\x1B[94m", "\x1B[39m"),
75
+ magentaBright: o("\x1B[95m", "\x1B[39m"),
76
+ cyanBright: o("\x1B[96m", "\x1B[39m"),
77
+ whiteBright: o("\x1B[97m", "\x1B[39m"),
78
+ bgBlackBright: o("\x1B[100m", "\x1B[49m"),
79
+ bgRedBright: o("\x1B[101m", "\x1B[49m"),
80
+ bgGreenBright: o("\x1B[102m", "\x1B[49m"),
81
+ bgYellowBright: o("\x1B[103m", "\x1B[49m"),
82
+ bgBlueBright: o("\x1B[104m", "\x1B[49m"),
83
+ bgMagentaBright: o("\x1B[105m", "\x1B[49m"),
84
+ bgCyanBright: o("\x1B[106m", "\x1B[49m"),
85
+ bgWhiteBright: o("\x1B[107m", "\x1B[49m")
86
86
  };
87
87
  }, "createColors");
88
88
  k.exports = w();
@@ -95,8 +95,8 @@ var S = O((y) => {
95
95
  Object.defineProperty(y, "__esModule", { value: !0 });
96
96
  y.dedent = void 0;
97
97
  function I(t) {
98
- for (var e = [], o = 1; o < arguments.length; o++)
99
- e[o - 1] = arguments[o];
98
+ for (var o = [], e = 1; e < arguments.length; e++)
99
+ o[e - 1] = arguments[e];
100
100
  var n = Array.from(typeof t == "string" ? [t] : t);
101
101
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
102
102
  var c = n.reduce(function(m, f) {
@@ -116,12 +116,12 @@ var S = O((y) => {
116
116
  }
117
117
  n[0] = n[0].replace(/^\r?\n/, "");
118
118
  var d = n[0];
119
- return e.forEach(function(m, f) {
119
+ return o.forEach(function(m, f) {
120
120
  var p = d.match(/(?:^|\n)( *)$/), x = p ? p[1] : "", g = m;
121
121
  typeof m == "string" && m.includes(`
122
122
  `) && (g = String(m).split(`
123
- `).map(function(b, ie) {
124
- return ie === 0 ? b : "" + x + b;
123
+ `).map(function(b, ce) {
124
+ return ce === 0 ? b : "" + x + b;
125
125
  }).join(`
126
126
  `)), d += g + n[f + 1];
127
127
  }), d;
@@ -137,15 +137,15 @@ var l = A(C(), 1), i = A(S(), 1);
137
137
  // src/storybook-error.ts
138
138
  function M({
139
139
  code: t,
140
- category: e
140
+ category: o
141
141
  }) {
142
- let o = String(t).padStart(4, "0");
143
- return `SB_${e}_${o}`;
142
+ let e = String(t).padStart(4, "0");
143
+ return `SB_${o}_${e}`;
144
144
  }
145
145
  r(M, "parseErrorCode");
146
146
  var a = class t extends Error {
147
- constructor(o) {
148
- super(t.getFullMessage(o));
147
+ constructor(e) {
148
+ super(t.getFullMessage(e));
149
149
  /**
150
150
  * Data associated with the error. Used to provide additional information in the error message or
151
151
  * to be passed to telemetry.
@@ -153,7 +153,7 @@ var a = class t extends Error {
153
153
  this.data = {};
154
154
  /** Flag used to easily determine if the error originates from Storybook. */
155
155
  this.fromStorybook = !0;
156
- this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
156
+ this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
157
157
  }
158
158
  static {
159
159
  r(this, "StorybookError");
@@ -163,20 +163,20 @@ var a = class t extends Error {
163
163
  }
164
164
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
165
165
  get name() {
166
- let o = this.constructor.name;
167
- return `${this.fullErrorCode} (${o})`;
166
+ let e = this.constructor.name;
167
+ return `${this.fullErrorCode} (${e})`;
168
168
  }
169
169
  /** Generates the error message along with additional documentation link (if applicable). */
170
170
  static getFullMessage({
171
- documentation: o,
171
+ documentation: e,
172
172
  code: n,
173
173
  category: c,
174
174
  message: u
175
175
  }) {
176
176
  let d;
177
- return o === !0 ? d = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof o == "string" ? d = o : Array.isArray(o) &&
177
+ return e === !0 ? d = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
178
178
  (d = `
179
- ${o.map((m) => ` - ${m}`).join(`
179
+ ${e.map((m) => ` - ${m}`).join(`
180
180
  `)}`), `${u}${d != null ? `
181
181
 
182
182
  More info: ${d}
@@ -185,7 +185,7 @@ More info: ${d}
185
185
  };
186
186
 
187
187
  // src/server-errors.ts
188
- var he = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
188
+ var Ee = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
189
189
  E", s.CLI_ADD = "CLI_ADD", s.CODEMOD = "CODEMOD", s.CORE_SERVER = "CORE-SERVER", s.CSF_PLUGIN = "CSF-PLUGIN", s.CSF_TOOLS = "CSF-TOOLS", s.CORE_COMMON =
190
190
  "CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
191
191
  TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
@@ -195,7 +195,7 @@ FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.F
195
195
  "FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
196
196
  FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
197
197
  s.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", s.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", s.FRAMEWORK_WEB_COMPONENTS_VITE = "FRA\
198
- MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(he || {}), T = class extends a {
198
+ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(Ee || {}), T = class extends a {
199
199
  static {
200
200
  r(this, "NxProjectDetectedError");
201
201
  }
@@ -225,34 +225,34 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
225
225
  });
226
226
  }
227
227
  }, W = class extends a {
228
- constructor(o) {
228
+ constructor(e) {
229
229
  super({
230
230
  category: "CORE-COMMON",
231
231
  code: 2,
232
232
  documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
233
233
  message: i.dedent`
234
- Invalid value of '${o.frameworkName}' in the 'framework' field of Storybook config.
234
+ Invalid value of '${e.frameworkName}' in the 'framework' field of Storybook config.
235
235
 
236
236
  Please run 'npx storybook automigrate' to automatically fix your config.
237
237
  `
238
238
  });
239
- this.data = o;
239
+ this.data = e;
240
240
  }
241
241
  static {
242
242
  r(this, "InvalidFrameworkNameError");
243
243
  }
244
244
  }, K = class extends a {
245
- constructor(o) {
245
+ constructor(e) {
246
246
  super({
247
247
  category: "CORE-COMMON",
248
248
  code: 3,
249
249
  documentation: "",
250
250
  message: i.dedent`
251
- Could not evaluate the '${o.frameworkName}' package from the 'framework' field of Storybook config.
251
+ Could not evaluate the '${e.frameworkName}' package from the 'framework' field of Storybook config.
252
252
 
253
253
  Are you sure it's a valid package and is installed?`
254
254
  });
255
- this.data = o;
255
+ this.data = e;
256
256
  }
257
257
  static {
258
258
  r(this, "CouldNotEvaluateFrameworkError");
@@ -307,29 +307,29 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
307
307
  Storybook needs Webpack stats (including errors) in order to build correctly.`
308
308
  });
309
309
  }
310
- }, j = class extends a {
311
- constructor(o) {
310
+ }, P = class extends a {
311
+ constructor(e) {
312
312
  super({
313
313
  category: "BUILDER-WEBPACK5",
314
314
  code: 2,
315
- message: o.error.message.trim()
315
+ message: e.error.message.trim()
316
316
  });
317
- this.data = o;
317
+ this.data = e;
318
318
  }
319
319
  static {
320
320
  r(this, "WebpackInvocationError");
321
321
  }
322
322
  };
323
- function P(t = "") {
323
+ function j(t = "") {
324
324
  return t.replace(/\u001B\[[0-9;]*m/g, "");
325
325
  }
326
- r(P, "removeAnsiEscapeCodes");
326
+ r(j, "removeAnsiEscapeCodes");
327
327
  var V = class extends a {
328
- constructor(o) {
329
- o.errors = o.errors.map((n) => ({
328
+ constructor(e) {
329
+ e.errors = e.errors.map((n) => ({
330
330
  ...n,
331
- message: P(n.message),
332
- stack: P(n.stack),
331
+ message: j(n.message),
332
+ stack: j(n.stack),
333
333
  name: n.name
334
334
  }));
335
335
  super({
@@ -341,22 +341,22 @@ var V = class extends a {
341
341
  Run Storybook with --debug-webpack for more information.
342
342
  `
343
343
  });
344
- this.data = o;
344
+ this.data = e;
345
345
  }
346
346
  static {
347
347
  r(this, "WebpackCompilationError");
348
348
  }
349
349
  }, $ = class extends a {
350
- constructor(o) {
350
+ constructor(e) {
351
351
  super({
352
352
  category: "CLI_INIT",
353
353
  code: 2,
354
354
  documentation: "https://storybook.js.org/docs/faq#error-no-angularjson-file-found",
355
355
  message: i.dedent`
356
- An angular.json file was not found in the current working directory: ${o.path}
356
+ An angular.json file was not found in the current working directory: ${e.path}
357
357
  Storybook needs it to work properly, so please rerun the command at the root of your project, where the angular.json file is located.`
358
358
  });
359
- this.data = o;
359
+ this.data = e;
360
360
  }
361
361
  static {
362
362
  r(this, "MissingAngularJsonError");
@@ -381,21 +381,21 @@ var V = class extends a {
381
381
  });
382
382
  }
383
383
  }, D = class extends a {
384
- constructor(o) {
384
+ constructor(e) {
385
385
  super({
386
386
  category: "CORE-SERVER",
387
387
  code: 2,
388
388
  documentation: "",
389
389
  message: i.dedent`
390
- Storybook failed to load the following preset: ${o.presetName}.
390
+ Storybook failed to load the following preset: ${e.presetName}.
391
391
 
392
392
  Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
393
393
 
394
394
  If you believe this is a bug, please open an issue on Github.
395
395
 
396
- ${o.error.stack || o.error.message}`
396
+ ${e.error.stack || e.error.message}`
397
397
  });
398
- this.data = o;
398
+ this.data = e;
399
399
  }
400
400
  static {
401
401
  r(this, "CriticalPresetLoadError");
@@ -422,31 +422,31 @@ var V = class extends a {
422
422
  });
423
423
  }
424
424
  }, G = class extends a {
425
- constructor(o) {
425
+ constructor(e) {
426
426
  super({
427
427
  category: "FRAMEWORK_NEXTJS",
428
428
  code: 1,
429
429
  documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
430
430
  message: i.dedent`
431
- Failed to fetch \`${o.fontFamily}\` from Google Fonts with URL: \`${o.url}\``
431
+ Failed to fetch \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
432
432
  });
433
- this.data = o;
433
+ this.data = e;
434
434
  }
435
435
  static {
436
436
  r(this, "GoogleFontsDownloadError");
437
437
  }
438
438
  }, Y = class extends a {
439
- constructor(o) {
439
+ constructor(e) {
440
440
  super({
441
441
  category: "FRAMEWORK_NEXTJS",
442
442
  code: 2,
443
443
  documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
444
444
  message: i.dedent`
445
- An error occurred when trying to load Google Fonts with URL \`${o.url}\`.
445
+ An error occurred when trying to load Google Fonts with URL \`${e.url}\`.
446
446
 
447
- ${o.error instanceof Error ? o.error.message : ""}`
447
+ ${e.error instanceof Error ? e.error.message : ""}`
448
448
  });
449
- this.data = o;
449
+ this.data = e;
450
450
  }
451
451
  static {
452
452
  r(this, "GoogleFontsLoadingError");
@@ -466,7 +466,7 @@ var V = class extends a {
466
466
  });
467
467
  }
468
468
  }, X = class extends a {
469
- constructor(o) {
469
+ constructor(e) {
470
470
  super({
471
471
  category: "CORE-SERVER",
472
472
  code: 4,
@@ -483,28 +483,28 @@ var V = class extends a {
483
483
 
484
484
  Please run \`npx storybook doctor\` for guidance on how to fix this issue.`
485
485
  });
486
- this.data = o;
486
+ this.data = e;
487
487
  }
488
488
  static {
489
489
  r(this, "NoMatchingExportError");
490
490
  }
491
491
  }, H = class extends a {
492
- constructor(o) {
492
+ constructor(e) {
493
493
  let n = [
494
- `Storybook failed to load ${o.location}`,
494
+ `Storybook failed to load ${e.location}`,
495
495
  "",
496
496
  "It looks like the file tried to load/import an ESM only module.",
497
- `Support for this is currently limited in ${o.location}`,
497
+ `Support for this is currently limited in ${e.location}`,
498
498
  "You can import ESM modules in your main file, but only as dynamic import.",
499
499
  ""
500
500
  ];
501
- o.line && n.push(
501
+ e.line && n.push(
502
502
  l.default.white(
503
- `In your ${l.default.yellow(o.location)} file, line ${l.default.bold(
504
- l.default.cyan(o.num)
503
+ `In your ${l.default.yellow(e.location)} file, line ${l.default.bold(
504
+ l.default.cyan(e.num)
505
505
  )} threw an error:`
506
506
  ),
507
- l.default.gray(o.line)
507
+ l.default.gray(e.line)
508
508
  ), n.push(
509
509
  "",
510
510
  l.default.white(
@@ -520,13 +520,13 @@ var V = class extends a {
520
520
  message: n.join(`
521
521
  `)
522
522
  });
523
- this.data = o;
523
+ this.data = e;
524
524
  }
525
525
  static {
526
526
  r(this, "MainFileESMOnlyImportError");
527
527
  }
528
528
  }, z = class extends a {
529
- constructor(o) {
529
+ constructor(e) {
530
530
  let n = {
531
531
  storybook: {
532
532
  helperMessage: "You can pass a --config-dir flag to tell Storybook, where your main.js file is located at.",
@@ -537,82 +537,82 @@ var V = class extends a {
537
537
  // TODO: add proper docs once available
538
538
  documentation: "https://storybook.js.org/docs/configure"
539
539
  }
540
- }, { documentation: c, helperMessage: u } = n[o.source || "storybook"];
540
+ }, { documentation: c, helperMessage: u } = n[e.source || "storybook"];
541
541
  super({
542
542
  category: "CORE-SERVER",
543
543
  code: 6,
544
544
  documentation: c,
545
545
  message: i.dedent`
546
- No configuration files have been found in your configDir: ${l.default.yellow(o.location)}.
546
+ No configuration files have been found in your configDir: ${l.default.yellow(e.location)}.
547
547
  Storybook needs a "main.js" file, please add it.
548
548
 
549
549
  ${u}`
550
550
  });
551
- this.data = o;
551
+ this.data = e;
552
552
  }
553
553
  static {
554
554
  r(this, "MainFileMissingError");
555
555
  }
556
556
  }, q = class extends a {
557
- constructor(o) {
557
+ constructor(e) {
558
558
  let n = l.default.white(
559
- (o.error.stack || o.error.message).replaceAll(process.cwd(), "")
559
+ (e.error.stack || e.error.message).replaceAll(process.cwd(), "")
560
560
  );
561
561
  super({
562
562
  category: "CORE-SERVER",
563
563
  code: 7,
564
564
  message: i.dedent`
565
- Storybook couldn't evaluate your ${l.default.yellow(o.location)} file.
565
+ Storybook couldn't evaluate your ${l.default.yellow(e.location)} file.
566
566
 
567
567
  Original error:
568
568
  ${n}`
569
569
  });
570
- this.data = o;
570
+ this.data = e;
571
571
  }
572
572
  static {
573
573
  r(this, "MainFileEvaluationError");
574
574
  }
575
575
  }, Q = class extends a {
576
- constructor(o) {
576
+ constructor(e) {
577
577
  super({
578
578
  category: "CORE-SERVER",
579
579
  code: 16,
580
- message: `Status has typeId "${o.status.typeId}" but was added to store with typeId "${o.typeId}". Full status: ${JSON.stringify(
581
- o.status,
580
+ message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
581
+ e.status,
582
582
  null,
583
583
  2
584
584
  )}`
585
585
  });
586
- this.data = o;
586
+ this.data = e;
587
587
  }
588
588
  static {
589
589
  r(this, "StatusTypeIdMismatchError");
590
590
  }
591
591
  }, Z = class extends a {
592
- constructor(o) {
592
+ constructor(e) {
593
593
  super({
594
594
  category: "CLI_INIT",
595
595
  code: 3,
596
596
  documentation: "",
597
597
  message: i.dedent`
598
- There was an error while using ${o.packageManager} to create a new ${o.projectType} project.
598
+ There was an error while using ${e.packageManager} to create a new ${e.projectType} project.
599
599
 
600
- ${o.error instanceof Error ? o.error.message : ""}`
600
+ ${e.error instanceof Error ? e.error.message : ""}`
601
601
  });
602
- this.data = o;
602
+ this.data = e;
603
603
  }
604
604
  static {
605
605
  r(this, "GenerateNewProjectOnInitError");
606
606
  }
607
607
  }, ee = class extends a {
608
- constructor(o) {
608
+ constructor(e) {
609
609
  super({
610
610
  category: "CLI_UPGRADE",
611
611
  code: 3,
612
612
  message: i.dedent`
613
613
  You are trying to upgrade Storybook to a lower version than the version currently installed. This is not supported.
614
614
 
615
- Storybook version ${o.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${o.currentVersion}.
615
+ Storybook version ${e.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${e.currentVersion}.
616
616
 
617
617
  This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
618
618
  This will cause npm to run the globally cached storybook binary, which might be an older version.
@@ -621,18 +621,18 @@ var V = class extends a {
621
621
 
622
622
  "npx storybook@latest upgrade"`
623
623
  });
624
- this.data = o;
624
+ this.data = e;
625
625
  }
626
626
  static {
627
627
  r(this, "UpgradeStorybookToLowerVersionError");
628
628
  }
629
629
  }, oe = class extends a {
630
- constructor(o) {
630
+ constructor(e) {
631
631
  super({
632
632
  category: "CLI_UPGRADE",
633
633
  code: 4,
634
634
  message: i.dedent`
635
- You are upgrading Storybook to the same version that is currently installed in the project, version ${o.beforeVersion}.
635
+ You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
636
636
 
637
637
  This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
638
638
  This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
@@ -646,7 +646,7 @@ var V = class extends a {
646
646
 
647
647
  "npx storybook automigrate"`
648
648
  });
649
- this.data = o;
649
+ this.data = e;
650
650
  }
651
651
  static {
652
652
  r(this, "UpgradeStorybookToSameVersionError");
@@ -695,21 +695,21 @@ var V = class extends a {
695
695
  });
696
696
  }
697
697
  }, ne = class extends a {
698
- constructor(o) {
698
+ constructor(e) {
699
699
  super({
700
700
  category: "CLI",
701
701
  code: 1,
702
702
  message: i.dedent`
703
- Unable to find versions of "${o.packageName}" using ${o.packageManager}
704
- ${o.error && `Reason: ${o.error}`}`
703
+ Unable to find versions of "${e.packageName}" using ${e.packageManager}
704
+ ${e.error && `Reason: ${e.error}`}`
705
705
  });
706
- this.data = o;
706
+ this.data = e;
707
707
  }
708
708
  static {
709
709
  r(this, "FindPackageVersionsError");
710
710
  }
711
711
  }, ae = class extends a {
712
- constructor(o) {
712
+ constructor(e) {
713
713
  super({
714
714
  category: "FRAMEWORK_NEXTJS",
715
715
  code: 3,
@@ -732,18 +732,32 @@ var V = class extends a {
732
732
  },
733
733
  };
734
734
 
735
- Original error: ${o.error.message}
735
+ Original error: ${e.error.message}
736
736
  `
737
737
  });
738
- this.data = o;
738
+ this.data = e;
739
739
  }
740
740
  static {
741
741
  r(this, "IncompatiblePostCssConfigError");
742
742
  }
743
+ }, ie = class extends a {
744
+ constructor(e) {
745
+ super({
746
+ category: "CORE-SERVER",
747
+ code: 1,
748
+ message: i.dedent`
749
+ Unable to save global settings file to ${e.filePath}
750
+ ${e.error && `Reason: ${e.error}`}`
751
+ });
752
+ this.data = e;
753
+ }
754
+ static {
755
+ r(this, "SavingGlobalSettingsFileError");
756
+ }
743
757
  };
744
758
  export {
745
759
  F as AngularLegacyBuildOptionsError,
746
- he as Category,
760
+ Ee as Category,
747
761
  L as ConflictingStaticDirConfigError,
748
762
  K as CouldNotEvaluateFrameworkError,
749
763
  D as CriticalPresetLoadError,
@@ -763,6 +777,7 @@ export {
763
777
  X as NoMatchingExportError,
764
778
  se as NoStatsForViteDevError,
765
779
  T as NxProjectDetectedError,
780
+ ie as SavingGlobalSettingsFileError,
766
781
  Q as StatusTypeIdMismatchError,
767
782
  J as SvelteViteWithSvelteKitError,
768
783
  re as UpgradeStorybookInWrongWorkingDirectory,
@@ -770,6 +785,6 @@ export {
770
785
  oe as UpgradeStorybookToSameVersionError,
771
786
  te as UpgradeStorybookUnknownCurrentVersionError,
772
787
  V as WebpackCompilationError,
773
- j as WebpackInvocationError,
788
+ P as WebpackInvocationError,
774
789
  N as WebpackMissingStatsError
775
790
  };