storybook 9.0.0-beta.6 → 9.0.0-beta.8

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/cli/bin/index.cjs +4184 -737
  4. package/dist/cli/bin/index.js +4198 -749
  5. package/dist/cli/index.cjs +25090 -21638
  6. package/dist/cli/index.d.ts +974 -1
  7. package/dist/cli/index.js +25330 -21876
  8. package/dist/common/index.cjs +4518 -4511
  9. package/dist/common/index.d.ts +7 -2
  10. package/dist/common/index.js +4528 -4521
  11. package/dist/core-server/index.cjs +3240 -3235
  12. package/dist/core-server/index.d.ts +22 -22
  13. package/dist/core-server/index.js +1288 -1283
  14. package/dist/core-server/presets/common-preset.cjs +1445 -1444
  15. package/dist/core-server/presets/common-preset.js +418 -417
  16. package/dist/manager/globals-runtime.js +8188 -8165
  17. package/dist/manager/runtime.js +1151 -1149
  18. package/dist/manager-api/index.cjs +1046 -1023
  19. package/dist/manager-api/index.d.ts +12 -1
  20. package/dist/manager-api/index.js +649 -626
  21. package/dist/preview/runtime.js +5389 -5388
  22. package/dist/preview-api/index.cjs +615 -614
  23. package/dist/preview-api/index.js +532 -531
  24. package/dist/server-errors.cjs +186 -171
  25. package/dist/server-errors.d.ts +11 -1
  26. package/dist/server-errors.js +167 -152
  27. package/dist/telemetry/index.cjs +4887 -1403
  28. package/dist/telemetry/index.d.ts +2 -1
  29. package/dist/telemetry/index.js +4923 -1437
  30. package/dist/test/index.d.ts +2 -6
  31. package/dist/test/index.js +2818 -2818
  32. package/dist/test/preview.cjs +648 -648
  33. package/dist/test/preview.js +837 -837
  34. package/dist/test/spy.cjs +112 -112
  35. package/dist/test/spy.d.ts +2 -6
  36. package/dist/test/spy.js +104 -104
  37. package/dist/types/index.cjs +4 -4
  38. package/dist/types/index.d.ts +2687 -2594
  39. package/package.json +3 -2
@@ -1,99 +1,99 @@
1
1
  "use strict";
2
- var le = Object.create;
2
+ var me = Object.create;
3
3
  var y = Object.defineProperty;
4
- var me = Object.getOwnPropertyDescriptor;
5
- var de = Object.getOwnPropertyNames;
6
- var ge = Object.getPrototypeOf, be = Object.prototype.hasOwnProperty;
7
- var r = (t, e) => y(t, "name", { value: e, configurable: !0 });
8
- var Q = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), pe = (t, e) => {
9
- for (var o in e)
10
- y(t, o, { get: e[o], enumerable: !0 });
11
- }, Z = (t, e, o, n) => {
12
- if (e && typeof e == "object" || typeof e == "function")
13
- for (let c of de(e))
14
- !be.call(t, c) && c !== o && y(t, c, { get: () => e[c], enumerable: !(n = me(e, c)) || n.enumerable });
4
+ var de = Object.getOwnPropertyDescriptor;
5
+ var ge = Object.getOwnPropertyNames;
6
+ var be = Object.getPrototypeOf, pe = Object.prototype.hasOwnProperty;
7
+ var r = (t, o) => y(t, "name", { value: o, configurable: !0 });
8
+ var Z = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports), ye = (t, o) => {
9
+ for (var e in o)
10
+ y(t, e, { get: o[e], enumerable: !0 });
11
+ }, ee = (t, o, e, n) => {
12
+ if (o && typeof o == "object" || typeof o == "function")
13
+ for (let c of ge(o))
14
+ !pe.call(t, c) && c !== e && y(t, c, { get: () => o[c], enumerable: !(n = de(o, c)) || n.enumerable });
15
15
  return t;
16
16
  };
17
- var ee = (t, e, o) => (o = t != null ? le(ge(t)) : {}, Z(
17
+ var oe = (t, o, e) => (e = t != null ? me(be(t)) : {}, ee(
18
18
  // If the importer is in node compatibility mode or this is not an ESM
19
19
  // file that has been converted to a CommonJS file using a Babel-
20
20
  // compatible transform (i.e. "__esModule" has not been set), then set
21
21
  // "default" to the CommonJS "module.exports" for node compatibility.
22
- e || !t || !t.__esModule ? y(o, "default", { value: t, enumerable: !0 }) : o,
22
+ o || !t || !t.__esModule ? y(e, "default", { value: t, enumerable: !0 }) : e,
23
23
  t
24
- )), ye = (t) => Z(y({}, "__esModule", { value: !0 }), t);
24
+ )), he = (t) => ee(y({}, "__esModule", { value: !0 }), t);
25
25
 
26
26
  // ../node_modules/picocolors/picocolors.js
27
- var re = Q((ke, k) => {
28
- var f = process || {}, oe = f.argv || [], E = f.env || {}, he = !(E.NO_COLOR || oe.includes("--no-color")) && (!!E.FORCE_COLOR || oe.includes(
29
- "--color") || f.platform === "win32" || (f.stdout || {}).isTTY && E.TERM !== "dumb" || !!E.CI), Ee = /* @__PURE__ */ r((t, e, o = t) => (n) => {
30
- let c = "" + n, u = c.indexOf(e, t.length);
31
- return ~u ? t + fe(c, e, o, u) + e : t + c + e;
32
- }, "formatter"), fe = /* @__PURE__ */ r((t, e, o, n) => {
27
+ var se = Z((Oe, k) => {
28
+ var f = process || {}, te = f.argv || [], E = f.env || {}, Ee = !(E.NO_COLOR || te.includes("--no-color")) && (!!E.FORCE_COLOR || te.includes(
29
+ "--color") || f.platform === "win32" || (f.stdout || {}).isTTY && E.TERM !== "dumb" || !!E.CI), fe = /* @__PURE__ */ r((t, o, e = t) => (n) => {
30
+ let c = "" + n, u = c.indexOf(o, t.length);
31
+ return ~u ? t + xe(c, o, e, u) + o : t + c + o;
32
+ }, "formatter"), xe = /* @__PURE__ */ r((t, o, e, n) => {
33
33
  let c = "", u = 0;
34
34
  do
35
- c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
35
+ c += t.substring(u, n) + e, u = n + o.length, n = t.indexOf(o, u);
36
36
  while (~n);
37
37
  return c + t.substring(u);
38
- }, "replaceClose"), te = /* @__PURE__ */ r((t = he) => {
39
- let e = t ? Ee : () => String;
38
+ }, "replaceClose"), re = /* @__PURE__ */ r((t = Ee) => {
39
+ let o = t ? fe : () => String;
40
40
  return {
41
41
  isColorSupported: t,
42
- reset: e("\x1B[0m", "\x1B[0m"),
43
- bold: e("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
44
- dim: e("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
45
- italic: e("\x1B[3m", "\x1B[23m"),
46
- underline: e("\x1B[4m", "\x1B[24m"),
47
- inverse: e("\x1B[7m", "\x1B[27m"),
48
- hidden: e("\x1B[8m", "\x1B[28m"),
49
- strikethrough: e("\x1B[9m", "\x1B[29m"),
50
- black: e("\x1B[30m", "\x1B[39m"),
51
- red: e("\x1B[31m", "\x1B[39m"),
52
- green: e("\x1B[32m", "\x1B[39m"),
53
- yellow: e("\x1B[33m", "\x1B[39m"),
54
- blue: e("\x1B[34m", "\x1B[39m"),
55
- magenta: e("\x1B[35m", "\x1B[39m"),
56
- cyan: e("\x1B[36m", "\x1B[39m"),
57
- white: e("\x1B[37m", "\x1B[39m"),
58
- gray: e("\x1B[90m", "\x1B[39m"),
59
- bgBlack: e("\x1B[40m", "\x1B[49m"),
60
- bgRed: e("\x1B[41m", "\x1B[49m"),
61
- bgGreen: e("\x1B[42m", "\x1B[49m"),
62
- bgYellow: e("\x1B[43m", "\x1B[49m"),
63
- bgBlue: e("\x1B[44m", "\x1B[49m"),
64
- bgMagenta: e("\x1B[45m", "\x1B[49m"),
65
- bgCyan: e("\x1B[46m", "\x1B[49m"),
66
- bgWhite: e("\x1B[47m", "\x1B[49m"),
67
- blackBright: e("\x1B[90m", "\x1B[39m"),
68
- redBright: e("\x1B[91m", "\x1B[39m"),
69
- greenBright: e("\x1B[92m", "\x1B[39m"),
70
- yellowBright: e("\x1B[93m", "\x1B[39m"),
71
- blueBright: e("\x1B[94m", "\x1B[39m"),
72
- magentaBright: e("\x1B[95m", "\x1B[39m"),
73
- cyanBright: e("\x1B[96m", "\x1B[39m"),
74
- whiteBright: e("\x1B[97m", "\x1B[39m"),
75
- bgBlackBright: e("\x1B[100m", "\x1B[49m"),
76
- bgRedBright: e("\x1B[101m", "\x1B[49m"),
77
- bgGreenBright: e("\x1B[102m", "\x1B[49m"),
78
- bgYellowBright: e("\x1B[103m", "\x1B[49m"),
79
- bgBlueBright: e("\x1B[104m", "\x1B[49m"),
80
- bgMagentaBright: e("\x1B[105m", "\x1B[49m"),
81
- bgCyanBright: e("\x1B[106m", "\x1B[49m"),
82
- bgWhiteBright: e("\x1B[107m", "\x1B[49m")
42
+ reset: o("\x1B[0m", "\x1B[0m"),
43
+ bold: o("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
44
+ dim: o("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
45
+ italic: o("\x1B[3m", "\x1B[23m"),
46
+ underline: o("\x1B[4m", "\x1B[24m"),
47
+ inverse: o("\x1B[7m", "\x1B[27m"),
48
+ hidden: o("\x1B[8m", "\x1B[28m"),
49
+ strikethrough: o("\x1B[9m", "\x1B[29m"),
50
+ black: o("\x1B[30m", "\x1B[39m"),
51
+ red: o("\x1B[31m", "\x1B[39m"),
52
+ green: o("\x1B[32m", "\x1B[39m"),
53
+ yellow: o("\x1B[33m", "\x1B[39m"),
54
+ blue: o("\x1B[34m", "\x1B[39m"),
55
+ magenta: o("\x1B[35m", "\x1B[39m"),
56
+ cyan: o("\x1B[36m", "\x1B[39m"),
57
+ white: o("\x1B[37m", "\x1B[39m"),
58
+ gray: o("\x1B[90m", "\x1B[39m"),
59
+ bgBlack: o("\x1B[40m", "\x1B[49m"),
60
+ bgRed: o("\x1B[41m", "\x1B[49m"),
61
+ bgGreen: o("\x1B[42m", "\x1B[49m"),
62
+ bgYellow: o("\x1B[43m", "\x1B[49m"),
63
+ bgBlue: o("\x1B[44m", "\x1B[49m"),
64
+ bgMagenta: o("\x1B[45m", "\x1B[49m"),
65
+ bgCyan: o("\x1B[46m", "\x1B[49m"),
66
+ bgWhite: o("\x1B[47m", "\x1B[49m"),
67
+ blackBright: o("\x1B[90m", "\x1B[39m"),
68
+ redBright: o("\x1B[91m", "\x1B[39m"),
69
+ greenBright: o("\x1B[92m", "\x1B[39m"),
70
+ yellowBright: o("\x1B[93m", "\x1B[39m"),
71
+ blueBright: o("\x1B[94m", "\x1B[39m"),
72
+ magentaBright: o("\x1B[95m", "\x1B[39m"),
73
+ cyanBright: o("\x1B[96m", "\x1B[39m"),
74
+ whiteBright: o("\x1B[97m", "\x1B[39m"),
75
+ bgBlackBright: o("\x1B[100m", "\x1B[49m"),
76
+ bgRedBright: o("\x1B[101m", "\x1B[49m"),
77
+ bgGreenBright: o("\x1B[102m", "\x1B[49m"),
78
+ bgYellowBright: o("\x1B[103m", "\x1B[49m"),
79
+ bgBlueBright: o("\x1B[104m", "\x1B[49m"),
80
+ bgMagentaBright: o("\x1B[105m", "\x1B[49m"),
81
+ bgCyanBright: o("\x1B[106m", "\x1B[49m"),
82
+ bgWhiteBright: o("\x1B[107m", "\x1B[49m")
83
83
  };
84
84
  }, "createColors");
85
- k.exports = te();
86
- k.exports.createColors = te;
85
+ k.exports = re();
86
+ k.exports.createColors = re;
87
87
  });
88
88
 
89
89
  // ../node_modules/ts-dedent/dist/index.js
90
- var ne = Q((h) => {
90
+ var ae = Z((h) => {
91
91
  "use strict";
92
92
  Object.defineProperty(h, "__esModule", { value: !0 });
93
93
  h.dedent = void 0;
94
- function se(t) {
95
- for (var e = [], o = 1; o < arguments.length; o++)
96
- e[o - 1] = arguments[o];
94
+ function ne(t) {
95
+ for (var o = [], e = 1; e < arguments.length; e++)
96
+ o[e - 1] = arguments[e];
97
97
  var n = Array.from(typeof t == "string" ? [t] : t);
98
98
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
99
99
  var c = n.reduce(function(m, x) {
@@ -113,26 +113,26 @@ var ne = Q((h) => {
113
113
  }
114
114
  n[0] = n[0].replace(/^\r?\n/, "");
115
115
  var d = n[0];
116
- return e.forEach(function(m, x) {
116
+ return o.forEach(function(m, x) {
117
117
  var p = d.match(/(?:^|\n)( *)$/), R = p ? p[1] : "", g = m;
118
118
  typeof m == "string" && m.includes(`
119
119
  `) && (g = String(m).split(`
120
- `).map(function(b, ue) {
121
- return ue === 0 ? b : "" + R + b;
120
+ `).map(function(b, le) {
121
+ return le === 0 ? b : "" + R + b;
122
122
  }).join(`
123
123
  `)), d += g + n[x + 1];
124
124
  }), d;
125
125
  }
126
- r(se, "dedent");
127
- h.dedent = se;
128
- h.default = se;
126
+ r(ne, "dedent");
127
+ h.dedent = ne;
128
+ h.default = ne;
129
129
  });
130
130
 
131
131
  // src/server-errors.ts
132
- var xe = {};
133
- pe(xe, {
132
+ var Re = {};
133
+ ye(Re, {
134
134
  AngularLegacyBuildOptionsError: () => W,
135
- Category: () => ce,
135
+ Category: () => ue,
136
136
  ConflictingStaticDirConfigError: () => C,
137
137
  CouldNotEvaluateFrameworkError: () => w,
138
138
  CriticalPresetLoadError: () => K,
@@ -149,11 +149,12 @@ pe(xe, {
149
149
  MissingAngularJsonError: () => v,
150
150
  MissingBuilderError: () => L,
151
151
  MissingFrameworkFieldError: () => A,
152
- NoMatchingExportError: () => P,
152
+ NoMatchingExportError: () => j,
153
153
  NoStatsForViteDevError: () => H,
154
154
  NxProjectDetectedError: () => O,
155
+ SavingGlobalSettingsFileError: () => Q,
155
156
  StatusTypeIdMismatchError: () => D,
156
- SvelteViteWithSvelteKitError: () => j,
157
+ SvelteViteWithSvelteKitError: () => P,
157
158
  UpgradeStorybookInWrongWorkingDirectory: () => X,
158
159
  UpgradeStorybookToLowerVersionError: () => G,
159
160
  UpgradeStorybookToSameVersionError: () => Y,
@@ -162,21 +163,21 @@ pe(xe, {
162
163
  WebpackInvocationError: () => M,
163
164
  WebpackMissingStatsError: () => S
164
165
  });
165
- module.exports = ye(xe);
166
- var l = ee(re(), 1), i = ee(ne(), 1);
166
+ module.exports = he(Re);
167
+ var l = oe(se(), 1), i = oe(ae(), 1);
167
168
 
168
169
  // src/storybook-error.ts
169
- function ae({
170
+ function ie({
170
171
  code: t,
171
- category: e
172
+ category: o
172
173
  }) {
173
- let o = String(t).padStart(4, "0");
174
- return `SB_${e}_${o}`;
174
+ let e = String(t).padStart(4, "0");
175
+ return `SB_${o}_${e}`;
175
176
  }
176
- r(ae, "parseErrorCode");
177
+ r(ie, "parseErrorCode");
177
178
  var a = class t extends Error {
178
- constructor(o) {
179
- super(t.getFullMessage(o));
179
+ constructor(e) {
180
+ super(t.getFullMessage(e));
180
181
  /**
181
182
  * Data associated with the error. Used to provide additional information in the error message or
182
183
  * to be passed to telemetry.
@@ -184,30 +185,30 @@ var a = class t extends Error {
184
185
  this.data = {};
185
186
  /** Flag used to easily determine if the error originates from Storybook. */
186
187
  this.fromStorybook = !0;
187
- this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
188
+ this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
188
189
  }
189
190
  static {
190
191
  r(this, "StorybookError");
191
192
  }
192
193
  get fullErrorCode() {
193
- return ae({ code: this.code, category: this.category });
194
+ return ie({ code: this.code, category: this.category });
194
195
  }
195
196
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
196
197
  get name() {
197
- let o = this.constructor.name;
198
- return `${this.fullErrorCode} (${o})`;
198
+ let e = this.constructor.name;
199
+ return `${this.fullErrorCode} (${e})`;
199
200
  }
200
201
  /** Generates the error message along with additional documentation link (if applicable). */
201
202
  static getFullMessage({
202
- documentation: o,
203
+ documentation: e,
203
204
  code: n,
204
205
  category: c,
205
206
  message: u
206
207
  }) {
207
208
  let d;
208
- return o === !0 ? d = `https://storybook.js.org/error/${ae({ code: n, category: c })}` : typeof o == "string" ? d = o : Array.isArray(o) &&
209
+ return e === !0 ? d = `https://storybook.js.org/error/${ie({ code: n, category: c })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
209
210
  (d = `
210
- ${o.map((m) => ` - ${m}`).join(`
211
+ ${e.map((m) => ` - ${m}`).join(`
211
212
  `)}`), `${u}${d != null ? `
212
213
 
213
214
  More info: ${d}
@@ -216,7 +217,7 @@ More info: ${d}
216
217
  };
217
218
 
218
219
  // src/server-errors.ts
219
- var ce = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
220
+ var ue = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
220
221
  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 =
221
222
  "CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
222
223
  TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
@@ -226,7 +227,7 @@ FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.F
226
227
  "FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
227
228
  FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
228
229
  s.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", s.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", s.FRAMEWORK_WEB_COMPONENTS_VITE = "FRA\
229
- MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ce || {}), O = class extends a {
230
+ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ue || {}), O = class extends a {
230
231
  static {
231
232
  r(this, "NxProjectDetectedError");
232
233
  }
@@ -256,34 +257,34 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
256
257
  });
257
258
  }
258
259
  }, _ = class extends a {
259
- constructor(o) {
260
+ constructor(e) {
260
261
  super({
261
262
  category: "CORE-COMMON",
262
263
  code: 2,
263
264
  documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
264
265
  message: i.dedent`
265
- Invalid value of '${o.frameworkName}' in the 'framework' field of Storybook config.
266
+ Invalid value of '${e.frameworkName}' in the 'framework' field of Storybook config.
266
267
 
267
268
  Please run 'npx storybook automigrate' to automatically fix your config.
268
269
  `
269
270
  });
270
- this.data = o;
271
+ this.data = e;
271
272
  }
272
273
  static {
273
274
  r(this, "InvalidFrameworkNameError");
274
275
  }
275
276
  }, w = class extends a {
276
- constructor(o) {
277
+ constructor(e) {
277
278
  super({
278
279
  category: "CORE-COMMON",
279
280
  code: 3,
280
281
  documentation: "",
281
282
  message: i.dedent`
282
- Could not evaluate the '${o.frameworkName}' package from the 'framework' field of Storybook config.
283
+ Could not evaluate the '${e.frameworkName}' package from the 'framework' field of Storybook config.
283
284
 
284
285
  Are you sure it's a valid package and is installed?`
285
286
  });
286
- this.data = o;
287
+ this.data = e;
287
288
  }
288
289
  static {
289
290
  r(this, "CouldNotEvaluateFrameworkError");
@@ -339,28 +340,28 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
339
340
  });
340
341
  }
341
342
  }, M = class extends a {
342
- constructor(o) {
343
+ constructor(e) {
343
344
  super({
344
345
  category: "BUILDER-WEBPACK5",
345
346
  code: 2,
346
- message: o.error.message.trim()
347
+ message: e.error.message.trim()
347
348
  });
348
- this.data = o;
349
+ this.data = e;
349
350
  }
350
351
  static {
351
352
  r(this, "WebpackInvocationError");
352
353
  }
353
354
  };
354
- function ie(t = "") {
355
+ function ce(t = "") {
355
356
  return t.replace(/\u001B\[[0-9;]*m/g, "");
356
357
  }
357
- r(ie, "removeAnsiEscapeCodes");
358
+ r(ce, "removeAnsiEscapeCodes");
358
359
  var T = class extends a {
359
- constructor(o) {
360
- o.errors = o.errors.map((n) => ({
360
+ constructor(e) {
361
+ e.errors = e.errors.map((n) => ({
361
362
  ...n,
362
- message: ie(n.message),
363
- stack: ie(n.stack),
363
+ message: ce(n.message),
364
+ stack: ce(n.stack),
364
365
  name: n.name
365
366
  }));
366
367
  super({
@@ -372,22 +373,22 @@ var T = class extends a {
372
373
  Run Storybook with --debug-webpack for more information.
373
374
  `
374
375
  });
375
- this.data = o;
376
+ this.data = e;
376
377
  }
377
378
  static {
378
379
  r(this, "WebpackCompilationError");
379
380
  }
380
381
  }, v = class extends a {
381
- constructor(o) {
382
+ constructor(e) {
382
383
  super({
383
384
  category: "CLI_INIT",
384
385
  code: 2,
385
386
  documentation: "https://storybook.js.org/docs/faq#error-no-angularjson-file-found",
386
387
  message: i.dedent`
387
- An angular.json file was not found in the current working directory: ${o.path}
388
+ An angular.json file was not found in the current working directory: ${e.path}
388
389
  Storybook needs it to work properly, so please rerun the command at the root of your project, where the angular.json file is located.`
389
390
  });
390
- this.data = o;
391
+ this.data = e;
391
392
  }
392
393
  static {
393
394
  r(this, "MissingAngularJsonError");
@@ -412,21 +413,21 @@ var T = class extends a {
412
413
  });
413
414
  }
414
415
  }, K = class extends a {
415
- constructor(o) {
416
+ constructor(e) {
416
417
  super({
417
418
  category: "CORE-SERVER",
418
419
  code: 2,
419
420
  documentation: "",
420
421
  message: i.dedent`
421
- Storybook failed to load the following preset: ${o.presetName}.
422
+ Storybook failed to load the following preset: ${e.presetName}.
422
423
 
423
424
  Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
424
425
 
425
426
  If you believe this is a bug, please open an issue on Github.
426
427
 
427
- ${o.error.stack || o.error.message}`
428
+ ${e.error.stack || e.error.message}`
428
429
  });
429
- this.data = o;
430
+ this.data = e;
430
431
  }
431
432
  static {
432
433
  r(this, "CriticalPresetLoadError");
@@ -453,36 +454,36 @@ var T = class extends a {
453
454
  });
454
455
  }
455
456
  }, B = class extends a {
456
- constructor(o) {
457
+ constructor(e) {
457
458
  super({
458
459
  category: "FRAMEWORK_NEXTJS",
459
460
  code: 1,
460
461
  documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
461
462
  message: i.dedent`
462
- Failed to fetch \`${o.fontFamily}\` from Google Fonts with URL: \`${o.url}\``
463
+ Failed to fetch \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
463
464
  });
464
- this.data = o;
465
+ this.data = e;
465
466
  }
466
467
  static {
467
468
  r(this, "GoogleFontsDownloadError");
468
469
  }
469
470
  }, N = class extends a {
470
- constructor(o) {
471
+ constructor(e) {
471
472
  super({
472
473
  category: "FRAMEWORK_NEXTJS",
473
474
  code: 2,
474
475
  documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
475
476
  message: i.dedent`
476
- An error occurred when trying to load Google Fonts with URL \`${o.url}\`.
477
+ An error occurred when trying to load Google Fonts with URL \`${e.url}\`.
477
478
 
478
- ${o.error instanceof Error ? o.error.message : ""}`
479
+ ${e.error instanceof Error ? e.error.message : ""}`
479
480
  });
480
- this.data = o;
481
+ this.data = e;
481
482
  }
482
483
  static {
483
484
  r(this, "GoogleFontsLoadingError");
484
485
  }
485
- }, j = class extends a {
486
+ }, P = class extends a {
486
487
  static {
487
488
  r(this, "SvelteViteWithSvelteKitError");
488
489
  }
@@ -496,8 +497,8 @@ var T = class extends a {
496
497
  Please use the @storybook/sveltekit framework instead.`
497
498
  });
498
499
  }
499
- }, P = class extends a {
500
- constructor(o) {
500
+ }, j = class extends a {
501
+ constructor(e) {
501
502
  super({
502
503
  category: "CORE-SERVER",
503
504
  code: 4,
@@ -514,28 +515,28 @@ var T = class extends a {
514
515
 
515
516
  Please run \`npx storybook doctor\` for guidance on how to fix this issue.`
516
517
  });
517
- this.data = o;
518
+ this.data = e;
518
519
  }
519
520
  static {
520
521
  r(this, "NoMatchingExportError");
521
522
  }
522
523
  }, V = class extends a {
523
- constructor(o) {
524
+ constructor(e) {
524
525
  let n = [
525
- `Storybook failed to load ${o.location}`,
526
+ `Storybook failed to load ${e.location}`,
526
527
  "",
527
528
  "It looks like the file tried to load/import an ESM only module.",
528
- `Support for this is currently limited in ${o.location}`,
529
+ `Support for this is currently limited in ${e.location}`,
529
530
  "You can import ESM modules in your main file, but only as dynamic import.",
530
531
  ""
531
532
  ];
532
- o.line && n.push(
533
+ e.line && n.push(
533
534
  l.default.white(
534
- `In your ${l.default.yellow(o.location)} file, line ${l.default.bold(
535
- l.default.cyan(o.num)
535
+ `In your ${l.default.yellow(e.location)} file, line ${l.default.bold(
536
+ l.default.cyan(e.num)
536
537
  )} threw an error:`
537
538
  ),
538
- l.default.gray(o.line)
539
+ l.default.gray(e.line)
539
540
  ), n.push(
540
541
  "",
541
542
  l.default.white(
@@ -551,13 +552,13 @@ var T = class extends a {
551
552
  message: n.join(`
552
553
  `)
553
554
  });
554
- this.data = o;
555
+ this.data = e;
555
556
  }
556
557
  static {
557
558
  r(this, "MainFileESMOnlyImportError");
558
559
  }
559
560
  }, $ = class extends a {
560
- constructor(o) {
561
+ constructor(e) {
561
562
  let n = {
562
563
  storybook: {
563
564
  helperMessage: "You can pass a --config-dir flag to tell Storybook, where your main.js file is located at.",
@@ -568,82 +569,82 @@ var T = class extends a {
568
569
  // TODO: add proper docs once available
569
570
  documentation: "https://storybook.js.org/docs/configure"
570
571
  }
571
- }, { documentation: c, helperMessage: u } = n[o.source || "storybook"];
572
+ }, { documentation: c, helperMessage: u } = n[e.source || "storybook"];
572
573
  super({
573
574
  category: "CORE-SERVER",
574
575
  code: 6,
575
576
  documentation: c,
576
577
  message: i.dedent`
577
- No configuration files have been found in your configDir: ${l.default.yellow(o.location)}.
578
+ No configuration files have been found in your configDir: ${l.default.yellow(e.location)}.
578
579
  Storybook needs a "main.js" file, please add it.
579
580
 
580
581
  ${u}`
581
582
  });
582
- this.data = o;
583
+ this.data = e;
583
584
  }
584
585
  static {
585
586
  r(this, "MainFileMissingError");
586
587
  }
587
588
  }, F = class extends a {
588
- constructor(o) {
589
+ constructor(e) {
589
590
  let n = l.default.white(
590
- (o.error.stack || o.error.message).replaceAll(process.cwd(), "")
591
+ (e.error.stack || e.error.message).replaceAll(process.cwd(), "")
591
592
  );
592
593
  super({
593
594
  category: "CORE-SERVER",
594
595
  code: 7,
595
596
  message: i.dedent`
596
- Storybook couldn't evaluate your ${l.default.yellow(o.location)} file.
597
+ Storybook couldn't evaluate your ${l.default.yellow(e.location)} file.
597
598
 
598
599
  Original error:
599
600
  ${n}`
600
601
  });
601
- this.data = o;
602
+ this.data = e;
602
603
  }
603
604
  static {
604
605
  r(this, "MainFileEvaluationError");
605
606
  }
606
607
  }, D = class extends a {
607
- constructor(o) {
608
+ constructor(e) {
608
609
  super({
609
610
  category: "CORE-SERVER",
610
611
  code: 16,
611
- message: `Status has typeId "${o.status.typeId}" but was added to store with typeId "${o.typeId}". Full status: ${JSON.stringify(
612
- o.status,
612
+ message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
613
+ e.status,
613
614
  null,
614
615
  2
615
616
  )}`
616
617
  });
617
- this.data = o;
618
+ this.data = e;
618
619
  }
619
620
  static {
620
621
  r(this, "StatusTypeIdMismatchError");
621
622
  }
622
623
  }, U = class extends a {
623
- constructor(o) {
624
+ constructor(e) {
624
625
  super({
625
626
  category: "CLI_INIT",
626
627
  code: 3,
627
628
  documentation: "",
628
629
  message: i.dedent`
629
- There was an error while using ${o.packageManager} to create a new ${o.projectType} project.
630
+ There was an error while using ${e.packageManager} to create a new ${e.projectType} project.
630
631
 
631
- ${o.error instanceof Error ? o.error.message : ""}`
632
+ ${e.error instanceof Error ? e.error.message : ""}`
632
633
  });
633
- this.data = o;
634
+ this.data = e;
634
635
  }
635
636
  static {
636
637
  r(this, "GenerateNewProjectOnInitError");
637
638
  }
638
639
  }, G = class extends a {
639
- constructor(o) {
640
+ constructor(e) {
640
641
  super({
641
642
  category: "CLI_UPGRADE",
642
643
  code: 3,
643
644
  message: i.dedent`
644
645
  You are trying to upgrade Storybook to a lower version than the version currently installed. This is not supported.
645
646
 
646
- Storybook version ${o.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${o.currentVersion}.
647
+ Storybook version ${e.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${e.currentVersion}.
647
648
 
648
649
  This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
649
650
  This will cause npm to run the globally cached storybook binary, which might be an older version.
@@ -652,18 +653,18 @@ var T = class extends a {
652
653
 
653
654
  "npx storybook@latest upgrade"`
654
655
  });
655
- this.data = o;
656
+ this.data = e;
656
657
  }
657
658
  static {
658
659
  r(this, "UpgradeStorybookToLowerVersionError");
659
660
  }
660
661
  }, Y = class extends a {
661
- constructor(o) {
662
+ constructor(e) {
662
663
  super({
663
664
  category: "CLI_UPGRADE",
664
665
  code: 4,
665
666
  message: i.dedent`
666
- You are upgrading Storybook to the same version that is currently installed in the project, version ${o.beforeVersion}.
667
+ You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
667
668
 
668
669
  This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
669
670
  This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
@@ -677,7 +678,7 @@ var T = class extends a {
677
678
 
678
679
  "npx storybook automigrate"`
679
680
  });
680
- this.data = o;
681
+ this.data = e;
681
682
  }
682
683
  static {
683
684
  r(this, "UpgradeStorybookToSameVersionError");
@@ -726,21 +727,21 @@ var T = class extends a {
726
727
  });
727
728
  }
728
729
  }, z = class extends a {
729
- constructor(o) {
730
+ constructor(e) {
730
731
  super({
731
732
  category: "CLI",
732
733
  code: 1,
733
734
  message: i.dedent`
734
- Unable to find versions of "${o.packageName}" using ${o.packageManager}
735
- ${o.error && `Reason: ${o.error}`}`
735
+ Unable to find versions of "${e.packageName}" using ${e.packageManager}
736
+ ${e.error && `Reason: ${e.error}`}`
736
737
  });
737
- this.data = o;
738
+ this.data = e;
738
739
  }
739
740
  static {
740
741
  r(this, "FindPackageVersionsError");
741
742
  }
742
743
  }, q = class extends a {
743
- constructor(o) {
744
+ constructor(e) {
744
745
  super({
745
746
  category: "FRAMEWORK_NEXTJS",
746
747
  code: 3,
@@ -763,12 +764,26 @@ var T = class extends a {
763
764
  },
764
765
  };
765
766
 
766
- Original error: ${o.error.message}
767
+ Original error: ${e.error.message}
767
768
  `
768
769
  });
769
- this.data = o;
770
+ this.data = e;
770
771
  }
771
772
  static {
772
773
  r(this, "IncompatiblePostCssConfigError");
773
774
  }
775
+ }, Q = class extends a {
776
+ constructor(e) {
777
+ super({
778
+ category: "CORE-SERVER",
779
+ code: 1,
780
+ message: i.dedent`
781
+ Unable to save global settings file to ${e.filePath}
782
+ ${e.error && `Reason: ${e.error}`}`
783
+ });
784
+ this.data = e;
785
+ }
786
+ static {
787
+ r(this, "SavingGlobalSettingsFileError");
788
+ }
774
789
  };