@storybook/react 10.6.0-alpha.7 → 10.6.0-alpha.9
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0ux9l9xgyxr from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0ux9l9xgyxr from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0ux9l9xgyxr from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0ux9l9xgyxr.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0ux9l9xgyxr.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0ux9l9xgyxr.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13095,10 +13095,6 @@ function up2(name, options) {
|
|
|
13095
13095
|
}
|
|
13096
13096
|
|
|
13097
13097
|
// src/componentManifest/utils.ts
|
|
13098
|
-
var groupBy = (items, keySelector) => items.reduce((acc = {}, item, index) => {
|
|
13099
|
-
let key = keySelector(item, index);
|
|
13100
|
-
return Array.isArray(acc[key]) || (acc[key] = []), acc[key].push(item), acc;
|
|
13101
|
-
}, {});
|
|
13102
13098
|
function groupByToMap(items, getKey) {
|
|
13103
13099
|
let result = /* @__PURE__ */ new Map();
|
|
13104
13100
|
for (let item of items) {
|
|
@@ -13179,6 +13175,7 @@ import {
|
|
|
13179
13175
|
import * as path from "path";
|
|
13180
13176
|
|
|
13181
13177
|
// src/componentManifest/componentMeta/componentMetaExtractor.ts
|
|
13178
|
+
import { extractComponentJsDocInfo } from "storybook/internal/component-meta";
|
|
13182
13179
|
var LARGE_SOURCE_THRESHOLD = 30, MAX_UNWRAP_DEPTH = 5, MAX_SERIALIZATION_DEPTH = 5;
|
|
13183
13180
|
function isLiteralType(type) {
|
|
13184
13181
|
return type.isStringLiteral() || type.isNumberLiteral();
|
|
@@ -13679,18 +13676,6 @@ function computeDisplayName({
|
|
|
13679
13676
|
let exportName = exportSymbol.getName();
|
|
13680
13677
|
return exportName === "default" ? resolvedName && resolvedName !== "default" && resolvedName !== "__function" ? resolvedName : void 0 : exportName;
|
|
13681
13678
|
}
|
|
13682
|
-
function extractComponentJsDocTags(typescript, checker, symbol) {
|
|
13683
|
-
let tags = symbol.getJsDocTags(checker);
|
|
13684
|
-
if (tags.length === 0)
|
|
13685
|
-
return;
|
|
13686
|
-
let groupedTags = groupBy(tags, (tag) => tag.name);
|
|
13687
|
-
return Object.fromEntries(
|
|
13688
|
-
Object.entries(groupedTags).map(([name, grouped]) => [
|
|
13689
|
-
name,
|
|
13690
|
-
(grouped ?? []).map((tag) => typescript.displayPartsToString(tag.text ?? []).trim())
|
|
13691
|
-
])
|
|
13692
|
-
);
|
|
13693
|
-
}
|
|
13694
13679
|
function serializeComponentDoc(typescript, checker, {
|
|
13695
13680
|
sourceFile,
|
|
13696
13681
|
resolvedComponent,
|
|
@@ -13757,7 +13742,7 @@ function serializeComponentDoc(typescript, checker, {
|
|
|
13757
13742
|
let displayName = (isMemberSelection ? displayNameOverride : void 0) ?? computeDisplayName({
|
|
13758
13743
|
exportSymbol,
|
|
13759
13744
|
resolvedSymbol: resolved
|
|
13760
|
-
}) ?? displayNameOverride,
|
|
13745
|
+
}) ?? displayNameOverride, resolvedJsDocInfo = extractComponentJsDocInfo(typescript, checker, resolved), description = resolvedJsDocInfo.description, selectedJsDocTags = resolvedJsDocInfo.jsDocTags, exportResolved = exportSymbol && exportSymbol !== resolved ? resolveAliasedSymbol(typescript, checker, exportSymbol) : void 0, exportJsDocTags = exportResolved ? extractComponentJsDocInfo(typescript, checker, exportResolved).jsDocTags : void 0, jsDocTags = selectedJsDocTags?.import || !exportJsDocTags?.import ? selectedJsDocTags : {
|
|
13761
13746
|
...selectedJsDocTags ?? {},
|
|
13762
13747
|
import: exportJsDocTags.import
|
|
13763
13748
|
};
|
|
@@ -15327,7 +15312,11 @@ var import_ts_dedent2 = __toESM(require_dist(), 1), TsconfigPaths = __toESM(requ
|
|
|
15327
15312
|
import { existsSync as existsSync2 } from "node:fs";
|
|
15328
15313
|
import { dirname as dirname3, sep } from "node:path";
|
|
15329
15314
|
import { babelParse, types as t } from "storybook/internal/babel";
|
|
15330
|
-
import {
|
|
15315
|
+
import {
|
|
15316
|
+
findTsconfigPathForPath,
|
|
15317
|
+
getTsconfigPathsBaseDir,
|
|
15318
|
+
supportedExtensions as supportedExtensions2
|
|
15319
|
+
} from "storybook/internal/common";
|
|
15331
15320
|
import { extractJSDocInfo } from "storybook/internal/csf-tools";
|
|
15332
15321
|
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
15333
15322
|
import {
|
|
@@ -15497,11 +15486,11 @@ function getMatchingDocgen(docgens, component) {
|
|
|
15497
15486
|
function matchPath(id, importerPath) {
|
|
15498
15487
|
importerPath ??= process.cwd();
|
|
15499
15488
|
let tsconfig = getTsConfig(importerPath);
|
|
15500
|
-
return tsconfig.resultType === "success" ? TsconfigPaths.createMatchPath(
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
"main"
|
|
15504
|
-
|
|
15489
|
+
return tsconfig.resultType === "success" ? TsconfigPaths.createMatchPath(
|
|
15490
|
+
getTsconfigPathsBaseDir(tsconfig.configFileAbsolutePath),
|
|
15491
|
+
tsconfig.paths,
|
|
15492
|
+
["browser", "module", "main"]
|
|
15493
|
+
)(id, void 0, void 0, supportedExtensions2) ?? id : id;
|
|
15505
15494
|
}
|
|
15506
15495
|
var getTsConfig = cached(
|
|
15507
15496
|
(path2) => {
|
|
@@ -16368,7 +16357,7 @@ function normalizeFileName(typescript, fileName) {
|
|
|
16368
16357
|
|
|
16369
16358
|
// src/componentManifest/resolveComponents.ts
|
|
16370
16359
|
import { recast } from "storybook/internal/babel";
|
|
16371
|
-
import { storyNameFromExport } from "storybook/internal/csf";
|
|
16360
|
+
import { storyNameFromExport } from "storybook/internal/csf/csf-utils";
|
|
16372
16361
|
import {
|
|
16373
16362
|
createStoryArgsResolver as createStoryArgsResolver2,
|
|
16374
16363
|
extractStoryJSDocInfo,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0ux9l9xgyxr from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0ux9l9xgyxr from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0ux9l9xgyxr from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0ux9l9xgyxr.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0ux9l9xgyxr.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0ux9l9xgyxr.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
extractArgTypes,
|
|
16
16
|
posix,
|
|
17
17
|
resolveStoryFileComponents
|
|
18
|
-
} from "../_node-chunks/chunk-
|
|
18
|
+
} from "../_node-chunks/chunk-S2KVNUG4.js";
|
|
19
19
|
|
|
20
20
|
// src/docgen/docgen-worker.ts
|
|
21
21
|
import { createLazyDocgenMiddleware } from "storybook/internal/common";
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0ux9l9xgyxr from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0ux9l9xgyxr from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0ux9l9xgyxr from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0ux9l9xgyxr.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0ux9l9xgyxr.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0ux9l9xgyxr.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
parseWithReactDocgen,
|
|
23
23
|
posix,
|
|
24
24
|
resolveStoryFileComponents
|
|
25
|
-
} from "./_node-chunks/chunk-
|
|
25
|
+
} from "./_node-chunks/chunk-S2KVNUG4.js";
|
|
26
26
|
|
|
27
27
|
// src/preset.ts
|
|
28
28
|
import path2, { join as join3 } 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
|
+
"version": "10.6.0-alpha.9",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@storybook/global": "^5.0.0",
|
|
52
|
-
"@storybook/react-dom-shim": "10.6.0-alpha.
|
|
52
|
+
"@storybook/react-dom-shim": "10.6.0-alpha.9",
|
|
53
53
|
"react-docgen": "^8.0.2",
|
|
54
54
|
"react-docgen-typescript": "^2.2.2"
|
|
55
55
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
83
83
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
84
84
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
85
|
-
"storybook": "^10.6.0-alpha.
|
|
85
|
+
"storybook": "^10.6.0-alpha.9",
|
|
86
86
|
"typescript": ">= 4.9.x"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|