@storybook/react 10.6.0-alpha.3 → 10.6.0-alpha.5

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_zo62u026vml from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_zo62u026vml from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_zo62u026vml from "node:module";
1
+ import CJS_COMPAT_NODE_URL_o9l9ewgtxdb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_o9l9ewgtxdb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_o9l9ewgtxdb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_zo62u026vml.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_zo62u026vml.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_zo62u026vml.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_o9l9ewgtxdb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_o9l9ewgtxdb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_o9l9ewgtxdb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -15,10 +15,10 @@ import {
15
15
  extractArgTypes,
16
16
  path,
17
17
  resolveStoryFileComponents
18
- } from "../_node-chunks/chunk-4F7QVGCG.js";
18
+ } from "../_node-chunks/chunk-3FLTYXW5.js";
19
19
 
20
20
  // src/docgen/docgen-worker.ts
21
- import { STORY_FILE_TEST_REGEXP, getStoryImportPathFromEntry as getStoryImportPathFromEntry2 } from "storybook/internal/common";
21
+ import { createLazyDocgenMiddleware } from "storybook/internal/common";
22
22
 
23
23
  // src/docgen/buildDocgen.ts
24
24
  import { getStoryImportPathFromEntry } from "storybook/internal/common";
@@ -78,26 +78,17 @@ async function buildDocgenPayload(input, context) {
78
78
  }
79
79
 
80
80
  // src/docgen/docgen-worker.ts
81
- var createDocgenProvider = () => {
82
- let managerPromise, getManager = () => (managerPromise || (managerPromise = (async () => {
81
+ var createDocgenProvider = () => createLazyDocgenMiddleware({
82
+ createManager: async () => {
83
83
  try {
84
84
  let ts = await import("typescript");
85
85
  return new ComponentMetaManager(ts);
86
86
  } catch {
87
87
  return;
88
88
  }
89
- })()), managerPromise);
90
- return (nextDocgen) => async (input) => {
91
- let storyImportPath = getStoryImportPathFromEntry2(input.entry);
92
- if (!storyImportPath || !STORY_FILE_TEST_REGEXP.test(storyImportPath))
93
- return nextDocgen(input);
94
- let componentMetaManager = await getManager();
95
- if (!componentMetaManager)
96
- return nextDocgen(input);
97
- let ours = await buildDocgenPayload(input, { componentMetaManager });
98
- return ours ? { ...await nextDocgen(input), ...ours } : nextDocgen(input);
99
- };
100
- };
89
+ },
90
+ extract: (componentMetaManager, input) => buildDocgenPayload(input, { componentMetaManager })
91
+ });
101
92
  export {
102
93
  createDocgenProvider
103
94
  };
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_zo62u026vml from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_zo62u026vml from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_zo62u026vml from "node:module";
1
+ import CJS_COMPAT_NODE_URL_o9l9ewgtxdb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_o9l9ewgtxdb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_o9l9ewgtxdb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_zo62u026vml.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_zo62u026vml.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_zo62u026vml.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_o9l9ewgtxdb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_o9l9ewgtxdb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_o9l9ewgtxdb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -23,7 +23,7 @@ import {
23
23
  parseWithReactDocgen,
24
24
  path,
25
25
  resolveStoryFileComponents
26
- } from "./_node-chunks/chunk-4F7QVGCG.js";
26
+ } from "./_node-chunks/chunk-3FLTYXW5.js";
27
27
 
28
28
  // src/preset.ts
29
29
  import path2, { join as join2 } from "node:path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "10.6.0-alpha.3",
3
+ "version": "10.6.0-alpha.5",
4
4
  "description": "Storybook React renderer",
5
5
  "keywords": [
6
6
  "storybook"
@@ -54,7 +54,7 @@
54
54
  ],
55
55
  "dependencies": {
56
56
  "@storybook/global": "^5.0.0",
57
- "@storybook/react-dom-shim": "10.6.0-alpha.3",
57
+ "@storybook/react-dom-shim": "10.6.0-alpha.5",
58
58
  "react-docgen": "^8.0.2",
59
59
  "react-docgen-typescript": "^2.2.2"
60
60
  },
@@ -87,7 +87,7 @@
87
87
  "@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
88
88
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
89
89
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
90
- "storybook": "^10.6.0-alpha.3",
90
+ "storybook": "^10.6.0-alpha.5",
91
91
  "typescript": ">= 4.9.x"
92
92
  },
93
93
  "peerDependenciesMeta": {