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.
- package/dist/bin/index.cjs +43 -43
- package/dist/bin/index.js +43 -43
- package/dist/cli/bin/index.cjs +629 -629
- package/dist/cli/bin/index.js +202 -201
- package/dist/cli/index.cjs +13788 -13797
- package/dist/cli/index.d.ts +712 -15
- package/dist/cli/index.js +12364 -12372
- package/dist/common/index.cjs +10997 -10888
- package/dist/common/index.d.ts +348 -66
- package/dist/common/index.js +24318 -24206
- package/dist/components/index.cjs +5 -3
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +5 -3
- package/dist/core-server/index.cjs +4838 -4791
- package/dist/core-server/index.d.ts +10 -1
- package/dist/core-server/index.js +5746 -5699
- package/dist/core-server/presets/common-manager.js +257 -243
- package/dist/core-server/presets/common-preset.cjs +1047 -1045
- package/dist/core-server/presets/common-preset.js +2053 -2048
- package/dist/csf-tools/index.cjs +226 -224
- package/dist/csf-tools/index.js +116 -112
- package/dist/manager/globals-runtime.js +6 -4
- package/dist/manager-api/index.cjs +73 -73
- package/dist/manager-api/index.js +140 -140
- package/dist/node-logger/index.cjs +8520 -994
- package/dist/node-logger/index.d.ts +395 -2
- package/dist/node-logger/index.js +8535 -995
- package/dist/server-errors.cjs +201 -242
- package/dist/server-errors.d.ts +1 -12
- package/dist/server-errors.js +182 -223
- package/dist/telemetry/index.cjs +1224 -1223
- package/dist/telemetry/index.d.ts +3 -2
- package/dist/telemetry/index.js +1069 -1066
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -1
package/dist/server-errors.cjs
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var ue = Object.create;
|
|
3
3
|
var y = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var be = Object.getPrototypeOf,
|
|
7
|
-
var r = (t,
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
y(t,
|
|
11
|
-
},
|
|
12
|
-
if (
|
|
13
|
-
for (let c of
|
|
14
|
-
!
|
|
4
|
+
var le = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var me = Object.getOwnPropertyNames;
|
|
6
|
+
var be = Object.getPrototypeOf, ge = 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), de = (t, e) => {
|
|
9
|
+
for (var o in e)
|
|
10
|
+
y(t, o, { get: e[o], enumerable: !0 });
|
|
11
|
+
}, Q = (t, e, o, n) => {
|
|
12
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
13
|
+
for (let c of me(e))
|
|
14
|
+
!ge.call(t, c) && c !== o && y(t, c, { get: () => e[c], enumerable: !(n = le(e, c)) || n.enumerable });
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var Z = (t, e, o) => (o = t != null ? ue(be(t)) : {}, Q(
|
|
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
|
+
e || !t || !t.__esModule ? y(o, "default", { value: t, enumerable: !0 }) : o,
|
|
23
23
|
t
|
|
24
|
-
)),
|
|
24
|
+
)), pe = (t) => Q(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 te = q((Re, k) => {
|
|
28
|
+
var f = process || {}, ee = f.argv || [], E = f.env || {}, ye = !(E.NO_COLOR || ee.includes("--no-color")) && (!!E.FORCE_COLOR || ee.includes(
|
|
29
|
+
"--color") || f.platform === "win32" || (f.stdout || {}).isTTY && E.TERM !== "dumb" || !!E.CI), he = /* @__PURE__ */ r((t, e, o = t) => (n) => {
|
|
30
|
+
let c = "" + n, u = c.indexOf(e, t.length);
|
|
31
|
+
return ~u ? t + Ee(c, e, o, u) + e : t + c + e;
|
|
32
|
+
}, "formatter"), Ee = /* @__PURE__ */ r((t, e, o, n) => {
|
|
33
33
|
let c = "", u = 0;
|
|
34
34
|
do
|
|
35
|
-
c += t.substring(u, n) +
|
|
35
|
+
c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
|
|
36
36
|
while (~n);
|
|
37
37
|
return c + t.substring(u);
|
|
38
|
-
}, "replaceClose"),
|
|
39
|
-
let
|
|
38
|
+
}, "replaceClose"), oe = /* @__PURE__ */ r((t = ye) => {
|
|
39
|
+
let e = t ? he : () => 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: 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")
|
|
83
83
|
};
|
|
84
84
|
}, "createColors");
|
|
85
|
-
k.exports =
|
|
86
|
-
k.exports.createColors =
|
|
85
|
+
k.exports = oe();
|
|
86
|
+
k.exports.createColors = oe;
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
// ../node_modules/ts-dedent/dist/index.js
|
|
90
|
-
var
|
|
90
|
+
var se = q((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
|
-
o
|
|
94
|
+
function re(t) {
|
|
95
|
+
for (var e = [], o = 1; o < arguments.length; o++)
|
|
96
|
+
e[o - 1] = arguments[o];
|
|
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) {
|
|
100
100
|
var p = x.match(/\n([\t ]+|(?!\s).)/g);
|
|
101
101
|
return p ? m.concat(p.map(function(R) {
|
|
102
|
-
var g,
|
|
103
|
-
return (
|
|
102
|
+
var g, d;
|
|
103
|
+
return (d = (g = R.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && d !== void 0 ? d : 0;
|
|
104
104
|
})) : m;
|
|
105
105
|
}, []);
|
|
106
106
|
if (c.length) {
|
|
@@ -112,72 +112,70 @@ var ae = Z((h) => {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
n[0] = n[0].replace(/^\r?\n/, "");
|
|
115
|
-
var
|
|
116
|
-
return
|
|
117
|
-
var p =
|
|
115
|
+
var b = n[0];
|
|
116
|
+
return e.forEach(function(m, x) {
|
|
117
|
+
var p = b.match(/(?:^|\n)( *)$/), R = p ? p[1] : "", g = m;
|
|
118
118
|
typeof m == "string" && m.includes(`
|
|
119
119
|
`) && (g = String(m).split(`
|
|
120
|
-
`).map(function(
|
|
121
|
-
return
|
|
120
|
+
`).map(function(d, ce) {
|
|
121
|
+
return ce === 0 ? d : "" + R + d;
|
|
122
122
|
}).join(`
|
|
123
|
-
`)),
|
|
124
|
-
}),
|
|
123
|
+
`)), b += g + n[x + 1];
|
|
124
|
+
}), b;
|
|
125
125
|
}
|
|
126
|
-
r(
|
|
127
|
-
h.dedent =
|
|
128
|
-
h.default =
|
|
126
|
+
r(re, "dedent");
|
|
127
|
+
h.dedent = re;
|
|
128
|
+
h.default = re;
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
// src/server-errors.ts
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
AngularLegacyBuildOptionsError: () =>
|
|
135
|
-
Category: () =>
|
|
132
|
+
var fe = {};
|
|
133
|
+
de(fe, {
|
|
134
|
+
AngularLegacyBuildOptionsError: () => K,
|
|
135
|
+
Category: () => ie,
|
|
136
136
|
ConflictingStaticDirConfigError: () => C,
|
|
137
137
|
CouldNotEvaluateFrameworkError: () => w,
|
|
138
|
-
CriticalPresetLoadError: () =>
|
|
139
|
-
FindPackageVersionsError: () =>
|
|
138
|
+
CriticalPresetLoadError: () => v,
|
|
139
|
+
FindPackageVersionsError: () => X,
|
|
140
140
|
GenerateNewProjectOnInitError: () => U,
|
|
141
|
-
GoogleFontsDownloadError: () =>
|
|
141
|
+
GoogleFontsDownloadError: () => L,
|
|
142
142
|
GoogleFontsLoadingError: () => N,
|
|
143
|
-
IncompatiblePostCssConfigError: () =>
|
|
143
|
+
IncompatiblePostCssConfigError: () => H,
|
|
144
144
|
InvalidFrameworkNameError: () => _,
|
|
145
|
-
InvalidStoriesEntryError: () =>
|
|
145
|
+
InvalidStoriesEntryError: () => S,
|
|
146
146
|
MainFileESMOnlyImportError: () => V,
|
|
147
147
|
MainFileEvaluationError: () => F,
|
|
148
148
|
MainFileMissingError: () => $,
|
|
149
|
-
MissingAngularJsonError: () =>
|
|
150
|
-
MissingBuilderError: () =>
|
|
149
|
+
MissingAngularJsonError: () => W,
|
|
150
|
+
MissingBuilderError: () => B,
|
|
151
151
|
MissingFrameworkFieldError: () => A,
|
|
152
152
|
NoMatchingExportError: () => j,
|
|
153
|
-
NoStatsForViteDevError: () =>
|
|
153
|
+
NoStatsForViteDevError: () => J,
|
|
154
154
|
NxProjectDetectedError: () => O,
|
|
155
|
-
SavingGlobalSettingsFileError: () =>
|
|
155
|
+
SavingGlobalSettingsFileError: () => z,
|
|
156
156
|
StatusTypeIdMismatchError: () => D,
|
|
157
157
|
SvelteViteWithSvelteKitError: () => P,
|
|
158
|
-
UpgradeStorybookInWrongWorkingDirectory: () => X,
|
|
159
158
|
UpgradeStorybookToLowerVersionError: () => G,
|
|
160
|
-
|
|
161
|
-
UpgradeStorybookUnknownCurrentVersionError: () => J,
|
|
159
|
+
UpgradeStorybookUnknownCurrentVersionError: () => Y,
|
|
162
160
|
WebpackCompilationError: () => T,
|
|
163
161
|
WebpackInvocationError: () => M,
|
|
164
|
-
WebpackMissingStatsError: () =>
|
|
162
|
+
WebpackMissingStatsError: () => I
|
|
165
163
|
});
|
|
166
|
-
module.exports =
|
|
167
|
-
var l =
|
|
164
|
+
module.exports = pe(fe);
|
|
165
|
+
var l = Z(te(), 1), i = Z(se(), 1);
|
|
168
166
|
|
|
169
167
|
// src/storybook-error.ts
|
|
170
|
-
function
|
|
168
|
+
function ne({
|
|
171
169
|
code: t,
|
|
172
|
-
category:
|
|
170
|
+
category: e
|
|
173
171
|
}) {
|
|
174
|
-
let
|
|
175
|
-
return `SB_${
|
|
172
|
+
let o = String(t).padStart(4, "0");
|
|
173
|
+
return `SB_${e}_${o}`;
|
|
176
174
|
}
|
|
177
|
-
r(
|
|
175
|
+
r(ne, "parseErrorCode");
|
|
178
176
|
var a = class t extends Error {
|
|
179
|
-
constructor(
|
|
180
|
-
super(t.getFullMessage(
|
|
177
|
+
constructor(o) {
|
|
178
|
+
super(t.getFullMessage(o));
|
|
181
179
|
/**
|
|
182
180
|
* Data associated with the error. Used to provide additional information in the error message or
|
|
183
181
|
* to be passed to telemetry.
|
|
@@ -185,39 +183,39 @@ var a = class t extends Error {
|
|
|
185
183
|
this.data = {};
|
|
186
184
|
/** Flag used to easily determine if the error originates from Storybook. */
|
|
187
185
|
this.fromStorybook = !0;
|
|
188
|
-
this.category =
|
|
186
|
+
this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
|
|
189
187
|
}
|
|
190
188
|
static {
|
|
191
189
|
r(this, "StorybookError");
|
|
192
190
|
}
|
|
193
191
|
get fullErrorCode() {
|
|
194
|
-
return
|
|
192
|
+
return ne({ code: this.code, category: this.category });
|
|
195
193
|
}
|
|
196
194
|
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
197
195
|
get name() {
|
|
198
|
-
let
|
|
199
|
-
return `${this.fullErrorCode} (${
|
|
196
|
+
let o = this.constructor.name;
|
|
197
|
+
return `${this.fullErrorCode} (${o})`;
|
|
200
198
|
}
|
|
201
199
|
/** Generates the error message along with additional documentation link (if applicable). */
|
|
202
200
|
static getFullMessage({
|
|
203
|
-
documentation:
|
|
201
|
+
documentation: o,
|
|
204
202
|
code: n,
|
|
205
203
|
category: c,
|
|
206
204
|
message: u
|
|
207
205
|
}) {
|
|
208
|
-
let
|
|
209
|
-
return
|
|
210
|
-
(
|
|
211
|
-
${
|
|
212
|
-
`)}`), `${u}${
|
|
206
|
+
let b;
|
|
207
|
+
return o === !0 ? b = `https://storybook.js.org/error/${ne({ code: n, category: c })}` : typeof o == "string" ? b = o : Array.isArray(o) &&
|
|
208
|
+
(b = `
|
|
209
|
+
${o.map((m) => ` - ${m}`).join(`
|
|
210
|
+
`)}`), `${u}${b != null ? `
|
|
213
211
|
|
|
214
|
-
More info: ${
|
|
212
|
+
More info: ${b}
|
|
215
213
|
` : ""}`;
|
|
216
214
|
}
|
|
217
215
|
};
|
|
218
216
|
|
|
219
217
|
// src/server-errors.ts
|
|
220
|
-
var
|
|
218
|
+
var ie = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
|
|
221
219
|
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 =
|
|
222
220
|
"CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
|
|
223
221
|
TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
|
|
@@ -227,7 +225,7 @@ FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.F
|
|
|
227
225
|
"FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
|
|
228
226
|
FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
|
|
229
227
|
s.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", s.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", s.FRAMEWORK_WEB_COMPONENTS_VITE = "FRA\
|
|
230
|
-
MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(
|
|
228
|
+
MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ie || {}), O = class extends a {
|
|
231
229
|
static {
|
|
232
230
|
r(this, "NxProjectDetectedError");
|
|
233
231
|
}
|
|
@@ -257,34 +255,34 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
257
255
|
});
|
|
258
256
|
}
|
|
259
257
|
}, _ = class extends a {
|
|
260
|
-
constructor(
|
|
258
|
+
constructor(o) {
|
|
261
259
|
super({
|
|
262
260
|
category: "CORE-COMMON",
|
|
263
261
|
code: 2,
|
|
264
262
|
documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
|
|
265
263
|
message: i.dedent`
|
|
266
|
-
Invalid value of '${
|
|
264
|
+
Invalid value of '${o.frameworkName}' in the 'framework' field of Storybook config.
|
|
267
265
|
|
|
268
266
|
Please run 'npx storybook automigrate' to automatically fix your config.
|
|
269
267
|
`
|
|
270
268
|
});
|
|
271
|
-
this.data =
|
|
269
|
+
this.data = o;
|
|
272
270
|
}
|
|
273
271
|
static {
|
|
274
272
|
r(this, "InvalidFrameworkNameError");
|
|
275
273
|
}
|
|
276
274
|
}, w = class extends a {
|
|
277
|
-
constructor(
|
|
275
|
+
constructor(o) {
|
|
278
276
|
super({
|
|
279
277
|
category: "CORE-COMMON",
|
|
280
278
|
code: 3,
|
|
281
279
|
documentation: "",
|
|
282
280
|
message: i.dedent`
|
|
283
|
-
Could not evaluate the '${
|
|
281
|
+
Could not evaluate the '${o.frameworkName}' package from the 'framework' field of Storybook config.
|
|
284
282
|
|
|
285
283
|
Are you sure it's a valid package and is installed?`
|
|
286
284
|
});
|
|
287
|
-
this.data =
|
|
285
|
+
this.data = o;
|
|
288
286
|
}
|
|
289
287
|
static {
|
|
290
288
|
r(this, "CouldNotEvaluateFrameworkError");
|
|
@@ -306,7 +304,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
306
304
|
Please remove the CLI flag from your storybook script and use only the 'staticDirs' option instead.`
|
|
307
305
|
});
|
|
308
306
|
}
|
|
309
|
-
},
|
|
307
|
+
}, S = class extends a {
|
|
310
308
|
static {
|
|
311
309
|
r(this, "InvalidStoriesEntryError");
|
|
312
310
|
}
|
|
@@ -322,7 +320,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
322
320
|
Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array.`
|
|
323
321
|
});
|
|
324
322
|
}
|
|
325
|
-
},
|
|
323
|
+
}, I = class extends a {
|
|
326
324
|
static {
|
|
327
325
|
r(this, "WebpackMissingStatsError");
|
|
328
326
|
}
|
|
@@ -340,28 +338,28 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
340
338
|
});
|
|
341
339
|
}
|
|
342
340
|
}, M = class extends a {
|
|
343
|
-
constructor(
|
|
341
|
+
constructor(o) {
|
|
344
342
|
super({
|
|
345
343
|
category: "BUILDER-WEBPACK5",
|
|
346
344
|
code: 2,
|
|
347
|
-
message:
|
|
345
|
+
message: o.error.message.trim()
|
|
348
346
|
});
|
|
349
|
-
this.data =
|
|
347
|
+
this.data = o;
|
|
350
348
|
}
|
|
351
349
|
static {
|
|
352
350
|
r(this, "WebpackInvocationError");
|
|
353
351
|
}
|
|
354
352
|
};
|
|
355
|
-
function
|
|
353
|
+
function ae(t = "") {
|
|
356
354
|
return t.replace(/\u001B\[[0-9;]*m/g, "");
|
|
357
355
|
}
|
|
358
|
-
r(
|
|
356
|
+
r(ae, "removeAnsiEscapeCodes");
|
|
359
357
|
var T = class extends a {
|
|
360
|
-
constructor(
|
|
361
|
-
|
|
358
|
+
constructor(o) {
|
|
359
|
+
o.errors = o.errors.map((n) => ({
|
|
362
360
|
...n,
|
|
363
|
-
message:
|
|
364
|
-
stack:
|
|
361
|
+
message: ae(n.message),
|
|
362
|
+
stack: ae(n.stack),
|
|
365
363
|
name: n.name
|
|
366
364
|
}));
|
|
367
365
|
super({
|
|
@@ -373,27 +371,27 @@ var T = class extends a {
|
|
|
373
371
|
Run Storybook with --debug-webpack for more information.
|
|
374
372
|
`
|
|
375
373
|
});
|
|
376
|
-
this.data =
|
|
374
|
+
this.data = o;
|
|
377
375
|
}
|
|
378
376
|
static {
|
|
379
377
|
r(this, "WebpackCompilationError");
|
|
380
378
|
}
|
|
381
|
-
},
|
|
382
|
-
constructor(
|
|
379
|
+
}, W = class extends a {
|
|
380
|
+
constructor(o) {
|
|
383
381
|
super({
|
|
384
382
|
category: "CLI_INIT",
|
|
385
383
|
code: 2,
|
|
386
384
|
documentation: "https://storybook.js.org/docs/faq#error-no-angularjson-file-found",
|
|
387
385
|
message: i.dedent`
|
|
388
|
-
An angular.json file was not found in the current working directory: ${
|
|
386
|
+
An angular.json file was not found in the current working directory: ${o.path}
|
|
389
387
|
Storybook needs it to work properly, so please rerun the command at the root of your project, where the angular.json file is located.`
|
|
390
388
|
});
|
|
391
|
-
this.data =
|
|
389
|
+
this.data = o;
|
|
392
390
|
}
|
|
393
391
|
static {
|
|
394
392
|
r(this, "MissingAngularJsonError");
|
|
395
393
|
}
|
|
396
|
-
},
|
|
394
|
+
}, K = class extends a {
|
|
397
395
|
static {
|
|
398
396
|
r(this, "AngularLegacyBuildOptionsError");
|
|
399
397
|
}
|
|
@@ -412,27 +410,27 @@ var T = class extends a {
|
|
|
412
410
|
Please run 'npx storybook automigrate' to automatically fix your config.`
|
|
413
411
|
});
|
|
414
412
|
}
|
|
415
|
-
},
|
|
416
|
-
constructor(
|
|
413
|
+
}, v = class extends a {
|
|
414
|
+
constructor(o) {
|
|
417
415
|
super({
|
|
418
416
|
category: "CORE-SERVER",
|
|
419
417
|
code: 2,
|
|
420
418
|
documentation: "",
|
|
421
419
|
message: i.dedent`
|
|
422
|
-
Storybook failed to load the following preset: ${
|
|
420
|
+
Storybook failed to load the following preset: ${o.presetName}.
|
|
423
421
|
|
|
424
422
|
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
|
|
425
423
|
|
|
426
424
|
If you believe this is a bug, please open an issue on Github.
|
|
427
425
|
|
|
428
|
-
${
|
|
426
|
+
${o.error.stack || o.error.message}`
|
|
429
427
|
});
|
|
430
|
-
this.data =
|
|
428
|
+
this.data = o;
|
|
431
429
|
}
|
|
432
430
|
static {
|
|
433
431
|
r(this, "CriticalPresetLoadError");
|
|
434
432
|
}
|
|
435
|
-
},
|
|
433
|
+
}, B = class extends a {
|
|
436
434
|
static {
|
|
437
435
|
r(this, "MissingBuilderError");
|
|
438
436
|
}
|
|
@@ -453,32 +451,32 @@ var T = class extends a {
|
|
|
453
451
|
If you believe this is a bug, please describe your issue in detail on Github.`
|
|
454
452
|
});
|
|
455
453
|
}
|
|
456
|
-
},
|
|
457
|
-
constructor(
|
|
454
|
+
}, L = class extends a {
|
|
455
|
+
constructor(o) {
|
|
458
456
|
super({
|
|
459
457
|
category: "FRAMEWORK_NEXTJS",
|
|
460
458
|
code: 1,
|
|
461
459
|
documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
|
|
462
460
|
message: i.dedent`
|
|
463
|
-
Failed to fetch \`${
|
|
461
|
+
Failed to fetch \`${o.fontFamily}\` from Google Fonts with URL: \`${o.url}\``
|
|
464
462
|
});
|
|
465
|
-
this.data =
|
|
463
|
+
this.data = o;
|
|
466
464
|
}
|
|
467
465
|
static {
|
|
468
466
|
r(this, "GoogleFontsDownloadError");
|
|
469
467
|
}
|
|
470
468
|
}, N = class extends a {
|
|
471
|
-
constructor(
|
|
469
|
+
constructor(o) {
|
|
472
470
|
super({
|
|
473
471
|
category: "FRAMEWORK_NEXTJS",
|
|
474
472
|
code: 2,
|
|
475
473
|
documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
|
|
476
474
|
message: i.dedent`
|
|
477
|
-
An error occurred when trying to load Google Fonts with URL \`${
|
|
475
|
+
An error occurred when trying to load Google Fonts with URL \`${o.url}\`.
|
|
478
476
|
|
|
479
|
-
${
|
|
477
|
+
${o.error instanceof Error ? o.error.message : ""}`
|
|
480
478
|
});
|
|
481
|
-
this.data =
|
|
479
|
+
this.data = o;
|
|
482
480
|
}
|
|
483
481
|
static {
|
|
484
482
|
r(this, "GoogleFontsLoadingError");
|
|
@@ -498,7 +496,7 @@ var T = class extends a {
|
|
|
498
496
|
});
|
|
499
497
|
}
|
|
500
498
|
}, j = class extends a {
|
|
501
|
-
constructor(
|
|
499
|
+
constructor(o) {
|
|
502
500
|
super({
|
|
503
501
|
category: "CORE-SERVER",
|
|
504
502
|
code: 4,
|
|
@@ -515,28 +513,28 @@ var T = class extends a {
|
|
|
515
513
|
|
|
516
514
|
Please run \`npx storybook doctor\` for guidance on how to fix this issue.`
|
|
517
515
|
});
|
|
518
|
-
this.data =
|
|
516
|
+
this.data = o;
|
|
519
517
|
}
|
|
520
518
|
static {
|
|
521
519
|
r(this, "NoMatchingExportError");
|
|
522
520
|
}
|
|
523
521
|
}, V = class extends a {
|
|
524
|
-
constructor(
|
|
522
|
+
constructor(o) {
|
|
525
523
|
let n = [
|
|
526
|
-
`Storybook failed to load ${
|
|
524
|
+
`Storybook failed to load ${o.location}`,
|
|
527
525
|
"",
|
|
528
526
|
"It looks like the file tried to load/import an ESM only module.",
|
|
529
|
-
`Support for this is currently limited in ${
|
|
527
|
+
`Support for this is currently limited in ${o.location}`,
|
|
530
528
|
"You can import ESM modules in your main file, but only as dynamic import.",
|
|
531
529
|
""
|
|
532
530
|
];
|
|
533
|
-
|
|
531
|
+
o.line && n.push(
|
|
534
532
|
l.default.white(
|
|
535
|
-
`In your ${l.default.yellow(
|
|
536
|
-
l.default.cyan(
|
|
533
|
+
`In your ${l.default.yellow(o.location)} file, line ${l.default.bold(
|
|
534
|
+
l.default.cyan(o.num)
|
|
537
535
|
)} threw an error:`
|
|
538
536
|
),
|
|
539
|
-
l.default.gray(
|
|
537
|
+
l.default.gray(o.line)
|
|
540
538
|
), n.push(
|
|
541
539
|
"",
|
|
542
540
|
l.default.white(
|
|
@@ -552,13 +550,13 @@ var T = class extends a {
|
|
|
552
550
|
message: n.join(`
|
|
553
551
|
`)
|
|
554
552
|
});
|
|
555
|
-
this.data =
|
|
553
|
+
this.data = o;
|
|
556
554
|
}
|
|
557
555
|
static {
|
|
558
556
|
r(this, "MainFileESMOnlyImportError");
|
|
559
557
|
}
|
|
560
558
|
}, $ = class extends a {
|
|
561
|
-
constructor(
|
|
559
|
+
constructor(o) {
|
|
562
560
|
let n = {
|
|
563
561
|
storybook: {
|
|
564
562
|
helperMessage: "You can pass a --config-dir flag to tell Storybook, where your main.js file is located at.",
|
|
@@ -569,82 +567,82 @@ var T = class extends a {
|
|
|
569
567
|
// TODO: add proper docs once available
|
|
570
568
|
documentation: "https://storybook.js.org/docs/configure"
|
|
571
569
|
}
|
|
572
|
-
}, { documentation: c, helperMessage: u } = n[
|
|
570
|
+
}, { documentation: c, helperMessage: u } = n[o.source || "storybook"];
|
|
573
571
|
super({
|
|
574
572
|
category: "CORE-SERVER",
|
|
575
573
|
code: 6,
|
|
576
574
|
documentation: c,
|
|
577
575
|
message: i.dedent`
|
|
578
|
-
No configuration files have been found in your configDir: ${l.default.yellow(
|
|
576
|
+
No configuration files have been found in your configDir: ${l.default.yellow(o.location)}.
|
|
579
577
|
Storybook needs a "main.js" file, please add it.
|
|
580
578
|
|
|
581
579
|
${u}`
|
|
582
580
|
});
|
|
583
|
-
this.data =
|
|
581
|
+
this.data = o;
|
|
584
582
|
}
|
|
585
583
|
static {
|
|
586
584
|
r(this, "MainFileMissingError");
|
|
587
585
|
}
|
|
588
586
|
}, F = class extends a {
|
|
589
|
-
constructor(
|
|
587
|
+
constructor(o) {
|
|
590
588
|
let n = l.default.white(
|
|
591
|
-
(
|
|
589
|
+
(o.error.stack || o.error.message).replaceAll(process.cwd(), "")
|
|
592
590
|
);
|
|
593
591
|
super({
|
|
594
592
|
category: "CORE-SERVER",
|
|
595
593
|
code: 7,
|
|
596
594
|
message: i.dedent`
|
|
597
|
-
Storybook couldn't evaluate your ${l.default.yellow(
|
|
595
|
+
Storybook couldn't evaluate your ${l.default.yellow(o.location)} file.
|
|
598
596
|
|
|
599
597
|
Original error:
|
|
600
598
|
${n}`
|
|
601
599
|
});
|
|
602
|
-
this.data =
|
|
600
|
+
this.data = o;
|
|
603
601
|
}
|
|
604
602
|
static {
|
|
605
603
|
r(this, "MainFileEvaluationError");
|
|
606
604
|
}
|
|
607
605
|
}, D = class extends a {
|
|
608
|
-
constructor(
|
|
606
|
+
constructor(o) {
|
|
609
607
|
super({
|
|
610
608
|
category: "CORE-SERVER",
|
|
611
609
|
code: 16,
|
|
612
|
-
message: `Status has typeId "${
|
|
613
|
-
|
|
610
|
+
message: `Status has typeId "${o.status.typeId}" but was added to store with typeId "${o.typeId}". Full status: ${JSON.stringify(
|
|
611
|
+
o.status,
|
|
614
612
|
null,
|
|
615
613
|
2
|
|
616
614
|
)}`
|
|
617
615
|
});
|
|
618
|
-
this.data =
|
|
616
|
+
this.data = o;
|
|
619
617
|
}
|
|
620
618
|
static {
|
|
621
619
|
r(this, "StatusTypeIdMismatchError");
|
|
622
620
|
}
|
|
623
621
|
}, U = class extends a {
|
|
624
|
-
constructor(
|
|
622
|
+
constructor(o) {
|
|
625
623
|
super({
|
|
626
624
|
category: "CLI_INIT",
|
|
627
625
|
code: 3,
|
|
628
626
|
documentation: "",
|
|
629
627
|
message: i.dedent`
|
|
630
|
-
There was an error while using ${
|
|
628
|
+
There was an error while using ${o.packageManager} to create a new ${o.projectType} project.
|
|
631
629
|
|
|
632
|
-
${
|
|
630
|
+
${o.error instanceof Error ? o.error.message : ""}`
|
|
633
631
|
});
|
|
634
|
-
this.data =
|
|
632
|
+
this.data = o;
|
|
635
633
|
}
|
|
636
634
|
static {
|
|
637
635
|
r(this, "GenerateNewProjectOnInitError");
|
|
638
636
|
}
|
|
639
637
|
}, G = class extends a {
|
|
640
|
-
constructor(
|
|
638
|
+
constructor(o) {
|
|
641
639
|
super({
|
|
642
640
|
category: "CLI_UPGRADE",
|
|
643
641
|
code: 3,
|
|
644
642
|
message: i.dedent`
|
|
645
643
|
You are trying to upgrade Storybook to a lower version than the version currently installed. This is not supported.
|
|
646
644
|
|
|
647
|
-
Storybook version ${
|
|
645
|
+
Storybook version ${o.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${o.currentVersion}.
|
|
648
646
|
|
|
649
647
|
This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
|
|
650
648
|
This will cause npm to run the globally cached storybook binary, which might be an older version.
|
|
@@ -653,37 +651,12 @@ var T = class extends a {
|
|
|
653
651
|
|
|
654
652
|
"npx storybook@latest upgrade"`
|
|
655
653
|
});
|
|
656
|
-
this.data =
|
|
654
|
+
this.data = o;
|
|
657
655
|
}
|
|
658
656
|
static {
|
|
659
657
|
r(this, "UpgradeStorybookToLowerVersionError");
|
|
660
658
|
}
|
|
661
659
|
}, Y = class extends a {
|
|
662
|
-
constructor(e) {
|
|
663
|
-
super({
|
|
664
|
-
category: "CLI_UPGRADE",
|
|
665
|
-
code: 4,
|
|
666
|
-
message: i.dedent`
|
|
667
|
-
You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
|
|
668
|
-
|
|
669
|
-
This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
|
|
670
|
-
This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
|
|
671
|
-
This also happens if you're running the Storybook CLI that is locally installed in your project.
|
|
672
|
-
|
|
673
|
-
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:
|
|
674
|
-
|
|
675
|
-
"npx storybook@latest upgrade"
|
|
676
|
-
|
|
677
|
-
If you intended to re-run automigrations, you should run the "automigrate" command directly instead:
|
|
678
|
-
|
|
679
|
-
"npx storybook automigrate"`
|
|
680
|
-
});
|
|
681
|
-
this.data = e;
|
|
682
|
-
}
|
|
683
|
-
static {
|
|
684
|
-
r(this, "UpgradeStorybookToSameVersionError");
|
|
685
|
-
}
|
|
686
|
-
}, J = class extends a {
|
|
687
660
|
static {
|
|
688
661
|
r(this, "UpgradeStorybookUnknownCurrentVersionError");
|
|
689
662
|
}
|
|
@@ -698,21 +671,7 @@ var T = class extends a {
|
|
|
698
671
|
It might help if you specify your Storybook config directory with the --config-dir flag.`
|
|
699
672
|
});
|
|
700
673
|
}
|
|
701
|
-
},
|
|
702
|
-
static {
|
|
703
|
-
r(this, "UpgradeStorybookInWrongWorkingDirectory");
|
|
704
|
-
}
|
|
705
|
-
constructor() {
|
|
706
|
-
super({
|
|
707
|
-
category: "CLI_UPGRADE",
|
|
708
|
-
code: 6,
|
|
709
|
-
message: i.dedent`
|
|
710
|
-
You are running the upgrade command in a CWD that does not contain Storybook dependencies.
|
|
711
|
-
|
|
712
|
-
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.`
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
}, H = class extends a {
|
|
674
|
+
}, J = class extends a {
|
|
716
675
|
static {
|
|
717
676
|
r(this, "NoStatsForViteDevError");
|
|
718
677
|
}
|
|
@@ -726,22 +685,22 @@ var T = class extends a {
|
|
|
726
685
|
Please remove the \`--stats-json\` flag when running in dev mode.`
|
|
727
686
|
});
|
|
728
687
|
}
|
|
729
|
-
},
|
|
730
|
-
constructor(
|
|
688
|
+
}, X = class extends a {
|
|
689
|
+
constructor(o) {
|
|
731
690
|
super({
|
|
732
691
|
category: "CLI",
|
|
733
692
|
code: 1,
|
|
734
693
|
message: i.dedent`
|
|
735
|
-
Unable to find versions of "${
|
|
736
|
-
${
|
|
694
|
+
Unable to find versions of "${o.packageName}" using ${o.packageManager}
|
|
695
|
+
${o.error && `Reason: ${o.error}`}`
|
|
737
696
|
});
|
|
738
|
-
this.data =
|
|
697
|
+
this.data = o;
|
|
739
698
|
}
|
|
740
699
|
static {
|
|
741
700
|
r(this, "FindPackageVersionsError");
|
|
742
701
|
}
|
|
743
|
-
},
|
|
744
|
-
constructor(
|
|
702
|
+
}, H = class extends a {
|
|
703
|
+
constructor(o) {
|
|
745
704
|
super({
|
|
746
705
|
category: "FRAMEWORK_NEXTJS",
|
|
747
706
|
code: 3,
|
|
@@ -764,24 +723,24 @@ var T = class extends a {
|
|
|
764
723
|
},
|
|
765
724
|
};
|
|
766
725
|
|
|
767
|
-
Original error: ${
|
|
726
|
+
Original error: ${o.error.message}
|
|
768
727
|
`
|
|
769
728
|
});
|
|
770
|
-
this.data =
|
|
729
|
+
this.data = o;
|
|
771
730
|
}
|
|
772
731
|
static {
|
|
773
732
|
r(this, "IncompatiblePostCssConfigError");
|
|
774
733
|
}
|
|
775
|
-
},
|
|
776
|
-
constructor(
|
|
734
|
+
}, z = class extends a {
|
|
735
|
+
constructor(o) {
|
|
777
736
|
super({
|
|
778
737
|
category: "CORE-SERVER",
|
|
779
738
|
code: 1,
|
|
780
739
|
message: i.dedent`
|
|
781
|
-
Unable to save global settings file to ${
|
|
782
|
-
${
|
|
740
|
+
Unable to save global settings file to ${o.filePath}
|
|
741
|
+
${o.error && `Reason: ${o.error}`}`
|
|
783
742
|
});
|
|
784
|
-
this.data =
|
|
743
|
+
this.data = o;
|
|
785
744
|
}
|
|
786
745
|
static {
|
|
787
746
|
r(this, "SavingGlobalSettingsFileError");
|