storybook 10.1.0-alpha.8 → 10.1.0-beta.0
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/_browser-chunks/Color-FTG7SQDA.js +1097 -0
- package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
- package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
- package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
- package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
- package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
- package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
- package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
- package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
- package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
- package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
- package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
- package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
- package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
- package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
- package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
- package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
- package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
- package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
- package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
- package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
- package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
- package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
- package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
- package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
- package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
- package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
- package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
- package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
- package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
- package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
- package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
- package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
- package/dist/_node-chunks/{builder-manager-57OYTFQ5.js → builder-manager-BDAQHXFI.js} +510 -1019
- package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
- package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
- package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
- package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
- package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
- package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
- package/dist/_node-chunks/{chunk-2GK7NW46.js → chunk-BG4RDXG7.js} +8 -10
- package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
- package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
- package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
- package/dist/_node-chunks/{chunk-RG4Z25PY.js → chunk-D6ND3TVY.js} +116 -276
- package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
- package/dist/_node-chunks/{chunk-EBYCXVVR.js → chunk-EVK2SBW5.js} +292 -688
- package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
- package/dist/_node-chunks/{chunk-6F6CCOXH.js → chunk-KVRF22SH.js} +469 -983
- package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
- package/dist/_node-chunks/{chunk-C4KEDJ6O.js → chunk-MMVV6DGG.js} +8133 -8887
- package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
- package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
- package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
- package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
- package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
- package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
- package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
- package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
- package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
- package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
- package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
- package/dist/_node-chunks/{chunk-RSHLCHYY.js → chunk-YWV55YW3.js} +15 -24
- package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
- package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
- package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
- package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
- package/dist/_node-chunks/p-limit-LDY632RS.js +116 -0
- package/dist/actions/decorator.js +21 -42
- package/dist/actions/index.js +3 -3
- package/dist/babel/index.d.ts +671 -335
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +601 -1548
- package/dist/bin/dispatcher.js +36 -36
- package/dist/bin/loader.js +24 -38
- package/dist/channels/index.js +98 -234
- package/dist/cli/index.d.ts +1479 -133
- package/dist/cli/index.js +30 -8540
- package/dist/client-logger/index.js +31 -61
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +66 -51
- package/dist/components/index.d.ts +575 -273
- package/dist/components/index.js +14863 -4313
- package/dist/core-events/index.js +2 -66
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +2910 -8519
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +2521 -5233
- package/dist/core-server/presets/common-override-preset.js +31 -60
- package/dist/core-server/presets/common-preset.js +663 -962
- package/dist/csf/index.js +534 -1179
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -6
- package/dist/highlight/index.js +2 -2
- package/dist/instrumenter/index.js +199 -415
- package/dist/manager/globals-runtime.js +59044 -67141
- package/dist/manager/globals.js +2 -3
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +11511 -10953
- package/dist/manager-api/index.d.ts +1811 -2
- package/dist/manager-api/index.js +1348 -2401
- package/dist/manager-errors.d.ts +9 -0
- package/dist/manager-errors.js +3 -3
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/mocking-utils/index.js +1181 -0
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -4471
- package/dist/preview/globals.js +2 -3
- package/dist/preview/runtime.js +10799 -22393
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +13 -13
- package/dist/preview-errors.d.ts +9 -0
- package/dist/preview-errors.js +4 -4
- package/dist/router/index.js +347 -899
- package/dist/server-errors.d.ts +34 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +24 -3
- package/dist/telemetry/index.js +25 -24
- package/dist/test/index.js +6131 -11916
- package/dist/theming/create.d.ts +1 -0
- package/dist/theming/create.js +4 -4
- package/dist/theming/index.d.ts +3366 -2599
- package/dist/theming/index.js +501 -1091
- package/dist/types/index.d.ts +72 -8
- package/dist/types/index.js +27 -12
- package/dist/viewport/index.js +3 -3
- package/package.json +26 -17
- package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
- package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
- package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
- package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
- package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
- package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
- package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
- package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
- package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
- package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
- package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
- package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
- package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
- package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
- package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
- package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
- package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
- package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
- package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
- package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
- package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
- package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
- package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
- package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
- package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
- package/dist/_node-chunks/camelcase-2KEDZHZ2.js +0 -18
- package/dist/_node-chunks/chunk-34NNXTBR.js +0 -28
- package/dist/_node-chunks/chunk-3N2A3KZX.js +0 -420
- package/dist/_node-chunks/chunk-5P7P5KDN.js +0 -90
- package/dist/_node-chunks/chunk-5WBRBDXI.js +0 -79
- package/dist/_node-chunks/chunk-7PWTU7T2.js +0 -697
- package/dist/_node-chunks/chunk-CHRHQ7AZ.js +0 -4272
- package/dist/_node-chunks/chunk-D4EGQLJI.js +0 -64656
- package/dist/_node-chunks/chunk-EKCURTKU.js +0 -1544
- package/dist/_node-chunks/chunk-GBVPPW4H.js +0 -1657
- package/dist/_node-chunks/chunk-J6VOKT2F.js +0 -220
- package/dist/_node-chunks/chunk-JLBYSGXS.js +0 -69
- package/dist/_node-chunks/chunk-LLCELSUL.js +0 -1198
- package/dist/_node-chunks/chunk-NS4OCQ4F.js +0 -61
- package/dist/_node-chunks/chunk-NXVLFYDR.js +0 -1518
- package/dist/_node-chunks/chunk-NZPWAJOZ.js +0 -304
- package/dist/_node-chunks/chunk-OYFSIV3I.js +0 -6712
- package/dist/_node-chunks/chunk-OZ43LMDF.js +0 -5029
- package/dist/_node-chunks/chunk-Q5HJHFF2.js +0 -61
- package/dist/_node-chunks/chunk-QHER4CEN.js +0 -34
- package/dist/_node-chunks/chunk-RF2PJM54.js +0 -1531
- package/dist/_node-chunks/chunk-S3OHGEE3.js +0 -101
- package/dist/_node-chunks/chunk-S5XOMVSV.js +0 -2256
- package/dist/_node-chunks/chunk-SGXQZ47H.js +0 -1586
- package/dist/_node-chunks/chunk-TDU6OVUH.js +0 -111
- package/dist/_node-chunks/chunk-TYQQFNQX.js +0 -1250
- package/dist/_node-chunks/chunk-WNGLARN2.js +0 -4741
- package/dist/_node-chunks/chunk-YUOVDCXL.js +0 -18
- package/dist/_node-chunks/dist-O5FB7YUW.js +0 -175
- package/dist/_node-chunks/globby-3NMV7WHX.js +0 -5222
- package/dist/_node-chunks/lib-VZD7BRSA.js +0 -518
- package/dist/_node-chunks/mdx-N42X6CFJ-3RP7RKKU.js +0 -22017
- package/dist/_node-chunks/p-limit-LIKBTXEJ.js +0 -168
- package/dist/_node-chunks/plugin-2NYZBK4A.js +0 -129
- package/dist/_node-chunks/plugin-6QGMO7J7.js +0 -159
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-Z2JI6J2H.js +0 -69102
- package/dist/_node-chunks/webpack-mock-plugin-D4BE2SSI.js +0 -124
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
|
@@ -1,60 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
__name
|
|
3
|
-
} from "../_browser-chunks/chunk-MM7DTO55.js";
|
|
1
|
+
import "../_browser-chunks/chunk-A242L54C.js";
|
|
4
2
|
|
|
5
3
|
// src/client-logger/index.ts
|
|
6
4
|
import { global } from "@storybook/global";
|
|
7
|
-
var { LOGLEVEL } = global
|
|
8
|
-
var levels = {
|
|
5
|
+
var { LOGLEVEL } = global, levels = {
|
|
9
6
|
trace: 1,
|
|
10
7
|
debug: 2,
|
|
11
8
|
info: 3,
|
|
12
9
|
warn: 4,
|
|
13
10
|
error: 5,
|
|
14
11
|
silent: 10
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, "info"),
|
|
34
|
-
warn: /* @__PURE__ */ __name((message, ...rest) => {
|
|
35
|
-
if (currentLogLevelNumber <= levels.warn) {
|
|
36
|
-
console.warn(message, ...rest);
|
|
37
|
-
}
|
|
38
|
-
}, "warn"),
|
|
39
|
-
error: /* @__PURE__ */ __name((message, ...rest) => {
|
|
40
|
-
if (currentLogLevelNumber <= levels.error) {
|
|
41
|
-
console.error(message, ...rest);
|
|
42
|
-
}
|
|
43
|
-
}, "error"),
|
|
44
|
-
log: /* @__PURE__ */ __name((message, ...rest) => {
|
|
45
|
-
if (currentLogLevelNumber < levels.silent) {
|
|
46
|
-
console.log(message, ...rest);
|
|
47
|
-
}
|
|
48
|
-
}, "log")
|
|
49
|
-
};
|
|
50
|
-
var logged = /* @__PURE__ */ new Set();
|
|
51
|
-
var once = /* @__PURE__ */ __name((type) => (message, ...rest) => {
|
|
52
|
-
if (logged.has(message)) {
|
|
53
|
-
return void 0;
|
|
12
|
+
}, currentLogLevelString = LOGLEVEL, currentLogLevelNumber = levels[currentLogLevelString] || levels.info, logger = {
|
|
13
|
+
trace: (message, ...rest) => {
|
|
14
|
+
currentLogLevelNumber <= levels.trace && console.trace(message, ...rest);
|
|
15
|
+
},
|
|
16
|
+
debug: (message, ...rest) => {
|
|
17
|
+
currentLogLevelNumber <= levels.debug && console.debug(message, ...rest);
|
|
18
|
+
},
|
|
19
|
+
info: (message, ...rest) => {
|
|
20
|
+
currentLogLevelNumber <= levels.info && console.info(message, ...rest);
|
|
21
|
+
},
|
|
22
|
+
warn: (message, ...rest) => {
|
|
23
|
+
currentLogLevelNumber <= levels.warn && console.warn(message, ...rest);
|
|
24
|
+
},
|
|
25
|
+
error: (message, ...rest) => {
|
|
26
|
+
currentLogLevelNumber <= levels.error && console.error(message, ...rest);
|
|
27
|
+
},
|
|
28
|
+
log: (message, ...rest) => {
|
|
29
|
+
currentLogLevelNumber < levels.silent && console.log(message, ...rest);
|
|
54
30
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
31
|
+
}, logged = /* @__PURE__ */ new Set(), once = (type) => (message, ...rest) => {
|
|
32
|
+
if (!logged.has(message))
|
|
33
|
+
return logged.add(message), logger[type](message, ...rest);
|
|
34
|
+
};
|
|
58
35
|
once.clear = () => logged.clear();
|
|
59
36
|
once.trace = once("trace");
|
|
60
37
|
once.debug = once("debug");
|
|
@@ -62,24 +39,17 @@ once.info = once("info");
|
|
|
62
39
|
once.warn = once("warn");
|
|
63
40
|
once.error = once("error");
|
|
64
41
|
once.log = once("log");
|
|
65
|
-
var deprecate = once("warn")
|
|
66
|
-
|
|
67
|
-
const argArray = [];
|
|
42
|
+
var deprecate = once("warn"), pretty = (type) => (...args) => {
|
|
43
|
+
let argArray = [];
|
|
68
44
|
if (args.length) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
while (reResultArray = startTagRe.exec(args[0])) {
|
|
74
|
-
argArray.push(reResultArray[2]);
|
|
75
|
-
argArray.push("");
|
|
76
|
-
}
|
|
77
|
-
for (let j = 1; j < args.length; j++) {
|
|
45
|
+
let startTagRe = /<span\s+style=(['"])([^'"]*)\1\s*>/gi, endTagRe = /<\/span>/gi, reResultArray;
|
|
46
|
+
for (argArray.push(args[0].replace(startTagRe, "%c").replace(endTagRe, "%c")); reResultArray = startTagRe.exec(args[0]); )
|
|
47
|
+
argArray.push(reResultArray[2]), argArray.push("");
|
|
48
|
+
for (let j = 1; j < args.length; j++)
|
|
78
49
|
argArray.push(args[j]);
|
|
79
|
-
}
|
|
80
50
|
}
|
|
81
51
|
logger[type].apply(logger, argArray);
|
|
82
|
-
}
|
|
52
|
+
};
|
|
83
53
|
pretty.trace = pretty("trace");
|
|
84
54
|
pretty.debug = pretty("debug");
|
|
85
55
|
pretty.info = pretty("info");
|
package/dist/common/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as storybook_internal_types from 'storybook/internal/types';
|
|
2
|
-
import { CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, Presets, PackageJson, CoreCommon_AddonInfo,
|
|
2
|
+
import { CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, Presets, PackageJson, CoreCommon_AddonInfo, SupportedFramework, SupportedRenderer, SupportedBuilder, Options as Options$2, CoreWebpackCompiler, CoreCommon_StorybookInfo, Ref, StorybookConfig, StoriesEntry, NormalizedStoriesSpecifier } from 'storybook/internal/types';
|
|
3
3
|
export { PackageJson } from 'storybook/internal/types';
|
|
4
4
|
import { WriteStream } from 'node:fs';
|
|
5
5
|
import { Buffer } from 'node:buffer';
|
|
@@ -7,6 +7,7 @@ import { ChildProcess } from 'node:child_process';
|
|
|
7
7
|
import { Readable, Writable, Stream } from 'node:stream';
|
|
8
8
|
import * as prettier from 'prettier';
|
|
9
9
|
import { ConfigFile } from 'storybook/internal/csf-tools';
|
|
10
|
+
import { types } from 'storybook/internal/babel';
|
|
10
11
|
|
|
11
12
|
declare const _default: {
|
|
12
13
|
'@storybook/addon-a11y': string;
|
|
@@ -441,6 +442,38 @@ type CommonOptions<EncodingType extends EncodingOption = DefaultEncodingOption>
|
|
|
441
442
|
readonly verbose?: boolean;
|
|
442
443
|
};
|
|
443
444
|
|
|
445
|
+
type Options$1<EncodingType extends EncodingOption = DefaultEncodingOption> = {
|
|
446
|
+
/**
|
|
447
|
+
Write some input to the `stdin` of your binary.
|
|
448
|
+
|
|
449
|
+
If the input is a file, use the `inputFile` option instead.
|
|
450
|
+
*/
|
|
451
|
+
readonly input?: string | Buffer | Readable;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
Use a file as input to the the `stdin` of your binary.
|
|
455
|
+
|
|
456
|
+
If the input is not a file, use the `input` option instead.
|
|
457
|
+
*/
|
|
458
|
+
readonly inputFile?: string;
|
|
459
|
+
} & CommonOptions<EncodingType>;
|
|
460
|
+
|
|
461
|
+
type NodeOptions<EncodingType extends EncodingOption = DefaultEncodingOption> = {
|
|
462
|
+
/**
|
|
463
|
+
The Node.js executable to use.
|
|
464
|
+
|
|
465
|
+
@default process.execPath
|
|
466
|
+
*/
|
|
467
|
+
readonly nodePath?: string;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.
|
|
471
|
+
|
|
472
|
+
@default process.execArgv
|
|
473
|
+
*/
|
|
474
|
+
readonly nodeOptions?: string[];
|
|
475
|
+
} & Options$1<EncodingType>;
|
|
476
|
+
|
|
444
477
|
type StdoutStderrAll = string | Buffer | undefined;
|
|
445
478
|
|
|
446
479
|
type ExecaReturnBase<StdoutStderrType extends StdoutStderrAll> = {
|
|
@@ -646,6 +679,21 @@ type ExecaChildProcess<StdoutStderrType extends StdoutStderrAll = string> = Chil
|
|
|
646
679
|
ExecaChildPromise<StdoutStderrType> &
|
|
647
680
|
Promise<ExecaReturnValue<StdoutStderrType>>;
|
|
648
681
|
|
|
682
|
+
type ExecuteCommandOptions = CommonOptions<'utf8'> & {
|
|
683
|
+
command: string;
|
|
684
|
+
args?: string[];
|
|
685
|
+
cwd?: string;
|
|
686
|
+
ignoreError?: boolean;
|
|
687
|
+
env?: Record<string, any>;
|
|
688
|
+
};
|
|
689
|
+
declare function executeCommand(options: ExecuteCommandOptions): ExecaChildProcess;
|
|
690
|
+
declare function executeCommandSync(options: ExecuteCommandOptions): string;
|
|
691
|
+
declare function executeNodeCommand({ scriptPath, args, options, }: {
|
|
692
|
+
scriptPath: string;
|
|
693
|
+
args?: string[];
|
|
694
|
+
options?: NodeOptions;
|
|
695
|
+
}): ExecaChildProcess;
|
|
696
|
+
|
|
649
697
|
type PackageJsonWithDepsAndDevDeps = PackageJson & Required<Pick<PackageJson, 'dependencies' | 'devDependencies'>>;
|
|
650
698
|
type PackageJsonWithMaybeDeps = Partial<Pick<PackageJson, 'dependencies' | 'devDependencies' | 'peerDependencies' | 'files'>>;
|
|
651
699
|
|
|
@@ -661,12 +709,13 @@ type InstallationMetadata = {
|
|
|
661
709
|
dedupeCommand: string;
|
|
662
710
|
};
|
|
663
711
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
712
|
+
declare enum PackageManagerName {
|
|
713
|
+
NPM = "npm",
|
|
714
|
+
YARN1 = "yarn1",
|
|
715
|
+
YARN2 = "yarn2",
|
|
716
|
+
PNPM = "pnpm",
|
|
717
|
+
BUN = "bun"
|
|
718
|
+
}
|
|
670
719
|
/**
|
|
671
720
|
* Extract package name and version from input
|
|
672
721
|
*
|
|
@@ -702,14 +751,11 @@ declare abstract class JsPackageManager {
|
|
|
702
751
|
static readonly latestVersionCache: Map<string, string | null>;
|
|
703
752
|
/** Cache for installed version results to avoid repeated file system calls. */
|
|
704
753
|
static readonly installedVersionCache: Map<string, string | null>;
|
|
754
|
+
/** Cache for package.json files to avoid repeated file system calls. */
|
|
755
|
+
static readonly packageJsonCache: Map<string, PackageJsonWithDepsAndDevDeps>;
|
|
705
756
|
constructor(options?: JsPackageManagerOptions);
|
|
706
757
|
/** Runs arbitrary package scripts. */
|
|
707
758
|
abstract getRunCommand(command: string): string;
|
|
708
|
-
/**
|
|
709
|
-
* Run a command from a local or remote. Fetches a package from the registry without installing it
|
|
710
|
-
* as a dependency, hotloads it, and runs whatever default command binary it exposes.
|
|
711
|
-
*/
|
|
712
|
-
abstract getRemoteRunCommand(pkg: string, args: string[], specifier?: string): string;
|
|
713
759
|
/** Get the package.json file for a given module. */
|
|
714
760
|
abstract getModulePackageJSON(packageName: string): Promise<PackageJson | null>;
|
|
715
761
|
isStorybookInMonorepo(): boolean;
|
|
@@ -841,33 +887,14 @@ declare abstract class JsPackageManager {
|
|
|
841
887
|
protected abstract runGetVersions<T extends boolean>(packageName: string, fetchAllVersions: T): Promise<T extends true ? string[] : string>;
|
|
842
888
|
abstract getRegistryURL(): Promise<string | undefined>;
|
|
843
889
|
abstract runInternalCommand(command: string, args: string[], cwd?: string, stdio?: 'inherit' | 'pipe' | 'ignore'): ExecaChildProcess;
|
|
844
|
-
abstract runPackageCommand(
|
|
845
|
-
|
|
890
|
+
abstract runPackageCommand(options: Omit<ExecuteCommandOptions, 'command'> & {
|
|
891
|
+
args: string[];
|
|
892
|
+
}): ExecaChildProcess;
|
|
846
893
|
abstract findInstallations(pattern?: string[]): Promise<InstallationMetadata | undefined>;
|
|
847
894
|
abstract findInstallations(pattern?: string[], options?: {
|
|
848
895
|
depth: number;
|
|
849
896
|
}): Promise<InstallationMetadata | undefined>;
|
|
850
897
|
abstract parseErrorFromLogs(logs?: string): string;
|
|
851
|
-
executeCommandSync({ command, args, stdio, cwd, ignoreError, env, ...execaOptions }: CommonOptions<'utf8'> & {
|
|
852
|
-
command: string;
|
|
853
|
-
args: string[];
|
|
854
|
-
cwd?: string;
|
|
855
|
-
ignoreError?: boolean;
|
|
856
|
-
}): string;
|
|
857
|
-
/**
|
|
858
|
-
* Execute a command asynchronously and return the execa process. This allows you to hook into
|
|
859
|
-
* stdout/stderr streams and monitor the process.
|
|
860
|
-
*
|
|
861
|
-
* @example Const process = packageManager.executeCommand({ command: 'npm', args: ['install'] });
|
|
862
|
-
* process.stdout?.on('data', (data) => console.log(data.toString())); const result = await
|
|
863
|
-
* process;
|
|
864
|
-
*/
|
|
865
|
-
executeCommand({ command, args, stdio, cwd, ignoreError, env, ...execaOptions }: CommonOptions<'utf8'> & {
|
|
866
|
-
command: string;
|
|
867
|
-
args: string[];
|
|
868
|
-
cwd?: string;
|
|
869
|
-
ignoreError?: boolean;
|
|
870
|
-
}): ExecaChildProcess;
|
|
871
898
|
/** Returns the installed (within node_modules or pnp zip) version of a specified package */
|
|
872
899
|
getInstalledVersion(packageName: string): Promise<string | null>;
|
|
873
900
|
isPackageInstalled(packageName: string): Promise<boolean>;
|
|
@@ -965,7 +992,7 @@ declare function getEnvConfig(program: Record<string, any>, configEnv: Record<st
|
|
|
965
992
|
* // SCENARIO 2:
|
|
966
993
|
* // or you can pass it to stdio and capture the output of that command
|
|
967
994
|
* try {
|
|
968
|
-
* await
|
|
995
|
+
* await executeCommand({
|
|
969
996
|
* command: 'pnpm',
|
|
970
997
|
* args: ['info', packageName, ...args],
|
|
971
998
|
* // do not output to the user, and send stdio and stderr to log file
|
|
@@ -1022,16 +1049,17 @@ declare const commonGlobOptions: (glob: string) => {
|
|
|
1022
1049
|
ignore: string[];
|
|
1023
1050
|
};
|
|
1024
1051
|
|
|
1025
|
-
declare const frameworkToRenderer: Record<
|
|
1052
|
+
declare const frameworkToRenderer: Record<SupportedFramework | SupportedRenderer, SupportedRenderer>;
|
|
1053
|
+
declare const frameworkToBuilder: Record<SupportedFramework, SupportedBuilder>;
|
|
1026
1054
|
|
|
1027
1055
|
/**
|
|
1028
1056
|
* Builder options can be specified in `core.builder.options` or `framework.options.builder`.
|
|
1029
1057
|
* Preference is given here to `framework.options.builder` if both are specified.
|
|
1030
1058
|
*/
|
|
1031
|
-
declare function getBuilderOptions<T extends Record<string, any>>(options: Options$
|
|
1059
|
+
declare function getBuilderOptions<T extends Record<string, any>>(options: Options$2): Promise<T | Record<string, never>>;
|
|
1032
1060
|
|
|
1033
1061
|
/** Framework can be a string or an object. This utility always returns the string name. */
|
|
1034
|
-
declare function getFrameworkName(options: Options$
|
|
1062
|
+
declare function getFrameworkName(options: Options$2): Promise<string>;
|
|
1035
1063
|
/**
|
|
1036
1064
|
* Extracts the proper framework name from the given framework field. The framework field can be the
|
|
1037
1065
|
* framework package name or a path to the framework package.
|
|
@@ -1039,38 +1067,39 @@ declare function getFrameworkName(options: Options$1): Promise<string>;
|
|
|
1039
1067
|
* @example
|
|
1040
1068
|
*
|
|
1041
1069
|
* ```ts
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1070
|
+
* extractFrameworkPackageName('/path/to/@storybook/angular'); // => '@storybook/angular'
|
|
1071
|
+
* extractFrameworkPackageName('@third-party/framework'); // => '@third-party/framework'
|
|
1044
1072
|
* ```
|
|
1045
1073
|
*/
|
|
1046
|
-
declare const
|
|
1074
|
+
declare const extractFrameworkPackageName: (framework: string) => string;
|
|
1047
1075
|
|
|
1048
1076
|
/**
|
|
1049
1077
|
* Render is set as a string on core. It must be set by the framework It falls back to the framework
|
|
1050
1078
|
* name if not set
|
|
1051
1079
|
*/
|
|
1052
|
-
declare function getRendererName(options: Options$
|
|
1080
|
+
declare function getRendererName(options: Options$2): Promise<string>;
|
|
1053
1081
|
/**
|
|
1054
1082
|
* Extracts the proper renderer name from the given framework name.
|
|
1055
1083
|
*
|
|
1056
1084
|
* @example
|
|
1057
1085
|
*
|
|
1058
1086
|
* ```ts
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1087
|
+
* extractRenderer('@storybook/react'); // => 'react'
|
|
1088
|
+
* extractRenderer('@storybook/angular'); // => 'angular'
|
|
1089
|
+
* extractRenderer('@third-party/framework'); // => null
|
|
1062
1090
|
* ```
|
|
1063
1091
|
*
|
|
1064
1092
|
* @param frameworkName The name of the framework.
|
|
1065
1093
|
* @returns The name of the renderer.
|
|
1066
1094
|
*/
|
|
1067
|
-
declare function
|
|
1095
|
+
declare function extractRenderer(frameworkName: string): Promise<storybook_internal_types.SupportedRenderer | null>;
|
|
1068
1096
|
|
|
1069
1097
|
declare function getStorybookConfiguration(storybookScript: string, shortName: string, longName: string): string | null;
|
|
1070
1098
|
|
|
1071
|
-
declare const rendererPackages: Record<string,
|
|
1072
|
-
declare const frameworkPackages: Record<string,
|
|
1073
|
-
declare const builderPackages: string
|
|
1099
|
+
declare const rendererPackages: Record<string, SupportedRenderer>;
|
|
1100
|
+
declare const frameworkPackages: Record<string, SupportedFramework>;
|
|
1101
|
+
declare const builderPackages: Record<string, SupportedBuilder>;
|
|
1102
|
+
declare const compilerPackages: Record<string, CoreWebpackCompiler>;
|
|
1074
1103
|
declare const findConfigFile: (prefix: string, configDir: string) => string | null;
|
|
1075
1104
|
declare const getConfigInfo: (configDir?: string) => {
|
|
1076
1105
|
configDir: string;
|
|
@@ -1078,10 +1107,10 @@ declare const getConfigInfo: (configDir?: string) => {
|
|
|
1078
1107
|
previewConfigPath: string | null;
|
|
1079
1108
|
managerConfigPath: string | null;
|
|
1080
1109
|
};
|
|
1081
|
-
declare const getStorybookInfo: (configDir?: string) => CoreCommon_StorybookInfo
|
|
1110
|
+
declare const getStorybookInfo: (configDir?: string, cwd?: string) => Promise<CoreCommon_StorybookInfo>;
|
|
1082
1111
|
|
|
1083
|
-
declare const getAutoRefs: (options: Options$
|
|
1084
|
-
declare function getRefs(options: Options$
|
|
1112
|
+
declare const getAutoRefs: (options: Options$2) => Promise<Record<string, Ref>>;
|
|
1113
|
+
declare function getRefs(options: Options$2): Promise<Record<string, Ref>>;
|
|
1085
1114
|
|
|
1086
1115
|
declare function globToRegexp(glob: string): RegExp;
|
|
1087
1116
|
|
|
@@ -1305,11 +1334,6 @@ declare function loadPreviewOrConfigFile({ configDir }: {
|
|
|
1305
1334
|
configDir: string;
|
|
1306
1335
|
}): string | undefined;
|
|
1307
1336
|
|
|
1308
|
-
declare const commandLog: (message: string) => (errorMessage?: string | void | undefined, errorInfo?: string) => void;
|
|
1309
|
-
declare function paddedLog(message: string): void;
|
|
1310
|
-
declare function getChars(char: string, amount: number): string;
|
|
1311
|
-
declare function codeLog(codeLines: string[], leftPadAmount?: number): void;
|
|
1312
|
-
|
|
1313
1337
|
declare function logConfig(caption: unknown, config: unknown): void;
|
|
1314
1338
|
|
|
1315
1339
|
declare const DEFAULT_FILES_PATTERN = "**/*.@(mdx|stories.@(js|jsx|mjs|ts|tsx))";
|
|
@@ -1409,7 +1433,7 @@ type GetStoryIdOptions = StoryIdData & {
|
|
|
1409
1433
|
userTitle?: string;
|
|
1410
1434
|
storyFilePath: string;
|
|
1411
1435
|
};
|
|
1412
|
-
declare function getStoryId(data: StoryIdData, options: Options$
|
|
1436
|
+
declare function getStoryId(data: StoryIdData, options: Options$2): Promise<{
|
|
1413
1437
|
storyId: string;
|
|
1414
1438
|
kind: string;
|
|
1415
1439
|
}>;
|
|
@@ -1418,10 +1442,61 @@ declare function getStoryTitle({ storyFilePath, configDir, stories, workingDir,
|
|
|
1418
1442
|
/** Replaces the path separator with forward slashes */
|
|
1419
1443
|
declare const posix: (localPath: string, seperator?: string) => string;
|
|
1420
1444
|
|
|
1421
|
-
declare const getAddonNames: (mainConfig: StorybookConfig) => string[];
|
|
1422
|
-
|
|
1423
1445
|
declare function syncStorybookAddons(mainConfig: StorybookConfig, previewConfigPath: string, configDir: string): Promise<void>;
|
|
1424
|
-
declare function
|
|
1446
|
+
declare function syncPreviewAddonsWithMainConfig(mainConfig: StorybookConfig, previewConfig: ConfigFile, configDir: string): Promise<ConfigFile>;
|
|
1447
|
+
|
|
1448
|
+
interface SetupAddonInConfigOptions {
|
|
1449
|
+
addonName: string;
|
|
1450
|
+
mainConfigCSFFile: ConfigFile;
|
|
1451
|
+
previewConfigPath: string | undefined;
|
|
1452
|
+
configDir: string;
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Setup an addon in the Storybook configuration by adding it to the addons array in main config and
|
|
1456
|
+
* syncing it with preview config.
|
|
1457
|
+
*
|
|
1458
|
+
* @param options Configuration options for setting up the addon
|
|
1459
|
+
*/
|
|
1460
|
+
declare function setupAddonInConfig({ addonName, previewConfigPath, configDir, mainConfigCSFFile, }: SetupAddonInConfigOptions): Promise<void>;
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* Checks if the following node declarations exists in the main config file.
|
|
1464
|
+
*
|
|
1465
|
+
* @example
|
|
1466
|
+
*
|
|
1467
|
+
* ```ts
|
|
1468
|
+
* const <name> = () => {};
|
|
1469
|
+
* function <name>() {}
|
|
1470
|
+
* ```
|
|
1471
|
+
*/
|
|
1472
|
+
declare function doesVariableOrFunctionDeclarationExist(node: types.Node, name: string): boolean;
|
|
1473
|
+
/**
|
|
1474
|
+
* Returns the name of the getAbsolutePath wrapper function if it exists in the main config file.
|
|
1475
|
+
*
|
|
1476
|
+
* @returns Name of the getAbsolutePath wrapper function (e.g. `getAbsolutePath`).
|
|
1477
|
+
*/
|
|
1478
|
+
declare function getAbsolutePathWrapperName(config: ConfigFile): string | null;
|
|
1479
|
+
/** Check if the node needs to be wrapped with getAbsolutePath wrapper. */
|
|
1480
|
+
declare function isGetAbsolutePathWrapperNecessary(node: types.Node, cb?: (node: types.StringLiteral | types.ObjectProperty | types.ArrayExpression) => void): boolean;
|
|
1481
|
+
/**
|
|
1482
|
+
* Get all fields that need to be wrapped with getAbsolutePath wrapper.
|
|
1483
|
+
*
|
|
1484
|
+
* @returns Array of fields that need to be wrapped with getAbsolutePath wrapper.
|
|
1485
|
+
*/
|
|
1486
|
+
declare function getFieldsForGetAbsolutePathWrapper(config: ConfigFile): types.Node[];
|
|
1487
|
+
/**
|
|
1488
|
+
* Returns AST for the following function
|
|
1489
|
+
*
|
|
1490
|
+
* @example
|
|
1491
|
+
*
|
|
1492
|
+
* ```ts
|
|
1493
|
+
* function getAbsolutePath(value) {
|
|
1494
|
+
* return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
|
1495
|
+
* }
|
|
1496
|
+
* ```
|
|
1497
|
+
*/
|
|
1498
|
+
declare function getAbsolutePathWrapperAsCallExpression(isConfigTypescript: boolean): types.FunctionDeclaration;
|
|
1499
|
+
declare function wrapValueWithGetAbsolutePathWrapper(config: ConfigFile, node: types.Node): void;
|
|
1425
1500
|
|
|
1426
1501
|
/**
|
|
1427
1502
|
* Helper function to scan for files matching a glob pattern and transform them
|
|
@@ -1509,7 +1584,9 @@ declare const safeResolveModule: ({ specifier, parent, extensions, }: {
|
|
|
1509
1584
|
extensions?: string[];
|
|
1510
1585
|
}) => string | undefined;
|
|
1511
1586
|
|
|
1587
|
+
declare const getAddonNames: (mainConfig: StorybookConfig) => string[];
|
|
1588
|
+
|
|
1512
1589
|
declare const groupBy: <K extends PropertyKey, T>(items: T[], keySelector: (item: T, index: number) => K) => Record<K, T[]>;
|
|
1513
1590
|
declare function invariant(condition: unknown, message?: string | (() => string)): asserts condition;
|
|
1514
1591
|
|
|
1515
|
-
export {
|
|
1592
|
+
export { DEFAULT_FILES_PATTERN, type ExecuteCommandOptions, type FileOptions, FileSystemCache, HandledError, type InstallationMetadata, type InterPresetOptions, JsPackageManager, JsPackageManagerFactory, type PackageJsonInfo, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, PackageManagerName, type PackageMetadata, type RemoveAddonOptions, type SetupAddonInConfigOptions, builderPackages, cache, checkAddonOrder, commonGlobOptions, compilerPackages, createFileSystemCache, createLogStream, doesVariableOrFunctionDeclarationExist, executeCommand, executeCommandSync, executeNodeCommand, extractFrameworkPackageName, extractRenderer, filterPresetsConfig, findConfigFile, findFilesUp, formatFileContent, frameworkPackages, frameworkToBuilder, frameworkToRenderer, getAbsolutePathWrapperAsCallExpression, getAbsolutePathWrapperName, getAddonNames, getAutoRefs, getBuilderOptions, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFieldsForGetAbsolutePathWrapper, getFrameworkName, getInterpretedFile, getPackageDetails, getPresets, getPrettier, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, globToRegexp, groupBy, importMetaResolve, importModule, interpolate, invalidateProjectRootCache, invariant, isCI, isCorePackage, isGetAbsolutePathWrapperNecessary, isPreservingSymlinks, isSatelliteAddon, loadAllPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, optionalEnvToBoolean, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolveImport, resolvePackageDir, resolvePathInStorybookCache, safeResolveModule, satisfies, scanAndTransformFiles, serverRequire, setupAddonInConfig, stringifyEnvs, stringifyProcessEnvs, supportedExtensions, syncPreviewAddonsWithMainConfig, syncStorybookAddons, temporaryDirectory, temporaryFile, transformImportFiles, validateConfigurationFiles, validateFrameworkName, _default as versions, wrapValueWithGetAbsolutePathWrapper };
|