storybook 9.0.11 → 9.0.12

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 (35) hide show
  1. package/dist/bin/index.cjs +43 -43
  2. package/dist/bin/index.js +43 -43
  3. package/dist/cli/bin/index.cjs +629 -629
  4. package/dist/cli/bin/index.js +202 -201
  5. package/dist/cli/index.cjs +13788 -13797
  6. package/dist/cli/index.d.ts +712 -15
  7. package/dist/cli/index.js +12364 -12372
  8. package/dist/common/index.cjs +10997 -10888
  9. package/dist/common/index.d.ts +348 -66
  10. package/dist/common/index.js +24318 -24206
  11. package/dist/components/index.cjs +5 -3
  12. package/dist/components/index.d.ts +2 -1
  13. package/dist/components/index.js +5 -3
  14. package/dist/core-server/index.cjs +4838 -4791
  15. package/dist/core-server/index.d.ts +10 -1
  16. package/dist/core-server/index.js +5746 -5699
  17. package/dist/core-server/presets/common-manager.js +257 -243
  18. package/dist/core-server/presets/common-preset.cjs +1047 -1045
  19. package/dist/core-server/presets/common-preset.js +2053 -2048
  20. package/dist/csf-tools/index.cjs +226 -224
  21. package/dist/csf-tools/index.js +116 -112
  22. package/dist/manager/globals-runtime.js +6 -4
  23. package/dist/manager-api/index.cjs +73 -73
  24. package/dist/manager-api/index.js +140 -140
  25. package/dist/node-logger/index.cjs +8520 -994
  26. package/dist/node-logger/index.d.ts +395 -2
  27. package/dist/node-logger/index.js +8535 -995
  28. package/dist/server-errors.cjs +201 -242
  29. package/dist/server-errors.d.ts +1 -12
  30. package/dist/server-errors.js +182 -223
  31. package/dist/telemetry/index.cjs +1224 -1223
  32. package/dist/telemetry/index.d.ts +3 -2
  33. package/dist/telemetry/index.js +1069 -1066
  34. package/dist/types/index.d.ts +3 -3
  35. package/package.json +2 -1
@@ -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 ue = Object.create;
7
+ var ie = Object.create;
8
8
  var R = Object.defineProperty;
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 });
9
+ var ce = Object.getOwnPropertyDescriptor;
10
+ var ue = Object.getOwnPropertyNames;
11
+ var le = Object.getPrototypeOf, me = 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 be = (t, e, o, n) => {
15
+ if (e && typeof e == "object" || typeof e == "function")
16
+ for (let c of ue(e))
17
+ !me.call(t, c) && c !== o && R(t, c, { get: () => e[c], enumerable: !(n = ce(e, c)) || n.enumerable });
18
18
  return t;
19
19
  };
20
- var A = (t, o, e) => (e = t != null ? ue(de(t)) : {}, be(
20
+ var A = (t, e, o) => (o = t != null ? ie(le(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
- o || !t || !t.__esModule ? R(e, "default", { value: t, enumerable: !0 }) : e,
25
+ e || !t || !t.__esModule ? R(o, "default", { value: t, enumerable: !0 }) : o,
26
26
  t
27
27
  ));
28
28
 
29
29
  // ../node_modules/picocolors/picocolors.js
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) => {
30
+ var C = O((Ee, k) => {
31
+ var E = process || {}, _ = E.argv || [], h = E.env || {}, ge = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes(
32
+ "--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), de = /* @__PURE__ */ r((t, e, o = t) => (n) => {
33
+ let c = "" + n, u = c.indexOf(e, t.length);
34
+ return ~u ? t + pe(c, e, o, u) + e : t + c + e;
35
+ }, "formatter"), pe = /* @__PURE__ */ r((t, e, o, n) => {
36
36
  let c = "", u = 0;
37
37
  do
38
- c += t.substring(u, n) + e, u = n + o.length, n = t.indexOf(o, u);
38
+ c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
39
39
  while (~n);
40
40
  return c + t.substring(u);
41
- }, "replaceClose"), w = /* @__PURE__ */ r((t = pe) => {
42
- let o = t ? ye : () => String;
41
+ }, "replaceClose"), w = /* @__PURE__ */ r((t = ge) => {
42
+ let e = t ? de : () => String;
43
43
  return {
44
44
  isColorSupported: t,
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")
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")
86
86
  };
87
87
  }, "createColors");
88
88
  k.exports = w();
@@ -90,20 +90,20 @@ var C = O((xe, k) => {
90
90
  });
91
91
 
92
92
  // ../node_modules/ts-dedent/dist/index.js
93
- var S = O((y) => {
93
+ var I = O((y) => {
94
94
  "use strict";
95
95
  Object.defineProperty(y, "__esModule", { value: !0 });
96
96
  y.dedent = void 0;
97
- function I(t) {
98
- for (var o = [], e = 1; e < arguments.length; e++)
99
- o[e - 1] = arguments[e];
97
+ function S(t) {
98
+ for (var e = [], o = 1; o < arguments.length; o++)
99
+ e[o - 1] = arguments[o];
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) {
103
103
  var p = f.match(/\n([\t ]+|(?!\s).)/g);
104
104
  return p ? m.concat(p.map(function(x) {
105
- var g, b;
106
- return (b = (g = x.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0;
105
+ var g, d;
106
+ return (d = (g = x.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && d !== void 0 ? d : 0;
107
107
  })) : m;
108
108
  }, []);
109
109
  if (c.length) {
@@ -115,37 +115,37 @@ var S = O((y) => {
115
115
  });
116
116
  }
117
117
  n[0] = n[0].replace(/^\r?\n/, "");
118
- var d = n[0];
119
- return o.forEach(function(m, f) {
120
- var p = d.match(/(?:^|\n)( *)$/), x = p ? p[1] : "", g = m;
118
+ var b = n[0];
119
+ return e.forEach(function(m, f) {
120
+ var p = b.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, ce) {
124
- return ce === 0 ? b : "" + x + b;
123
+ `).map(function(d, ae) {
124
+ return ae === 0 ? d : "" + x + d;
125
125
  }).join(`
126
- `)), d += g + n[f + 1];
127
- }), d;
126
+ `)), b += g + n[f + 1];
127
+ }), b;
128
128
  }
129
- r(I, "dedent");
130
- y.dedent = I;
131
- y.default = I;
129
+ r(S, "dedent");
130
+ y.dedent = S;
131
+ y.default = S;
132
132
  });
133
133
 
134
134
  // src/server-errors.ts
135
- var l = A(C(), 1), i = A(S(), 1);
135
+ var l = A(C(), 1), i = A(I(), 1);
136
136
 
137
137
  // src/storybook-error.ts
138
138
  function M({
139
139
  code: t,
140
- category: o
140
+ category: e
141
141
  }) {
142
- let e = String(t).padStart(4, "0");
143
- return `SB_${o}_${e}`;
142
+ let o = String(t).padStart(4, "0");
143
+ return `SB_${e}_${o}`;
144
144
  }
145
145
  r(M, "parseErrorCode");
146
146
  var a = class t extends Error {
147
- constructor(e) {
148
- super(t.getFullMessage(e));
147
+ constructor(o) {
148
+ super(t.getFullMessage(o));
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 = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
156
+ this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
157
157
  }
158
158
  static {
159
159
  r(this, "StorybookError");
@@ -163,29 +163,29 @@ 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 e = this.constructor.name;
167
- return `${this.fullErrorCode} (${e})`;
166
+ let o = this.constructor.name;
167
+ return `${this.fullErrorCode} (${o})`;
168
168
  }
169
169
  /** Generates the error message along with additional documentation link (if applicable). */
170
170
  static getFullMessage({
171
- documentation: e,
171
+ documentation: o,
172
172
  code: n,
173
173
  category: c,
174
174
  message: u
175
175
  }) {
176
- let d;
177
- return e === !0 ? d = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
178
- (d = `
179
- ${e.map((m) => ` - ${m}`).join(`
180
- `)}`), `${u}${d != null ? `
176
+ let b;
177
+ return o === !0 ? b = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof o == "string" ? b = o : Array.isArray(o) &&
178
+ (b = `
179
+ ${o.map((m) => ` - ${m}`).join(`
180
+ `)}`), `${u}${b != null ? `
181
181
 
182
- More info: ${d}
182
+ More info: ${b}
183
183
  ` : ""}`;
184
184
  }
185
185
  };
186
186
 
187
187
  // src/server-errors.ts
188
- var Ee = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
188
+ var ye = /* @__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))(Ee || {}), T = class extends a {
198
+ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ye || {}), T = class extends a {
199
199
  static {
200
200
  r(this, "NxProjectDetectedError");
201
201
  }
@@ -209,7 +209,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
209
209
  Run "nx g @nx/storybook:configuration <your-project-name>" to add Storybook to a given Nx app or lib.`
210
210
  });
211
211
  }
212
- }, v = class extends a {
212
+ }, W = class extends a {
213
213
  static {
214
214
  r(this, "MissingFrameworkFieldError");
215
215
  }
@@ -224,40 +224,40 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
224
224
  Please run 'npx storybook automigrate' to automatically fix your config.`
225
225
  });
226
226
  }
227
- }, W = class extends a {
228
- constructor(e) {
227
+ }, K = class extends a {
228
+ constructor(o) {
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 '${e.frameworkName}' in the 'framework' field of Storybook config.
234
+ Invalid value of '${o.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 = e;
239
+ this.data = o;
240
240
  }
241
241
  static {
242
242
  r(this, "InvalidFrameworkNameError");
243
243
  }
244
- }, K = class extends a {
245
- constructor(e) {
244
+ }, v = class extends a {
245
+ constructor(o) {
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 '${e.frameworkName}' package from the 'framework' field of Storybook config.
251
+ Could not evaluate the '${o.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 = e;
255
+ this.data = o;
256
256
  }
257
257
  static {
258
258
  r(this, "CouldNotEvaluateFrameworkError");
259
259
  }
260
- }, L = class extends a {
260
+ }, B = class extends a {
261
261
  static {
262
262
  r(this, "ConflictingStaticDirConfigError");
263
263
  }
@@ -274,7 +274,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
274
274
  Please remove the CLI flag from your storybook script and use only the 'staticDirs' option instead.`
275
275
  });
276
276
  }
277
- }, B = class extends a {
277
+ }, L = class extends a {
278
278
  static {
279
279
  r(this, "InvalidStoriesEntryError");
280
280
  }
@@ -308,13 +308,13 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
308
308
  });
309
309
  }
310
310
  }, P = class extends a {
311
- constructor(e) {
311
+ constructor(o) {
312
312
  super({
313
313
  category: "BUILDER-WEBPACK5",
314
314
  code: 2,
315
- message: e.error.message.trim()
315
+ message: o.error.message.trim()
316
316
  });
317
- this.data = e;
317
+ this.data = o;
318
318
  }
319
319
  static {
320
320
  r(this, "WebpackInvocationError");
@@ -325,8 +325,8 @@ function j(t = "") {
325
325
  }
326
326
  r(j, "removeAnsiEscapeCodes");
327
327
  var V = class extends a {
328
- constructor(e) {
329
- e.errors = e.errors.map((n) => ({
328
+ constructor(o) {
329
+ o.errors = o.errors.map((n) => ({
330
330
  ...n,
331
331
  message: j(n.message),
332
332
  stack: j(n.stack),
@@ -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 = e;
344
+ this.data = o;
345
345
  }
346
346
  static {
347
347
  r(this, "WebpackCompilationError");
348
348
  }
349
349
  }, $ = class extends a {
350
- constructor(e) {
350
+ constructor(o) {
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: ${e.path}
356
+ An angular.json file was not found in the current working directory: ${o.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 = e;
359
+ this.data = o;
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(e) {
384
+ constructor(o) {
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: ${e.presetName}.
390
+ Storybook failed to load the following preset: ${o.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
- ${e.error.stack || e.error.message}`
396
+ ${o.error.stack || o.error.message}`
397
397
  });
398
- this.data = e;
398
+ this.data = o;
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(e) {
425
+ constructor(o) {
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 \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
431
+ Failed to fetch \`${o.fontFamily}\` from Google Fonts with URL: \`${o.url}\``
432
432
  });
433
- this.data = e;
433
+ this.data = o;
434
434
  }
435
435
  static {
436
436
  r(this, "GoogleFontsDownloadError");
437
437
  }
438
438
  }, Y = class extends a {
439
- constructor(e) {
439
+ constructor(o) {
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 \`${e.url}\`.
445
+ An error occurred when trying to load Google Fonts with URL \`${o.url}\`.
446
446
 
447
- ${e.error instanceof Error ? e.error.message : ""}`
447
+ ${o.error instanceof Error ? o.error.message : ""}`
448
448
  });
449
- this.data = e;
449
+ this.data = o;
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(e) {
469
+ constructor(o) {
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 = e;
486
+ this.data = o;
487
487
  }
488
488
  static {
489
489
  r(this, "NoMatchingExportError");
490
490
  }
491
491
  }, H = class extends a {
492
- constructor(e) {
492
+ constructor(o) {
493
493
  let n = [
494
- `Storybook failed to load ${e.location}`,
494
+ `Storybook failed to load ${o.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 ${e.location}`,
497
+ `Support for this is currently limited in ${o.location}`,
498
498
  "You can import ESM modules in your main file, but only as dynamic import.",
499
499
  ""
500
500
  ];
501
- e.line && n.push(
501
+ o.line && n.push(
502
502
  l.default.white(
503
- `In your ${l.default.yellow(e.location)} file, line ${l.default.bold(
504
- l.default.cyan(e.num)
503
+ `In your ${l.default.yellow(o.location)} file, line ${l.default.bold(
504
+ l.default.cyan(o.num)
505
505
  )} threw an error:`
506
506
  ),
507
- l.default.gray(e.line)
507
+ l.default.gray(o.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 = e;
523
+ this.data = o;
524
524
  }
525
525
  static {
526
526
  r(this, "MainFileESMOnlyImportError");
527
527
  }
528
528
  }, z = class extends a {
529
- constructor(e) {
529
+ constructor(o) {
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[e.source || "storybook"];
540
+ }, { documentation: c, helperMessage: u } = n[o.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(e.location)}.
546
+ No configuration files have been found in your configDir: ${l.default.yellow(o.location)}.
547
547
  Storybook needs a "main.js" file, please add it.
548
548
 
549
549
  ${u}`
550
550
  });
551
- this.data = e;
551
+ this.data = o;
552
552
  }
553
553
  static {
554
554
  r(this, "MainFileMissingError");
555
555
  }
556
556
  }, q = class extends a {
557
- constructor(e) {
557
+ constructor(o) {
558
558
  let n = l.default.white(
559
- (e.error.stack || e.error.message).replaceAll(process.cwd(), "")
559
+ (o.error.stack || o.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(e.location)} file.
565
+ Storybook couldn't evaluate your ${l.default.yellow(o.location)} file.
566
566
 
567
567
  Original error:
568
568
  ${n}`
569
569
  });
570
- this.data = e;
570
+ this.data = o;
571
571
  }
572
572
  static {
573
573
  r(this, "MainFileEvaluationError");
574
574
  }
575
575
  }, Q = class extends a {
576
- constructor(e) {
576
+ constructor(o) {
577
577
  super({
578
578
  category: "CORE-SERVER",
579
579
  code: 16,
580
- message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
581
- e.status,
580
+ message: `Status has typeId "${o.status.typeId}" but was added to store with typeId "${o.typeId}". Full status: ${JSON.stringify(
581
+ o.status,
582
582
  null,
583
583
  2
584
584
  )}`
585
585
  });
586
- this.data = e;
586
+ this.data = o;
587
587
  }
588
588
  static {
589
589
  r(this, "StatusTypeIdMismatchError");
590
590
  }
591
591
  }, Z = class extends a {
592
- constructor(e) {
592
+ constructor(o) {
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 ${e.packageManager} to create a new ${e.projectType} project.
598
+ There was an error while using ${o.packageManager} to create a new ${o.projectType} project.
599
599
 
600
- ${e.error instanceof Error ? e.error.message : ""}`
600
+ ${o.error instanceof Error ? o.error.message : ""}`
601
601
  });
602
- this.data = e;
602
+ this.data = o;
603
603
  }
604
604
  static {
605
605
  r(this, "GenerateNewProjectOnInitError");
606
606
  }
607
607
  }, ee = class extends a {
608
- constructor(e) {
608
+ constructor(o) {
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 ${e.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${e.currentVersion}.
615
+ Storybook version ${o.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${o.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,37 +621,12 @@ var V = class extends a {
621
621
 
622
622
  "npx storybook@latest upgrade"`
623
623
  });
624
- this.data = e;
624
+ this.data = o;
625
625
  }
626
626
  static {
627
627
  r(this, "UpgradeStorybookToLowerVersionError");
628
628
  }
629
629
  }, oe = class extends a {
630
- constructor(e) {
631
- super({
632
- category: "CLI_UPGRADE",
633
- code: 4,
634
- message: i.dedent`
635
- You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
636
-
637
- This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
638
- This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
639
- This also happens if you're running the Storybook CLI that is locally installed in your project.
640
-
641
- If you intended to upgrade to the latest version, you should always run the Storybook CLI with a version specifier to force npm to download the latest version:
642
-
643
- "npx storybook@latest upgrade"
644
-
645
- If you intended to re-run automigrations, you should run the "automigrate" command directly instead:
646
-
647
- "npx storybook automigrate"`
648
- });
649
- this.data = e;
650
- }
651
- static {
652
- r(this, "UpgradeStorybookToSameVersionError");
653
- }
654
- }, te = class extends a {
655
630
  static {
656
631
  r(this, "UpgradeStorybookUnknownCurrentVersionError");
657
632
  }
@@ -666,21 +641,7 @@ var V = class extends a {
666
641
  It might help if you specify your Storybook config directory with the --config-dir flag.`
667
642
  });
668
643
  }
669
- }, re = class extends a {
670
- static {
671
- r(this, "UpgradeStorybookInWrongWorkingDirectory");
672
- }
673
- constructor() {
674
- super({
675
- category: "CLI_UPGRADE",
676
- code: 6,
677
- message: i.dedent`
678
- You are running the upgrade command in a CWD that does not contain Storybook dependencies.
679
-
680
- Did you mean to run it in a different directory? Make sure the directory you run this command in contains a package.json with your Storybook dependencies.`
681
- });
682
- }
683
- }, se = class extends a {
644
+ }, te = class extends a {
684
645
  static {
685
646
  r(this, "NoStatsForViteDevError");
686
647
  }
@@ -694,22 +655,22 @@ var V = class extends a {
694
655
  Please remove the \`--stats-json\` flag when running in dev mode.`
695
656
  });
696
657
  }
697
- }, ne = class extends a {
698
- constructor(e) {
658
+ }, re = class extends a {
659
+ constructor(o) {
699
660
  super({
700
661
  category: "CLI",
701
662
  code: 1,
702
663
  message: i.dedent`
703
- Unable to find versions of "${e.packageName}" using ${e.packageManager}
704
- ${e.error && `Reason: ${e.error}`}`
664
+ Unable to find versions of "${o.packageName}" using ${o.packageManager}
665
+ ${o.error && `Reason: ${o.error}`}`
705
666
  });
706
- this.data = e;
667
+ this.data = o;
707
668
  }
708
669
  static {
709
670
  r(this, "FindPackageVersionsError");
710
671
  }
711
- }, ae = class extends a {
712
- constructor(e) {
672
+ }, se = class extends a {
673
+ constructor(o) {
713
674
  super({
714
675
  category: "FRAMEWORK_NEXTJS",
715
676
  code: 3,
@@ -732,24 +693,24 @@ var V = class extends a {
732
693
  },
733
694
  };
734
695
 
735
- Original error: ${e.error.message}
696
+ Original error: ${o.error.message}
736
697
  `
737
698
  });
738
- this.data = e;
699
+ this.data = o;
739
700
  }
740
701
  static {
741
702
  r(this, "IncompatiblePostCssConfigError");
742
703
  }
743
- }, ie = class extends a {
744
- constructor(e) {
704
+ }, ne = class extends a {
705
+ constructor(o) {
745
706
  super({
746
707
  category: "CORE-SERVER",
747
708
  code: 1,
748
709
  message: i.dedent`
749
- Unable to save global settings file to ${e.filePath}
750
- ${e.error && `Reason: ${e.error}`}`
710
+ Unable to save global settings file to ${o.filePath}
711
+ ${o.error && `Reason: ${o.error}`}`
751
712
  });
752
- this.data = e;
713
+ this.data = o;
753
714
  }
754
715
  static {
755
716
  r(this, "SavingGlobalSettingsFileError");
@@ -757,33 +718,31 @@ var V = class extends a {
757
718
  };
758
719
  export {
759
720
  F as AngularLegacyBuildOptionsError,
760
- Ee as Category,
761
- L as ConflictingStaticDirConfigError,
762
- K as CouldNotEvaluateFrameworkError,
721
+ ye as Category,
722
+ B as ConflictingStaticDirConfigError,
723
+ v as CouldNotEvaluateFrameworkError,
763
724
  D as CriticalPresetLoadError,
764
- ne as FindPackageVersionsError,
725
+ re as FindPackageVersionsError,
765
726
  Z as GenerateNewProjectOnInitError,
766
727
  G as GoogleFontsDownloadError,
767
728
  Y as GoogleFontsLoadingError,
768
- ae as IncompatiblePostCssConfigError,
769
- W as InvalidFrameworkNameError,
770
- B as InvalidStoriesEntryError,
729
+ se as IncompatiblePostCssConfigError,
730
+ K as InvalidFrameworkNameError,
731
+ L as InvalidStoriesEntryError,
771
732
  H as MainFileESMOnlyImportError,
772
733
  q as MainFileEvaluationError,
773
734
  z as MainFileMissingError,
774
735
  $ as MissingAngularJsonError,
775
736
  U as MissingBuilderError,
776
- v as MissingFrameworkFieldError,
737
+ W as MissingFrameworkFieldError,
777
738
  X as NoMatchingExportError,
778
- se as NoStatsForViteDevError,
739
+ te as NoStatsForViteDevError,
779
740
  T as NxProjectDetectedError,
780
- ie as SavingGlobalSettingsFileError,
741
+ ne as SavingGlobalSettingsFileError,
781
742
  Q as StatusTypeIdMismatchError,
782
743
  J as SvelteViteWithSvelteKitError,
783
- re as UpgradeStorybookInWrongWorkingDirectory,
784
744
  ee as UpgradeStorybookToLowerVersionError,
785
- oe as UpgradeStorybookToSameVersionError,
786
- te as UpgradeStorybookUnknownCurrentVersionError,
745
+ oe as UpgradeStorybookUnknownCurrentVersionError,
787
746
  V as WebpackCompilationError,
788
747
  P as WebpackInvocationError,
789
748
  N as WebpackMissingStatsError