storybook 10.0.0-beta.1 → 10.0.0-beta.3
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/_node-chunks/{builder-manager-EXW4ETLN.js → builder-manager-DXAEQZJB.js} +16 -16
- package/dist/_node-chunks/{camelcase-VZZFWA2L.js → camelcase-CMMT6PHY.js} +7 -7
- package/dist/_node-chunks/{chunk-U45F2NP6.js → chunk-3SUJKLRV.js} +7 -7
- package/dist/_node-chunks/{chunk-5ZX5SJOP.js → chunk-4TGAX5W7.js} +7 -7
- package/dist/_node-chunks/{chunk-GVCXNIAA.js → chunk-5XVEWBRA.js} +143 -15
- package/dist/_node-chunks/{chunk-EDBXIJN5.js → chunk-6Z44ODDR.js} +7 -7
- package/dist/_node-chunks/{chunk-5V6QH7WC.js → chunk-7EGB7ALG.js} +7 -7
- package/dist/_node-chunks/{chunk-2QZOLZDJ.js → chunk-AKW5OJ2T.js} +9 -9
- package/dist/_node-chunks/chunk-ALWVSNSK.js +62 -0
- package/dist/_node-chunks/{chunk-WDKWVNL2.js → chunk-BV4J7FF6.js} +7 -7
- package/dist/_node-chunks/{chunk-F5J33SXQ.js → chunk-CNKVQCQJ.js} +7 -7
- package/dist/_node-chunks/{chunk-EO4S3VXL.js → chunk-DNOOZ2LS.js} +58 -47
- package/dist/_node-chunks/{chunk-3SGKBLOL.js → chunk-EI44VA3U.js} +8 -8
- package/dist/_node-chunks/{chunk-ICPKUV5G.js → chunk-EVY6P65U.js} +7 -7
- package/dist/_node-chunks/{chunk-CM3UGTR5.js → chunk-IA7M33LK.js} +7 -7
- package/dist/_node-chunks/{chunk-XTSBFCVE.js → chunk-ICETGZAR.js} +7 -7
- package/dist/_node-chunks/chunk-ICFGNVW7.js +1476 -0
- package/dist/_node-chunks/{chunk-PL2PKDRO.js → chunk-KQXC7XVZ.js} +16 -16
- package/dist/_node-chunks/{chunk-32JYCD74.js → chunk-LRQFELIZ.js} +8 -8
- package/dist/_node-chunks/{chunk-LAUOYAOX.js → chunk-MHNUEOON.js} +7 -7
- package/dist/_node-chunks/{chunk-24TGL6EX.js → chunk-MVPVYHBT.js} +7 -7
- package/dist/_node-chunks/{chunk-PMEEE3UE.js → chunk-PA26PSV2.js} +7 -7
- package/dist/_node-chunks/{chunk-FZP2YGG3.js → chunk-PAZJQ2GH.js} +7 -7
- package/dist/_node-chunks/{chunk-QC5FE2D7.js → chunk-PK6SVDYW.js} +7 -7
- package/dist/_node-chunks/{chunk-2G5THETV.js → chunk-QI3AVWUV.js} +12 -12
- package/dist/_node-chunks/{chunk-VNLBDN2Z.js → chunk-R6TLLF24.js} +6 -6
- package/dist/_node-chunks/{chunk-3ZKQWDCG.js → chunk-RUCPXDO3.js} +8 -8
- package/dist/_node-chunks/{chunk-4WNZYNQY.js → chunk-SHXAIHPO.js} +7 -7
- package/dist/_node-chunks/{chunk-WP7DV5JT.js → chunk-TL5RNPZW.js} +10 -10
- package/dist/_node-chunks/{chunk-QJTT4OC2.js → chunk-VDFQYNPZ.js} +8 -8
- package/dist/_node-chunks/{chunk-V2ZF4DUD.js → chunk-WELIADWR.js} +9 -9
- package/dist/_node-chunks/{chunk-6CCUFDHU.js → chunk-WRSYICUI.js} +7 -7
- package/dist/_node-chunks/{chunk-SUMFFLGF.js → chunk-XRAB2RZN.js} +6 -6
- package/dist/_node-chunks/chunk-YRXKNGPR.js +18 -0
- package/dist/_node-chunks/{default-browser-id-JNATP42X.js → default-browser-id-2X5XLPPS.js} +7 -7
- package/dist/_node-chunks/{dist-VZL6D6Y3.js → dist-JSBOOVQK.js} +9 -9
- package/dist/_node-chunks/{globby-GZXJJ4W6.js → globby-YYTLHNUO.js} +9 -9
- package/dist/_node-chunks/{lib-PHT5GCV2.js → lib-DJHADRPZ.js} +11 -11
- package/dist/_node-chunks/{mdx-N42X6CFJ-EPDIV4A2.js → mdx-N42X6CFJ-WT6XCDU6.js} +8 -8
- package/dist/_node-chunks/{p-limit-AJIFSZTI.js → p-limit-HTXI4SGX.js} +8 -8
- package/dist/_node-chunks/{plugin-3VI56CEF.js → plugin-NNRMQ2YK.js} +10 -10
- package/dist/_node-chunks/{plugin-AV4OEKYM.js → plugin-W22F3FQV.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-E7J5FKLA.js → webpack-inject-mocker-runtime-plugin-VFNVWMAM.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-VTYGW7HO.js → webpack-mock-plugin-Q4ED2M25.js} +9 -9
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +11 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +8 -8
- package/dist/cli/index.js +20 -20
- package/dist/common/index.js +22 -22
- package/dist/components/index.d.ts +228 -1
- package/dist/core-server/index.d.ts +515 -14
- package/dist/core-server/index.js +36 -36
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +22 -31
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.js +7 -1
- package/dist/csf-tools/index.d.ts +34 -0
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +3 -2
- package/dist/manager/runtime.js +1 -12
- package/dist/manager-api/index.d.ts +501 -0
- package/dist/manager-api/index.js +1 -1
- package/dist/manager-errors.d.ts +501 -0
- package/dist/node-logger/index.js +14 -14
- package/dist/preview/runtime.js +9 -2
- package/dist/preview-errors.d.ts +501 -0
- package/dist/router/index.d.ts +668 -10
- package/dist/server-errors.d.ts +501 -0
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.js +25 -25
- package/dist/test/index.js +2 -1
- package/dist/types/index.d.ts +523 -9
- package/package.json +2 -4
- package/dist/_node-chunks/chunk-GE6I3YYG.js +0 -62
- package/dist/_node-chunks/chunk-KXCNXWXI.js +0 -18
- package/dist/_node-chunks/chunk-ZMV3WY6R.js +0 -9845
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,23 +13,23 @@ import {
|
|
|
13
13
|
BROWSER_TARGETS,
|
|
14
14
|
NODE_TARGET,
|
|
15
15
|
SUPPORTED_FEATURES
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-R6TLLF24.js";
|
|
17
17
|
import {
|
|
18
18
|
require_build
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PK6SVDYW.js";
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
} from "./chunk-
|
|
21
|
+
resolveModulePath
|
|
22
|
+
} from "./chunk-ICFGNVW7.js";
|
|
23
23
|
import {
|
|
24
24
|
resolvePackageDir
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-LRQFELIZ.js";
|
|
26
26
|
import {
|
|
27
27
|
join,
|
|
28
28
|
parse
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-EVY6P65U.js";
|
|
30
30
|
import {
|
|
31
31
|
slash
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WRSYICUI.js";
|
|
33
33
|
import {
|
|
34
34
|
__commonJS,
|
|
35
35
|
__esm,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
__require,
|
|
39
39
|
__toCommonJS,
|
|
40
40
|
__toESM
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XRAB2RZN.js";
|
|
42
42
|
|
|
43
43
|
// ../node_modules/tslib/tslib.es6.mjs
|
|
44
44
|
var tslib_es6_exports = {};
|
|
@@ -2548,8 +2548,8 @@ var getConfig = /* @__PURE__ */ __name(async (options) => {
|
|
|
2548
2548
|
const tsconfigPath = getTemplatePath("addon.tsconfig.json");
|
|
2549
2549
|
let configDirManagerEntry;
|
|
2550
2550
|
try {
|
|
2551
|
-
configDirManagerEntry =
|
|
2552
|
-
|
|
2551
|
+
configDirManagerEntry = resolveModulePath("./manager", {
|
|
2552
|
+
from: options.configDir,
|
|
2553
2553
|
extensions: [".js", ".mjs", ".jsx", ".ts", ".mts", ".tsx"]
|
|
2554
2554
|
});
|
|
2555
2555
|
} catch (e) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XRAB2RZN.js";
|
|
15
15
|
|
|
16
16
|
// ../node_modules/camelcase/index.js
|
|
17
17
|
var UPPERCASE = /[\p{Lu}]/u;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__commonJS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XRAB2RZN.js";
|
|
15
15
|
|
|
16
16
|
// ../node_modules/pretty-hrtime/index.js
|
|
17
17
|
var require_pretty_hrtime = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__name
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XRAB2RZN.js";
|
|
16
16
|
|
|
17
17
|
// ../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
|
|
18
18
|
var require_resolve_uri_umd = __commonJS({
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
require_dist
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BV4J7FF6.js";
|
|
15
15
|
import {
|
|
16
16
|
__name,
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XRAB2RZN.js";
|
|
19
19
|
|
|
20
20
|
// src/csf-tools/CsfFile.ts
|
|
21
21
|
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
@@ -165,7 +165,7 @@ var NoMetaError = class extends Error {
|
|
|
165
165
|
super(import_ts_dedent.dedent`
|
|
166
166
|
CSF: ${msg} ${formatLocation(ast, fileName)}
|
|
167
167
|
|
|
168
|
-
More info: https://storybook.js.org/docs/writing-stories#default-export
|
|
168
|
+
More info: https://storybook.js.org/docs/writing-stories?ref=error#default-export
|
|
169
169
|
`);
|
|
170
170
|
this.name = this.constructor.name;
|
|
171
171
|
}
|
|
@@ -179,7 +179,7 @@ var MultipleMetaError = class extends Error {
|
|
|
179
179
|
super(import_ts_dedent.dedent`
|
|
180
180
|
CSF: ${message} ${formatLocation(ast, fileName)}
|
|
181
181
|
|
|
182
|
-
More info: https://storybook.js.org/docs/writing-stories#default-export
|
|
182
|
+
More info: https://storybook.js.org/docs/writing-stories?ref=error#default-export
|
|
183
183
|
`);
|
|
184
184
|
this.name = this.constructor.name;
|
|
185
185
|
}
|
|
@@ -193,7 +193,7 @@ var MixedFactoryError = class extends Error {
|
|
|
193
193
|
super(import_ts_dedent.dedent`
|
|
194
194
|
CSF: ${message} ${formatLocation(ast, fileName)}
|
|
195
195
|
|
|
196
|
-
More info: https://storybook.js.org/docs/writing-stories#default-export
|
|
196
|
+
More info: https://storybook.js.org/docs/writing-stories?ref=error#default-export
|
|
197
197
|
`);
|
|
198
198
|
this.name = this.constructor.name;
|
|
199
199
|
}
|
|
@@ -207,7 +207,7 @@ var BadMetaError = class extends Error {
|
|
|
207
207
|
super(import_ts_dedent.dedent`
|
|
208
208
|
CSF: ${message} ${formatLocation(ast, fileName)}
|
|
209
209
|
|
|
210
|
-
More info: https://storybook.js.org/docs/writing-stories#default-export
|
|
210
|
+
More info: https://storybook.js.org/docs/writing-stories?ref=error#default-export
|
|
211
211
|
`);
|
|
212
212
|
this.name = this.constructor.name;
|
|
213
213
|
}
|
|
@@ -339,9 +339,15 @@ var CsfFile = class {
|
|
|
339
339
|
metaNode = decl;
|
|
340
340
|
} else if (
|
|
341
341
|
// export default { ... } as Meta<...>
|
|
342
|
+
// export default { ... } satisfies Meta<...>
|
|
342
343
|
(t2.isTSAsExpression(decl) || t2.isTSSatisfiesExpression(decl)) && t2.isObjectExpression(decl.expression)
|
|
343
344
|
) {
|
|
344
345
|
metaNode = decl.expression;
|
|
346
|
+
} else if (
|
|
347
|
+
// export default { ... } satisfies Meta as Meta<...>
|
|
348
|
+
t2.isTSAsExpression(decl) && t2.isTSSatisfiesExpression(decl.expression) && t2.isObjectExpression(decl.expression.expression)
|
|
349
|
+
) {
|
|
350
|
+
metaNode = decl.expression.expression;
|
|
345
351
|
}
|
|
346
352
|
if (metaNode && t2.isProgram(parent)) {
|
|
347
353
|
self._parseMeta(metaNode, parent);
|
|
@@ -387,7 +393,13 @@ var CsfFile = class {
|
|
|
387
393
|
}
|
|
388
394
|
let storyNode;
|
|
389
395
|
if (t2.isVariableDeclarator(decl)) {
|
|
390
|
-
|
|
396
|
+
if (t2.isTSAsExpression(decl.init) && t2.isTSSatisfiesExpression(decl.init.expression)) {
|
|
397
|
+
storyNode = decl.init.expression.expression;
|
|
398
|
+
} else if (t2.isTSAsExpression(decl.init) || t2.isTSSatisfiesExpression(decl.init)) {
|
|
399
|
+
storyNode = decl.init.expression;
|
|
400
|
+
} else {
|
|
401
|
+
storyNode = decl.init;
|
|
402
|
+
}
|
|
391
403
|
} else {
|
|
392
404
|
storyNode = decl;
|
|
393
405
|
}
|
|
@@ -469,9 +481,15 @@ var CsfFile = class {
|
|
|
469
481
|
metaNode = decl;
|
|
470
482
|
} else if (
|
|
471
483
|
// export default { ... } as Meta<...>
|
|
472
|
-
|
|
484
|
+
// export default { ... } satisfies Meta<...>
|
|
485
|
+
(t2.isTSAsExpression(decl) || t2.isTSSatisfiesExpression(decl)) && t2.isObjectExpression(decl.expression)
|
|
473
486
|
) {
|
|
474
487
|
metaNode = decl.expression;
|
|
488
|
+
} else if (
|
|
489
|
+
// export default { ... } satisfies Meta as Meta<...>
|
|
490
|
+
t2.isTSAsExpression(decl) && t2.isTSSatisfiesExpression(decl.expression) && t2.isObjectExpression(decl.expression.expression)
|
|
491
|
+
) {
|
|
492
|
+
metaNode = decl.expression.expression;
|
|
475
493
|
}
|
|
476
494
|
if (metaNode && t2.isProgram(parent)) {
|
|
477
495
|
self._parseMeta(metaNode, parent);
|
|
@@ -539,7 +557,7 @@ var CsfFile = class {
|
|
|
539
557
|
throw new Error(import_ts_dedent.dedent`
|
|
540
558
|
Unexpected \`storiesOf\` usage: ${formatLocation(node, self._options.fileName)}.
|
|
541
559
|
|
|
542
|
-
SB8 does not support \`storiesOf\`.
|
|
560
|
+
SB8 does not support \`storiesOf\`.
|
|
543
561
|
`);
|
|
544
562
|
}
|
|
545
563
|
if (t2.isMemberExpression(callee) && t2.isIdentifier(callee.property) && callee.property.name === "meta" && t2.isIdentifier(callee.object) && node.arguments.length > 0) {
|
|
@@ -1425,6 +1443,116 @@ var ConfigFile = class {
|
|
|
1425
1443
|
}
|
|
1426
1444
|
}
|
|
1427
1445
|
}
|
|
1446
|
+
_removeRequireImport(importSpecifier, fromImport) {
|
|
1447
|
+
const requireDeclarationIndex = this._ast.program.body.findIndex((node) => {
|
|
1448
|
+
const hasDeclaration = t3.isVariableDeclaration(node) && node.declarations.length === 1 && t3.isVariableDeclarator(node.declarations[0]) && t3.isCallExpression(node.declarations[0].init) && t3.isIdentifier(node.declarations[0].init.callee) && node.declarations[0].init.callee.name === "require" && t3.isStringLiteral(node.declarations[0].init.arguments[0]) && (node.declarations[0].init.arguments[0].value === fromImport || node.declarations[0].init.arguments[0].value === fromImport.split("node:")[1]);
|
|
1449
|
+
return hasDeclaration;
|
|
1450
|
+
});
|
|
1451
|
+
if (requireDeclarationIndex === -1) {
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
const requireDeclaration = this._ast.program.body[requireDeclarationIndex];
|
|
1455
|
+
const declarator = requireDeclaration.declarations[0];
|
|
1456
|
+
if (importSpecifier === null) {
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
if (typeof importSpecifier === "string") {
|
|
1460
|
+
if (t3.isIdentifier(declarator.id) && declarator.id.name === importSpecifier) {
|
|
1461
|
+
this._ast.program.body.splice(requireDeclarationIndex, 1);
|
|
1462
|
+
}
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
if (typeof importSpecifier === "object" && "namespace" in importSpecifier) {
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
if (Array.isArray(importSpecifier) && t3.isObjectPattern(declarator.id)) {
|
|
1469
|
+
const objectPattern = declarator.id;
|
|
1470
|
+
importSpecifier.forEach((specifier) => {
|
|
1471
|
+
const index = objectPattern.properties.findIndex(
|
|
1472
|
+
(prop) => t3.isObjectProperty(prop) && t3.isIdentifier(prop.key) && prop.key.name === specifier
|
|
1473
|
+
);
|
|
1474
|
+
if (index !== -1) {
|
|
1475
|
+
objectPattern.properties.splice(index, 1);
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
if (objectPattern.properties.length === 0) {
|
|
1479
|
+
this._ast.program.body.splice(requireDeclarationIndex, 1);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
_removeImport(importSpecifier, fromImport) {
|
|
1484
|
+
const importDeclarationIndex = this._ast.program.body.findIndex(
|
|
1485
|
+
(node) => t3.isImportDeclaration(node) && (node.source.value === fromImport || node.source.value === fromImport.split("node:")[1])
|
|
1486
|
+
);
|
|
1487
|
+
if (importDeclarationIndex === -1) {
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1490
|
+
const importDeclaration = this._ast.program.body[importDeclarationIndex];
|
|
1491
|
+
if (importSpecifier === null) {
|
|
1492
|
+
if (importDeclaration.specifiers.length === 0) {
|
|
1493
|
+
this._ast.program.body.splice(importDeclarationIndex, 1);
|
|
1494
|
+
}
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
if (typeof importSpecifier === "object" && "namespace" in importSpecifier) {
|
|
1498
|
+
const index = importDeclaration.specifiers.findIndex(
|
|
1499
|
+
(specifier) => t3.isImportNamespaceSpecifier(specifier) && t3.isIdentifier(specifier.local) && specifier.local.name === importSpecifier.namespace
|
|
1500
|
+
);
|
|
1501
|
+
if (index !== -1) {
|
|
1502
|
+
importDeclaration.specifiers.splice(index, 1);
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
if (typeof importSpecifier === "string") {
|
|
1506
|
+
const index = importDeclaration.specifiers.findIndex(
|
|
1507
|
+
(specifier) => t3.isImportDefaultSpecifier(specifier) && t3.isIdentifier(specifier.local) && specifier.local.name === importSpecifier
|
|
1508
|
+
);
|
|
1509
|
+
if (index !== -1) {
|
|
1510
|
+
importDeclaration.specifiers.splice(index, 1);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
if (Array.isArray(importSpecifier)) {
|
|
1514
|
+
importSpecifier.forEach((specifier) => {
|
|
1515
|
+
const index = importDeclaration.specifiers.findIndex(
|
|
1516
|
+
(current) => t3.isImportSpecifier(current) && t3.isIdentifier(current.imported) && current.imported.name === specifier
|
|
1517
|
+
);
|
|
1518
|
+
if (index !== -1) {
|
|
1519
|
+
importDeclaration.specifiers.splice(index, 1);
|
|
1520
|
+
}
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
if (importDeclaration.specifiers.length === 0) {
|
|
1524
|
+
this._ast.program.body.splice(importDeclarationIndex, 1);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Remove import specifiers for a given import statement.
|
|
1529
|
+
*
|
|
1530
|
+
* Does not support removing type imports (yet)
|
|
1531
|
+
*
|
|
1532
|
+
* @example
|
|
1533
|
+
*
|
|
1534
|
+
* ```ts
|
|
1535
|
+
* // import { foo } from 'bar';
|
|
1536
|
+
* setImport(['foo'], 'bar');
|
|
1537
|
+
*
|
|
1538
|
+
* // import foo from 'bar';
|
|
1539
|
+
* setImport('foo', 'bar');
|
|
1540
|
+
*
|
|
1541
|
+
* // import * as foo from 'bar';
|
|
1542
|
+
* setImport({ namespace: 'foo' }, 'bar');
|
|
1543
|
+
*
|
|
1544
|
+
* // import 'bar';
|
|
1545
|
+
* setImport(null, 'bar');
|
|
1546
|
+
* ```
|
|
1547
|
+
*
|
|
1548
|
+
* @param importSpecifiers - The import specifiers to remove. If a string is passed in, will only
|
|
1549
|
+
* remove the default import. Otherwise, named imports matching the array will be removed.
|
|
1550
|
+
* @param fromImport - The module to import from
|
|
1551
|
+
*/
|
|
1552
|
+
removeImport(importSpecifier, fromImport) {
|
|
1553
|
+
this._removeRequireImport(importSpecifier, fromImport);
|
|
1554
|
+
this._removeImport(importSpecifier, fromImport);
|
|
1555
|
+
}
|
|
1428
1556
|
};
|
|
1429
1557
|
var loadConfig = /* @__PURE__ */ __name((code, fileName) => {
|
|
1430
1558
|
const ast = babelParse2(code);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__commonJS,
|
|
14
14
|
__name,
|
|
15
15
|
__require
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XRAB2RZN.js";
|
|
17
17
|
|
|
18
18
|
// ../node_modules/ms/index.js
|
|
19
19
|
var require_ms = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__name
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XRAB2RZN.js";
|
|
16
16
|
|
|
17
17
|
// ../node_modules/picocolors/picocolors.js
|
|
18
18
|
var require_picocolors = __commonJS({
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
require_dist
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BV4J7FF6.js";
|
|
15
15
|
import {
|
|
16
16
|
require_picocolors
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7EGB7ALG.js";
|
|
18
18
|
import {
|
|
19
19
|
__name,
|
|
20
20
|
__toESM
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XRAB2RZN.js";
|
|
22
22
|
|
|
23
23
|
// src/server-errors.ts
|
|
24
24
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/common/versions.ts
|
|
14
|
+
var versions_default = {
|
|
15
|
+
"@storybook/addon-a11y": "10.0.0-beta.3",
|
|
16
|
+
"@storybook/addon-docs": "10.0.0-beta.3",
|
|
17
|
+
"@storybook/addon-jest": "10.0.0-beta.3",
|
|
18
|
+
"@storybook/addon-links": "10.0.0-beta.3",
|
|
19
|
+
"@storybook/addon-onboarding": "10.0.0-beta.3",
|
|
20
|
+
"storybook-addon-pseudo-states": "10.0.0-beta.3",
|
|
21
|
+
"@storybook/addon-themes": "10.0.0-beta.3",
|
|
22
|
+
"@storybook/addon-vitest": "10.0.0-beta.3",
|
|
23
|
+
"@storybook/builder-vite": "10.0.0-beta.3",
|
|
24
|
+
"@storybook/builder-webpack5": "10.0.0-beta.3",
|
|
25
|
+
storybook: "10.0.0-beta.3",
|
|
26
|
+
"@storybook/angular": "10.0.0-beta.3",
|
|
27
|
+
"@storybook/ember": "10.0.0-beta.3",
|
|
28
|
+
"@storybook/html-vite": "10.0.0-beta.3",
|
|
29
|
+
"@storybook/nextjs": "10.0.0-beta.3",
|
|
30
|
+
"@storybook/nextjs-vite": "10.0.0-beta.3",
|
|
31
|
+
"@storybook/preact-vite": "10.0.0-beta.3",
|
|
32
|
+
"@storybook/react-native-web-vite": "10.0.0-beta.3",
|
|
33
|
+
"@storybook/react-vite": "10.0.0-beta.3",
|
|
34
|
+
"@storybook/react-webpack5": "10.0.0-beta.3",
|
|
35
|
+
"@storybook/server-webpack5": "10.0.0-beta.3",
|
|
36
|
+
"@storybook/svelte-vite": "10.0.0-beta.3",
|
|
37
|
+
"@storybook/sveltekit": "10.0.0-beta.3",
|
|
38
|
+
"@storybook/vue3-vite": "10.0.0-beta.3",
|
|
39
|
+
"@storybook/web-components-vite": "10.0.0-beta.3",
|
|
40
|
+
sb: "10.0.0-beta.3",
|
|
41
|
+
"@storybook/cli": "10.0.0-beta.3",
|
|
42
|
+
"@storybook/codemod": "10.0.0-beta.3",
|
|
43
|
+
"@storybook/core-webpack": "10.0.0-beta.3",
|
|
44
|
+
"create-storybook": "10.0.0-beta.3",
|
|
45
|
+
"@storybook/csf-plugin": "10.0.0-beta.3",
|
|
46
|
+
"eslint-plugin-storybook": "10.0.0-beta.3",
|
|
47
|
+
"@storybook/react-dom-shim": "10.0.0-beta.3",
|
|
48
|
+
"@storybook/preset-create-react-app": "10.0.0-beta.3",
|
|
49
|
+
"@storybook/preset-react-webpack": "10.0.0-beta.3",
|
|
50
|
+
"@storybook/preset-server-webpack": "10.0.0-beta.3",
|
|
51
|
+
"@storybook/html": "10.0.0-beta.3",
|
|
52
|
+
"@storybook/preact": "10.0.0-beta.3",
|
|
53
|
+
"@storybook/react": "10.0.0-beta.3",
|
|
54
|
+
"@storybook/server": "10.0.0-beta.3",
|
|
55
|
+
"@storybook/svelte": "10.0.0-beta.3",
|
|
56
|
+
"@storybook/vue3": "10.0.0-beta.3",
|
|
57
|
+
"@storybook/web-components": "10.0.0-beta.3"
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
versions_default
|
|
62
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__name
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XRAB2RZN.js";
|
|
16
16
|
|
|
17
17
|
// ../node_modules/ts-dedent/dist/index.js
|
|
18
18
|
var require_dist = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__name,
|
|
14
14
|
__require
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XRAB2RZN.js";
|
|
16
16
|
|
|
17
17
|
// ../node_modules/@storybook/docs-mdx/dist/chunk-H6DQNFQR.js
|
|
18
18
|
var __create = Object.create;
|