@storybook/react-vite 11.0.0-alpha.1 → 11.0.0-alpha.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.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ei9vo5m4b0p from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ei9vo5m4b0p from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ei9vo5m4b0p from "node:module";
1
+ import CJS_COMPAT_NODE_URL_19a5hkkoxve from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_19a5hkkoxve from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_19a5hkkoxve from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ei9vo5m4b0p.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ei9vo5m4b0p.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ei9vo5m4b0p.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_19a5hkkoxve.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_19a5hkkoxve.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_19a5hkkoxve.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 matchPath = createTsconfigMatchPath(id), docgenResults = parse(src, {
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-CJ1Nc_eA.js";
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 };
@@ -1,4 +1,4 @@
1
- import { n as StorybookConfig } from "../chunk-CJ1Nc_eA.js";
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;
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ei9vo5m4b0p from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ei9vo5m4b0p from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ei9vo5m4b0p from "node:module";
1
+ import CJS_COMPAT_NODE_URL_19a5hkkoxve from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_19a5hkkoxve from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_19a5hkkoxve from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ei9vo5m4b0p.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ei9vo5m4b0p.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ei9vo5m4b0p.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_19a5hkkoxve.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_19a5hkkoxve.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_19a5hkkoxve.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-CJ1Nc_eA.js";
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 CJS_COMPAT_NODE_URL_ei9vo5m4b0p from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ei9vo5m4b0p from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ei9vo5m4b0p from "node:module";
1
+ import CJS_COMPAT_NODE_URL_19a5hkkoxve from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_19a5hkkoxve from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_19a5hkkoxve from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ei9vo5m4b0p.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ei9vo5m4b0p.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ei9vo5m4b0p.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_19a5hkkoxve.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_19a5hkkoxve.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_19a5hkkoxve.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-SMQRH3AW.js");
36
+ let { reactDocgen } = await import("./_node-chunks/react-docgen-5EM6RLGK.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.1",
3
+ "version": "11.0.0-alpha.2",
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.1",
58
- "@storybook/react": "11.0.0-alpha.1",
57
+ "@storybook/builder-vite": "11.0.0-alpha.2",
58
+ "@storybook/react": "11.0.0-alpha.2",
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": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
72
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
73
- "storybook": "^11.0.0-alpha.1",
74
- "typescript": ">= 4.9.x",
71
+ "react": "^18.0.0 || ^19.0.0",
72
+ "react-dom": "^18.0.0 || ^19.0.0",
73
+ "storybook": "^11.0.0-alpha.2",
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": {