storybook-react-rsbuild 0.0.1 → 0.0.3
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/LICENSE +1 -1
- package/README.md +3 -1
- package/dist/{index-8cba017d.d.ts → index-8df66448.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/loaders/react-docgen-loader.js +15 -3
- package/dist/loaders/react-docgen-loader.mjs +15 -3
- package/dist/preset.d.ts +1 -1
- package/package.json +23 -12
- package/preset.js +1 -1
package/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2024
|
3
|
+
Copyright (c) 2024 Rspack Contrib
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
@@ -801,8 +801,6 @@ type BaseIndexInput = {
|
|
801
801
|
metaId?: MetaId;
|
802
802
|
/** Tags for filtering entries in Storybook and its tools. */
|
803
803
|
tags?: Tag$1[];
|
804
|
-
/** Tags from the meta for filtering entries in Storybook and its tools. */
|
805
|
-
metaTags?: Tag$1[];
|
806
804
|
/**
|
807
805
|
* The id of the entry, auto-generated from {@link title}/{@link metaId} and {@link exportName} if unspecified.
|
808
806
|
* If specified, the story in the CSF file _must_ have a matching id set at `parameters.__id`, to be correctly matched.
|
@@ -997,6 +995,8 @@ type DocsOptions = {
|
|
997
995
|
* Should we generate a docs entry per CSF file?
|
998
996
|
* Set to 'tag' (the default) to generate an entry for every CSF file with the
|
999
997
|
* 'autodocs' tag.
|
998
|
+
*
|
999
|
+
* @deprecated Use `tags: ['autodocs']` in `.storybook/preview.js` instead
|
1000
1000
|
*/
|
1001
1001
|
autodocs?: boolean | 'tag';
|
1002
1002
|
/**
|
package/dist/index.d.ts
CHANGED
@@ -133,13 +133,22 @@ var actualNameHandler = function actualNameHandler2(documentation, componentDefi
|
|
133
133
|
var defaultHandlers = Object.values(import_react_docgen.builtinHandlers).map((handler) => handler);
|
134
134
|
var defaultResolver = new import_react_docgen.builtinResolvers.FindExportedDefinitionsResolver();
|
135
135
|
var handlers = [...defaultHandlers, actualNameHandler];
|
136
|
-
var
|
136
|
+
var tsconfigPathsInitializeStatus = "uninitialized";
|
137
|
+
var resolveTsconfigPathsInitialingPromise;
|
138
|
+
var tsconfigPathsInitialingPromise = new Promise((resolve2) => {
|
139
|
+
resolveTsconfigPathsInitialingPromise = resolve2;
|
140
|
+
});
|
141
|
+
var finishInitialization = () => {
|
142
|
+
resolveTsconfigPathsInitialingPromise();
|
143
|
+
tsconfigPathsInitializeStatus = "initialized";
|
144
|
+
};
|
137
145
|
var matchPath;
|
138
146
|
async function reactDocgenLoader(source) {
|
139
147
|
const callback = this.async();
|
140
148
|
const options = this.getOptions() || {};
|
141
149
|
const { debug = false } = options;
|
142
|
-
if (
|
150
|
+
if (tsconfigPathsInitializeStatus === "uninitialized") {
|
151
|
+
tsconfigPathsInitializeStatus = "initializing";
|
143
152
|
const tsconfigPath = await (0, import_find_up.default)("tsconfig.json", { cwd: process.cwd() });
|
144
153
|
const tsconfig = TsconfigPaths.loadConfig(tsconfigPath);
|
145
154
|
if (tsconfig.resultType === "success") {
|
@@ -150,7 +159,10 @@ async function reactDocgenLoader(source) {
|
|
150
159
|
["browser", "module", "main"]
|
151
160
|
);
|
152
161
|
}
|
153
|
-
|
162
|
+
finishInitialization();
|
163
|
+
}
|
164
|
+
if (tsconfigPathsInitializeStatus === "initializing") {
|
165
|
+
await tsconfigPathsInitialingPromise;
|
154
166
|
}
|
155
167
|
try {
|
156
168
|
const docgenResults = (0, import_react_docgen.parse)(source, {
|
@@ -97,13 +97,22 @@ var actualNameHandler = function actualNameHandler2(documentation, componentDefi
|
|
97
97
|
var defaultHandlers = Object.values(builtinHandlers).map((handler) => handler);
|
98
98
|
var defaultResolver = new builtinResolvers.FindExportedDefinitionsResolver();
|
99
99
|
var handlers = [...defaultHandlers, actualNameHandler];
|
100
|
-
var
|
100
|
+
var tsconfigPathsInitializeStatus = "uninitialized";
|
101
|
+
var resolveTsconfigPathsInitialingPromise;
|
102
|
+
var tsconfigPathsInitialingPromise = new Promise((resolve2) => {
|
103
|
+
resolveTsconfigPathsInitialingPromise = resolve2;
|
104
|
+
});
|
105
|
+
var finishInitialization = () => {
|
106
|
+
resolveTsconfigPathsInitialingPromise();
|
107
|
+
tsconfigPathsInitializeStatus = "initialized";
|
108
|
+
};
|
101
109
|
var matchPath;
|
102
110
|
async function reactDocgenLoader(source) {
|
103
111
|
const callback = this.async();
|
104
112
|
const options = this.getOptions() || {};
|
105
113
|
const { debug = false } = options;
|
106
|
-
if (
|
114
|
+
if (tsconfigPathsInitializeStatus === "uninitialized") {
|
115
|
+
tsconfigPathsInitializeStatus = "initializing";
|
107
116
|
const tsconfigPath = await findUp("tsconfig.json", { cwd: process.cwd() });
|
108
117
|
const tsconfig = TsconfigPaths.loadConfig(tsconfigPath);
|
109
118
|
if (tsconfig.resultType === "success") {
|
@@ -114,7 +123,10 @@ async function reactDocgenLoader(source) {
|
|
114
123
|
["browser", "module", "main"]
|
115
124
|
);
|
116
125
|
}
|
117
|
-
|
126
|
+
finishInitialization();
|
127
|
+
}
|
128
|
+
if (tsconfigPathsInitializeStatus === "initializing") {
|
129
|
+
await tsconfigPathsInitialingPromise;
|
118
130
|
}
|
119
131
|
try {
|
120
132
|
const docgenResults = parse(source, {
|
package/dist/preset.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
{
|
2
2
|
"name": "storybook-react-rsbuild",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.3",
|
4
4
|
"description": "Storybook for React and Rsbuild: Develop React components in isolation with Hot Reloading.",
|
5
5
|
"keywords": [
|
6
|
-
"storybook"
|
6
|
+
"storybook",
|
7
|
+
"rsbuild",
|
8
|
+
"rspack",
|
9
|
+
"react"
|
7
10
|
],
|
11
|
+
"bugs": {
|
12
|
+
"url": "https://github.com/rspack-contrib/storybook-rsbuild/issues"
|
13
|
+
},
|
14
|
+
"repository": {
|
15
|
+
"type": "git",
|
16
|
+
"url": "https://github.com/rspack-contrib/storybook-rsbuild",
|
17
|
+
"directory": "packages/builder-react"
|
18
|
+
},
|
8
19
|
"license": "MIT",
|
9
20
|
"exports": {
|
10
21
|
".": {
|
@@ -39,17 +50,22 @@
|
|
39
50
|
],
|
40
51
|
"dependencies": {
|
41
52
|
"@rsbuild/core": "0.6.15",
|
42
|
-
"@storybook/docs-tools": "8.0.10",
|
43
|
-
"@storybook/node-logger": "8.0.10",
|
44
|
-
"@storybook/react": "8.0.10",
|
45
|
-
"@storybook/react-docgen-typescript-plugin": "1.0.1",
|
53
|
+
"@storybook/docs-tools": "^8.0.10",
|
54
|
+
"@storybook/node-logger": "^8.0.10",
|
55
|
+
"@storybook/react": "^8.0.10",
|
56
|
+
"@storybook/react-docgen-typescript-plugin": "^1.0.1",
|
46
57
|
"@types/node": "^18.0.0",
|
47
58
|
"find-up": "^5.0.0",
|
48
59
|
"magic-string": "^0.30.10",
|
49
60
|
"react-docgen": "^7.0.3",
|
50
61
|
"resolve": "^1.22.8",
|
51
62
|
"tsconfig-paths": "^4.2.0",
|
52
|
-
"storybook-builder-rsbuild": "0.0.
|
63
|
+
"storybook-builder-rsbuild": "0.0.3"
|
64
|
+
},
|
65
|
+
"devDependencies": {
|
66
|
+
"@storybook/types": "^8.0.10",
|
67
|
+
"add": "^2.0.6",
|
68
|
+
"typescript": "^5.3.2"
|
53
69
|
},
|
54
70
|
"peerDependencies": {
|
55
71
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
|
@@ -75,11 +91,6 @@
|
|
75
91
|
],
|
76
92
|
"platform": "node"
|
77
93
|
},
|
78
|
-
"devDependencies": {
|
79
|
-
"@storybook/types": "8.0.10",
|
80
|
-
"add": "^2.0.6",
|
81
|
-
"typescript": "^5.3.2"
|
82
|
-
},
|
83
94
|
"scripts": {
|
84
95
|
"check": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/check.ts",
|
85
96
|
"prep": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/bundle.ts"
|
package/preset.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
module.exports = require('./dist/preset')
|
1
|
+
module.exports = require('./dist/preset')
|