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.
- package/dist/bin/index.cjs +44 -44
- package/dist/bin/index.js +44 -44
- package/dist/builder-manager/index.cjs +191 -186
- package/dist/builder-manager/index.js +476 -471
- package/dist/channels/index.js +919 -941
- package/dist/cli/bin/index.cjs +4184 -737
- package/dist/cli/bin/index.js +4198 -749
- package/dist/cli/index.cjs +25089 -21637
- package/dist/cli/index.d.ts +974 -1
- package/dist/cli/index.js +25329 -21875
- package/dist/common/index.cjs +4545 -4538
- package/dist/common/index.d.ts +6 -1
- package/dist/common/index.js +4545 -4538
- package/dist/components/index.js +2254 -2260
- package/dist/core-server/index.cjs +4689 -4659
- package/dist/core-server/index.js +3261 -3230
- package/dist/core-server/presets/common-manager.js +2279 -2288
- package/dist/core-server/presets/common-preset.cjs +1445 -1444
- package/dist/core-server/presets/common-preset.js +418 -417
- package/dist/docs-tools/index.js +596 -603
- package/dist/instrumenter/index.js +1105 -1110
- package/dist/manager/globals-runtime.js +19954 -20093
- package/dist/manager/runtime.js +1874 -1881
- package/dist/manager-api/index.cjs +1 -1
- package/dist/manager-api/index.js +1309 -1340
- package/dist/manager-errors.js +37 -41
- package/dist/preview/runtime.js +13100 -13251
- package/dist/preview-api/index.cjs +615 -614
- package/dist/preview-api/index.js +1107 -1122
- package/dist/preview-errors.js +152 -173
- package/dist/server-errors.cjs +186 -171
- package/dist/server-errors.d.ts +11 -1
- package/dist/server-errors.js +167 -152
- package/dist/telemetry/index.cjs +4887 -1403
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.js +4923 -1437
- package/dist/test/index.js +8269 -8357
- package/dist/test/preview.js +3508 -3568
- package/package.json +4 -2
package/dist/server-errors.cjs
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var me = Object.create;
|
|
3
3
|
var y = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var r = (t,
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
y(t,
|
|
11
|
-
},
|
|
12
|
-
if (
|
|
13
|
-
for (let c of
|
|
14
|
-
!
|
|
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
|
|
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
|
-
|
|
22
|
+
o || !t || !t.__esModule ? y(e, "default", { value: t, enumerable: !0 }) : e,
|
|
23
23
|
t
|
|
24
|
-
)),
|
|
24
|
+
)), he = (t) => ee(y({}, "__esModule", { value: !0 }), t);
|
|
25
25
|
|
|
26
26
|
// ../node_modules/picocolors/picocolors.js
|
|
27
|
-
var
|
|
28
|
-
var f = process || {},
|
|
29
|
-
"--color") || f.platform === "win32" || (f.stdout || {}).isTTY && E.TERM !== "dumb" || !!E.CI),
|
|
30
|
-
let c = "" + n, u = c.indexOf(
|
|
31
|
-
return ~u ? t +
|
|
32
|
-
}, "formatter"),
|
|
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) +
|
|
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"),
|
|
39
|
-
let
|
|
38
|
+
}, "replaceClose"), re = /* @__PURE__ */ r((t = Ee) => {
|
|
39
|
+
let o = t ? fe : () => String;
|
|
40
40
|
return {
|
|
41
41
|
isColorSupported: t,
|
|
42
|
-
reset:
|
|
43
|
-
bold:
|
|
44
|
-
dim:
|
|
45
|
-
italic:
|
|
46
|
-
underline:
|
|
47
|
-
inverse:
|
|
48
|
-
hidden:
|
|
49
|
-
strikethrough:
|
|
50
|
-
black:
|
|
51
|
-
red:
|
|
52
|
-
green:
|
|
53
|
-
yellow:
|
|
54
|
-
blue:
|
|
55
|
-
magenta:
|
|
56
|
-
cyan:
|
|
57
|
-
white:
|
|
58
|
-
gray:
|
|
59
|
-
bgBlack:
|
|
60
|
-
bgRed:
|
|
61
|
-
bgGreen:
|
|
62
|
-
bgYellow:
|
|
63
|
-
bgBlue:
|
|
64
|
-
bgMagenta:
|
|
65
|
-
bgCyan:
|
|
66
|
-
bgWhite:
|
|
67
|
-
blackBright:
|
|
68
|
-
redBright:
|
|
69
|
-
greenBright:
|
|
70
|
-
yellowBright:
|
|
71
|
-
blueBright:
|
|
72
|
-
magentaBright:
|
|
73
|
-
cyanBright:
|
|
74
|
-
whiteBright:
|
|
75
|
-
bgBlackBright:
|
|
76
|
-
bgRedBright:
|
|
77
|
-
bgGreenBright:
|
|
78
|
-
bgYellowBright:
|
|
79
|
-
bgBlueBright:
|
|
80
|
-
bgMagentaBright:
|
|
81
|
-
bgCyanBright:
|
|
82
|
-
bgWhiteBright:
|
|
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 =
|
|
86
|
-
k.exports.createColors =
|
|
85
|
+
k.exports = re();
|
|
86
|
+
k.exports.createColors = re;
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
// ../node_modules/ts-dedent/dist/index.js
|
|
90
|
-
var
|
|
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
|
|
95
|
-
for (var
|
|
96
|
-
e
|
|
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
|
|
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,
|
|
121
|
-
return
|
|
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(
|
|
127
|
-
h.dedent =
|
|
128
|
-
h.default =
|
|
126
|
+
r(ne, "dedent");
|
|
127
|
+
h.dedent = ne;
|
|
128
|
+
h.default = ne;
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
// src/server-errors.ts
|
|
132
|
-
var
|
|
133
|
-
|
|
132
|
+
var Re = {};
|
|
133
|
+
ye(Re, {
|
|
134
134
|
AngularLegacyBuildOptionsError: () => W,
|
|
135
|
-
Category: () =>
|
|
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: () =>
|
|
152
|
+
NoMatchingExportError: () => j,
|
|
153
153
|
NoStatsForViteDevError: () => H,
|
|
154
154
|
NxProjectDetectedError: () => O,
|
|
155
|
+
SavingGlobalSettingsFileError: () => Q,
|
|
155
156
|
StatusTypeIdMismatchError: () => D,
|
|
156
|
-
SvelteViteWithSvelteKitError: () =>
|
|
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 =
|
|
166
|
-
var l =
|
|
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
|
|
170
|
+
function ie({
|
|
170
171
|
code: t,
|
|
171
|
-
category:
|
|
172
|
+
category: o
|
|
172
173
|
}) {
|
|
173
|
-
let
|
|
174
|
-
return `SB_${
|
|
174
|
+
let e = String(t).padStart(4, "0");
|
|
175
|
+
return `SB_${o}_${e}`;
|
|
175
176
|
}
|
|
176
|
-
r(
|
|
177
|
+
r(ie, "parseErrorCode");
|
|
177
178
|
var a = class t extends Error {
|
|
178
|
-
constructor(
|
|
179
|
-
super(t.getFullMessage(
|
|
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 =
|
|
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
|
|
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
|
|
198
|
-
return `${this.fullErrorCode} (${
|
|
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:
|
|
203
|
+
documentation: e,
|
|
203
204
|
code: n,
|
|
204
205
|
category: c,
|
|
205
206
|
message: u
|
|
206
207
|
}) {
|
|
207
208
|
let d;
|
|
208
|
-
return
|
|
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
|
-
${
|
|
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
|
|
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))(
|
|
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(
|
|
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 '${
|
|
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 =
|
|
271
|
+
this.data = e;
|
|
271
272
|
}
|
|
272
273
|
static {
|
|
273
274
|
r(this, "InvalidFrameworkNameError");
|
|
274
275
|
}
|
|
275
276
|
}, w = class extends a {
|
|
276
|
-
constructor(
|
|
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 '${
|
|
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 =
|
|
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(
|
|
343
|
+
constructor(e) {
|
|
343
344
|
super({
|
|
344
345
|
category: "BUILDER-WEBPACK5",
|
|
345
346
|
code: 2,
|
|
346
|
-
message:
|
|
347
|
+
message: e.error.message.trim()
|
|
347
348
|
});
|
|
348
|
-
this.data =
|
|
349
|
+
this.data = e;
|
|
349
350
|
}
|
|
350
351
|
static {
|
|
351
352
|
r(this, "WebpackInvocationError");
|
|
352
353
|
}
|
|
353
354
|
};
|
|
354
|
-
function
|
|
355
|
+
function ce(t = "") {
|
|
355
356
|
return t.replace(/\u001B\[[0-9;]*m/g, "");
|
|
356
357
|
}
|
|
357
|
-
r(
|
|
358
|
+
r(ce, "removeAnsiEscapeCodes");
|
|
358
359
|
var T = class extends a {
|
|
359
|
-
constructor(
|
|
360
|
-
|
|
360
|
+
constructor(e) {
|
|
361
|
+
e.errors = e.errors.map((n) => ({
|
|
361
362
|
...n,
|
|
362
|
-
message:
|
|
363
|
-
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 =
|
|
376
|
+
this.data = e;
|
|
376
377
|
}
|
|
377
378
|
static {
|
|
378
379
|
r(this, "WebpackCompilationError");
|
|
379
380
|
}
|
|
380
381
|
}, v = class extends a {
|
|
381
|
-
constructor(
|
|
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: ${
|
|
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 =
|
|
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(
|
|
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: ${
|
|
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
|
-
${
|
|
428
|
+
${e.error.stack || e.error.message}`
|
|
428
429
|
});
|
|
429
|
-
this.data =
|
|
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(
|
|
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 \`${
|
|
463
|
+
Failed to fetch \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
|
|
463
464
|
});
|
|
464
|
-
this.data =
|
|
465
|
+
this.data = e;
|
|
465
466
|
}
|
|
466
467
|
static {
|
|
467
468
|
r(this, "GoogleFontsDownloadError");
|
|
468
469
|
}
|
|
469
470
|
}, N = class extends a {
|
|
470
|
-
constructor(
|
|
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 \`${
|
|
477
|
+
An error occurred when trying to load Google Fonts with URL \`${e.url}\`.
|
|
477
478
|
|
|
478
|
-
${
|
|
479
|
+
${e.error instanceof Error ? e.error.message : ""}`
|
|
479
480
|
});
|
|
480
|
-
this.data =
|
|
481
|
+
this.data = e;
|
|
481
482
|
}
|
|
482
483
|
static {
|
|
483
484
|
r(this, "GoogleFontsLoadingError");
|
|
484
485
|
}
|
|
485
|
-
},
|
|
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
|
-
},
|
|
500
|
-
constructor(
|
|
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 =
|
|
518
|
+
this.data = e;
|
|
518
519
|
}
|
|
519
520
|
static {
|
|
520
521
|
r(this, "NoMatchingExportError");
|
|
521
522
|
}
|
|
522
523
|
}, V = class extends a {
|
|
523
|
-
constructor(
|
|
524
|
+
constructor(e) {
|
|
524
525
|
let n = [
|
|
525
|
-
`Storybook failed to load ${
|
|
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 ${
|
|
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
|
-
|
|
533
|
+
e.line && n.push(
|
|
533
534
|
l.default.white(
|
|
534
|
-
`In your ${l.default.yellow(
|
|
535
|
-
l.default.cyan(
|
|
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(
|
|
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 =
|
|
555
|
+
this.data = e;
|
|
555
556
|
}
|
|
556
557
|
static {
|
|
557
558
|
r(this, "MainFileESMOnlyImportError");
|
|
558
559
|
}
|
|
559
560
|
}, $ = class extends a {
|
|
560
|
-
constructor(
|
|
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[
|
|
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(
|
|
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 =
|
|
583
|
+
this.data = e;
|
|
583
584
|
}
|
|
584
585
|
static {
|
|
585
586
|
r(this, "MainFileMissingError");
|
|
586
587
|
}
|
|
587
588
|
}, F = class extends a {
|
|
588
|
-
constructor(
|
|
589
|
+
constructor(e) {
|
|
589
590
|
let n = l.default.white(
|
|
590
|
-
(
|
|
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(
|
|
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 =
|
|
602
|
+
this.data = e;
|
|
602
603
|
}
|
|
603
604
|
static {
|
|
604
605
|
r(this, "MainFileEvaluationError");
|
|
605
606
|
}
|
|
606
607
|
}, D = class extends a {
|
|
607
|
-
constructor(
|
|
608
|
+
constructor(e) {
|
|
608
609
|
super({
|
|
609
610
|
category: "CORE-SERVER",
|
|
610
611
|
code: 16,
|
|
611
|
-
message: `Status has typeId "${
|
|
612
|
-
|
|
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 =
|
|
618
|
+
this.data = e;
|
|
618
619
|
}
|
|
619
620
|
static {
|
|
620
621
|
r(this, "StatusTypeIdMismatchError");
|
|
621
622
|
}
|
|
622
623
|
}, U = class extends a {
|
|
623
|
-
constructor(
|
|
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 ${
|
|
630
|
+
There was an error while using ${e.packageManager} to create a new ${e.projectType} project.
|
|
630
631
|
|
|
631
|
-
${
|
|
632
|
+
${e.error instanceof Error ? e.error.message : ""}`
|
|
632
633
|
});
|
|
633
|
-
this.data =
|
|
634
|
+
this.data = e;
|
|
634
635
|
}
|
|
635
636
|
static {
|
|
636
637
|
r(this, "GenerateNewProjectOnInitError");
|
|
637
638
|
}
|
|
638
639
|
}, G = class extends a {
|
|
639
|
-
constructor(
|
|
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 ${
|
|
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 =
|
|
656
|
+
this.data = e;
|
|
656
657
|
}
|
|
657
658
|
static {
|
|
658
659
|
r(this, "UpgradeStorybookToLowerVersionError");
|
|
659
660
|
}
|
|
660
661
|
}, Y = class extends a {
|
|
661
|
-
constructor(
|
|
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 ${
|
|
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 =
|
|
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(
|
|
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 "${
|
|
735
|
-
${
|
|
735
|
+
Unable to find versions of "${e.packageName}" using ${e.packageManager}
|
|
736
|
+
${e.error && `Reason: ${e.error}`}`
|
|
736
737
|
});
|
|
737
|
-
this.data =
|
|
738
|
+
this.data = e;
|
|
738
739
|
}
|
|
739
740
|
static {
|
|
740
741
|
r(this, "FindPackageVersionsError");
|
|
741
742
|
}
|
|
742
743
|
}, q = class extends a {
|
|
743
|
-
constructor(
|
|
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: ${
|
|
767
|
+
Original error: ${e.error.message}
|
|
767
768
|
`
|
|
768
769
|
});
|
|
769
|
-
this.data =
|
|
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
|
};
|