@storybook/react 11.0.0-beta.1 → 11.0.0-beta.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.
- package/dist/_browser-chunks/{chunk-2TQVKMJE.js → chunk-EA5DV32Q.js} +36 -1
- package/dist/_browser-chunks/{chunk-6MBKXM7O.js → chunk-U7XUEUFQ.js} +2 -2
- package/dist/_browser-chunks/{chunk-LGSTPTL6.js → chunk-WWHCZJWM.js} +10 -9
- package/dist/_node-chunks/{chunk-37XDLJI5.js → chunk-2DNUEB5U.js} +18 -17
- package/dist/_node-chunks/{chunk-RVHW3VEA.js → chunk-ASUAJQT5.js} +6 -6
- package/dist/_node-chunks/{chunk-FCIBS77S.js → chunk-BWU7O3KC.js} +7 -7
- package/dist/_node-chunks/{chunk-IYZUDUNZ.js → chunk-DW2HJ23M.js} +7 -7
- package/dist/_node-chunks/{chunk-U53ZMSA3.js → chunk-PXKXGEPO.js} +1716 -515
- package/dist/_node-chunks/{chunk-YNIH7TZQ.js → chunk-QRCEILHM.js} +8 -8
- package/dist/_node-chunks/chunk-TP7UUO2M.js +18 -0
- package/dist/_node-chunks/{chunk-GQOGANUK.js → chunk-VQBUQHU3.js} +11 -13
- package/dist/_node-chunks/{chunk-PPFRYFMF.js → chunk-XIFLZILW.js} +16 -8
- package/dist/_node-chunks/{chunk-FUHORIY7.js → chunk-XQPV7U3R.js} +9 -9
- package/dist/_node-chunks/{extractArgTypesFromComponentFile-EQEZZAHL.js → extractArgTypesFromComponentFile-PKEIPQGN.js} +17 -15
- package/dist/_node-chunks/{extractReactDocgenInfo-COAPYCG6.js → extractReactDocgenInfo-J6CKNSQN.js} +11 -11
- package/dist/_node-chunks/{extractReactTypescriptDocgenInfo-7FFDIBEA.js → extractReactTypescriptDocgenInfo-AJTC3KA3.js} +9 -9
- package/dist/_node-chunks/reactDocgen-YAGNM6ZQ.js +26 -0
- package/dist/builder-docgen.d.ts +2 -2
- package/dist/builder-docgen.js +9 -8
- package/dist/docgen/docgen-worker.js +22 -18
- package/dist/entry-preview-argtypes.js +1 -1
- package/dist/entry-preview-docs.js +1 -1
- package/dist/index.js +3 -3
- package/dist/preset.js +35 -25
- package/dist/preview.js +3 -3
- package/package.json +5 -3
- package/dist/_node-chunks/reactDocgen-6ZJPM2YE.js +0 -26
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
buildComponentDocgenFromResolved,
|
|
14
14
|
posix,
|
|
15
15
|
resolveStoryFileComponents
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PXKXGEPO.js";
|
|
17
17
|
import {
|
|
18
18
|
extractArgTypes
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2DNUEB5U.js";
|
|
20
20
|
|
|
21
21
|
// src/docgen/buildDocgen.ts
|
|
22
22
|
import { getStoryImportPathFromEntry } from "storybook/internal/common";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/docgen-typescript-apis.ts
|
|
14
|
+
var REACT_DOCGEN_TYPESCRIPT_APIS = ["compiler", "native"];
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
REACT_DOCGEN_TYPESCRIPT_APIS
|
|
18
|
+
};
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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
|
-
ComponentMetaManager
|
|
14
|
-
|
|
13
|
+
ComponentMetaManager,
|
|
14
|
+
loadDocgenTypeScript
|
|
15
|
+
} from "./chunk-PXKXGEPO.js";
|
|
15
16
|
|
|
16
17
|
// src/componentManifest/componentMetaManagerSingleton.ts
|
|
17
|
-
import { loadTypeScriptCompilerApi } from "storybook/internal/common";
|
|
18
18
|
import { logger } from "storybook/internal/node-logger";
|
|
19
19
|
var componentMetaManagerPromise;
|
|
20
|
-
function getSharedComponentMetaManager() {
|
|
20
|
+
function getSharedComponentMetaManager(typeScriptSpecifier) {
|
|
21
21
|
return componentMetaManagerPromise || (componentMetaManagerPromise = (async () => {
|
|
22
22
|
try {
|
|
23
|
-
return new ComponentMetaManager(
|
|
24
|
-
await loadTypeScriptCompilerApi(() => import("typescript"))
|
|
25
|
-
);
|
|
23
|
+
return new ComponentMetaManager(await loadDocgenTypeScript(typeScriptSpecifier));
|
|
26
24
|
} catch (err) {
|
|
27
25
|
logger.debug(`[reactComponentMeta] Skipping component metadata extraction: ${err}`);
|
|
28
26
|
return;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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 {
|
|
13
|
+
REACT_DOCGEN_TYPESCRIPT_APIS
|
|
14
|
+
} from "./chunk-TP7UUO2M.js";
|
|
12
15
|
|
|
13
16
|
// src/builder-docgen.ts
|
|
14
17
|
import {
|
|
@@ -19,7 +22,11 @@ import {
|
|
|
19
22
|
var REACT_BUILDER_DOCGEN_PACKAGES = {
|
|
20
23
|
"react-docgen": "^8.0.2",
|
|
21
24
|
"react-docgen-typescript": "^2.2.2",
|
|
22
|
-
|
|
25
|
+
// TEMPORARY(ts-7.1): 0.7 only. 0.9 accepts TypeScript `>=7.1.0-0`; npm resolves optional peers when
|
|
26
|
+
// it checks for conflicts, picks a 7.1 prerelease, and fails to install a project without its own
|
|
27
|
+
// `typescript`. Once TypeScript 7.1.0 is stable, allow 0.8 and 0.9 again and drop `@^0.7.0` from the
|
|
28
|
+
// docs and MIGRATION.md.
|
|
29
|
+
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.7.0",
|
|
23
30
|
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0"
|
|
24
31
|
};
|
|
25
32
|
function getReactBuilderDocgenPackages(reactDocgen, builder) {
|
|
@@ -45,7 +52,8 @@ async function prepareReactBuilderDocgen({
|
|
|
45
52
|
builderDocgen: `typescript.reactDocgen: '${reactDocgen}'`,
|
|
46
53
|
disableBuilderDocgen: "typescript.reactDocgen: false",
|
|
47
54
|
documentation: "https://storybook.js.org/docs/api/main-config/main-config-typescript#reactdocgen",
|
|
48
|
-
note: mode !== reactDocgen ? "`react-docgen-typescript` needs the TypeScript compiler API, which your `typescript` package does not have, so builder docgen uses `react-docgen` instead." : void 0
|
|
55
|
+
note: mode !== reactDocgen ? "`react-docgen-typescript` needs the TypeScript compiler API, which your `typescript` package does not have, so builder docgen uses `react-docgen` instead." : void 0,
|
|
56
|
+
apis: REACT_DOCGEN_TYPESCRIPT_APIS
|
|
49
57
|
})).length > 0 ? void 0 : mode;
|
|
50
58
|
}
|
|
51
59
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
cachedReadFileSync,
|
|
15
15
|
cachedResolveImport,
|
|
16
16
|
matchPath
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DW2HJ23M.js";
|
|
18
18
|
import {
|
|
19
19
|
require_dist
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BWU7O3KC.js";
|
|
21
21
|
import {
|
|
22
22
|
__commonJS,
|
|
23
23
|
__require,
|
|
24
24
|
__toESM
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ASUAJQT5.js";
|
|
26
26
|
|
|
27
27
|
// ../../../node_modules/resolve/lib/homedir.js
|
|
28
28
|
var require_homedir = __commonJS({
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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
|
getSharedComponentMetaManager
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VQBUQHU3.js";
|
|
15
15
|
import {
|
|
16
16
|
extractArgTypesFromComponentMeta
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-QRCEILHM.js";
|
|
18
|
+
import "./chunk-PXKXGEPO.js";
|
|
19
|
+
import "./chunk-TP7UUO2M.js";
|
|
20
|
+
import "./chunk-DW2HJ23M.js";
|
|
21
|
+
import "./chunk-2DNUEB5U.js";
|
|
22
|
+
import "./chunk-BWU7O3KC.js";
|
|
23
|
+
import "./chunk-ASUAJQT5.js";
|
|
23
24
|
|
|
24
25
|
// src/docgen/extractArgTypesFromComponentFile.ts
|
|
25
26
|
async function extractArgTypesFromComponentFile({
|
|
26
27
|
componentFilePath,
|
|
27
|
-
componentExportName = "default"
|
|
28
|
+
componentExportName = "default",
|
|
29
|
+
typeScriptSpecifier
|
|
28
30
|
}) {
|
|
29
|
-
let manager = await getSharedComponentMetaManager();
|
|
31
|
+
let manager = await getSharedComponentMetaManager(typeScriptSpecifier);
|
|
30
32
|
if (!manager)
|
|
31
33
|
return null;
|
|
32
34
|
let component = {
|
package/dist/_node-chunks/{extractReactDocgenInfo-COAPYCG6.js → extractReactDocgenInfo-J6CKNSQN.js}
RENAMED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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
|
parseWithReactDocgen
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XQPV7U3R.js";
|
|
15
15
|
import {
|
|
16
16
|
cachedReadFileSync
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DW2HJ23M.js";
|
|
18
18
|
import {
|
|
19
19
|
extractArgTypes
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-2DNUEB5U.js";
|
|
21
|
+
import "./chunk-BWU7O3KC.js";
|
|
22
|
+
import "./chunk-ASUAJQT5.js";
|
|
23
23
|
|
|
24
24
|
// src/componentManifest/reactDocgen/extractReactDocgenInfo.ts
|
|
25
25
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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
|
extractArgTypes
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-2DNUEB5U.js";
|
|
15
|
+
import "./chunk-BWU7O3KC.js";
|
|
16
|
+
import "./chunk-ASUAJQT5.js";
|
|
17
17
|
|
|
18
18
|
// src/componentManifest/reactDocgen/extractReactTypescriptDocgenInfo.ts
|
|
19
19
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
getMatchingDocgen,
|
|
14
|
+
getReactDocgen,
|
|
15
|
+
getReactDocgenImporter,
|
|
16
|
+
parseWithReactDocgen
|
|
17
|
+
} from "./chunk-XQPV7U3R.js";
|
|
18
|
+
import "./chunk-DW2HJ23M.js";
|
|
19
|
+
import "./chunk-BWU7O3KC.js";
|
|
20
|
+
import "./chunk-ASUAJQT5.js";
|
|
21
|
+
export {
|
|
22
|
+
getMatchingDocgen,
|
|
23
|
+
getReactDocgen,
|
|
24
|
+
getReactDocgenImporter,
|
|
25
|
+
parseWithReactDocgen
|
|
26
|
+
};
|
package/dist/builder-docgen.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type ReactDocgenConfig = 'react-docgen' | 'react-docgen-typescript' | false;
|
|
|
13
13
|
declare const REACT_BUILDER_DOCGEN_PACKAGES: {
|
|
14
14
|
readonly 'react-docgen': '^8.0.2';
|
|
15
15
|
readonly 'react-docgen-typescript': '^2.2.2';
|
|
16
|
-
readonly '@joshwooding/vite-plugin-react-docgen-typescript': '^0.7.0
|
|
16
|
+
readonly '@joshwooding/vite-plugin-react-docgen-typescript': '^0.7.0';
|
|
17
17
|
readonly '@storybook/react-docgen-typescript-plugin': '1.0.6--canary.9.0c3f3b7.0';
|
|
18
18
|
};
|
|
19
19
|
type ReactBuilderDocgenPackage = keyof typeof REACT_BUILDER_DOCGEN_PACKAGES;
|
|
@@ -45,7 +45,7 @@ declare function prepareReactBuilderDocgen({
|
|
|
45
45
|
reactDocgen: Exclude<ReactDocgenConfig, false>;
|
|
46
46
|
builder: 'vite' | 'webpack'; /** Resolve from the framework package, which declares the packages as optional peers. */
|
|
47
47
|
resolve: (specifier: string) => string;
|
|
48
|
-
options: Pick<Options, 'configDir'>;
|
|
48
|
+
options: Pick<Options, 'configDir' | 'presets'>;
|
|
49
49
|
}): Promise<Exclude<ReactDocgenConfig, false> | undefined>;
|
|
50
50
|
//#endregion
|
|
51
51
|
export { REACT_BUILDER_DOCGEN_PACKAGES, ReactBuilderDocgenPackage, getReactBuilderDocgenPackages, isReactBuilderDocgenPackageInstalled, prepareReactBuilderDocgen };
|
package/dist/builder-docgen.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
getReactBuilderDocgenPackages,
|
|
15
15
|
isReactBuilderDocgenPackageInstalled,
|
|
16
16
|
prepareReactBuilderDocgen
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
18
|
-
import "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-XIFLZILW.js";
|
|
18
|
+
import "./_node-chunks/chunk-TP7UUO2M.js";
|
|
19
|
+
import "./_node-chunks/chunk-ASUAJQT5.js";
|
|
19
20
|
export {
|
|
20
21
|
REACT_BUILDER_DOCGEN_PACKAGES,
|
|
21
22
|
getReactBuilderDocgenPackages,
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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
|
buildDocgenPayload
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-QRCEILHM.js";
|
|
15
15
|
import {
|
|
16
|
-
ComponentMetaManager
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import "../_node-chunks/chunk-
|
|
20
|
-
import "../_node-chunks/chunk-
|
|
21
|
-
import "../_node-chunks/chunk-
|
|
16
|
+
ComponentMetaManager,
|
|
17
|
+
loadDocgenTypeScript
|
|
18
|
+
} from "../_node-chunks/chunk-PXKXGEPO.js";
|
|
19
|
+
import "../_node-chunks/chunk-TP7UUO2M.js";
|
|
20
|
+
import "../_node-chunks/chunk-DW2HJ23M.js";
|
|
21
|
+
import "../_node-chunks/chunk-2DNUEB5U.js";
|
|
22
|
+
import "../_node-chunks/chunk-BWU7O3KC.js";
|
|
23
|
+
import "../_node-chunks/chunk-ASUAJQT5.js";
|
|
22
24
|
|
|
23
25
|
// src/docgen/docgen-worker.ts
|
|
24
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
createLazyDocgenMiddleware
|
|
28
|
+
} from "storybook/internal/common";
|
|
25
29
|
import { logger } from "storybook/internal/node-logger";
|
|
26
|
-
var createDocgenProvider = (
|
|
30
|
+
var createDocgenProvider = ({
|
|
31
|
+
typeScriptSpecifier
|
|
32
|
+
} = {}) => createLazyDocgenMiddleware({
|
|
27
33
|
createManager: async () => {
|
|
28
34
|
try {
|
|
29
|
-
return new ComponentMetaManager(
|
|
30
|
-
await loadTypeScriptCompilerApi(() => import("typescript"))
|
|
31
|
-
);
|
|
35
|
+
return new ComponentMetaManager(await loadDocgenTypeScript(typeScriptSpecifier));
|
|
32
36
|
} catch (err) {
|
|
33
37
|
logger.warn(`React docgen is unavailable. ${err instanceof Error ? err.message : err}`);
|
|
34
38
|
return;
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
applyDecorators,
|
|
3
3
|
decorators,
|
|
4
4
|
parameters
|
|
5
|
-
} from "./_browser-chunks/chunk-
|
|
5
|
+
} from "./_browser-chunks/chunk-EA5DV32Q.js";
|
|
6
6
|
import "./_browser-chunks/chunk-DDIRQRCA.js";
|
|
7
7
|
import "./_browser-chunks/chunk-B3FR4PBN.js";
|
|
8
8
|
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__definePreview
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-U7XUEUFQ.js";
|
|
4
4
|
import {
|
|
5
5
|
entry_preview_exports,
|
|
6
6
|
renderToCanvas
|
|
7
7
|
} from "./_browser-chunks/chunk-I62VTYU3.js";
|
|
8
8
|
import {
|
|
9
9
|
entry_preview_argtypes_exports
|
|
10
|
-
} from "./_browser-chunks/chunk-
|
|
11
|
-
import "./_browser-chunks/chunk-
|
|
10
|
+
} from "./_browser-chunks/chunk-WWHCZJWM.js";
|
|
11
|
+
import "./_browser-chunks/chunk-EA5DV32Q.js";
|
|
12
12
|
import "./_browser-chunks/chunk-DDIRQRCA.js";
|
|
13
13
|
import "./_browser-chunks/chunk-B3FR4PBN.js";
|
|
14
14
|
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
package/dist/preset.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.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
|
REACT_BUILDER_DOCGEN_PACKAGES
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-XIFLZILW.js";
|
|
15
15
|
import {
|
|
16
16
|
getSharedComponentMetaManager
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-VQBUQHU3.js";
|
|
18
18
|
import {
|
|
19
19
|
buildReactComponentDocgenFromResolved,
|
|
20
20
|
buildStoryDocsFromResolved,
|
|
@@ -24,17 +24,21 @@ import {
|
|
|
24
24
|
join,
|
|
25
25
|
posix,
|
|
26
26
|
resolveStoryFileComponents
|
|
27
|
-
} from "./_node-chunks/chunk-
|
|
27
|
+
} from "./_node-chunks/chunk-PXKXGEPO.js";
|
|
28
|
+
import {
|
|
29
|
+
REACT_DOCGEN_TYPESCRIPT_APIS
|
|
30
|
+
} from "./_node-chunks/chunk-TP7UUO2M.js";
|
|
28
31
|
import {
|
|
29
32
|
invalidateCache
|
|
30
|
-
} from "./_node-chunks/chunk-
|
|
31
|
-
import "./_node-chunks/chunk-
|
|
33
|
+
} from "./_node-chunks/chunk-DW2HJ23M.js";
|
|
34
|
+
import "./_node-chunks/chunk-ASUAJQT5.js";
|
|
32
35
|
|
|
33
36
|
// src/preset.ts
|
|
34
37
|
import path2, { join as join3 } from "node:path";
|
|
35
38
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
36
39
|
import {
|
|
37
40
|
getProjectRoot,
|
|
41
|
+
getTypeScriptSpecifierForDocgen as getTypeScriptSpecifierForDocgen3,
|
|
38
42
|
isModuleNotFoundError,
|
|
39
43
|
isTypeScriptReadyForDocgen
|
|
40
44
|
} from "storybook/internal/common";
|
|
@@ -279,6 +283,7 @@ var reactResolveAlias = ({ react, reactDom }) => ({
|
|
|
279
283
|
// src/componentManifest/generator.ts
|
|
280
284
|
import {
|
|
281
285
|
getStoryImportPathFromEntry,
|
|
286
|
+
getTypeScriptSpecifierForDocgen,
|
|
282
287
|
selectComponentEntriesByComponentId
|
|
283
288
|
} from "storybook/internal/common";
|
|
284
289
|
var manifests = async (existingManifests = {}, options) => {
|
|
@@ -294,7 +299,7 @@ var manifests = async (existingManifests = {}, options) => {
|
|
|
294
299
|
};
|
|
295
300
|
let docgenEngine = features2?.experimentalReactComponentMeta ? "react-component-meta" : typescriptOptions.reactDocgen || "react-docgen";
|
|
296
301
|
invalidateCache(), invalidateParser();
|
|
297
|
-
let startTime = performance.now(), manager = docgenEngine === "react-component-meta" ? await getSharedComponentMetaManager() : void 0, entriesByUniqueComponent = [
|
|
302
|
+
let startTime = performance.now(), manager = docgenEngine === "react-component-meta" ? await getSharedComponentMetaManager(await getTypeScriptSpecifierForDocgen(options)) : void 0, entriesByUniqueComponent = [
|
|
298
303
|
...selectComponentEntriesByComponentId(manifestEntries).values()
|
|
299
304
|
], resolvedEntries = await Promise.all(
|
|
300
305
|
entriesByUniqueComponent.map(async (entry) => {
|
|
@@ -372,7 +377,7 @@ var enrichCsf = async (input, options) => {
|
|
|
372
377
|
return;
|
|
373
378
|
let { format: format3 } = await getPrettier(), code, snippet;
|
|
374
379
|
try {
|
|
375
|
-
code = getCodeSnippet(csfSource, key, csfSource._meta?.component).
|
|
380
|
+
code = getCodeSnippet(csfSource, key, csfSource._meta?.component).snippet;
|
|
376
381
|
} catch (e) {
|
|
377
382
|
if (!(e instanceof Error))
|
|
378
383
|
return;
|
|
@@ -400,12 +405,14 @@ var enrichCsf = async (input, options) => {
|
|
|
400
405
|
|
|
401
406
|
// src/docgen/preset.ts
|
|
402
407
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
{
|
|
406
|
-
moduleSpecifier: fileURLToPath2(import.meta.resolve("@storybook/react/internal/docgen-worker"))
|
|
407
|
-
|
|
408
|
-
|
|
408
|
+
import { getTypeScriptSpecifierForDocgen as getTypeScriptSpecifierForDocgen2 } from "storybook/internal/common";
|
|
409
|
+
var experimental_docgenProvider = async (existing = [], options) => {
|
|
410
|
+
let descriptor = {
|
|
411
|
+
moduleSpecifier: fileURLToPath2(import.meta.resolve("@storybook/react/internal/docgen-worker")),
|
|
412
|
+
options: { typeScriptSpecifier: await getTypeScriptSpecifierForDocgen2(options) }
|
|
413
|
+
};
|
|
414
|
+
return [...existing, descriptor];
|
|
415
|
+
};
|
|
409
416
|
|
|
410
417
|
// src/docgen/story-docs-preset.ts
|
|
411
418
|
import { STORY_FILE_TEST_REGEXP, getStoryImportPathFromEntry as getStoryImportPathFromEntry3 } from "storybook/internal/common";
|
|
@@ -435,7 +442,8 @@ async function buildStoryDocsPayload(input, context) {
|
|
|
435
442
|
csf,
|
|
436
443
|
componentName,
|
|
437
444
|
component,
|
|
438
|
-
allComponents
|
|
445
|
+
allComponents,
|
|
446
|
+
withTemplate: !0
|
|
439
447
|
});
|
|
440
448
|
}
|
|
441
449
|
|
|
@@ -460,6 +468,7 @@ var experimental_storyDocsProvider = async (nextStoryDocs, options) => {
|
|
|
460
468
|
var isDocgenProviderEnabled = async (_existing, options) => {
|
|
461
469
|
let { reactDocgen } = await options.presets?.apply("typescript", {}) ?? {};
|
|
462
470
|
return isTypeScriptReadyForDocgen((specifier) => import.meta.resolve(specifier), options, {
|
|
471
|
+
apis: REACT_DOCGEN_TYPESCRIPT_APIS,
|
|
463
472
|
builderDocgenFallback: reactDocgen === !1 ? void 0 : { packageName: "react-docgen", range: REACT_BUILDER_DOCGEN_PACKAGES["react-docgen"] }
|
|
464
473
|
});
|
|
465
474
|
}, features = async (existing) => ({
|
|
@@ -500,15 +509,16 @@ async function webpack(config = {}, options) {
|
|
|
500
509
|
return target ? aliasReactInWebpack(config, target) : config;
|
|
501
510
|
}
|
|
502
511
|
async function internal_getArgTypesData(_input, options) {
|
|
503
|
-
let { componentFilePath, componentExportName, presets } = options ?? {};
|
|
512
|
+
let { componentFilePath, componentExportName, presets, configDir } = options ?? {};
|
|
504
513
|
if (!componentFilePath)
|
|
505
514
|
return null;
|
|
506
515
|
let absoluteComponentFilePath = path2.isAbsolute(componentFilePath) ? componentFilePath : join3(getProjectRoot(), componentFilePath);
|
|
507
516
|
if ((await presets?.apply("features", {}))?.docgenServer) {
|
|
508
|
-
let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-
|
|
517
|
+
let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-PKEIPQGN.js");
|
|
509
518
|
return extractArgTypesFromComponentFile({
|
|
510
519
|
componentFilePath: absoluteComponentFilePath,
|
|
511
|
-
componentExportName
|
|
520
|
+
componentExportName,
|
|
521
|
+
typeScriptSpecifier: configDir && presets ? await getTypeScriptSpecifierForDocgen3({ configDir, presets }) : void 0
|
|
512
522
|
});
|
|
513
523
|
}
|
|
514
524
|
let typescriptOptions = {};
|
|
@@ -523,14 +533,14 @@ async function internal_getArgTypesData(_input, options) {
|
|
|
523
533
|
let argTypesData;
|
|
524
534
|
try {
|
|
525
535
|
if (reactDocgen === "react-docgen-typescript") {
|
|
526
|
-
let { extractArgTypesFromDocgenTypescript } = await import("./_node-chunks/extractReactTypescriptDocgenInfo-
|
|
536
|
+
let { extractArgTypesFromDocgenTypescript } = await import("./_node-chunks/extractReactTypescriptDocgenInfo-AJTC3KA3.js");
|
|
527
537
|
argTypesData = await extractArgTypesFromDocgenTypescript({
|
|
528
538
|
componentFilePath: absoluteComponentFilePath,
|
|
529
539
|
componentExportName,
|
|
530
540
|
reactDocgenTypescriptOptions
|
|
531
541
|
});
|
|
532
542
|
} else {
|
|
533
|
-
let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-
|
|
543
|
+
let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-J6CKNSQN.js");
|
|
534
544
|
argTypesData = extractArgTypesFromDocgen({
|
|
535
545
|
componentFilePath: absoluteComponentFilePath,
|
|
536
546
|
componentExportName
|
package/dist/preview.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__definePreview
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-U7XUEUFQ.js";
|
|
4
4
|
import "./_browser-chunks/chunk-I62VTYU3.js";
|
|
5
|
-
import "./_browser-chunks/chunk-
|
|
6
|
-
import "./_browser-chunks/chunk-
|
|
5
|
+
import "./_browser-chunks/chunk-WWHCZJWM.js";
|
|
6
|
+
import "./_browser-chunks/chunk-EA5DV32Q.js";
|
|
7
7
|
import "./_browser-chunks/chunk-DDIRQRCA.js";
|
|
8
8
|
import "./_browser-chunks/chunk-B3FR4PBN.js";
|
|
9
9
|
import "./_browser-chunks/chunk-UAWMPV5J.js";
|