storybook-react-rsbuild 3.3.4 → 3.4.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/dist/_node-chunks/{chunk-2WDMEXMG.js → chunk-WAF6O3HU.js} +6 -6
- package/dist/_node-chunks/{generate-K4AE4BED.js → generate-HP7ZOIR5.js} +7 -7
- package/dist/_node-chunks/{options-FQ4LDEH4.js → options-5CFRO3ZP.js} +7 -7
- package/dist/_node-chunks/{react-docgen-typescript-JNMHFERQ.js → react-docgen-typescript-IQKHJACJ.js} +10 -10
- package/dist/_node-chunks/{typescript-PGG4LONL.js → typescript-7FGY3J7A.js} +7 -7
- package/dist/loaders/react-docgen-loader.js +19 -9
- package/dist/node/index.js +7 -7
- package/dist/preset.js +39 -29
- package/package.json +8 -8
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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 "./chunk-
|
|
12
|
+
import "./chunk-WAF6O3HU.js";
|
|
13
13
|
|
|
14
14
|
// src/plugins/react-docgen-typescript/utils/generate.ts
|
|
15
15
|
import MagicString from "magic-string";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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 "./chunk-
|
|
12
|
+
import "./chunk-WAF6O3HU.js";
|
|
13
13
|
|
|
14
14
|
// src/plugins/react-docgen-typescript/utils/options.ts
|
|
15
15
|
function getGenerateOptions(options) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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 "./chunk-
|
|
12
|
+
import "./chunk-WAF6O3HU.js";
|
|
13
13
|
|
|
14
14
|
// src/plugins/react-docgen-typescript/index.ts
|
|
15
15
|
import { createFilter } from "@rollup/pluginutils";
|
|
@@ -36,7 +36,7 @@ var getDocgen = async (config) => {
|
|
|
36
36
|
docgenOptions
|
|
37
37
|
);
|
|
38
38
|
}, startWatch = async (config, onProgramCreatedOrUpdated) => {
|
|
39
|
-
let { default: ts } = await import("typescript"), { getTSConfigFile } = await import("./typescript-
|
|
39
|
+
let { default: ts } = await import("typescript"), { getTSConfigFile } = await import("./typescript-7FGY3J7A.js"), compilerOptions = {
|
|
40
40
|
jsx: ts.JsxEmit.React,
|
|
41
41
|
module: ts.ModuleKind.CommonJS,
|
|
42
42
|
target: ts.ScriptTarget.Latest
|
|
@@ -71,8 +71,8 @@ var getDocgen = async (config) => {
|
|
|
71
71
|
name: "rsbuild-plugin-react-docgen-typescript",
|
|
72
72
|
setup(api) {
|
|
73
73
|
api.modifyRsbuildConfig(async () => {
|
|
74
|
-
let { getGenerateOptions } = await import("./options-
|
|
75
|
-
generateDocgenCodeBlock = (await import("./generate-
|
|
74
|
+
let { getGenerateOptions } = await import("./options-5CFRO3ZP.js");
|
|
75
|
+
generateDocgenCodeBlock = (await import("./generate-HP7ZOIR5.js")).generateDocgenCodeBlock, docGenParser = await getDocgen(config), generateOptions = getGenerateOptions(config), [tsProgram, closeWatch] = await startWatch(config, (program) => {
|
|
76
76
|
tsProgram = program;
|
|
77
77
|
for (let [
|
|
78
78
|
filepath,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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 "./chunk-
|
|
12
|
+
import "./chunk-WAF6O3HU.js";
|
|
13
13
|
|
|
14
14
|
// src/plugins/react-docgen-typescript/utils/typescript.ts
|
|
15
15
|
import { dirname } from "node:path";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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-WAF6O3HU.js";
|
|
13
13
|
|
|
14
14
|
// src/loaders/react-docgen-loader.ts
|
|
15
15
|
import findUp from "find-up";
|
|
@@ -124,12 +124,22 @@ var { getNameOrValue, isReactForwardRefCall } = utils, actualNameHandler = funct
|
|
|
124
124
|
resolveTsconfigPathsInitialingPromise = resolve2;
|
|
125
125
|
}), finishInitialization = () => {
|
|
126
126
|
resolveTsconfigPathsInitialingPromise(), tsconfigPathsInitializeStatus = "initialized";
|
|
127
|
-
}, matchPath
|
|
127
|
+
}, matchPath, TSCONFIG_CANDIDATES = [
|
|
128
|
+
"tsconfig.json",
|
|
129
|
+
"tsconfig.base.json",
|
|
130
|
+
"tsconfig.app.json"
|
|
131
|
+
], findTsconfigPath = async (cwd) => {
|
|
132
|
+
for (let candidate of TSCONFIG_CANDIDATES) {
|
|
133
|
+
let found = await findUp(candidate, { cwd });
|
|
134
|
+
if (found)
|
|
135
|
+
return found;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
128
138
|
async function reactDocgenLoader(source, map) {
|
|
129
139
|
let callback = this.async(), options = this.getOptions() || {}, { debug = !1 } = options;
|
|
130
140
|
if (tsconfigPathsInitializeStatus === "uninitialized") {
|
|
131
141
|
tsconfigPathsInitializeStatus = "initializing";
|
|
132
|
-
let tsconfigPath = await
|
|
142
|
+
let tsconfigPath = await findTsconfigPath(process.cwd()), tsconfig = TsconfigPaths.loadConfig(tsconfigPath);
|
|
133
143
|
tsconfig.resultType === "success" && (logger.info("Using tsconfig paths for react-docgen"), matchPath = TsconfigPaths.createMatchPath(
|
|
134
144
|
tsconfig.absoluteBaseUrl,
|
|
135
145
|
tsconfig.paths,
|
package/dist/node/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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-WAF6O3HU.js";
|
|
13
13
|
|
|
14
14
|
// src/node/index.ts
|
|
15
15
|
function defineMain(config) {
|
package/dist/preset.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f8033dfd40ee1738 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f8033dfd40ee1738 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f8033dfd40ee1738.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f8033dfd40ee1738.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f8033dfd40ee1738.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
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-WAF6O3HU.js";
|
|
15
15
|
|
|
16
16
|
// src/preset.ts
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
@@ -26,40 +26,50 @@ function requirer(resolver, path) {
|
|
|
26
26
|
|
|
27
27
|
// src/react-docs.ts
|
|
28
28
|
var rsbuildFinalDocs = async (config, options) => {
|
|
29
|
+
if ((await options.presets.apply("features", {}))?.experimentalDocgenServer)
|
|
30
|
+
return config;
|
|
29
31
|
let typescriptOptions = await options.presets.apply("typescript", {}), debug = options.loglevel === "debug", { reactDocgen, reactDocgenTypescriptOptions } = typescriptOptions || {};
|
|
30
32
|
if (typeof reactDocgen != "string")
|
|
31
33
|
return config;
|
|
32
|
-
|
|
34
|
+
let reactDocgenLoaderRule = (test) => ({
|
|
35
|
+
test,
|
|
36
|
+
enforce: "pre",
|
|
37
|
+
loader: requirer(
|
|
38
|
+
__require.resolve,
|
|
39
|
+
"storybook-react-rsbuild/loaders/react-docgen-loader"
|
|
40
|
+
),
|
|
41
|
+
options: {
|
|
42
|
+
debug
|
|
43
|
+
},
|
|
44
|
+
exclude: /(\.(stories|story)\.(js|jsx|ts|tsx))|(node_modules)/
|
|
45
|
+
}), typescriptPresent;
|
|
46
|
+
try {
|
|
47
|
+
__require.resolve("typescript"), typescriptPresent = !0;
|
|
48
|
+
} catch {
|
|
49
|
+
typescriptPresent = !1;
|
|
50
|
+
}
|
|
51
|
+
if (!(reactDocgen === "react-docgen-typescript" && typescriptPresent))
|
|
33
52
|
return mergeRsbuildConfig(config, {
|
|
34
53
|
tools: {
|
|
35
54
|
rspack: {
|
|
36
55
|
module: {
|
|
37
|
-
rules: [
|
|
38
|
-
{
|
|
39
|
-
test: /\.(cjs|mjs|tsx?|jsx?)$/,
|
|
40
|
-
enforce: "pre",
|
|
41
|
-
loader: requirer(
|
|
42
|
-
__require.resolve,
|
|
43
|
-
"storybook-react-rsbuild/loaders/react-docgen-loader"
|
|
44
|
-
),
|
|
45
|
-
options: {
|
|
46
|
-
debug
|
|
47
|
-
},
|
|
48
|
-
exclude: /(\.(stories|story)\.(js|jsx|ts|tsx))|(node_modules)/
|
|
49
|
-
}
|
|
50
|
-
]
|
|
56
|
+
rules: [reactDocgenLoaderRule(/\.(cjs|mjs|tsx?|jsx?)$/)]
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
});
|
|
55
|
-
let
|
|
56
|
-
try {
|
|
57
|
-
__require.resolve("typescript"), typescriptPresent = !0;
|
|
58
|
-
} catch {
|
|
59
|
-
typescriptPresent = !1;
|
|
60
|
-
}
|
|
61
|
-
let reactDocGenTsPlugin = await import("./_node-chunks/react-docgen-typescript-JNMHFERQ.js");
|
|
61
|
+
let reactDocGenTsPlugin = await import("./_node-chunks/react-docgen-typescript-IQKHJACJ.js");
|
|
62
62
|
return mergeRsbuildConfig(config, {
|
|
63
|
+
tools: {
|
|
64
|
+
rspack: {
|
|
65
|
+
module: {
|
|
66
|
+
// The vendored react-docgen-typescript plugin only matches `**/**.tsx`, so non-TS
|
|
67
|
+
// files still need plain react-docgen.
|
|
68
|
+
// @see https://github.com/storybookjs/storybook/blob/3e12dfc040/code/presets/react-webpack/src/framework-preset-react-docs.ts#L60
|
|
69
|
+
rules: [reactDocgenLoaderRule(/\.(cjs|mjs|jsx?)$/)]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
63
73
|
plugins: [
|
|
64
74
|
await reactDocGenTsPlugin.default({
|
|
65
75
|
...reactDocgenTypescriptOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-react-rsbuild",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Storybook for React and Rsbuild: Develop React components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"!src/**/*"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rollup/pluginutils": "^5.
|
|
50
|
-
"@storybook/react": "^10.
|
|
49
|
+
"@rollup/pluginutils": "^5.4.0",
|
|
50
|
+
"@storybook/react": "^10.5.5",
|
|
51
51
|
"@storybook/react-docgen-typescript-plugin": "^1.0.1",
|
|
52
52
|
"find-up": "^5.0.0",
|
|
53
53
|
"magic-string": "^0.30.21",
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
"react-docgen-typescript": "^2.4.0",
|
|
56
56
|
"resolve": "^1.22.12",
|
|
57
57
|
"tsconfig-paths": "^4.2.0",
|
|
58
|
-
"storybook-builder-rsbuild": "3.
|
|
58
|
+
"storybook-builder-rsbuild": "3.4.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@rsbuild/core": "^2.
|
|
61
|
+
"@rsbuild/core": "^2.1.10",
|
|
62
62
|
"@types/node": "^22.0.0",
|
|
63
|
-
"@types/react": "^18.3.
|
|
63
|
+
"@types/react": "^18.3.31",
|
|
64
64
|
"@types/resolve": "^1.20.6",
|
|
65
65
|
"react": "18.3.1",
|
|
66
66
|
"react-dom": "18.3.1",
|
|
67
|
-
"storybook": "10.
|
|
67
|
+
"storybook": "10.5.5",
|
|
68
68
|
"typescript": "^5.9.3"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@rsbuild/core": "^1.5.0 || ^2.0.0-0",
|
|
72
72
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
73
73
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
74
|
-
"storybook": "^10.
|
|
74
|
+
"storybook": "^10.5.5",
|
|
75
75
|
"typescript": ">= 4.2.x"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|