storybook 9.0.0-beta.1 → 9.0.0-beta.11
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/assets/server/base-preview-head.html +2 -1
- package/dist/actions/decorator.js +49 -52
- package/dist/actions/index.cjs +42 -44
- package/dist/actions/index.js +37 -40
- package/dist/actions/preview.cjs +44 -46
- package/dist/actions/preview.d.ts +501 -0
- package/dist/actions/preview.js +24 -27
- package/dist/babel/index.cjs +15060 -14974
- package/dist/babel/index.d.ts +37 -18
- package/dist/babel/index.js +15097 -15011
- package/dist/backgrounds/index.d.ts +501 -0
- package/dist/backgrounds/preview.d.ts +501 -0
- package/dist/bin/index.cjs +44 -44
- package/dist/bin/index.js +44 -44
- package/dist/builder-manager/index.cjs +303 -283
- package/dist/builder-manager/index.js +545 -524
- package/dist/channels/index.js +919 -941
- package/dist/cli/bin/index.cjs +4184 -736
- package/dist/cli/bin/index.js +4198 -748
- package/dist/cli/index.cjs +36838 -28392
- package/dist/cli/index.d.ts +974 -1
- package/dist/cli/index.js +41620 -33168
- package/dist/client-logger/index.d.ts +2 -1
- package/dist/common/index.cjs +4783 -4691
- package/dist/common/index.d.ts +8 -2
- package/dist/common/index.js +5165 -5069
- package/dist/components/index.cjs +7905 -5600
- package/dist/components/index.d.ts +12 -12
- package/dist/components/index.js +4713 -3786
- package/dist/controls/preview.d.ts +501 -0
- package/dist/core-server/index.cjs +6799 -6708
- package/dist/core-server/index.d.ts +526 -25
- package/dist/core-server/index.js +6948 -6851
- package/dist/core-server/presets/common-manager.js +4528 -3377
- package/dist/core-server/presets/common-override-preset.cjs +10 -12
- package/dist/core-server/presets/common-override-preset.js +3 -5
- package/dist/core-server/presets/common-preset.cjs +2301 -2238
- package/dist/core-server/presets/common-preset.js +2389 -2322
- package/dist/docs-tools/index.cjs +484 -464
- package/dist/docs-tools/index.js +781 -768
- package/dist/highlight/index.cjs +19 -18
- package/dist/highlight/index.d.ts +4 -5
- package/dist/highlight/index.js +3 -2
- package/dist/highlight/preview.cjs +314 -310
- package/dist/highlight/preview.d.ts +501 -0
- package/dist/highlight/preview.js +296 -292
- package/dist/instrumenter/index.cjs +561 -559
- package/dist/instrumenter/index.js +1564 -1516
- package/dist/manager/globals-module-info.cjs +2 -0
- package/dist/manager/globals-module-info.js +2 -0
- package/dist/manager/globals-runtime.js +23602 -23339
- package/dist/manager/runtime.js +4891 -4650
- package/dist/manager-api/index.cjs +2400 -2321
- package/dist/manager-api/index.d.ts +513 -1
- package/dist/manager-api/index.js +1951 -1903
- package/dist/manager-errors.js +37 -41
- package/dist/measure/index.d.ts +501 -0
- package/dist/measure/preview.d.ts +501 -0
- package/dist/node-logger/index.cjs +25 -25
- package/dist/node-logger/index.js +25 -25
- package/dist/outline/index.d.ts +501 -0
- package/dist/outline/preview.d.ts +501 -0
- package/dist/preview/runtime.js +35803 -35785
- package/dist/preview-api/index.cjs +1287 -1265
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +1367 -1361
- package/dist/preview-errors.js +152 -173
- package/dist/router/index.cjs +5674 -2282
- package/dist/router/index.d.ts +622 -243
- package/dist/router/index.js +1318 -872
- package/dist/server-errors.cjs +192 -177
- package/dist/server-errors.d.ts +11 -1
- package/dist/server-errors.js +173 -158
- package/dist/telemetry/index.cjs +4934 -1445
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.js +4966 -1475
- package/dist/test/index.cjs +1876 -1878
- package/dist/test/index.d.ts +1269 -83
- package/dist/test/index.js +9157 -9248
- package/dist/test/preview.cjs +49 -15862
- package/dist/test/preview.d.ts +520 -13
- package/dist/test/preview.js +42 -14493
- package/dist/theming/create.cjs +2244 -79
- package/dist/theming/create.js +951 -67
- package/dist/theming/index.cjs +3209 -1067
- package/dist/theming/index.js +1816 -947
- package/dist/types/index.cjs +4 -4
- package/dist/types/index.d.ts +3124 -2596
- package/dist/viewport/index.d.ts +502 -3
- package/dist/viewport/preview.d.ts +501 -0
- package/package.json +14 -38
- package/dist/test/spy.cjs +0 -258
- package/dist/test/spy.d.ts +0 -66
- package/dist/test/spy.js +0 -240
package/dist/server-errors.js
CHANGED
|
@@ -4,85 +4,85 @@ import { dirname as ESM_COMPAT_dirname } from 'node:path';
|
|
|
4
4
|
const __filename = ESM_COMPAT_fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = ESM_COMPAT_dirname(__filename);
|
|
6
6
|
const require = ESM_COMPAT_Module.createRequire(import.meta.url);
|
|
7
|
-
var
|
|
7
|
+
var ue = Object.create;
|
|
8
8
|
var R = Object.defineProperty;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var r = (t,
|
|
13
|
-
var O = (t,
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
for (let c of
|
|
17
|
-
!
|
|
9
|
+
var le = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var me = Object.getOwnPropertyNames;
|
|
11
|
+
var de = Object.getPrototypeOf, ge = Object.prototype.hasOwnProperty;
|
|
12
|
+
var r = (t, o) => R(t, "name", { value: o, configurable: !0 });
|
|
13
|
+
var O = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports);
|
|
14
|
+
var be = (t, o, e, n) => {
|
|
15
|
+
if (o && typeof o == "object" || typeof o == "function")
|
|
16
|
+
for (let c of me(o))
|
|
17
|
+
!ge.call(t, c) && c !== e && R(t, c, { get: () => o[c], enumerable: !(n = le(o, c)) || n.enumerable });
|
|
18
18
|
return t;
|
|
19
19
|
};
|
|
20
|
-
var A = (t,
|
|
20
|
+
var A = (t, o, e) => (e = t != null ? ue(de(t)) : {}, be(
|
|
21
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
23
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
|
|
25
|
+
o || !t || !t.__esModule ? R(e, "default", { value: t, enumerable: !0 }) : e,
|
|
26
26
|
t
|
|
27
27
|
));
|
|
28
28
|
|
|
29
29
|
// ../node_modules/picocolors/picocolors.js
|
|
30
|
-
var C = O((
|
|
31
|
-
var E = process || {}, _ = E.argv || [], h = E.env || {},
|
|
32
|
-
"--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI),
|
|
33
|
-
let c = "" + n, u = c.indexOf(
|
|
34
|
-
return ~u ? t +
|
|
35
|
-
}, "formatter"),
|
|
30
|
+
var C = O((xe, k) => {
|
|
31
|
+
var E = process || {}, _ = E.argv || [], h = E.env || {}, pe = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes(
|
|
32
|
+
"--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), ye = /* @__PURE__ */ r((t, o, e = t) => (n) => {
|
|
33
|
+
let c = "" + n, u = c.indexOf(o, t.length);
|
|
34
|
+
return ~u ? t + he(c, o, e, u) + o : t + c + o;
|
|
35
|
+
}, "formatter"), he = /* @__PURE__ */ r((t, o, e, n) => {
|
|
36
36
|
let c = "", u = 0;
|
|
37
37
|
do
|
|
38
|
-
c += t.substring(u, n) +
|
|
38
|
+
c += t.substring(u, n) + e, u = n + o.length, n = t.indexOf(o, u);
|
|
39
39
|
while (~n);
|
|
40
40
|
return c + t.substring(u);
|
|
41
|
-
}, "replaceClose"), w = /* @__PURE__ */ r((t =
|
|
42
|
-
let
|
|
41
|
+
}, "replaceClose"), w = /* @__PURE__ */ r((t = pe) => {
|
|
42
|
+
let o = t ? ye : () => String;
|
|
43
43
|
return {
|
|
44
44
|
isColorSupported: t,
|
|
45
|
-
reset:
|
|
46
|
-
bold:
|
|
47
|
-
dim:
|
|
48
|
-
italic:
|
|
49
|
-
underline:
|
|
50
|
-
inverse:
|
|
51
|
-
hidden:
|
|
52
|
-
strikethrough:
|
|
53
|
-
black:
|
|
54
|
-
red:
|
|
55
|
-
green:
|
|
56
|
-
yellow:
|
|
57
|
-
blue:
|
|
58
|
-
magenta:
|
|
59
|
-
cyan:
|
|
60
|
-
white:
|
|
61
|
-
gray:
|
|
62
|
-
bgBlack:
|
|
63
|
-
bgRed:
|
|
64
|
-
bgGreen:
|
|
65
|
-
bgYellow:
|
|
66
|
-
bgBlue:
|
|
67
|
-
bgMagenta:
|
|
68
|
-
bgCyan:
|
|
69
|
-
bgWhite:
|
|
70
|
-
blackBright:
|
|
71
|
-
redBright:
|
|
72
|
-
greenBright:
|
|
73
|
-
yellowBright:
|
|
74
|
-
blueBright:
|
|
75
|
-
magentaBright:
|
|
76
|
-
cyanBright:
|
|
77
|
-
whiteBright:
|
|
78
|
-
bgBlackBright:
|
|
79
|
-
bgRedBright:
|
|
80
|
-
bgGreenBright:
|
|
81
|
-
bgYellowBright:
|
|
82
|
-
bgBlueBright:
|
|
83
|
-
bgMagentaBright:
|
|
84
|
-
bgCyanBright:
|
|
85
|
-
bgWhiteBright:
|
|
45
|
+
reset: o("\x1B[0m", "\x1B[0m"),
|
|
46
|
+
bold: o("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
47
|
+
dim: o("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
48
|
+
italic: o("\x1B[3m", "\x1B[23m"),
|
|
49
|
+
underline: o("\x1B[4m", "\x1B[24m"),
|
|
50
|
+
inverse: o("\x1B[7m", "\x1B[27m"),
|
|
51
|
+
hidden: o("\x1B[8m", "\x1B[28m"),
|
|
52
|
+
strikethrough: o("\x1B[9m", "\x1B[29m"),
|
|
53
|
+
black: o("\x1B[30m", "\x1B[39m"),
|
|
54
|
+
red: o("\x1B[31m", "\x1B[39m"),
|
|
55
|
+
green: o("\x1B[32m", "\x1B[39m"),
|
|
56
|
+
yellow: o("\x1B[33m", "\x1B[39m"),
|
|
57
|
+
blue: o("\x1B[34m", "\x1B[39m"),
|
|
58
|
+
magenta: o("\x1B[35m", "\x1B[39m"),
|
|
59
|
+
cyan: o("\x1B[36m", "\x1B[39m"),
|
|
60
|
+
white: o("\x1B[37m", "\x1B[39m"),
|
|
61
|
+
gray: o("\x1B[90m", "\x1B[39m"),
|
|
62
|
+
bgBlack: o("\x1B[40m", "\x1B[49m"),
|
|
63
|
+
bgRed: o("\x1B[41m", "\x1B[49m"),
|
|
64
|
+
bgGreen: o("\x1B[42m", "\x1B[49m"),
|
|
65
|
+
bgYellow: o("\x1B[43m", "\x1B[49m"),
|
|
66
|
+
bgBlue: o("\x1B[44m", "\x1B[49m"),
|
|
67
|
+
bgMagenta: o("\x1B[45m", "\x1B[49m"),
|
|
68
|
+
bgCyan: o("\x1B[46m", "\x1B[49m"),
|
|
69
|
+
bgWhite: o("\x1B[47m", "\x1B[49m"),
|
|
70
|
+
blackBright: o("\x1B[90m", "\x1B[39m"),
|
|
71
|
+
redBright: o("\x1B[91m", "\x1B[39m"),
|
|
72
|
+
greenBright: o("\x1B[92m", "\x1B[39m"),
|
|
73
|
+
yellowBright: o("\x1B[93m", "\x1B[39m"),
|
|
74
|
+
blueBright: o("\x1B[94m", "\x1B[39m"),
|
|
75
|
+
magentaBright: o("\x1B[95m", "\x1B[39m"),
|
|
76
|
+
cyanBright: o("\x1B[96m", "\x1B[39m"),
|
|
77
|
+
whiteBright: o("\x1B[97m", "\x1B[39m"),
|
|
78
|
+
bgBlackBright: o("\x1B[100m", "\x1B[49m"),
|
|
79
|
+
bgRedBright: o("\x1B[101m", "\x1B[49m"),
|
|
80
|
+
bgGreenBright: o("\x1B[102m", "\x1B[49m"),
|
|
81
|
+
bgYellowBright: o("\x1B[103m", "\x1B[49m"),
|
|
82
|
+
bgBlueBright: o("\x1B[104m", "\x1B[49m"),
|
|
83
|
+
bgMagentaBright: o("\x1B[105m", "\x1B[49m"),
|
|
84
|
+
bgCyanBright: o("\x1B[106m", "\x1B[49m"),
|
|
85
|
+
bgWhiteBright: o("\x1B[107m", "\x1B[49m")
|
|
86
86
|
};
|
|
87
87
|
}, "createColors");
|
|
88
88
|
k.exports = w();
|
|
@@ -95,8 +95,8 @@ var S = O((y) => {
|
|
|
95
95
|
Object.defineProperty(y, "__esModule", { value: !0 });
|
|
96
96
|
y.dedent = void 0;
|
|
97
97
|
function I(t) {
|
|
98
|
-
for (var
|
|
99
|
-
e
|
|
98
|
+
for (var o = [], e = 1; e < arguments.length; e++)
|
|
99
|
+
o[e - 1] = arguments[e];
|
|
100
100
|
var n = Array.from(typeof t == "string" ? [t] : t);
|
|
101
101
|
n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
102
102
|
var c = n.reduce(function(m, f) {
|
|
@@ -116,12 +116,12 @@ var S = O((y) => {
|
|
|
116
116
|
}
|
|
117
117
|
n[0] = n[0].replace(/^\r?\n/, "");
|
|
118
118
|
var d = n[0];
|
|
119
|
-
return
|
|
119
|
+
return o.forEach(function(m, f) {
|
|
120
120
|
var p = d.match(/(?:^|\n)( *)$/), x = p ? p[1] : "", g = m;
|
|
121
121
|
typeof m == "string" && m.includes(`
|
|
122
122
|
`) && (g = String(m).split(`
|
|
123
|
-
`).map(function(b,
|
|
124
|
-
return
|
|
123
|
+
`).map(function(b, ce) {
|
|
124
|
+
return ce === 0 ? b : "" + x + b;
|
|
125
125
|
}).join(`
|
|
126
126
|
`)), d += g + n[f + 1];
|
|
127
127
|
}), d;
|
|
@@ -137,15 +137,15 @@ var l = A(C(), 1), i = A(S(), 1);
|
|
|
137
137
|
// src/storybook-error.ts
|
|
138
138
|
function M({
|
|
139
139
|
code: t,
|
|
140
|
-
category:
|
|
140
|
+
category: o
|
|
141
141
|
}) {
|
|
142
|
-
let
|
|
143
|
-
return `SB_${
|
|
142
|
+
let e = String(t).padStart(4, "0");
|
|
143
|
+
return `SB_${o}_${e}`;
|
|
144
144
|
}
|
|
145
145
|
r(M, "parseErrorCode");
|
|
146
146
|
var a = class t extends Error {
|
|
147
|
-
constructor(
|
|
148
|
-
super(t.getFullMessage(
|
|
147
|
+
constructor(e) {
|
|
148
|
+
super(t.getFullMessage(e));
|
|
149
149
|
/**
|
|
150
150
|
* Data associated with the error. Used to provide additional information in the error message or
|
|
151
151
|
* to be passed to telemetry.
|
|
@@ -153,7 +153,7 @@ var a = class t extends Error {
|
|
|
153
153
|
this.data = {};
|
|
154
154
|
/** Flag used to easily determine if the error originates from Storybook. */
|
|
155
155
|
this.fromStorybook = !0;
|
|
156
|
-
this.category =
|
|
156
|
+
this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
|
|
157
157
|
}
|
|
158
158
|
static {
|
|
159
159
|
r(this, "StorybookError");
|
|
@@ -163,20 +163,20 @@ var a = class t extends Error {
|
|
|
163
163
|
}
|
|
164
164
|
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
165
165
|
get name() {
|
|
166
|
-
let
|
|
167
|
-
return `${this.fullErrorCode} (${
|
|
166
|
+
let e = this.constructor.name;
|
|
167
|
+
return `${this.fullErrorCode} (${e})`;
|
|
168
168
|
}
|
|
169
169
|
/** Generates the error message along with additional documentation link (if applicable). */
|
|
170
170
|
static getFullMessage({
|
|
171
|
-
documentation:
|
|
171
|
+
documentation: e,
|
|
172
172
|
code: n,
|
|
173
173
|
category: c,
|
|
174
174
|
message: u
|
|
175
175
|
}) {
|
|
176
176
|
let d;
|
|
177
|
-
return
|
|
177
|
+
return e === !0 ? d = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
|
|
178
178
|
(d = `
|
|
179
|
-
${
|
|
179
|
+
${e.map((m) => ` - ${m}`).join(`
|
|
180
180
|
`)}`), `${u}${d != null ? `
|
|
181
181
|
|
|
182
182
|
More info: ${d}
|
|
@@ -185,7 +185,7 @@ More info: ${d}
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
// src/server-errors.ts
|
|
188
|
-
var
|
|
188
|
+
var Ee = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
|
|
189
189
|
E", s.CLI_ADD = "CLI_ADD", s.CODEMOD = "CODEMOD", s.CORE_SERVER = "CORE-SERVER", s.CSF_PLUGIN = "CSF-PLUGIN", s.CSF_TOOLS = "CSF-TOOLS", s.CORE_COMMON =
|
|
190
190
|
"CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
|
|
191
191
|
TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
|
|
@@ -195,7 +195,7 @@ FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.F
|
|
|
195
195
|
"FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
|
|
196
196
|
FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
|
|
197
197
|
s.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", s.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", s.FRAMEWORK_WEB_COMPONENTS_VITE = "FRA\
|
|
198
|
-
MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(
|
|
198
|
+
MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(Ee || {}), T = class extends a {
|
|
199
199
|
static {
|
|
200
200
|
r(this, "NxProjectDetectedError");
|
|
201
201
|
}
|
|
@@ -203,13 +203,13 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
203
203
|
super({
|
|
204
204
|
category: "CLI_INIT",
|
|
205
205
|
code: 1,
|
|
206
|
-
documentation: "https://nx.dev/
|
|
206
|
+
documentation: "https://nx.dev/nx-api/storybook#generating-storybook-configuration",
|
|
207
207
|
message: i.dedent`
|
|
208
208
|
We have detected Nx in your project. Nx has its own Storybook initializer, so please use it instead.
|
|
209
|
-
Run "nx g @nx/storybook:configuration" to add Storybook to
|
|
209
|
+
Run "nx g @nx/storybook:configuration <your-project-name>" to add Storybook to a given Nx app or lib.`
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
},
|
|
212
|
+
}, v = class extends a {
|
|
213
213
|
static {
|
|
214
214
|
r(this, "MissingFrameworkFieldError");
|
|
215
215
|
}
|
|
@@ -224,35 +224,35 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
224
224
|
Please run 'npx storybook automigrate' to automatically fix your config.`
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
},
|
|
228
|
-
constructor(
|
|
227
|
+
}, W = class extends a {
|
|
228
|
+
constructor(e) {
|
|
229
229
|
super({
|
|
230
230
|
category: "CORE-COMMON",
|
|
231
231
|
code: 2,
|
|
232
232
|
documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
|
|
233
233
|
message: i.dedent`
|
|
234
|
-
Invalid value of '${
|
|
234
|
+
Invalid value of '${e.frameworkName}' in the 'framework' field of Storybook config.
|
|
235
235
|
|
|
236
236
|
Please run 'npx storybook automigrate' to automatically fix your config.
|
|
237
237
|
`
|
|
238
238
|
});
|
|
239
|
-
this.data =
|
|
239
|
+
this.data = e;
|
|
240
240
|
}
|
|
241
241
|
static {
|
|
242
242
|
r(this, "InvalidFrameworkNameError");
|
|
243
243
|
}
|
|
244
244
|
}, K = class extends a {
|
|
245
|
-
constructor(
|
|
245
|
+
constructor(e) {
|
|
246
246
|
super({
|
|
247
247
|
category: "CORE-COMMON",
|
|
248
248
|
code: 3,
|
|
249
249
|
documentation: "",
|
|
250
250
|
message: i.dedent`
|
|
251
|
-
Could not evaluate the '${
|
|
251
|
+
Could not evaluate the '${e.frameworkName}' package from the 'framework' field of Storybook config.
|
|
252
252
|
|
|
253
253
|
Are you sure it's a valid package and is installed?`
|
|
254
254
|
});
|
|
255
|
-
this.data =
|
|
255
|
+
this.data = e;
|
|
256
256
|
}
|
|
257
257
|
static {
|
|
258
258
|
r(this, "CouldNotEvaluateFrameworkError");
|
|
@@ -307,29 +307,29 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
|
|
|
307
307
|
Storybook needs Webpack stats (including errors) in order to build correctly.`
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
},
|
|
311
|
-
constructor(
|
|
310
|
+
}, P = class extends a {
|
|
311
|
+
constructor(e) {
|
|
312
312
|
super({
|
|
313
313
|
category: "BUILDER-WEBPACK5",
|
|
314
314
|
code: 2,
|
|
315
|
-
message:
|
|
315
|
+
message: e.error.message.trim()
|
|
316
316
|
});
|
|
317
|
-
this.data =
|
|
317
|
+
this.data = e;
|
|
318
318
|
}
|
|
319
319
|
static {
|
|
320
320
|
r(this, "WebpackInvocationError");
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
|
-
function
|
|
323
|
+
function j(t = "") {
|
|
324
324
|
return t.replace(/\u001B\[[0-9;]*m/g, "");
|
|
325
325
|
}
|
|
326
|
-
r(
|
|
326
|
+
r(j, "removeAnsiEscapeCodes");
|
|
327
327
|
var V = class extends a {
|
|
328
|
-
constructor(
|
|
329
|
-
|
|
328
|
+
constructor(e) {
|
|
329
|
+
e.errors = e.errors.map((n) => ({
|
|
330
330
|
...n,
|
|
331
|
-
message:
|
|
332
|
-
stack:
|
|
331
|
+
message: j(n.message),
|
|
332
|
+
stack: j(n.stack),
|
|
333
333
|
name: n.name
|
|
334
334
|
}));
|
|
335
335
|
super({
|
|
@@ -341,22 +341,22 @@ var V = class extends a {
|
|
|
341
341
|
Run Storybook with --debug-webpack for more information.
|
|
342
342
|
`
|
|
343
343
|
});
|
|
344
|
-
this.data =
|
|
344
|
+
this.data = e;
|
|
345
345
|
}
|
|
346
346
|
static {
|
|
347
347
|
r(this, "WebpackCompilationError");
|
|
348
348
|
}
|
|
349
349
|
}, $ = class extends a {
|
|
350
|
-
constructor(
|
|
350
|
+
constructor(e) {
|
|
351
351
|
super({
|
|
352
352
|
category: "CLI_INIT",
|
|
353
353
|
code: 2,
|
|
354
354
|
documentation: "https://storybook.js.org/docs/faq#error-no-angularjson-file-found",
|
|
355
355
|
message: i.dedent`
|
|
356
|
-
An angular.json file was not found in the current working directory: ${
|
|
356
|
+
An angular.json file was not found in the current working directory: ${e.path}
|
|
357
357
|
Storybook needs it to work properly, so please rerun the command at the root of your project, where the angular.json file is located.`
|
|
358
358
|
});
|
|
359
|
-
this.data =
|
|
359
|
+
this.data = e;
|
|
360
360
|
}
|
|
361
361
|
static {
|
|
362
362
|
r(this, "MissingAngularJsonError");
|
|
@@ -381,21 +381,21 @@ var V = class extends a {
|
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
383
|
}, D = class extends a {
|
|
384
|
-
constructor(
|
|
384
|
+
constructor(e) {
|
|
385
385
|
super({
|
|
386
386
|
category: "CORE-SERVER",
|
|
387
387
|
code: 2,
|
|
388
388
|
documentation: "",
|
|
389
389
|
message: i.dedent`
|
|
390
|
-
Storybook failed to load the following preset: ${
|
|
390
|
+
Storybook failed to load the following preset: ${e.presetName}.
|
|
391
391
|
|
|
392
392
|
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
|
|
393
393
|
|
|
394
394
|
If you believe this is a bug, please open an issue on Github.
|
|
395
395
|
|
|
396
|
-
${
|
|
396
|
+
${e.error.stack || e.error.message}`
|
|
397
397
|
});
|
|
398
|
-
this.data =
|
|
398
|
+
this.data = e;
|
|
399
399
|
}
|
|
400
400
|
static {
|
|
401
401
|
r(this, "CriticalPresetLoadError");
|
|
@@ -422,31 +422,31 @@ var V = class extends a {
|
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}, G = class extends a {
|
|
425
|
-
constructor(
|
|
425
|
+
constructor(e) {
|
|
426
426
|
super({
|
|
427
427
|
category: "FRAMEWORK_NEXTJS",
|
|
428
428
|
code: 1,
|
|
429
429
|
documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
|
|
430
430
|
message: i.dedent`
|
|
431
|
-
Failed to fetch \`${
|
|
431
|
+
Failed to fetch \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
|
|
432
432
|
});
|
|
433
|
-
this.data =
|
|
433
|
+
this.data = e;
|
|
434
434
|
}
|
|
435
435
|
static {
|
|
436
436
|
r(this, "GoogleFontsDownloadError");
|
|
437
437
|
}
|
|
438
438
|
}, Y = class extends a {
|
|
439
|
-
constructor(
|
|
439
|
+
constructor(e) {
|
|
440
440
|
super({
|
|
441
441
|
category: "FRAMEWORK_NEXTJS",
|
|
442
442
|
code: 2,
|
|
443
443
|
documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
|
|
444
444
|
message: i.dedent`
|
|
445
|
-
An error occurred when trying to load Google Fonts with URL \`${
|
|
445
|
+
An error occurred when trying to load Google Fonts with URL \`${e.url}\`.
|
|
446
446
|
|
|
447
|
-
${
|
|
447
|
+
${e.error instanceof Error ? e.error.message : ""}`
|
|
448
448
|
});
|
|
449
|
-
this.data =
|
|
449
|
+
this.data = e;
|
|
450
450
|
}
|
|
451
451
|
static {
|
|
452
452
|
r(this, "GoogleFontsLoadingError");
|
|
@@ -466,7 +466,7 @@ var V = class extends a {
|
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
468
|
}, X = class extends a {
|
|
469
|
-
constructor(
|
|
469
|
+
constructor(e) {
|
|
470
470
|
super({
|
|
471
471
|
category: "CORE-SERVER",
|
|
472
472
|
code: 4,
|
|
@@ -483,28 +483,28 @@ var V = class extends a {
|
|
|
483
483
|
|
|
484
484
|
Please run \`npx storybook doctor\` for guidance on how to fix this issue.`
|
|
485
485
|
});
|
|
486
|
-
this.data =
|
|
486
|
+
this.data = e;
|
|
487
487
|
}
|
|
488
488
|
static {
|
|
489
489
|
r(this, "NoMatchingExportError");
|
|
490
490
|
}
|
|
491
491
|
}, H = class extends a {
|
|
492
|
-
constructor(
|
|
492
|
+
constructor(e) {
|
|
493
493
|
let n = [
|
|
494
|
-
`Storybook failed to load ${
|
|
494
|
+
`Storybook failed to load ${e.location}`,
|
|
495
495
|
"",
|
|
496
496
|
"It looks like the file tried to load/import an ESM only module.",
|
|
497
|
-
`Support for this is currently limited in ${
|
|
497
|
+
`Support for this is currently limited in ${e.location}`,
|
|
498
498
|
"You can import ESM modules in your main file, but only as dynamic import.",
|
|
499
499
|
""
|
|
500
500
|
];
|
|
501
|
-
|
|
501
|
+
e.line && n.push(
|
|
502
502
|
l.default.white(
|
|
503
|
-
`In your ${l.default.yellow(
|
|
504
|
-
l.default.cyan(
|
|
503
|
+
`In your ${l.default.yellow(e.location)} file, line ${l.default.bold(
|
|
504
|
+
l.default.cyan(e.num)
|
|
505
505
|
)} threw an error:`
|
|
506
506
|
),
|
|
507
|
-
l.default.gray(
|
|
507
|
+
l.default.gray(e.line)
|
|
508
508
|
), n.push(
|
|
509
509
|
"",
|
|
510
510
|
l.default.white(
|
|
@@ -520,13 +520,13 @@ var V = class extends a {
|
|
|
520
520
|
message: n.join(`
|
|
521
521
|
`)
|
|
522
522
|
});
|
|
523
|
-
this.data =
|
|
523
|
+
this.data = e;
|
|
524
524
|
}
|
|
525
525
|
static {
|
|
526
526
|
r(this, "MainFileESMOnlyImportError");
|
|
527
527
|
}
|
|
528
528
|
}, z = class extends a {
|
|
529
|
-
constructor(
|
|
529
|
+
constructor(e) {
|
|
530
530
|
let n = {
|
|
531
531
|
storybook: {
|
|
532
532
|
helperMessage: "You can pass a --config-dir flag to tell Storybook, where your main.js file is located at.",
|
|
@@ -537,82 +537,82 @@ var V = class extends a {
|
|
|
537
537
|
// TODO: add proper docs once available
|
|
538
538
|
documentation: "https://storybook.js.org/docs/configure"
|
|
539
539
|
}
|
|
540
|
-
}, { documentation: c, helperMessage: u } = n[
|
|
540
|
+
}, { documentation: c, helperMessage: u } = n[e.source || "storybook"];
|
|
541
541
|
super({
|
|
542
542
|
category: "CORE-SERVER",
|
|
543
543
|
code: 6,
|
|
544
544
|
documentation: c,
|
|
545
545
|
message: i.dedent`
|
|
546
|
-
No configuration files have been found in your configDir: ${l.default.yellow(
|
|
546
|
+
No configuration files have been found in your configDir: ${l.default.yellow(e.location)}.
|
|
547
547
|
Storybook needs a "main.js" file, please add it.
|
|
548
548
|
|
|
549
549
|
${u}`
|
|
550
550
|
});
|
|
551
|
-
this.data =
|
|
551
|
+
this.data = e;
|
|
552
552
|
}
|
|
553
553
|
static {
|
|
554
554
|
r(this, "MainFileMissingError");
|
|
555
555
|
}
|
|
556
556
|
}, q = class extends a {
|
|
557
|
-
constructor(
|
|
557
|
+
constructor(e) {
|
|
558
558
|
let n = l.default.white(
|
|
559
|
-
(
|
|
559
|
+
(e.error.stack || e.error.message).replaceAll(process.cwd(), "")
|
|
560
560
|
);
|
|
561
561
|
super({
|
|
562
562
|
category: "CORE-SERVER",
|
|
563
563
|
code: 7,
|
|
564
564
|
message: i.dedent`
|
|
565
|
-
Storybook couldn't evaluate your ${l.default.yellow(
|
|
565
|
+
Storybook couldn't evaluate your ${l.default.yellow(e.location)} file.
|
|
566
566
|
|
|
567
567
|
Original error:
|
|
568
568
|
${n}`
|
|
569
569
|
});
|
|
570
|
-
this.data =
|
|
570
|
+
this.data = e;
|
|
571
571
|
}
|
|
572
572
|
static {
|
|
573
573
|
r(this, "MainFileEvaluationError");
|
|
574
574
|
}
|
|
575
575
|
}, Q = class extends a {
|
|
576
|
-
constructor(
|
|
576
|
+
constructor(e) {
|
|
577
577
|
super({
|
|
578
578
|
category: "CORE-SERVER",
|
|
579
579
|
code: 16,
|
|
580
|
-
message: `Status has typeId "${
|
|
581
|
-
|
|
580
|
+
message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
|
|
581
|
+
e.status,
|
|
582
582
|
null,
|
|
583
583
|
2
|
|
584
584
|
)}`
|
|
585
585
|
});
|
|
586
|
-
this.data =
|
|
586
|
+
this.data = e;
|
|
587
587
|
}
|
|
588
588
|
static {
|
|
589
589
|
r(this, "StatusTypeIdMismatchError");
|
|
590
590
|
}
|
|
591
591
|
}, Z = class extends a {
|
|
592
|
-
constructor(
|
|
592
|
+
constructor(e) {
|
|
593
593
|
super({
|
|
594
594
|
category: "CLI_INIT",
|
|
595
595
|
code: 3,
|
|
596
596
|
documentation: "",
|
|
597
597
|
message: i.dedent`
|
|
598
|
-
There was an error while using ${
|
|
598
|
+
There was an error while using ${e.packageManager} to create a new ${e.projectType} project.
|
|
599
599
|
|
|
600
|
-
${
|
|
600
|
+
${e.error instanceof Error ? e.error.message : ""}`
|
|
601
601
|
});
|
|
602
|
-
this.data =
|
|
602
|
+
this.data = e;
|
|
603
603
|
}
|
|
604
604
|
static {
|
|
605
605
|
r(this, "GenerateNewProjectOnInitError");
|
|
606
606
|
}
|
|
607
607
|
}, ee = class extends a {
|
|
608
|
-
constructor(
|
|
608
|
+
constructor(e) {
|
|
609
609
|
super({
|
|
610
610
|
category: "CLI_UPGRADE",
|
|
611
611
|
code: 3,
|
|
612
612
|
message: i.dedent`
|
|
613
613
|
You are trying to upgrade Storybook to a lower version than the version currently installed. This is not supported.
|
|
614
614
|
|
|
615
|
-
Storybook version ${
|
|
615
|
+
Storybook version ${e.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${e.currentVersion}.
|
|
616
616
|
|
|
617
617
|
This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
|
|
618
618
|
This will cause npm to run the globally cached storybook binary, which might be an older version.
|
|
@@ -621,18 +621,18 @@ var V = class extends a {
|
|
|
621
621
|
|
|
622
622
|
"npx storybook@latest upgrade"`
|
|
623
623
|
});
|
|
624
|
-
this.data =
|
|
624
|
+
this.data = e;
|
|
625
625
|
}
|
|
626
626
|
static {
|
|
627
627
|
r(this, "UpgradeStorybookToLowerVersionError");
|
|
628
628
|
}
|
|
629
629
|
}, oe = class extends a {
|
|
630
|
-
constructor(
|
|
630
|
+
constructor(e) {
|
|
631
631
|
super({
|
|
632
632
|
category: "CLI_UPGRADE",
|
|
633
633
|
code: 4,
|
|
634
634
|
message: i.dedent`
|
|
635
|
-
You are upgrading Storybook to the same version that is currently installed in the project, version ${
|
|
635
|
+
You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
|
|
636
636
|
|
|
637
637
|
This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
|
|
638
638
|
This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
|
|
@@ -646,7 +646,7 @@ var V = class extends a {
|
|
|
646
646
|
|
|
647
647
|
"npx storybook automigrate"`
|
|
648
648
|
});
|
|
649
|
-
this.data =
|
|
649
|
+
this.data = e;
|
|
650
650
|
}
|
|
651
651
|
static {
|
|
652
652
|
r(this, "UpgradeStorybookToSameVersionError");
|
|
@@ -695,21 +695,21 @@ var V = class extends a {
|
|
|
695
695
|
});
|
|
696
696
|
}
|
|
697
697
|
}, ne = class extends a {
|
|
698
|
-
constructor(
|
|
698
|
+
constructor(e) {
|
|
699
699
|
super({
|
|
700
700
|
category: "CLI",
|
|
701
701
|
code: 1,
|
|
702
702
|
message: i.dedent`
|
|
703
|
-
Unable to find versions of "${
|
|
704
|
-
${
|
|
703
|
+
Unable to find versions of "${e.packageName}" using ${e.packageManager}
|
|
704
|
+
${e.error && `Reason: ${e.error}`}`
|
|
705
705
|
});
|
|
706
|
-
this.data =
|
|
706
|
+
this.data = e;
|
|
707
707
|
}
|
|
708
708
|
static {
|
|
709
709
|
r(this, "FindPackageVersionsError");
|
|
710
710
|
}
|
|
711
711
|
}, ae = class extends a {
|
|
712
|
-
constructor(
|
|
712
|
+
constructor(e) {
|
|
713
713
|
super({
|
|
714
714
|
category: "FRAMEWORK_NEXTJS",
|
|
715
715
|
code: 3,
|
|
@@ -732,18 +732,32 @@ var V = class extends a {
|
|
|
732
732
|
},
|
|
733
733
|
};
|
|
734
734
|
|
|
735
|
-
Original error: ${
|
|
735
|
+
Original error: ${e.error.message}
|
|
736
736
|
`
|
|
737
737
|
});
|
|
738
|
-
this.data =
|
|
738
|
+
this.data = e;
|
|
739
739
|
}
|
|
740
740
|
static {
|
|
741
741
|
r(this, "IncompatiblePostCssConfigError");
|
|
742
742
|
}
|
|
743
|
+
}, ie = class extends a {
|
|
744
|
+
constructor(e) {
|
|
745
|
+
super({
|
|
746
|
+
category: "CORE-SERVER",
|
|
747
|
+
code: 1,
|
|
748
|
+
message: i.dedent`
|
|
749
|
+
Unable to save global settings file to ${e.filePath}
|
|
750
|
+
${e.error && `Reason: ${e.error}`}`
|
|
751
|
+
});
|
|
752
|
+
this.data = e;
|
|
753
|
+
}
|
|
754
|
+
static {
|
|
755
|
+
r(this, "SavingGlobalSettingsFileError");
|
|
756
|
+
}
|
|
743
757
|
};
|
|
744
758
|
export {
|
|
745
759
|
F as AngularLegacyBuildOptionsError,
|
|
746
|
-
|
|
760
|
+
Ee as Category,
|
|
747
761
|
L as ConflictingStaticDirConfigError,
|
|
748
762
|
K as CouldNotEvaluateFrameworkError,
|
|
749
763
|
D as CriticalPresetLoadError,
|
|
@@ -752,17 +766,18 @@ export {
|
|
|
752
766
|
G as GoogleFontsDownloadError,
|
|
753
767
|
Y as GoogleFontsLoadingError,
|
|
754
768
|
ae as IncompatiblePostCssConfigError,
|
|
755
|
-
|
|
769
|
+
W as InvalidFrameworkNameError,
|
|
756
770
|
B as InvalidStoriesEntryError,
|
|
757
771
|
H as MainFileESMOnlyImportError,
|
|
758
772
|
q as MainFileEvaluationError,
|
|
759
773
|
z as MainFileMissingError,
|
|
760
774
|
$ as MissingAngularJsonError,
|
|
761
775
|
U as MissingBuilderError,
|
|
762
|
-
|
|
776
|
+
v as MissingFrameworkFieldError,
|
|
763
777
|
X as NoMatchingExportError,
|
|
764
778
|
se as NoStatsForViteDevError,
|
|
765
779
|
T as NxProjectDetectedError,
|
|
780
|
+
ie as SavingGlobalSettingsFileError,
|
|
766
781
|
Q as StatusTypeIdMismatchError,
|
|
767
782
|
J as SvelteViteWithSvelteKitError,
|
|
768
783
|
re as UpgradeStorybookInWrongWorkingDirectory,
|
|
@@ -770,6 +785,6 @@ export {
|
|
|
770
785
|
oe as UpgradeStorybookToSameVersionError,
|
|
771
786
|
te as UpgradeStorybookUnknownCurrentVersionError,
|
|
772
787
|
V as WebpackCompilationError,
|
|
773
|
-
|
|
788
|
+
P as WebpackInvocationError,
|
|
774
789
|
N as WebpackMissingStatsError
|
|
775
790
|
};
|