storybook 9.0.0-alpha.2 → 9.0.0-alpha.21
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/README.md +1 -1
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/server/base-preview-head.html +1 -3
- package/bin/index.cjs +2 -2
- package/dist/actions/decorator.d.ts +6 -0
- package/dist/actions/decorator.js +134 -0
- package/dist/actions/index.cjs +123 -0
- package/dist/actions/index.d.ts +102 -0
- package/dist/actions/index.js +108 -0
- package/dist/actions/preview.cjs +161 -0
- package/dist/actions/preview.d.ts +54 -0
- package/dist/actions/preview.js +152 -0
- package/dist/babel/index.cjs +822 -816
- package/dist/babel/index.js +822 -816
- package/dist/backgrounds/index.cjs +148 -0
- package/dist/backgrounds/index.d.ts +91 -0
- package/dist/backgrounds/index.js +130 -0
- package/dist/backgrounds/preview.cjs +143 -0
- package/dist/backgrounds/preview.d.ts +54 -0
- package/dist/backgrounds/preview.js +127 -0
- package/dist/bin/index.cjs +49 -70
- package/dist/bin/index.js +49 -70
- package/dist/builder-manager/index.cjs +319 -326
- package/dist/builder-manager/index.js +576 -583
- package/dist/channels/index.cjs +1026 -981
- package/dist/channels/index.js +1258 -1207
- package/dist/cli/bin/index.cjs +483 -483
- package/dist/cli/bin/index.js +495 -495
- package/dist/cli/index.cjs +61735 -7590
- package/dist/cli/index.d.ts +25 -21
- package/dist/cli/index.js +61776 -7631
- package/dist/client-logger/index.cjs +56 -88
- package/dist/client-logger/index.js +41 -47
- package/dist/common/index.cjs +16137 -9085
- package/dist/common/index.d.ts +35 -30
- package/dist/common/index.js +16230 -9172
- package/dist/component-testing/index.cjs +23 -0
- package/dist/component-testing/index.d.ts +3 -0
- package/dist/component-testing/index.js +5 -0
- package/dist/component-testing/preview.cjs +40 -0
- package/dist/component-testing/preview.d.ts +5 -0
- package/dist/component-testing/preview.js +25 -0
- package/dist/components/index.cjs +16268 -24926
- package/dist/components/index.d.ts +98 -347
- package/dist/components/index.js +5905 -19177
- package/dist/controls/decorator.d.ts +5 -0
- package/dist/controls/decorator.js +8 -0
- package/dist/controls/index.cjs +26 -0
- package/dist/controls/index.d.ts +39 -0
- package/dist/controls/index.js +6 -0
- package/dist/controls/preview.cjs +26 -0
- package/dist/controls/preview.d.ts +54 -0
- package/dist/controls/preview.js +9 -0
- package/dist/core-events/index.cjs +91 -106
- package/dist/core-events/index.d.ts +139 -104
- package/dist/core-events/index.js +79 -94
- package/dist/core-server/index.cjs +13898 -13409
- package/dist/core-server/index.d.ts +270 -3
- package/dist/core-server/index.js +13981 -13497
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +12149 -17
- package/dist/core-server/presets/common-preset.cjs +3009 -3155
- package/dist/core-server/presets/common-preset.js +2862 -3009
- package/dist/csf/index.cjs +76 -120
- package/dist/csf/index.d.ts +2 -6
- package/dist/csf/index.js +69 -113
- package/dist/csf-tools/index.cjs +412 -403
- package/dist/csf-tools/index.d.ts +0 -4
- package/dist/csf-tools/index.js +410 -401
- package/dist/docs-tools/index.cjs +2569 -575
- package/dist/docs-tools/index.d.ts +2 -2
- package/dist/docs-tools/index.js +2565 -564
- package/dist/highlight/index.cjs +27 -0
- package/dist/highlight/index.d.ts +61 -0
- package/dist/highlight/index.js +7 -0
- package/dist/highlight/preview.cjs +535 -0
- package/dist/highlight/preview.d.ts +54 -0
- package/dist/highlight/preview.js +519 -0
- package/dist/instrumenter/index.cjs +2207 -2342
- package/dist/instrumenter/index.d.ts +8 -7
- package/dist/instrumenter/index.js +2430 -2603
- package/dist/manager/globals-module-info.cjs +291 -151
- package/dist/manager/globals-module-info.d.ts +1 -1
- package/dist/manager/globals-module-info.js +275 -135
- package/dist/manager/globals-runtime.js +60263 -28383
- package/dist/manager/globals.cjs +23 -19
- package/dist/manager/globals.d.ts +8 -5
- package/dist/manager/globals.js +10 -6
- package/dist/manager/runtime.js +4625 -3921
- package/dist/manager-api/index.cjs +4228 -3833
- package/dist/manager-api/index.d.ts +398 -102
- package/dist/manager-api/index.js +3500 -3084
- package/dist/manager-errors.d.ts +25 -1
- package/dist/manager-errors.js +50 -30
- package/dist/measure/index.cjs +476 -0
- package/dist/measure/index.d.ts +66 -0
- package/dist/measure/index.js +464 -0
- package/dist/measure/preview.cjs +466 -0
- package/dist/measure/preview.d.ts +59 -0
- package/dist/measure/preview.js +450 -0
- package/dist/outline/index.cjs +528 -0
- package/dist/outline/index.d.ts +66 -0
- package/dist/outline/index.js +500 -0
- package/dist/outline/preview.cjs +518 -0
- package/dist/outline/preview.d.ts +59 -0
- package/dist/outline/preview.js +486 -0
- package/dist/preview/globals.cjs +21 -17
- package/dist/preview/globals.d.ts +4 -1
- package/dist/preview/globals.js +6 -2
- package/dist/preview/runtime.js +46311 -6614
- package/dist/preview-api/index.cjs +1363 -1899
- package/dist/preview-api/index.d.ts +81 -395
- package/dist/preview-api/index.js +1711 -2169
- package/dist/preview-errors.cjs +119 -88
- package/dist/preview-errors.d.ts +30 -2
- package/dist/preview-errors.js +192 -142
- package/dist/router/index.cjs +847 -871
- package/dist/router/index.js +193 -199
- package/dist/server-errors.cjs +188 -124
- package/dist/server-errors.d.ts +36 -2
- package/dist/server-errors.js +188 -124
- package/dist/telemetry/index.cjs +1056 -1979
- package/dist/telemetry/index.d.ts +26 -5
- package/dist/telemetry/index.js +1091 -2010
- package/dist/test/index.cjs +35686 -0
- package/dist/test/index.d.ts +186 -0
- package/dist/test/index.js +33840 -0
- package/dist/test/preview.cjs +15870 -0
- package/dist/test/preview.d.ts +48 -0
- package/dist/test/preview.js +14501 -0
- package/dist/test/spy.cjs +258 -0
- package/dist/test/spy.d.ts +66 -0
- package/dist/test/spy.js +240 -0
- package/dist/theming/create.cjs +79 -2269
- package/dist/theming/create.js +67 -841
- package/dist/theming/index.cjs +1065 -3232
- package/dist/theming/index.js +951 -1719
- package/dist/types/index.cjs +11 -12
- package/dist/types/index.d.ts +684 -163
- package/dist/types/index.js +1 -2
- package/dist/viewport/index.cjs +310 -0
- package/dist/viewport/index.d.ts +320 -0
- package/dist/viewport/index.js +290 -0
- package/dist/viewport/preview.cjs +35 -0
- package/dist/viewport/preview.d.ts +68 -0
- package/dist/viewport/preview.js +19 -0
- package/package.json +359 -12
package/dist/server-errors.cjs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var le = Object.create;
|
|
3
3
|
var y = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
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
9
|
for (var o in e)
|
|
10
10
|
y(t, o, { get: e[o], enumerable: !0 });
|
|
11
|
-
},
|
|
11
|
+
}, Z = (t, e, o, n) => {
|
|
12
12
|
if (e && typeof e == "object" || typeof e == "function")
|
|
13
|
-
for (let c of
|
|
14
|
-
!
|
|
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 });
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var ee = (t, e, o) => (o = t != null ? le(ge(t)) : {}, Z(
|
|
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
|
+
)), ye = (t) => Z(y({}, "__esModule", { value: !0 }), t);
|
|
25
25
|
|
|
26
26
|
// ../node_modules/picocolors/picocolors.js
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
"--color") ||
|
|
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
30
|
let c = "" + n, u = c.indexOf(e, t.length);
|
|
31
|
-
return ~u ? t +
|
|
32
|
-
}, "formatter"),
|
|
31
|
+
return ~u ? t + fe(c, e, o, u) + e : t + c + e;
|
|
32
|
+
}, "formatter"), fe = /* @__PURE__ */ r((t, e, o, n) => {
|
|
33
33
|
let c = "", u = 0;
|
|
34
34
|
do
|
|
35
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 e = t ?
|
|
38
|
+
}, "replaceClose"), te = /* @__PURE__ */ r((t = he) => {
|
|
39
|
+
let e = t ? Ee : () => String;
|
|
40
40
|
return {
|
|
41
41
|
isColorSupported: t,
|
|
42
42
|
reset: e("\x1B[0m", "\x1B[0m"),
|
|
@@ -82,25 +82,25 @@ var ee = z((Re, k) => {
|
|
|
82
82
|
bgWhiteBright: e("\x1B[107m", "\x1B[49m")
|
|
83
83
|
};
|
|
84
84
|
}, "createColors");
|
|
85
|
-
k.exports =
|
|
86
|
-
k.exports.createColors =
|
|
85
|
+
k.exports = te();
|
|
86
|
+
k.exports.createColors = te;
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
// ../node_modules/ts-dedent/dist/index.js
|
|
90
|
-
var
|
|
90
|
+
var ne = Q((h) => {
|
|
91
91
|
"use strict";
|
|
92
92
|
Object.defineProperty(h, "__esModule", { value: !0 });
|
|
93
93
|
h.dedent = void 0;
|
|
94
|
-
function
|
|
94
|
+
function se(t) {
|
|
95
95
|
for (var e = [], o = 1; o < arguments.length; o++)
|
|
96
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
|
-
return p ? m.concat(p.map(function(
|
|
102
|
-
var g,
|
|
103
|
-
return (
|
|
101
|
+
return p ? m.concat(p.map(function(R) {
|
|
102
|
+
var g, b;
|
|
103
|
+
return (b = (g = R.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0;
|
|
104
104
|
})) : m;
|
|
105
105
|
}, []);
|
|
106
106
|
if (c.length) {
|
|
@@ -112,65 +112,68 @@ var te = z((h) => {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
n[0] = n[0].replace(/^\r?\n/, "");
|
|
115
|
-
var
|
|
115
|
+
var d = n[0];
|
|
116
116
|
return e.forEach(function(m, x) {
|
|
117
|
-
var p =
|
|
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(
|
|
121
|
-
return
|
|
120
|
+
`).map(function(b, ue) {
|
|
121
|
+
return ue === 0 ? b : "" + R + b;
|
|
122
122
|
}).join(`
|
|
123
|
-
`)),
|
|
124
|
-
}),
|
|
123
|
+
`)), d += g + n[x + 1];
|
|
124
|
+
}), d;
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
h.dedent =
|
|
128
|
-
h.default =
|
|
126
|
+
r(se, "dedent");
|
|
127
|
+
h.dedent = se;
|
|
128
|
+
h.default = se;
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
// src/server-errors.ts
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
AngularLegacyBuildOptionsError: () =>
|
|
135
|
-
Category: () =>
|
|
136
|
-
ConflictingStaticDirConfigError: () =>
|
|
137
|
-
CouldNotEvaluateFrameworkError: () =>
|
|
138
|
-
CriticalPresetLoadError: () =>
|
|
139
|
-
FindPackageVersionsError: () =>
|
|
140
|
-
GenerateNewProjectOnInitError: () =>
|
|
132
|
+
var xe = {};
|
|
133
|
+
pe(xe, {
|
|
134
|
+
AngularLegacyBuildOptionsError: () => v,
|
|
135
|
+
Category: () => ce,
|
|
136
|
+
ConflictingStaticDirConfigError: () => C,
|
|
137
|
+
CouldNotEvaluateFrameworkError: () => w,
|
|
138
|
+
CriticalPresetLoadError: () => K,
|
|
139
|
+
FindPackageVersionsError: () => z,
|
|
140
|
+
GenerateNewProjectOnInitError: () => U,
|
|
141
141
|
GoogleFontsDownloadError: () => B,
|
|
142
|
-
GoogleFontsLoadingError: () =>
|
|
142
|
+
GoogleFontsLoadingError: () => N,
|
|
143
|
+
IncompatiblePostCssConfigError: () => q,
|
|
143
144
|
InvalidFrameworkNameError: () => _,
|
|
144
|
-
InvalidStoriesEntryError: () =>
|
|
145
|
+
InvalidStoriesEntryError: () => I,
|
|
145
146
|
MainFileESMOnlyImportError: () => V,
|
|
146
147
|
MainFileEvaluationError: () => F,
|
|
147
|
-
MainFileMissingError: () =>
|
|
148
|
+
MainFileMissingError: () => $,
|
|
148
149
|
MissingAngularJsonError: () => W,
|
|
149
150
|
MissingBuilderError: () => L,
|
|
150
151
|
MissingFrameworkFieldError: () => A,
|
|
151
|
-
NoMatchingExportError: () =>
|
|
152
|
+
NoMatchingExportError: () => P,
|
|
152
153
|
NoStatsForViteDevError: () => H,
|
|
153
154
|
NxProjectDetectedError: () => O,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
StatusTypeIdMismatchError: () => D,
|
|
156
|
+
SvelteViteWithSvelteKitError: () => j,
|
|
157
|
+
UpgradeStorybookInWrongWorkingDirectory: () => X,
|
|
158
|
+
UpgradeStorybookToLowerVersionError: () => G,
|
|
159
|
+
UpgradeStorybookToSameVersionError: () => Y,
|
|
160
|
+
UpgradeStorybookUnknownCurrentVersionError: () => J,
|
|
161
|
+
WebpackCompilationError: () => T,
|
|
162
|
+
WebpackInvocationError: () => M,
|
|
163
|
+
WebpackMissingStatsError: () => S
|
|
161
164
|
});
|
|
162
|
-
module.exports =
|
|
163
|
-
var l =
|
|
165
|
+
module.exports = ye(xe);
|
|
166
|
+
var l = ee(re(), 1), i = ee(ne(), 1);
|
|
164
167
|
|
|
165
168
|
// src/storybook-error.ts
|
|
166
|
-
function
|
|
169
|
+
function ae({
|
|
167
170
|
code: t,
|
|
168
171
|
category: e
|
|
169
172
|
}) {
|
|
170
173
|
let o = String(t).padStart(4, "0");
|
|
171
174
|
return `SB_${e}_${o}`;
|
|
172
175
|
}
|
|
173
|
-
|
|
176
|
+
r(ae, "parseErrorCode");
|
|
174
177
|
var a = class t extends Error {
|
|
175
178
|
constructor(o) {
|
|
176
179
|
super(t.getFullMessage(o));
|
|
@@ -184,10 +187,10 @@ var a = class t extends Error {
|
|
|
184
187
|
this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
|
|
185
188
|
}
|
|
186
189
|
static {
|
|
187
|
-
|
|
190
|
+
r(this, "StorybookError");
|
|
188
191
|
}
|
|
189
192
|
get fullErrorCode() {
|
|
190
|
-
return
|
|
193
|
+
return ae({ code: this.code, category: this.category });
|
|
191
194
|
}
|
|
192
195
|
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
193
196
|
get name() {
|
|
@@ -201,32 +204,31 @@ var a = class t extends Error {
|
|
|
201
204
|
category: c,
|
|
202
205
|
message: u
|
|
203
206
|
}) {
|
|
204
|
-
let
|
|
205
|
-
return o === !0 ?
|
|
206
|
-
(
|
|
207
|
+
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
|
+
(d = `
|
|
207
210
|
${o.map((m) => ` - ${m}`).join(`
|
|
208
|
-
`)}`), `${u}${
|
|
211
|
+
`)}`), `${u}${d != null ? `
|
|
209
212
|
|
|
210
|
-
More info: ${
|
|
213
|
+
More info: ${d}
|
|
211
214
|
` : ""}`;
|
|
212
215
|
}
|
|
213
216
|
};
|
|
214
217
|
|
|
215
218
|
// src/server-errors.ts
|
|
216
|
-
var
|
|
217
|
-
E",
|
|
218
|
-
"CORE-COMMON",
|
|
219
|
-
TE",
|
|
220
|
-
|
|
221
|
-
FRAMEWORK_HTML-VITE",
|
|
222
|
-
"FRAMEWORK_PREACT-VITE",
|
|
223
|
-
"FRAMEWORK_REACT-WEBPACK5",
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
219
|
+
var ce = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
|
|
220
|
+
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
|
+
"CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
|
|
222
|
+
TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
|
|
223
|
+
s.CORE_WEBPACK = "CORE-WEBPACK", s.FRAMEWORK_ANGULAR = "FRAMEWORK_ANGULAR", s.FRAMEWORK_EMBER = "FRAMEWORK_EMBER", s.FRAMEWORK_HTML_VITE = "\
|
|
224
|
+
FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", s.FRAMEWORK_PREACT_VITE =
|
|
225
|
+
"FRAMEWORK_PREACT-VITE", s.FRAMEWORK_PREACT_WEBPACK5 = "FRAMEWORK_PREACT-WEBPACK5", s.FRAMEWORK_REACT_VITE = "FRAMEWORK_REACT-VITE", s.FRAMEWORK_REACT_WEBPACK5 =
|
|
226
|
+
"FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
|
|
227
|
+
FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
|
|
228
|
+
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 {
|
|
228
230
|
static {
|
|
229
|
-
|
|
231
|
+
r(this, "NxProjectDetectedError");
|
|
230
232
|
}
|
|
231
233
|
constructor() {
|
|
232
234
|
super({
|
|
@@ -240,7 +242,7 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
240
242
|
}
|
|
241
243
|
}, A = class extends a {
|
|
242
244
|
static {
|
|
243
|
-
|
|
245
|
+
r(this, "MissingFrameworkFieldError");
|
|
244
246
|
}
|
|
245
247
|
constructor() {
|
|
246
248
|
super({
|
|
@@ -268,9 +270,9 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
268
270
|
this.data = o;
|
|
269
271
|
}
|
|
270
272
|
static {
|
|
271
|
-
|
|
273
|
+
r(this, "InvalidFrameworkNameError");
|
|
272
274
|
}
|
|
273
|
-
},
|
|
275
|
+
}, w = class extends a {
|
|
274
276
|
constructor(o) {
|
|
275
277
|
super({
|
|
276
278
|
category: "CORE-COMMON",
|
|
@@ -284,11 +286,11 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
284
286
|
this.data = o;
|
|
285
287
|
}
|
|
286
288
|
static {
|
|
287
|
-
|
|
289
|
+
r(this, "CouldNotEvaluateFrameworkError");
|
|
288
290
|
}
|
|
289
|
-
},
|
|
291
|
+
}, C = class extends a {
|
|
290
292
|
static {
|
|
291
|
-
|
|
293
|
+
r(this, "ConflictingStaticDirConfigError");
|
|
292
294
|
}
|
|
293
295
|
constructor() {
|
|
294
296
|
super({
|
|
@@ -303,9 +305,9 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
303
305
|
Please remove the CLI flag from your storybook script and use only the 'staticDirs' option instead.`
|
|
304
306
|
});
|
|
305
307
|
}
|
|
306
|
-
},
|
|
308
|
+
}, I = class extends a {
|
|
307
309
|
static {
|
|
308
|
-
|
|
310
|
+
r(this, "InvalidStoriesEntryError");
|
|
309
311
|
}
|
|
310
312
|
constructor() {
|
|
311
313
|
super({
|
|
@@ -319,9 +321,9 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
319
321
|
Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array.`
|
|
320
322
|
});
|
|
321
323
|
}
|
|
322
|
-
},
|
|
324
|
+
}, S = class extends a {
|
|
323
325
|
static {
|
|
324
|
-
|
|
326
|
+
r(this, "WebpackMissingStatsError");
|
|
325
327
|
}
|
|
326
328
|
constructor() {
|
|
327
329
|
super({
|
|
@@ -336,7 +338,7 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
336
338
|
Storybook needs Webpack stats (including errors) in order to build correctly.`
|
|
337
339
|
});
|
|
338
340
|
}
|
|
339
|
-
},
|
|
341
|
+
}, M = class extends a {
|
|
340
342
|
constructor(o) {
|
|
341
343
|
super({
|
|
342
344
|
category: "BUILDER-WEBPACK5",
|
|
@@ -346,19 +348,19 @@ WEB-COMPONENTS-WEBPACK5", r))(ne || {}), O = class extends a {
|
|
|
346
348
|
this.data = o;
|
|
347
349
|
}
|
|
348
350
|
static {
|
|
349
|
-
|
|
351
|
+
r(this, "WebpackInvocationError");
|
|
350
352
|
}
|
|
351
353
|
};
|
|
352
|
-
function
|
|
354
|
+
function ie(t = "") {
|
|
353
355
|
return t.replace(/\u001B\[[0-9;]*m/g, "");
|
|
354
356
|
}
|
|
355
|
-
|
|
356
|
-
var
|
|
357
|
+
r(ie, "removeAnsiEscapeCodes");
|
|
358
|
+
var T = class extends a {
|
|
357
359
|
constructor(o) {
|
|
358
360
|
o.errors = o.errors.map((n) => ({
|
|
359
361
|
...n,
|
|
360
|
-
message:
|
|
361
|
-
stack:
|
|
362
|
+
message: ie(n.message),
|
|
363
|
+
stack: ie(n.stack),
|
|
362
364
|
name: n.name
|
|
363
365
|
}));
|
|
364
366
|
super({
|
|
@@ -373,7 +375,7 @@ var S = class extends a {
|
|
|
373
375
|
this.data = o;
|
|
374
376
|
}
|
|
375
377
|
static {
|
|
376
|
-
|
|
378
|
+
r(this, "WebpackCompilationError");
|
|
377
379
|
}
|
|
378
380
|
}, W = class extends a {
|
|
379
381
|
constructor(o) {
|
|
@@ -388,11 +390,11 @@ var S = class extends a {
|
|
|
388
390
|
this.data = o;
|
|
389
391
|
}
|
|
390
392
|
static {
|
|
391
|
-
|
|
393
|
+
r(this, "MissingAngularJsonError");
|
|
392
394
|
}
|
|
393
|
-
},
|
|
395
|
+
}, v = class extends a {
|
|
394
396
|
static {
|
|
395
|
-
|
|
397
|
+
r(this, "AngularLegacyBuildOptionsError");
|
|
396
398
|
}
|
|
397
399
|
constructor() {
|
|
398
400
|
super({
|
|
@@ -409,7 +411,7 @@ var S = class extends a {
|
|
|
409
411
|
Please run 'npx storybook automigrate' to automatically fix your config.`
|
|
410
412
|
});
|
|
411
413
|
}
|
|
412
|
-
},
|
|
414
|
+
}, K = class extends a {
|
|
413
415
|
constructor(o) {
|
|
414
416
|
super({
|
|
415
417
|
category: "CORE-SERVER",
|
|
@@ -427,11 +429,11 @@ var S = class extends a {
|
|
|
427
429
|
this.data = o;
|
|
428
430
|
}
|
|
429
431
|
static {
|
|
430
|
-
|
|
432
|
+
r(this, "CriticalPresetLoadError");
|
|
431
433
|
}
|
|
432
434
|
}, L = class extends a {
|
|
433
435
|
static {
|
|
434
|
-
|
|
436
|
+
r(this, "MissingBuilderError");
|
|
435
437
|
}
|
|
436
438
|
constructor() {
|
|
437
439
|
super({
|
|
@@ -462,9 +464,9 @@ var S = class extends a {
|
|
|
462
464
|
this.data = o;
|
|
463
465
|
}
|
|
464
466
|
static {
|
|
465
|
-
|
|
467
|
+
r(this, "GoogleFontsDownloadError");
|
|
466
468
|
}
|
|
467
|
-
},
|
|
469
|
+
}, N = class extends a {
|
|
468
470
|
constructor(o) {
|
|
469
471
|
super({
|
|
470
472
|
category: "FRAMEWORK_NEXTJS",
|
|
@@ -478,9 +480,23 @@ var S = class extends a {
|
|
|
478
480
|
this.data = o;
|
|
479
481
|
}
|
|
480
482
|
static {
|
|
481
|
-
|
|
483
|
+
r(this, "GoogleFontsLoadingError");
|
|
482
484
|
}
|
|
483
|
-
},
|
|
485
|
+
}, j = class extends a {
|
|
486
|
+
static {
|
|
487
|
+
r(this, "SvelteViteWithSvelteKitError");
|
|
488
|
+
}
|
|
489
|
+
constructor() {
|
|
490
|
+
super({
|
|
491
|
+
category: "FRAMEWORK_SVELTE-VITE",
|
|
492
|
+
code: 1,
|
|
493
|
+
documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sveltekit-needs-the-storybooksveltekit-framework",
|
|
494
|
+
message: i.dedent`
|
|
495
|
+
We've detected a SvelteKit project using the @storybook/svelte-vite framework, which is not supported.
|
|
496
|
+
Please use the @storybook/sveltekit framework instead.`
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
}, P = class extends a {
|
|
484
500
|
constructor(o) {
|
|
485
501
|
super({
|
|
486
502
|
category: "CORE-SERVER",
|
|
@@ -501,7 +517,7 @@ var S = class extends a {
|
|
|
501
517
|
this.data = o;
|
|
502
518
|
}
|
|
503
519
|
static {
|
|
504
|
-
|
|
520
|
+
r(this, "NoMatchingExportError");
|
|
505
521
|
}
|
|
506
522
|
}, V = class extends a {
|
|
507
523
|
constructor(o) {
|
|
@@ -538,9 +554,9 @@ var S = class extends a {
|
|
|
538
554
|
this.data = o;
|
|
539
555
|
}
|
|
540
556
|
static {
|
|
541
|
-
|
|
557
|
+
r(this, "MainFileESMOnlyImportError");
|
|
542
558
|
}
|
|
543
|
-
},
|
|
559
|
+
}, $ = class extends a {
|
|
544
560
|
constructor(o) {
|
|
545
561
|
let n = {
|
|
546
562
|
storybook: {
|
|
@@ -566,7 +582,7 @@ var S = class extends a {
|
|
|
566
582
|
this.data = o;
|
|
567
583
|
}
|
|
568
584
|
static {
|
|
569
|
-
|
|
585
|
+
r(this, "MainFileMissingError");
|
|
570
586
|
}
|
|
571
587
|
}, F = class extends a {
|
|
572
588
|
constructor(o) {
|
|
@@ -585,9 +601,25 @@ var S = class extends a {
|
|
|
585
601
|
this.data = o;
|
|
586
602
|
}
|
|
587
603
|
static {
|
|
588
|
-
|
|
604
|
+
r(this, "MainFileEvaluationError");
|
|
589
605
|
}
|
|
590
|
-
},
|
|
606
|
+
}, D = class extends a {
|
|
607
|
+
constructor(o) {
|
|
608
|
+
super({
|
|
609
|
+
category: "CORE-SERVER",
|
|
610
|
+
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,
|
|
613
|
+
null,
|
|
614
|
+
2
|
|
615
|
+
)}`
|
|
616
|
+
});
|
|
617
|
+
this.data = o;
|
|
618
|
+
}
|
|
619
|
+
static {
|
|
620
|
+
r(this, "StatusTypeIdMismatchError");
|
|
621
|
+
}
|
|
622
|
+
}, U = class extends a {
|
|
591
623
|
constructor(o) {
|
|
592
624
|
super({
|
|
593
625
|
category: "CLI_INIT",
|
|
@@ -601,9 +633,9 @@ var S = class extends a {
|
|
|
601
633
|
this.data = o;
|
|
602
634
|
}
|
|
603
635
|
static {
|
|
604
|
-
|
|
636
|
+
r(this, "GenerateNewProjectOnInitError");
|
|
605
637
|
}
|
|
606
|
-
},
|
|
638
|
+
}, G = class extends a {
|
|
607
639
|
constructor(o) {
|
|
608
640
|
super({
|
|
609
641
|
category: "CLI_UPGRADE",
|
|
@@ -623,9 +655,9 @@ var S = class extends a {
|
|
|
623
655
|
this.data = o;
|
|
624
656
|
}
|
|
625
657
|
static {
|
|
626
|
-
|
|
658
|
+
r(this, "UpgradeStorybookToLowerVersionError");
|
|
627
659
|
}
|
|
628
|
-
},
|
|
660
|
+
}, Y = class extends a {
|
|
629
661
|
constructor(o) {
|
|
630
662
|
super({
|
|
631
663
|
category: "CLI_UPGRADE",
|
|
@@ -648,11 +680,11 @@ var S = class extends a {
|
|
|
648
680
|
this.data = o;
|
|
649
681
|
}
|
|
650
682
|
static {
|
|
651
|
-
|
|
683
|
+
r(this, "UpgradeStorybookToSameVersionError");
|
|
652
684
|
}
|
|
653
|
-
},
|
|
685
|
+
}, J = class extends a {
|
|
654
686
|
static {
|
|
655
|
-
|
|
687
|
+
r(this, "UpgradeStorybookUnknownCurrentVersionError");
|
|
656
688
|
}
|
|
657
689
|
constructor() {
|
|
658
690
|
super({
|
|
@@ -665,9 +697,9 @@ var S = class extends a {
|
|
|
665
697
|
It might help if you specify your Storybook config directory with the --config-dir flag.`
|
|
666
698
|
});
|
|
667
699
|
}
|
|
668
|
-
},
|
|
700
|
+
}, X = class extends a {
|
|
669
701
|
static {
|
|
670
|
-
|
|
702
|
+
r(this, "UpgradeStorybookInWrongWorkingDirectory");
|
|
671
703
|
}
|
|
672
704
|
constructor() {
|
|
673
705
|
super({
|
|
@@ -681,7 +713,7 @@ var S = class extends a {
|
|
|
681
713
|
}
|
|
682
714
|
}, H = class extends a {
|
|
683
715
|
static {
|
|
684
|
-
|
|
716
|
+
r(this, "NoStatsForViteDevError");
|
|
685
717
|
}
|
|
686
718
|
constructor() {
|
|
687
719
|
super({
|
|
@@ -693,7 +725,7 @@ var S = class extends a {
|
|
|
693
725
|
Please remove the \`--stats-json\` flag when running in dev mode.`
|
|
694
726
|
});
|
|
695
727
|
}
|
|
696
|
-
},
|
|
728
|
+
}, z = class extends a {
|
|
697
729
|
constructor(o) {
|
|
698
730
|
super({
|
|
699
731
|
category: "CLI",
|
|
@@ -705,6 +737,38 @@ var S = class extends a {
|
|
|
705
737
|
this.data = o;
|
|
706
738
|
}
|
|
707
739
|
static {
|
|
708
|
-
|
|
740
|
+
r(this, "FindPackageVersionsError");
|
|
741
|
+
}
|
|
742
|
+
}, q = class extends a {
|
|
743
|
+
constructor(o) {
|
|
744
|
+
super({
|
|
745
|
+
category: "FRAMEWORK_NEXTJS",
|
|
746
|
+
code: 3,
|
|
747
|
+
message: i.dedent`
|
|
748
|
+
Incompatible PostCSS configuration format detected.
|
|
749
|
+
|
|
750
|
+
Next.js uses an array-based format for plugins which is not compatible with Vite:
|
|
751
|
+
|
|
752
|
+
// ❌ Incompatible format (used by Next.js)
|
|
753
|
+
const config = {
|
|
754
|
+
plugins: ["@tailwindcss/postcss"],
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
Please transform your PostCSS config to use the object-based format, which is compatible with Next.js and Vite:
|
|
758
|
+
|
|
759
|
+
// ✅ Compatible format (works with Next.js and Vite)
|
|
760
|
+
const config = {
|
|
761
|
+
plugins: {
|
|
762
|
+
"@tailwindcss/postcss": {},
|
|
763
|
+
},
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
Original error: ${o.error.message}
|
|
767
|
+
`
|
|
768
|
+
});
|
|
769
|
+
this.data = o;
|
|
770
|
+
}
|
|
771
|
+
static {
|
|
772
|
+
r(this, "IncompatiblePostCssConfigError");
|
|
709
773
|
}
|
|
710
774
|
};
|
package/dist/server-errors.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import { StoryId } from 'storybook/internal/csf';
|
|
2
|
+
|
|
3
|
+
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warning' | 'status-value:unknown';
|
|
4
|
+
type StatusTypeId = string;
|
|
5
|
+
interface Status {
|
|
6
|
+
value: StatusValue;
|
|
7
|
+
typeId: StatusTypeId;
|
|
8
|
+
storyId: StoryId;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
data?: any;
|
|
12
|
+
sidebarContextMenu?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
1
15
|
declare abstract class StorybookError extends Error {
|
|
2
16
|
/** Category of the error. Used to classify the type of error, e.g., 'PREVIEW_API'. */
|
|
3
17
|
readonly category: string;
|
|
@@ -69,7 +83,6 @@ declare enum Category {
|
|
|
69
83
|
FRAMEWORK_REACT_WEBPACK5 = "FRAMEWORK_REACT-WEBPACK5",
|
|
70
84
|
FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5",
|
|
71
85
|
FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE",
|
|
72
|
-
FRAMEWORK_SVELTE_WEBPACK5 = "FRAMEWORK_SVELTE-WEBPACK5",
|
|
73
86
|
FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT",
|
|
74
87
|
FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE",
|
|
75
88
|
FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
|
|
@@ -177,6 +190,9 @@ declare class GoogleFontsLoadingError extends StorybookError {
|
|
|
177
190
|
url: string;
|
|
178
191
|
});
|
|
179
192
|
}
|
|
193
|
+
declare class SvelteViteWithSvelteKitError extends StorybookError {
|
|
194
|
+
constructor();
|
|
195
|
+
}
|
|
180
196
|
declare class NoMatchingExportError extends StorybookError {
|
|
181
197
|
data: {
|
|
182
198
|
error: unknown | Error;
|
|
@@ -217,6 +233,16 @@ declare class MainFileEvaluationError extends StorybookError {
|
|
|
217
233
|
error: Error;
|
|
218
234
|
});
|
|
219
235
|
}
|
|
236
|
+
declare class StatusTypeIdMismatchError extends StorybookError {
|
|
237
|
+
data: {
|
|
238
|
+
status: Status;
|
|
239
|
+
typeId: StatusTypeId;
|
|
240
|
+
};
|
|
241
|
+
constructor(data: {
|
|
242
|
+
status: Status;
|
|
243
|
+
typeId: StatusTypeId;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
220
246
|
declare class GenerateNewProjectOnInitError extends StorybookError {
|
|
221
247
|
data: {
|
|
222
248
|
error: unknown | Error;
|
|
@@ -268,5 +294,13 @@ declare class FindPackageVersionsError extends StorybookError {
|
|
|
268
294
|
packageManager: string;
|
|
269
295
|
});
|
|
270
296
|
}
|
|
297
|
+
declare class IncompatiblePostCssConfigError extends StorybookError {
|
|
298
|
+
data: {
|
|
299
|
+
error: Error;
|
|
300
|
+
};
|
|
301
|
+
constructor(data: {
|
|
302
|
+
error: Error;
|
|
303
|
+
});
|
|
304
|
+
}
|
|
271
305
|
|
|
272
|
-
export { AngularLegacyBuildOptionsError, Category, ConflictingStaticDirConfigError, CouldNotEvaluateFrameworkError, CriticalPresetLoadError, FindPackageVersionsError, GenerateNewProjectOnInitError, GoogleFontsDownloadError, GoogleFontsLoadingError, InvalidFrameworkNameError, InvalidStoriesEntryError, MainFileESMOnlyImportError, MainFileEvaluationError, MainFileMissingError, MissingAngularJsonError, MissingBuilderError, MissingFrameworkFieldError, NoMatchingExportError, NoStatsForViteDevError, NxProjectDetectedError, UpgradeStorybookInWrongWorkingDirectory, UpgradeStorybookToLowerVersionError, UpgradeStorybookToSameVersionError, UpgradeStorybookUnknownCurrentVersionError, WebpackCompilationError, WebpackInvocationError, WebpackMissingStatsError };
|
|
306
|
+
export { AngularLegacyBuildOptionsError, Category, ConflictingStaticDirConfigError, CouldNotEvaluateFrameworkError, CriticalPresetLoadError, FindPackageVersionsError, GenerateNewProjectOnInitError, GoogleFontsDownloadError, GoogleFontsLoadingError, IncompatiblePostCssConfigError, InvalidFrameworkNameError, InvalidStoriesEntryError, MainFileESMOnlyImportError, MainFileEvaluationError, MainFileMissingError, MissingAngularJsonError, MissingBuilderError, MissingFrameworkFieldError, NoMatchingExportError, NoStatsForViteDevError, NxProjectDetectedError, StatusTypeIdMismatchError, SvelteViteWithSvelteKitError, UpgradeStorybookInWrongWorkingDirectory, UpgradeStorybookToLowerVersionError, UpgradeStorybookToSameVersionError, UpgradeStorybookUnknownCurrentVersionError, WebpackCompilationError, WebpackInvocationError, WebpackMissingStatsError };
|