storybook-builder-rsbuild 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/compiled/@storybook/core-webpack/package.json +1 -1
- package/dist/_node-chunks/{chunk-IFQ2M2R3.js → chunk-TZR55EN2.js} +6 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -18
- package/dist/loaders/export-order-loader.js +7 -7
- package/dist/loaders/rsbuild-automock-loader.js +7 -7
- package/dist/loaders/storybook-mock-transform-loader.js +7 -7
- package/dist/preview-preset.js +7 -7
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@storybook/core-webpack","version":"10.1.
|
|
1
|
+
{"name":"@storybook/core-webpack","version":"10.1.11","funding":{"type":"opencollective","url":"https://opencollective.com/storybook"},"license":"MIT","types":"index.d.ts","type":"module"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_517fd21b22dc697b from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_517fd21b22dc697b from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_517fd21b22dc697b from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_517fd21b22dc697b.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_517fd21b22dc697b.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_517fd21b22dc697b.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as rsbuildReal from '@rsbuild/core';
|
|
2
|
-
import { RsbuildConfig } from '@rsbuild/core';
|
|
2
|
+
import { RsbuildConfig, DevConfig } from '@rsbuild/core';
|
|
3
3
|
import { Builder, TypescriptOptions as TypescriptOptions$1, Options, StorybookConfigRaw, BuilderResult as BuilderResult$1 } from 'storybook/internal/types';
|
|
4
4
|
import { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
|
|
5
5
|
|
|
@@ -27,9 +27,9 @@ type BuilderOptions = {
|
|
|
27
27
|
*/
|
|
28
28
|
rsbuildConfigPath?: string;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Pass-through Rsbuild `dev.lazyCompilation` options.
|
|
31
31
|
*/
|
|
32
|
-
lazyCompilation?:
|
|
32
|
+
lazyCompilation?: DevConfig['lazyCompilation'];
|
|
33
33
|
/**
|
|
34
34
|
* Enable Rspack's [persistent cache(experimental)](https://rspack.dev/config/experiments#experimentscache).
|
|
35
35
|
* We continue to use the name `fsCache` here to maintain better compatibility with the webpack builder.
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_517fd21b22dc697b from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_517fd21b22dc697b from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_517fd21b22dc697b from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_517fd21b22dc697b.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_517fd21b22dc697b.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_517fd21b22dc697b.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
|
__require,
|
|
15
15
|
__toESM
|
|
16
|
-
} from "./_node-chunks/chunk-
|
|
16
|
+
} from "./_node-chunks/chunk-TZR55EN2.js";
|
|
17
17
|
|
|
18
18
|
// ../../node_modules/.pnpm/pretty-hrtime@1.0.3/node_modules/pretty-hrtime/index.js
|
|
19
19
|
var require_pretty_hrtime = __commonJS({
|
|
@@ -346,7 +346,7 @@ var getVirtualModules = async (options) => {
|
|
|
346
346
|
options
|
|
347
347
|
)).map((entry) => typeof entry == "object" ? entry.absolute : slash(entry)),
|
|
348
348
|
loadPreviewOrConfigFile(options)
|
|
349
|
-
].filter(Boolean), storiesFilename = "storybook-stories.js", storiesPath = resolve(join(workingDir, storiesFilename)), needPipelinedImport =
|
|
349
|
+
].filter(Boolean), storiesFilename = "storybook-stories.js", storiesPath = resolve(join(workingDir, storiesFilename)), needPipelinedImport = builderOptions.lazyCompilation !== !1 && !isProd;
|
|
350
350
|
virtualModules[storiesPath] = __webpack_exports__toImportFn(stories, {
|
|
351
351
|
needPipelinedImport
|
|
352
352
|
});
|
|
@@ -391,7 +391,7 @@ var require2 = createRequire(import.meta.url), getAbsolutePath = (input) => {
|
|
|
391
391
|
".tsx",
|
|
392
392
|
".json",
|
|
393
393
|
".cjs"
|
|
394
|
-
], globalPath = maybeGetAbsolutePath("@storybook/global"), storybookPaths = {
|
|
394
|
+
], RAW_QUERY_REGEX = /[?&]raw(?:&|=|$)/, globalPath = maybeGetAbsolutePath("@storybook/global"), storybookPaths = {
|
|
395
395
|
// biome-ignore lint/complexity/useLiteralKeys: dynamic key required for conditional spread
|
|
396
396
|
...globalPath ? { "@storybook/global": globalPath } : {}
|
|
397
397
|
}, iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
|
|
@@ -439,9 +439,11 @@ var require2 = createRequire(import.meta.url), getAbsolutePath = (input) => {
|
|
|
439
439
|
]), stories = normalizeStories2(nonNormalizedStories, {
|
|
440
440
|
configDir: options.configDir,
|
|
441
441
|
workingDir
|
|
442
|
-
}), shouldCheckTs = typescriptOptions.check && !typescriptOptions.skipCompiler, tsCheckOptions = typescriptOptions.checkOptions || {}, builderOptions = await getBuilderOptions2(options), cacheConfig = builderOptions.fsCache ? !0 : void 0,
|
|
442
|
+
}), shouldCheckTs = typescriptOptions.check && !typescriptOptions.skipCompiler, tsCheckOptions = typescriptOptions.checkOptions || {}, builderOptions = await getBuilderOptions2(options), cacheConfig = builderOptions.fsCache ? !0 : void 0, shouldDisableDevFeatures = process.env.SB_RSBUILD_TEST_MINIMAL_DEV === "true", lazyCompilationConfig;
|
|
443
|
+
isProd || (shouldDisableDevFeatures ? lazyCompilationConfig = !1 : lazyCompilationConfig = builderOptions.lazyCompilation === void 0 ? {
|
|
443
444
|
entries: !1
|
|
444
|
-
} :
|
|
445
|
+
} : builderOptions.lazyCompilation);
|
|
446
|
+
let shouldDisableHmr = shouldDisableDevFeatures;
|
|
445
447
|
if (!template)
|
|
446
448
|
throw new Error(dedent`
|
|
447
449
|
Storybook's Webpack5 builder requires a template to be specified.
|
|
@@ -451,10 +453,7 @@ var require2 = createRequire(import.meta.url), getAbsolutePath = (input) => {
|
|
|
451
453
|
`);
|
|
452
454
|
let externals = globalsNameReferenceMap;
|
|
453
455
|
build2?.test?.disableBlocks && (externals["@storybook/blocks"] = "__STORYBOOK_BLOCKS_EMPTY_MODULE__");
|
|
454
|
-
let { virtualModules: virtualModuleMapping, entries: dynamicEntries } = await getVirtualModules(options)
|
|
455
|
-
if (!options.cache)
|
|
456
|
-
throw new Error("Cache is required");
|
|
457
|
-
let contentFromConfig = {}, { content } = await loadConfig({
|
|
456
|
+
let { virtualModules: virtualModuleMapping, entries: dynamicEntries } = await getVirtualModules(options), contentFromConfig = {}, { content } = await loadConfig({
|
|
458
457
|
cwd: workingDir,
|
|
459
458
|
path: rsbuildConfigPath
|
|
460
459
|
}), { environments, ...withoutEnv } = content;
|
|
@@ -514,7 +513,8 @@ var require2 = createRequire(import.meta.url), getAbsolutePath = (input) => {
|
|
|
514
513
|
},
|
|
515
514
|
dev: {
|
|
516
515
|
assetPrefix: "/",
|
|
517
|
-
progressBar: !quiet
|
|
516
|
+
progressBar: !quiet,
|
|
517
|
+
hmr: shouldDisableHmr ? !1 : void 0
|
|
518
518
|
},
|
|
519
519
|
resolve: {
|
|
520
520
|
alias: {
|
|
@@ -551,7 +551,7 @@ var require2 = createRequire(import.meta.url), getAbsolutePath = (input) => {
|
|
|
551
551
|
swc: (config) => {
|
|
552
552
|
config.env ??= {}, config.env.bugfixes = !0;
|
|
553
553
|
},
|
|
554
|
-
rspack: (config, { addRules, rspack, mergeConfig }) => {
|
|
554
|
+
rspack: (config, { addRules, appendRules, rspack, mergeConfig }) => {
|
|
555
555
|
if (addRules({
|
|
556
556
|
test: /\.stories\.([tj])sx?$|(stories|story)\.mdx$/,
|
|
557
557
|
exclude: /node_modules/,
|
|
@@ -596,7 +596,10 @@ var require2 = createRequire(import.meta.url), getAbsolutePath = (input) => {
|
|
|
596
596
|
}),
|
|
597
597
|
new CaseSensitivePathsPlugin()
|
|
598
598
|
].filter(Boolean)
|
|
599
|
-
), config.experiments ??= {}, config.experiments.outputModule = !1, config.externalsType = "var", config.output ??= {}, config.output.module = !1, config.output.chunkFormat = "array-push", config.output.chunkLoading = "jsonp", lazyCompilationConfig !== void 0 && (config.lazyCompilation = lazyCompilationConfig),
|
|
599
|
+
), config.experiments ??= {}, config.experiments.outputModule = !1, config.externalsType = "var", config.output ??= {}, config.output.module = !1, config.output.chunkFormat = "array-push", config.output.chunkLoading = "jsonp", lazyCompilationConfig !== void 0 && (config.lazyCompilation = lazyCompilationConfig), appendRules({
|
|
600
|
+
resourceQuery: RAW_QUERY_REGEX,
|
|
601
|
+
type: "asset/source"
|
|
602
|
+
}), mergeConfig(
|
|
600
603
|
config,
|
|
601
604
|
extraWebpackConfig || {},
|
|
602
605
|
webpackConfigFromPresets
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_517fd21b22dc697b from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_517fd21b22dc697b from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_517fd21b22dc697b from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_517fd21b22dc697b.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_517fd21b22dc697b.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_517fd21b22dc697b.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "../_node-chunks/chunk-
|
|
12
|
+
import "../_node-chunks/chunk-TZR55EN2.js";
|
|
13
13
|
|
|
14
14
|
// src/loaders/export-order-loader.ts
|
|
15
15
|
import assert from "node:assert";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_517fd21b22dc697b from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_517fd21b22dc697b from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_517fd21b22dc697b from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_517fd21b22dc697b.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_517fd21b22dc697b.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_517fd21b22dc697b.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "../_node-chunks/chunk-
|
|
12
|
+
import "../_node-chunks/chunk-TZR55EN2.js";
|
|
13
13
|
|
|
14
14
|
// src/loaders/rsbuild-automock-loader.ts
|
|
15
15
|
import { babelParser, getAutomockCode } from "storybook/internal/mocking-utils";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_517fd21b22dc697b from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_517fd21b22dc697b from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_517fd21b22dc697b from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_517fd21b22dc697b.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_517fd21b22dc697b.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_517fd21b22dc697b.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "../_node-chunks/chunk-
|
|
12
|
+
import "../_node-chunks/chunk-TZR55EN2.js";
|
|
13
13
|
|
|
14
14
|
// src/loaders/storybook-mock-transform-loader.ts
|
|
15
15
|
import { rewriteSbMockImportCalls } from "storybook/internal/mocking-utils";
|
package/dist/preview-preset.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_517fd21b22dc697b from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_517fd21b22dc697b from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_517fd21b22dc697b from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_517fd21b22dc697b.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_517fd21b22dc697b.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_517fd21b22dc697b.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./_node-chunks/chunk-
|
|
12
|
+
import "./_node-chunks/chunk-TZR55EN2.js";
|
|
13
13
|
|
|
14
14
|
// src/preview-preset.ts
|
|
15
15
|
import { createRequire } from "node:module";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-builder-rsbuild",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Rsbuild builder for Storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
],
|
|
10
10
|
"homepage": "https://storybook.rsbuild.rs",
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/rstackjs/storybook-rsbuild/issues"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "https://github.com/rstackjs/storybook-rsbuild",
|
|
17
17
|
"directory": "packages/builder-rsbuild"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"@vitest/mocker": "3.2.4",
|
|
48
48
|
"browser-assert": "^1.2.1",
|
|
49
49
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
50
|
-
"cjs-module-lexer": "^2.
|
|
50
|
+
"cjs-module-lexer": "^2.2.0",
|
|
51
51
|
"constants-browserify": "^1.0.0",
|
|
52
52
|
"es-module-lexer": "^1.7.0",
|
|
53
|
-
"fs-extra": "^11.3.
|
|
53
|
+
"fs-extra": "^11.3.3",
|
|
54
54
|
"magic-string": "^0.30.21",
|
|
55
55
|
"path-browserify": "^1.0.1",
|
|
56
56
|
"picocolors": "^1.1.1",
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
"util-deprecate": "^1.0.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@rsbuild/core": "^1.
|
|
67
|
-
"@storybook/core-webpack": "10.1.
|
|
66
|
+
"@rsbuild/core": "^1.7.2",
|
|
67
|
+
"@storybook/core-webpack": "10.1.11",
|
|
68
68
|
"@types/fs-extra": "^11.0.4",
|
|
69
69
|
"@types/node": "^22.0.0",
|
|
70
70
|
"@types/pretty-hrtime": "^1.0.3",
|
|
71
71
|
"prebundle": "^1.6.0",
|
|
72
72
|
"pretty-hrtime": "^1.0.3",
|
|
73
73
|
"slash": "^5.1.0",
|
|
74
|
-
"storybook": "10.1.
|
|
74
|
+
"storybook": "10.1.11",
|
|
75
75
|
"typescript": "^5.9.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|