storybook-builder-rsbuild 2.1.5 → 3.0.0-beta.1
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/compiled/@storybook/core-webpack/index.d.ts +56 -0
- package/compiled/@storybook/core-webpack/index.js +360 -0
- package/compiled/@storybook/core-webpack/package.json +1 -0
- package/dist/_node-chunks/chunk-MIMCYZFR.js +45 -0
- package/dist/index.d.ts +3 -72
- package/dist/index.js +459 -406
- package/dist/loaders/export-order-loader.js +31 -52
- package/dist/preview-preset.js +17 -39
- package/package.json +18 -30
- package/dist/chunk-TTFRSOOU.mjs +0 -34
- package/dist/index.mjs +0 -667
- package/dist/loaders/export-order-loader.d.ts +0 -5
- package/dist/loaders/export-order-loader.mjs +0 -49
- package/dist/preview-preset.d.ts +0 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { StorybookConfig as StorybookConfig$1, Options, NormalizedStoriesSpecifier } from 'storybook/internal/types';
|
|
2
|
+
export { BuilderResult, Options, Preset, TypescriptOptions } from 'storybook/internal/types';
|
|
3
|
+
|
|
4
|
+
type RulesConfig = any;
|
|
5
|
+
type ModuleConfig = {
|
|
6
|
+
rules?: RulesConfig[];
|
|
7
|
+
};
|
|
8
|
+
type ResolveConfig = {
|
|
9
|
+
extensions?: string[];
|
|
10
|
+
mainFields?: (string | string[])[] | undefined;
|
|
11
|
+
alias?: any;
|
|
12
|
+
};
|
|
13
|
+
interface WebpackConfiguration {
|
|
14
|
+
plugins?: any[];
|
|
15
|
+
module?: ModuleConfig;
|
|
16
|
+
resolve?: ResolveConfig;
|
|
17
|
+
optimization?: any;
|
|
18
|
+
devtool?: false | string;
|
|
19
|
+
}
|
|
20
|
+
type BuilderOptions = {
|
|
21
|
+
fsCache?: boolean;
|
|
22
|
+
lazyCompilation?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type StorybookConfig<TWebpackConfiguration = WebpackConfiguration> = StorybookConfig$1 & {
|
|
25
|
+
/**
|
|
26
|
+
* Modify or return a custom Webpack config after the Storybook's default configuration has run
|
|
27
|
+
* (mostly used by addons).
|
|
28
|
+
*/
|
|
29
|
+
webpack?: (config: TWebpackConfiguration, options: Options) => TWebpackConfiguration | Promise<TWebpackConfiguration>;
|
|
30
|
+
/** Modify or return a custom Webpack config after every addon has run. */
|
|
31
|
+
webpackFinal?: (config: TWebpackConfiguration, options: Options) => TWebpackConfiguration | Promise<TWebpackConfiguration>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
declare const loadCustomWebpackConfig: (configDir: string) => Promise<any>;
|
|
35
|
+
|
|
36
|
+
declare const checkWebpackVersion: (webpack: {
|
|
37
|
+
version?: string;
|
|
38
|
+
}, specifier: string, caption: string) => void;
|
|
39
|
+
|
|
40
|
+
declare function mergeConfigs(config: WebpackConfiguration, customConfig: WebpackConfiguration): WebpackConfiguration;
|
|
41
|
+
|
|
42
|
+
declare function webpackIncludeRegexp(specifier: NormalizedStoriesSpecifier): RegExp;
|
|
43
|
+
declare function toImportFnPart(specifier: NormalizedStoriesSpecifier): string;
|
|
44
|
+
declare function toImportFn(stories: NormalizedStoriesSpecifier[], { needPipelinedImport }?: {
|
|
45
|
+
needPipelinedImport?: boolean;
|
|
46
|
+
}): string;
|
|
47
|
+
|
|
48
|
+
declare const toRequireContext: (specifier: NormalizedStoriesSpecifier) => {
|
|
49
|
+
path: string;
|
|
50
|
+
recursive: boolean;
|
|
51
|
+
match: RegExp;
|
|
52
|
+
};
|
|
53
|
+
declare const toRequireContextString: (specifier: NormalizedStoriesSpecifier) => string;
|
|
54
|
+
|
|
55
|
+
export { checkWebpackVersion, loadCustomWebpackConfig, mergeConfigs, toImportFn, toImportFnPart, toRequireContext, toRequireContextString, webpackIncludeRegexp };
|
|
56
|
+
export type { BuilderOptions, ModuleConfig, ResolveConfig, RulesConfig, StorybookConfig, WebpackConfiguration };
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_storybook_internal_common_7991bda6__ from "storybook/internal/common";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_storybook_internal_node_logger_87de4309__ from "storybook/internal/node-logger";
|
|
4
|
+
var __webpack_modules__ = {
|
|
5
|
+
980: (__unused_webpack_module, exports) => {
|
|
6
|
+
var __webpack_unused_export__;
|
|
7
|
+
__webpack_unused_export__ = { value: true };
|
|
8
|
+
exports.TW = void 0;
|
|
9
|
+
function dedent(templ) {
|
|
10
|
+
var values = [];
|
|
11
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
12
|
+
values[_i - 1] = arguments[_i];
|
|
13
|
+
}
|
|
14
|
+
var strings = Array.from(typeof templ === "string" ? [templ] : templ);
|
|
15
|
+
strings[strings.length - 1] = strings[strings.length - 1].replace(
|
|
16
|
+
/\r?\n([\t ]*)$/,
|
|
17
|
+
"",
|
|
18
|
+
);
|
|
19
|
+
var indentLengths = strings.reduce(function (arr, str) {
|
|
20
|
+
var matches = str.match(/\n([\t ]+|(?!\s).)/g);
|
|
21
|
+
if (matches) {
|
|
22
|
+
return arr.concat(
|
|
23
|
+
matches.map(function (match) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return (_b =
|
|
26
|
+
(_a = match.match(/[\t ]/g)) === null || _a === void 0
|
|
27
|
+
? void 0
|
|
28
|
+
: _a.length) !== null && _b !== void 0
|
|
29
|
+
? _b
|
|
30
|
+
: 0;
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return arr;
|
|
35
|
+
}, []);
|
|
36
|
+
if (indentLengths.length) {
|
|
37
|
+
var pattern_1 = new RegExp(
|
|
38
|
+
"\n[\t ]{" + Math.min.apply(Math, indentLengths) + "}",
|
|
39
|
+
"g",
|
|
40
|
+
);
|
|
41
|
+
strings = strings.map(function (str) {
|
|
42
|
+
return str.replace(pattern_1, "\n");
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
strings[0] = strings[0].replace(/^\r?\n/, "");
|
|
46
|
+
var string = strings[0];
|
|
47
|
+
values.forEach(function (value, i) {
|
|
48
|
+
var endentations = string.match(/(?:^|\n)( *)$/);
|
|
49
|
+
var endentation = endentations ? endentations[1] : "";
|
|
50
|
+
var indentedValue = value;
|
|
51
|
+
if (typeof value === "string" && value.includes("\n")) {
|
|
52
|
+
indentedValue = String(value)
|
|
53
|
+
.split("\n")
|
|
54
|
+
.map(function (str, i) {
|
|
55
|
+
return i === 0 ? str : "" + endentation + str;
|
|
56
|
+
})
|
|
57
|
+
.join("\n");
|
|
58
|
+
}
|
|
59
|
+
string += indentedValue + strings[i + 1];
|
|
60
|
+
});
|
|
61
|
+
return string;
|
|
62
|
+
}
|
|
63
|
+
exports.TW = dedent;
|
|
64
|
+
__webpack_unused_export__ = dedent;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
var __webpack_module_cache__ = {};
|
|
68
|
+
function __nccwpck_require__(moduleId) {
|
|
69
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
70
|
+
if (cachedModule !== undefined) {
|
|
71
|
+
return cachedModule.exports;
|
|
72
|
+
}
|
|
73
|
+
var module = (__webpack_module_cache__[moduleId] = { exports: {} });
|
|
74
|
+
var threw = true;
|
|
75
|
+
try {
|
|
76
|
+
__webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
|
77
|
+
threw = false;
|
|
78
|
+
} finally {
|
|
79
|
+
if (threw) delete __webpack_module_cache__[moduleId];
|
|
80
|
+
}
|
|
81
|
+
return module.exports;
|
|
82
|
+
}
|
|
83
|
+
(() => {
|
|
84
|
+
__nccwpck_require__.d = (exports, definition) => {
|
|
85
|
+
for (var key in definition) {
|
|
86
|
+
if (
|
|
87
|
+
__nccwpck_require__.o(definition, key) &&
|
|
88
|
+
!__nccwpck_require__.o(exports, key)
|
|
89
|
+
) {
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: definition[key],
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
})();
|
|
98
|
+
(() => {
|
|
99
|
+
__nccwpck_require__.o = (obj, prop) =>
|
|
100
|
+
Object.prototype.hasOwnProperty.call(obj, prop);
|
|
101
|
+
})();
|
|
102
|
+
if (typeof __nccwpck_require__ !== "undefined")
|
|
103
|
+
__nccwpck_require__.ab =
|
|
104
|
+
new URL(".", import.meta.url).pathname.slice(
|
|
105
|
+
import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0,
|
|
106
|
+
-1,
|
|
107
|
+
) + "/";
|
|
108
|
+
var __webpack_exports__ = {};
|
|
109
|
+
__nccwpck_require__.d(__webpack_exports__, {
|
|
110
|
+
il: () => checkWebpackVersion,
|
|
111
|
+
Tu: () => loadCustomWebpackConfig,
|
|
112
|
+
SV: () => mergeConfigs,
|
|
113
|
+
T1: () => toImportFn,
|
|
114
|
+
i8: () => toImportFnPart,
|
|
115
|
+
sg: () => toRequireContext,
|
|
116
|
+
HO: () => toRequireContextString,
|
|
117
|
+
hO: () => webpackIncludeRegexp,
|
|
118
|
+
});
|
|
119
|
+
const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(
|
|
120
|
+
import.meta.url,
|
|
121
|
+
)("node:url");
|
|
122
|
+
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(
|
|
123
|
+
import.meta.url,
|
|
124
|
+
)("node:path");
|
|
125
|
+
const external_node_module_namespaceObject = __WEBPACK_EXTERNAL_createRequire(
|
|
126
|
+
import.meta.url,
|
|
127
|
+
)("node:module");
|
|
128
|
+
var x = (y) => {
|
|
129
|
+
var x = {};
|
|
130
|
+
__nccwpck_require__.d(x, y);
|
|
131
|
+
return x;
|
|
132
|
+
};
|
|
133
|
+
var y = (x) => () => x;
|
|
134
|
+
const common_namespaceObject = x({
|
|
135
|
+
["globToRegexp"]: () =>
|
|
136
|
+
__WEBPACK_EXTERNAL_MODULE_storybook_internal_common_7991bda6__.globToRegexp,
|
|
137
|
+
["serverRequire"]: () =>
|
|
138
|
+
__WEBPACK_EXTERNAL_MODULE_storybook_internal_common_7991bda6__.serverRequire,
|
|
139
|
+
});
|
|
140
|
+
var node_logger_x = (y) => {
|
|
141
|
+
var x = {};
|
|
142
|
+
__nccwpck_require__.d(x, y);
|
|
143
|
+
return x;
|
|
144
|
+
};
|
|
145
|
+
var node_logger_y = (x) => () => x;
|
|
146
|
+
const node_logger_namespaceObject = node_logger_x({
|
|
147
|
+
["logger"]: () =>
|
|
148
|
+
__WEBPACK_EXTERNAL_MODULE_storybook_internal_node_logger_87de4309__.logger,
|
|
149
|
+
});
|
|
150
|
+
var dist = __nccwpck_require__(980);
|
|
151
|
+
var dist_filename = external_node_url_namespaceObject.fileURLToPath(
|
|
152
|
+
import.meta.url,
|
|
153
|
+
);
|
|
154
|
+
var dist_dirname = external_node_path_namespaceObject.dirname(dist_filename);
|
|
155
|
+
var dist_require = external_node_module_namespaceObject.createRequire(
|
|
156
|
+
import.meta.url,
|
|
157
|
+
);
|
|
158
|
+
var __defProp = Object.defineProperty;
|
|
159
|
+
var __name = (target, value) =>
|
|
160
|
+
__defProp(target, "name", { value, configurable: true });
|
|
161
|
+
var webpackConfigs = ["webpack.config", "webpackfile"];
|
|
162
|
+
var loadCustomWebpackConfig = __name(
|
|
163
|
+
async (configDir) =>
|
|
164
|
+
(0, common_namespaceObject.serverRequire)(
|
|
165
|
+
webpackConfigs.map((configName) =>
|
|
166
|
+
(0, external_node_path_namespaceObject.resolve)(configDir, configName),
|
|
167
|
+
),
|
|
168
|
+
),
|
|
169
|
+
"loadCustomWebpackConfig",
|
|
170
|
+
);
|
|
171
|
+
var checkWebpackVersion = __name((webpack, specifier, caption) => {
|
|
172
|
+
if (!webpack.version) {
|
|
173
|
+
node_logger_namespaceObject.logger.info(
|
|
174
|
+
"Skipping webpack version check, no version available",
|
|
175
|
+
);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (webpack.version !== specifier) {
|
|
179
|
+
node_logger_namespaceObject.logger.warn((0, dist.TW)`
|
|
180
|
+
Unexpected webpack version in ${caption}:
|
|
181
|
+
- Received '${webpack.version}'
|
|
182
|
+
- Expected '${specifier}'
|
|
183
|
+
|
|
184
|
+
If you're using Webpack 5 in SB6.2 and upgrading, consider: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack-5-manager-build
|
|
185
|
+
|
|
186
|
+
For more info about Webpack 5 support: https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324#troubleshooting
|
|
187
|
+
`);
|
|
188
|
+
}
|
|
189
|
+
}, "checkWebpackVersion");
|
|
190
|
+
function mergePluginsField(defaultPlugins = [], customPlugins = []) {
|
|
191
|
+
return [...defaultPlugins, ...customPlugins];
|
|
192
|
+
}
|
|
193
|
+
__name(mergePluginsField, "mergePluginsField");
|
|
194
|
+
function mergeRulesField(defaultRules = [], customRules = []) {
|
|
195
|
+
return [...defaultRules, ...customRules];
|
|
196
|
+
}
|
|
197
|
+
__name(mergeRulesField, "mergeRulesField");
|
|
198
|
+
function mergeExtensionsField(
|
|
199
|
+
{ extensions: defaultExtensions = [] },
|
|
200
|
+
{ extensions: customExtensions = [] },
|
|
201
|
+
) {
|
|
202
|
+
return [...defaultExtensions, ...customExtensions];
|
|
203
|
+
}
|
|
204
|
+
__name(mergeExtensionsField, "mergeExtensionsField");
|
|
205
|
+
function mergeAliasField(
|
|
206
|
+
{ alias: defaultAlias = {} },
|
|
207
|
+
{ alias: customAlias = {} },
|
|
208
|
+
) {
|
|
209
|
+
return { ...defaultAlias, ...customAlias };
|
|
210
|
+
}
|
|
211
|
+
__name(mergeAliasField, "mergeAliasField");
|
|
212
|
+
function mergeModuleField(a, b) {
|
|
213
|
+
return { ...a, ...b, rules: mergeRulesField(a.rules || [], b.rules || []) };
|
|
214
|
+
}
|
|
215
|
+
__name(mergeModuleField, "mergeModuleField");
|
|
216
|
+
function mergeResolveField(
|
|
217
|
+
{ resolve: defaultResolve = {} },
|
|
218
|
+
{ resolve: customResolve = {} },
|
|
219
|
+
) {
|
|
220
|
+
return {
|
|
221
|
+
...defaultResolve,
|
|
222
|
+
...customResolve,
|
|
223
|
+
alias: mergeAliasField(defaultResolve, customResolve),
|
|
224
|
+
extensions: mergeExtensionsField(defaultResolve, customResolve),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
__name(mergeResolveField, "mergeResolveField");
|
|
228
|
+
function mergeOptimizationField(
|
|
229
|
+
{ optimization: defaultOptimization = {} },
|
|
230
|
+
{ optimization: customOptimization = {} },
|
|
231
|
+
) {
|
|
232
|
+
return { ...defaultOptimization, ...customOptimization };
|
|
233
|
+
}
|
|
234
|
+
__name(mergeOptimizationField, "mergeOptimizationField");
|
|
235
|
+
function mergeConfigs(config, customConfig) {
|
|
236
|
+
return {
|
|
237
|
+
...customConfig,
|
|
238
|
+
...config,
|
|
239
|
+
devtool: customConfig.devtool || config.devtool,
|
|
240
|
+
plugins: mergePluginsField(config.plugins, customConfig.plugins),
|
|
241
|
+
module: mergeModuleField(config.module || {}, customConfig.module || {}),
|
|
242
|
+
resolve: mergeResolveField(config, customConfig),
|
|
243
|
+
optimization: mergeOptimizationField(config, customConfig),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
__name(mergeConfigs, "mergeConfigs");
|
|
247
|
+
function importPipeline() {
|
|
248
|
+
let importGate = Promise.resolve();
|
|
249
|
+
return async (importFn) => {
|
|
250
|
+
await importGate;
|
|
251
|
+
const moduleExportsPromise = importFn();
|
|
252
|
+
importGate = importGate.then(async () => {
|
|
253
|
+
await moduleExportsPromise;
|
|
254
|
+
});
|
|
255
|
+
return moduleExportsPromise;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
__name(importPipeline, "importPipeline");
|
|
259
|
+
function adjustRegexToExcludeNodeModules(originalRegex) {
|
|
260
|
+
const originalRegexString = originalRegex.source;
|
|
261
|
+
const startsWithCaret = originalRegexString.startsWith("^");
|
|
262
|
+
const excludeNodeModulesPattern = startsWithCaret
|
|
263
|
+
? "(?!.*node_modules)"
|
|
264
|
+
: "^(?!.*node_modules)";
|
|
265
|
+
const adjustedRegexString = startsWithCaret
|
|
266
|
+
? `^${excludeNodeModulesPattern}${originalRegexString.substring(1)}`
|
|
267
|
+
: excludeNodeModulesPattern + originalRegexString;
|
|
268
|
+
return new RegExp(adjustedRegexString);
|
|
269
|
+
}
|
|
270
|
+
__name(adjustRegexToExcludeNodeModules, "adjustRegexToExcludeNodeModules");
|
|
271
|
+
function webpackIncludeRegexp(specifier) {
|
|
272
|
+
const { directory, files } = specifier;
|
|
273
|
+
const directoryWithoutLeadingDots = directory.replace(/^(\.+\/)+/, "/");
|
|
274
|
+
const webpackIncludeGlob = [".", ".."].includes(directory)
|
|
275
|
+
? files
|
|
276
|
+
: `${directoryWithoutLeadingDots}/${files}`;
|
|
277
|
+
const webpackIncludeRegexpWithCaret = webpackIncludeGlob.includes(
|
|
278
|
+
"node_modules",
|
|
279
|
+
)
|
|
280
|
+
? (0, common_namespaceObject.globToRegexp)(webpackIncludeGlob)
|
|
281
|
+
: adjustRegexToExcludeNodeModules(
|
|
282
|
+
(0, common_namespaceObject.globToRegexp)(webpackIncludeGlob),
|
|
283
|
+
);
|
|
284
|
+
return new RegExp(webpackIncludeRegexpWithCaret.source.replace(/^\^/, ""));
|
|
285
|
+
}
|
|
286
|
+
__name(webpackIncludeRegexp, "webpackIncludeRegexp");
|
|
287
|
+
function toImportFnPart(specifier) {
|
|
288
|
+
const { directory, importPathMatcher } = specifier;
|
|
289
|
+
return (0, dist.TW)`
|
|
290
|
+
async (path) => {
|
|
291
|
+
if (!${importPathMatcher}.exec(path)) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const pathRemainder = path.substring(${directory.length + 1});
|
|
296
|
+
return import(
|
|
297
|
+
/* webpackChunkName: "[request]" */
|
|
298
|
+
/* webpackInclude: ${webpackIncludeRegexp(specifier)} */
|
|
299
|
+
'${directory}/' + pathRemainder
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
`;
|
|
304
|
+
}
|
|
305
|
+
__name(toImportFnPart, "toImportFnPart");
|
|
306
|
+
function toImportFn(stories, { needPipelinedImport } = {}) {
|
|
307
|
+
let pipelinedImport = `const pipeline = (x) => x();`;
|
|
308
|
+
if (needPipelinedImport) {
|
|
309
|
+
pipelinedImport = `\n const importPipeline = ${importPipeline};\n const pipeline = importPipeline();\n `;
|
|
310
|
+
}
|
|
311
|
+
return (0, dist.TW)`
|
|
312
|
+
${pipelinedImport}
|
|
313
|
+
|
|
314
|
+
const importers = [
|
|
315
|
+
${stories.map(toImportFnPart).join(",\n")}
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
export async function importFn(path) {
|
|
319
|
+
for (let i = 0; i < importers.length; i++) {
|
|
320
|
+
const moduleExports = await pipeline(() => importers[i](path));
|
|
321
|
+
if (moduleExports) {
|
|
322
|
+
return moduleExports;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
328
|
+
__name(toImportFn, "toImportFn");
|
|
329
|
+
var toRequireContext = __name((specifier) => {
|
|
330
|
+
const { directory, files } = specifier;
|
|
331
|
+
const match = (0, common_namespaceObject.globToRegexp)(`./${files}`);
|
|
332
|
+
return {
|
|
333
|
+
path: directory,
|
|
334
|
+
recursive: files.includes("**") || files.split("/").length > 1,
|
|
335
|
+
match,
|
|
336
|
+
};
|
|
337
|
+
}, "toRequireContext");
|
|
338
|
+
var toRequireContextString = __name((specifier) => {
|
|
339
|
+
const { path: p, recursive: r, match: m } = toRequireContext(specifier);
|
|
340
|
+
const result = `require.context('${p}', ${r}, ${m})`;
|
|
341
|
+
return result;
|
|
342
|
+
}, "toRequireContextString");
|
|
343
|
+
var __webpack_exports__checkWebpackVersion = __webpack_exports__.il;
|
|
344
|
+
var __webpack_exports__loadCustomWebpackConfig = __webpack_exports__.Tu;
|
|
345
|
+
var __webpack_exports__mergeConfigs = __webpack_exports__.SV;
|
|
346
|
+
var __webpack_exports__toImportFn = __webpack_exports__.T1;
|
|
347
|
+
var __webpack_exports__toImportFnPart = __webpack_exports__.i8;
|
|
348
|
+
var __webpack_exports__toRequireContext = __webpack_exports__.sg;
|
|
349
|
+
var __webpack_exports__toRequireContextString = __webpack_exports__.HO;
|
|
350
|
+
var __webpack_exports__webpackIncludeRegexp = __webpack_exports__.hO;
|
|
351
|
+
export {
|
|
352
|
+
__webpack_exports__checkWebpackVersion as checkWebpackVersion,
|
|
353
|
+
__webpack_exports__loadCustomWebpackConfig as loadCustomWebpackConfig,
|
|
354
|
+
__webpack_exports__mergeConfigs as mergeConfigs,
|
|
355
|
+
__webpack_exports__toImportFn as toImportFn,
|
|
356
|
+
__webpack_exports__toImportFnPart as toImportFnPart,
|
|
357
|
+
__webpack_exports__toRequireContext as toRequireContext,
|
|
358
|
+
__webpack_exports__toRequireContextString as toRequireContextString,
|
|
359
|
+
__webpack_exports__webpackIncludeRegexp as webpackIncludeRegexp,
|
|
360
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@storybook/core-webpack","version":"10.0.7","funding":{"type":"opencollective","url":"https://opencollective.com/storybook"},"license":"MIT","types":"index.d.ts","type":"module"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_c7aef05d0183c9d0 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_c7aef05d0183c9d0 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_c7aef05d0183c9d0 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_c7aef05d0183c9d0.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_c7aef05d0183c9d0.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_c7aef05d0183c9d0.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
var __create = Object.create;
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
+
var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x, {
|
|
18
|
+
get: (a, b) => (typeof require < "u" ? require : a)[b]
|
|
19
|
+
}) : x)(function(x) {
|
|
20
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
21
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
});
|
|
23
|
+
var __commonJS = (cb, mod) => function() {
|
|
24
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
25
|
+
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
33
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
34
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
35
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
36
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
38
|
+
mod
|
|
39
|
+
));
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
__require,
|
|
43
|
+
__commonJS,
|
|
44
|
+
__toESM
|
|
45
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,72 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
|
|
5
|
-
|
|
6
|
-
type RsbuildStats = {
|
|
7
|
-
toJson: (...args: any[]) => any;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Options for TypeScript usage within Storybook.
|
|
11
|
-
*/
|
|
12
|
-
interface TypescriptOptions extends TypescriptOptions$1 {
|
|
13
|
-
/**
|
|
14
|
-
* Configures `@rsbuild/plugin-type-check`, using `fork-ts-checker-webpack-plugin` under the hood.
|
|
15
|
-
*/
|
|
16
|
-
checkOptions?: PluginTypeCheckerOptions;
|
|
17
|
-
}
|
|
18
|
-
type RsbuildBuilder = Builder<RsbuildConfig, RsbuildStats>;
|
|
19
|
-
type RsbuildFinal = (config: RsbuildConfig, options: Options) => RsbuildConfig | Promise<RsbuildConfig>;
|
|
20
|
-
type StorybookConfigRsbuild = {
|
|
21
|
-
rsbuildFinal?: RsbuildFinal;
|
|
22
|
-
webpackAddons?: StorybookConfigRaw['addons'];
|
|
23
|
-
};
|
|
24
|
-
type BuilderOptions = {
|
|
25
|
-
/**
|
|
26
|
-
* Path to rsbuild.config file, relative to CWD.
|
|
27
|
-
*/
|
|
28
|
-
rsbuildConfigPath?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Enable Rspack's lazy compilation (experimental).
|
|
31
|
-
*/
|
|
32
|
-
lazyCompilation?: NonNullable<RsbuildConfig['performance']>['buildCache'];
|
|
33
|
-
/**
|
|
34
|
-
* Enable Rspack's [persistent cache(experimental)](https://rspack.dev/config/experiments#experimentscache).
|
|
35
|
-
* We continue to use the name `fsCache` here to maintain better compatibility with the webpack builder.
|
|
36
|
-
*/
|
|
37
|
-
fsCache?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Which environment to use from the Rsbuild config.
|
|
40
|
-
*/
|
|
41
|
-
environment?: string;
|
|
42
|
-
/**
|
|
43
|
-
* @storybook/addon-docs options
|
|
44
|
-
*/
|
|
45
|
-
addonDocs?: any;
|
|
46
|
-
};
|
|
47
|
-
interface BuilderResult extends BuilderResult$1 {
|
|
48
|
-
stats?: Stats;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
declare const getVirtualModules: (options: Options) => Promise<{
|
|
52
|
-
virtualModules: Record<string, string>;
|
|
53
|
-
entries: string[];
|
|
54
|
-
}>;
|
|
55
|
-
|
|
56
|
-
type StatsOrMultiStats = Parameters<rsbuildReal.OnAfterBuildFn>[0]['stats'];
|
|
57
|
-
type Stats = NonNullable<Exclude<StatsOrMultiStats, {
|
|
58
|
-
stats: unknown[];
|
|
59
|
-
}>>;
|
|
60
|
-
declare const printDuration: (startTime: [number, number]) => string;
|
|
61
|
-
type BuilderStartOptions = Parameters<RsbuildBuilder['start']>['0'];
|
|
62
|
-
declare const executor: {
|
|
63
|
-
get: (options: Options) => Promise<typeof rsbuildReal>;
|
|
64
|
-
};
|
|
65
|
-
declare const getConfig: RsbuildBuilder['getConfig'];
|
|
66
|
-
declare function bail(): Promise<void>;
|
|
67
|
-
declare const start: RsbuildBuilder['start'];
|
|
68
|
-
declare const build: ({ options }: BuilderStartOptions) => Promise<Stats>;
|
|
69
|
-
declare const corePresets: string[];
|
|
70
|
-
declare const previewMainTemplate: () => string;
|
|
71
|
-
|
|
72
|
-
export { BuilderOptions, BuilderResult, RsbuildBuilder, RsbuildFinal, Stats, StorybookConfigRsbuild, TypescriptOptions, bail, build, corePresets, executor, getConfig, getVirtualModules, previewMainTemplate, printDuration, start };
|
|
1
|
+
// auto generated file from file:///Users/bytedance/Projects/storybook-rsbuild/scripts/build/utils/generate-type-mappers.ts, do not edit
|
|
2
|
+
export * from '../src/index.ts';
|
|
3
|
+
export type * from '../src/index.ts';
|