storybook-react-rsbuild 3.1.0 → 3.2.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/_node-chunks/{chunk-QAELLT2I.js → chunk-HLWUFMVK.js} +6 -6
- package/dist/_node-chunks/{generate-3NSWG3A6.js → generate-VIQ2RH4I.js} +7 -7
- package/dist/_node-chunks/{options-JTHXXNGP.js → options-PTSZHBIB.js} +7 -7
- package/dist/_node-chunks/{react-docgen-typescript-ZJXJRNF5.js → react-docgen-typescript-2SOKSJO6.js} +10 -10
- package/dist/_node-chunks/{typescript-NR26UJ6O.js → typescript-V32BD7J6.js} +7 -7
- package/dist/loaders/react-docgen-loader.js +7 -7
- package/dist/node/index.js +7 -7
- package/dist/preset.d.ts +55 -0
- package/dist/preset.js +8 -8
- package/package.json +11 -8
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.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_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.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_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.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-V32BD7J6.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-PTSZHBIB.js");
|
|
75
|
+
generateDocgenCodeBlock = (await import("./generate-VIQ2RH4I.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_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.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_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.js";
|
|
13
13
|
|
|
14
14
|
// src/loaders/react-docgen-loader.ts
|
|
15
15
|
import findUp from "find-up";
|
package/dist/node/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.js";
|
|
13
13
|
|
|
14
14
|
// src/node/index.ts
|
|
15
15
|
function defineMain(config) {
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { StorybookConfig as StorybookConfig$1, TypescriptOptions, PresetProperty } from 'storybook/internal/types';
|
|
2
|
+
import { PluginOptions } from '@storybook/react-docgen-typescript-plugin';
|
|
3
|
+
import { StorybookConfigRsbuild, BuilderOptions, TypescriptOptions as TypescriptOptions$1 } from 'storybook-builder-rsbuild';
|
|
4
|
+
|
|
5
|
+
type FrameworkName = 'storybook-react-rsbuild';
|
|
6
|
+
type BuilderName = 'storybook-builder-rsbuild';
|
|
7
|
+
type FrameworkOptions = {
|
|
8
|
+
builder?: BuilderOptions;
|
|
9
|
+
strictMode?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Use React's legacy root API to mount components
|
|
12
|
+
* @description
|
|
13
|
+
* React has introduced a new root API with React 18.x to enable a whole set of new features (e.g. concurrent features)
|
|
14
|
+
* If this flag is true, the legacy Root API is used to mount components to make it easier to migrate step by step to React 18.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
legacyRootApi?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type TypescriptOptionsReact = {
|
|
20
|
+
/**
|
|
21
|
+
* Sets the type of Docgen when working with React and TypeScript
|
|
22
|
+
*
|
|
23
|
+
* @default `'react-docgen'`
|
|
24
|
+
*/
|
|
25
|
+
reactDocgen: 'react-docgen-typescript' | 'react-docgen' | false;
|
|
26
|
+
/**
|
|
27
|
+
* Configures `react-docgen-typescript-plugin`
|
|
28
|
+
*
|
|
29
|
+
* @default
|
|
30
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/builders/builder-webpack5/src/config/defaults.js#L4-L6
|
|
31
|
+
*/
|
|
32
|
+
reactDocgenTypescriptOptions: PluginOptions;
|
|
33
|
+
};
|
|
34
|
+
type StorybookConfigFramework = {
|
|
35
|
+
framework: FrameworkName | {
|
|
36
|
+
name: FrameworkName;
|
|
37
|
+
options: FrameworkOptions;
|
|
38
|
+
};
|
|
39
|
+
core?: StorybookConfig$1['core'] & {
|
|
40
|
+
builder?: BuilderName | {
|
|
41
|
+
name: BuilderName;
|
|
42
|
+
options: BuilderOptions;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
typescript?: Partial<TypescriptOptions & TypescriptOptions$1 & TypescriptOptionsReact>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The interface for Storybook configuration in `main.ts` files.
|
|
49
|
+
*/
|
|
50
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigRsbuild | keyof StorybookConfigFramework> & StorybookConfigRsbuild & StorybookConfigFramework;
|
|
51
|
+
|
|
52
|
+
declare const rsbuildFinal: NonNullable<StorybookConfig['rsbuildFinal']>;
|
|
53
|
+
declare const core: PresetProperty<'core'>;
|
|
54
|
+
|
|
55
|
+
export { core, rsbuildFinal };
|
package/dist/preset.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bce9f5a39a886437 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bce9f5a39a886437 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bce9f5a39a886437 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bce9f5a39a886437.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bce9f5a39a886437.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bce9f5a39a886437.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-HLWUFMVK.js";
|
|
15
15
|
|
|
16
16
|
// src/preset.ts
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
@@ -58,7 +58,7 @@ var rsbuildFinalDocs = async (config, options) => {
|
|
|
58
58
|
} catch {
|
|
59
59
|
typescriptPresent = !1;
|
|
60
60
|
}
|
|
61
|
-
let reactDocGenTsPlugin = await import("./_node-chunks/react-docgen-typescript-
|
|
61
|
+
let reactDocGenTsPlugin = await import("./_node-chunks/react-docgen-typescript-2SOKSJO6.js");
|
|
62
62
|
return mergeRsbuildConfig(config, {
|
|
63
63
|
plugins: [
|
|
64
64
|
await reactDocGenTsPlugin.default({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-react-rsbuild",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Storybook for React and Rsbuild: Develop React components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -33,7 +33,10 @@
|
|
|
33
33
|
"default": "./dist/node/index.js"
|
|
34
34
|
},
|
|
35
35
|
"./package.json": "./package.json",
|
|
36
|
-
"./preset":
|
|
36
|
+
"./preset": {
|
|
37
|
+
"types": "./dist/preset.d.ts",
|
|
38
|
+
"default": "./dist/preset.js"
|
|
39
|
+
}
|
|
37
40
|
},
|
|
38
41
|
"files": [
|
|
39
42
|
"dist/**/*",
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
],
|
|
45
48
|
"dependencies": {
|
|
46
49
|
"@rollup/pluginutils": "^5.3.0",
|
|
47
|
-
"@storybook/react": "^10.
|
|
50
|
+
"@storybook/react": "^10.1.9",
|
|
48
51
|
"@storybook/react-docgen-typescript-plugin": "^1.0.1",
|
|
49
52
|
"find-up": "^5.0.0",
|
|
50
53
|
"magic-string": "^0.30.21",
|
|
@@ -52,12 +55,12 @@
|
|
|
52
55
|
"react-docgen-typescript": "^2.4.0",
|
|
53
56
|
"resolve": "^1.22.11",
|
|
54
57
|
"tsconfig-paths": "^4.2.0",
|
|
55
|
-
"storybook-builder-rsbuild": "3.
|
|
58
|
+
"storybook-builder-rsbuild": "3.2.0"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
|
-
"@rsbuild/core": "^1.6.
|
|
61
|
+
"@rsbuild/core": "^1.6.13",
|
|
59
62
|
"@types/node": "^22.0.0",
|
|
60
|
-
"@types/react": "^18.3.
|
|
63
|
+
"@types/react": "^18.3.27",
|
|
61
64
|
"@types/resolve": "^1.20.6",
|
|
62
65
|
"react": "18.3.1",
|
|
63
66
|
"react-dom": "18.3.1",
|
|
@@ -66,8 +69,8 @@
|
|
|
66
69
|
},
|
|
67
70
|
"peerDependencies": {
|
|
68
71
|
"@rsbuild/core": "^1.5.0",
|
|
69
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
70
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
72
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
73
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
71
74
|
"storybook": "^10.1.0",
|
|
72
75
|
"typescript": ">= 4.2.x"
|
|
73
76
|
},
|