@storybook/react-vite 11.0.0-alpha.1 → 11.0.0-alpha.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/dist/_node-chunks/{react-docgen-SMQRH3AW.js → react-docgen-UT7MYCPI.js} +31 -12
- package/dist/{chunk-CJ1Nc_eA.d.ts → chunk-JjNtH-UF.d.ts} +0 -10
- package/dist/index.d.ts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +6 -6
- package/dist/preset.d.ts +1 -1
- package/dist/preset.js +7 -7
- package/package.json +7 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2z78wmasupc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2z78wmasupc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2z78wmasupc from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2z78wmasupc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2z78wmasupc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2z78wmasupc.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -131,12 +131,7 @@ async function reactDocgen({
|
|
|
131
131
|
async transform(src, id) {
|
|
132
132
|
if (filter(relative(cwd, id)))
|
|
133
133
|
try {
|
|
134
|
-
let
|
|
135
|
-
resolver: defaultResolver,
|
|
136
|
-
handlers,
|
|
137
|
-
importer: getReactDocgenImporter(matchPath),
|
|
138
|
-
filename: id
|
|
139
|
-
}), s = new MagicString(src);
|
|
134
|
+
let docgenResults = parseDocgen(src, id, createTsconfigMatchPath(id)), s = new MagicString(src);
|
|
140
135
|
return docgenResults.forEach((info) => {
|
|
141
136
|
let { actualName, definedInFile, ...docgenInfo } = info;
|
|
142
137
|
if (actualName && definedInFile == id) {
|
|
@@ -155,6 +150,30 @@ async function reactDocgen({
|
|
|
155
150
|
}
|
|
156
151
|
};
|
|
157
152
|
}
|
|
153
|
+
function parseDocgen(src, id, matchPath) {
|
|
154
|
+
let options = {
|
|
155
|
+
resolver: defaultResolver,
|
|
156
|
+
handlers,
|
|
157
|
+
importer: getReactDocgenImporter(matchPath),
|
|
158
|
+
filename: id
|
|
159
|
+
};
|
|
160
|
+
try {
|
|
161
|
+
return parse(src, {
|
|
162
|
+
...options,
|
|
163
|
+
babelOptions: { babelrc: !1, configFile: !1 }
|
|
164
|
+
});
|
|
165
|
+
} catch (isolatedError) {
|
|
166
|
+
if (isolatedError.code === ERROR_CODES.MISSING_DEFINITION)
|
|
167
|
+
throw isolatedError;
|
|
168
|
+
try {
|
|
169
|
+
return parse(src, options);
|
|
170
|
+
} catch (projectConfigError) {
|
|
171
|
+
throw projectConfigError.code === ERROR_CODES.MISSING_DEFINITION ? projectConfigError : (logger.debug(
|
|
172
|
+
`react-docgen also failed with the project Babel config for ${id}: ${projectConfigError}`
|
|
173
|
+
), isolatedError);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
158
177
|
function getReactDocgenImporter(matchPath) {
|
|
159
178
|
return makeFsImporter((filename, basedir) => {
|
|
160
179
|
let mappedFilenameByPaths = matchPath && matchPath(filename) || filename, result = defaultLookupModule(mappedFilenameByPaths, basedir);
|
|
@@ -8,16 +8,6 @@ type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
|
|
8
8
|
type FrameworkOptions = {
|
|
9
9
|
builder?: BuilderOptions;
|
|
10
10
|
strictMode?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Use React's legacy root API to mount components
|
|
13
|
-
*
|
|
14
|
-
* React has introduced a new root API with React 18.x to enable a whole set of new features (e.g.
|
|
15
|
-
* concurrent features) If this flag is true, the legacy Root API is used to mount components to
|
|
16
|
-
* make it easier to migrate step by step to React 18.
|
|
17
|
-
*
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
legacyRootApi?: boolean;
|
|
21
11
|
};
|
|
22
12
|
type StorybookConfigFramework = {
|
|
23
13
|
framework: FrameworkName | {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as StorybookConfig, t as FrameworkOptions } from "./chunk-
|
|
1
|
+
import { n as StorybookConfig, t as FrameworkOptions } from "./chunk-JjNtH-UF.js";
|
|
2
2
|
import { __definePreview as definePreview } from "@storybook/react";
|
|
3
3
|
export * from "@storybook/react";
|
|
4
4
|
export { FrameworkOptions, StorybookConfig, definePreview };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as StorybookConfig } from "../chunk-
|
|
1
|
+
import { n as StorybookConfig } from "../chunk-JjNtH-UF.js";
|
|
2
2
|
|
|
3
3
|
//#region code/frameworks/react-vite/.dts-emit/code/frameworks/react-vite/src/node/index.d.ts
|
|
4
4
|
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2z78wmasupc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2z78wmasupc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2z78wmasupc from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2z78wmasupc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2z78wmasupc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2z78wmasupc.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as StorybookConfig$1 } from "./chunk-
|
|
1
|
+
import { n as StorybookConfig$1 } from "./chunk-JjNtH-UF.js";
|
|
2
2
|
import { PresetProperty } from "storybook/internal/types";
|
|
3
3
|
|
|
4
4
|
//#region code/frameworks/react-vite/.dts-emit/code/frameworks/react-vite/src/preset.d.ts
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2z78wmasupc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2z78wmasupc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2z78wmasupc from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2z78wmasupc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2z78wmasupc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2z78wmasupc.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -33,7 +33,7 @@ var core = {
|
|
|
33
33
|
savePropValueAsString: !0
|
|
34
34
|
})
|
|
35
35
|
), typeof reactDocgenOption == "string") {
|
|
36
|
-
let { reactDocgen } = await import("./_node-chunks/react-docgen-
|
|
36
|
+
let { reactDocgen } = await import("./_node-chunks/react-docgen-UT7MYCPI.js");
|
|
37
37
|
plugins.unshift(
|
|
38
38
|
// If react-docgen is specified, use it for everything, otherwise only use it for non-typescript files
|
|
39
39
|
await reactDocgen({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-vite",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.3",
|
|
4
4
|
"description": "Storybook for React and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.7.0",
|
|
56
56
|
"@rollup/pluginutils": "^5.0.2",
|
|
57
|
-
"@storybook/builder-vite": "11.0.0-alpha.
|
|
58
|
-
"@storybook/react": "11.0.0-alpha.
|
|
57
|
+
"@storybook/builder-vite": "11.0.0-alpha.3",
|
|
58
|
+
"@storybook/react": "11.0.0-alpha.3",
|
|
59
59
|
"empathic": "^2.0.0",
|
|
60
60
|
"magic-string": "^1.1.0",
|
|
61
61
|
"react-docgen": "^8.0.2",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"vite": "^7.0.4"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"react": "^
|
|
72
|
-
"react-dom": "^
|
|
73
|
-
"storybook": "^11.0.0-alpha.
|
|
74
|
-
"typescript": "
|
|
71
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
72
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
73
|
+
"storybook": "^11.0.0-alpha.3",
|
|
74
|
+
"typescript": "^5.9.0 || ^6.0.0",
|
|
75
75
|
"vite": "^6.3.0 || ^7.0.0 || ^8.0.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|