@storybook/angular-vite 11.0.0-alpha.7 → 11.0.0-alpha.8
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/{chunk-3TMNUOKB.js → chunk-E3INC42D.js} +7 -7
- package/dist/_node-chunks/{chunk-JCPXXM2Q.js → chunk-ELK5QDJM.js} +6 -6
- package/dist/_node-chunks/{chunk-SYNVOJIG.js → chunk-FIWIIC4E.js} +7 -7
- package/dist/_node-chunks/{story-docs-template-analysis-DSYAHFCQ.js → story-docs-template-analysis-RYLJZDK3.js} +6 -6
- package/dist/builders/build-storybook/index.js +8 -8
- package/dist/builders/start-storybook/index.js +8 -8
- package/dist/docgen/docgen-worker.js +154 -50
- package/dist/node/index.js +6 -6
- package/dist/node/vitest.js +6 -6
- package/dist/preset.js +148 -115
- package/package.json +5 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -26,7 +26,7 @@ var resolveMetaComponent = createMetaComponentResolver(), storyImportResolver =
|
|
|
26
26
|
function parseStoryFile(storyFilePath, title) {
|
|
27
27
|
try {
|
|
28
28
|
let source = readFileSync(storyFilePath, "utf8");
|
|
29
|
-
return loadCsf(source, { makeTitle: () => title }).parse();
|
|
29
|
+
return loadCsf(source, { makeTitle: () => title, fileName: storyFilePath }).parse();
|
|
30
30
|
} catch {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.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
|
up
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ELK5QDJM.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/empathic/package.mjs
|
|
17
17
|
function up2(options) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
printErrorDetails,
|
|
17
17
|
requireBuilderTarget,
|
|
18
18
|
up
|
|
19
|
-
} from "../../_node-chunks/chunk-
|
|
19
|
+
} from "../../_node-chunks/chunk-FIWIIC4E.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveTsconfig
|
|
22
|
-
} from "../../_node-chunks/chunk-
|
|
22
|
+
} from "../../_node-chunks/chunk-ELK5QDJM.js";
|
|
23
23
|
|
|
24
24
|
// src/builders/build-storybook/index.ts
|
|
25
25
|
import { readFileSync } from "node:fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
printErrorDetails,
|
|
17
17
|
requireBuilderTarget,
|
|
18
18
|
up
|
|
19
|
-
} from "../../_node-chunks/chunk-
|
|
19
|
+
} from "../../_node-chunks/chunk-FIWIIC4E.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveTsconfig
|
|
22
|
-
} from "../../_node-chunks/chunk-
|
|
22
|
+
} from "../../_node-chunks/chunk-ELK5QDJM.js";
|
|
23
23
|
|
|
24
24
|
// src/builders/start-storybook/index.ts
|
|
25
25
|
import { readFileSync } from "node:fs";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.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
|
resolveStoryComponent
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-E3INC42D.js";
|
|
15
15
|
|
|
16
16
|
// src/docgen/docgen-worker.ts
|
|
17
17
|
import { STORY_FILE_TEST_REGEXP, getStoryImportPathFromEntry as getStoryImportPathFromEntry2 } from "storybook/internal/common";
|
|
18
18
|
import { logger as logger4 } from "storybook/internal/node-logger";
|
|
19
19
|
|
|
20
20
|
// ../../lib/angular-cm/dist/index.js
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
21
|
+
import CJS_COMPAT_NODE_URL_e6o4wgfr0te from "node:url";
|
|
22
|
+
import CJS_COMPAT_NODE_PATH_e6o4wgfr0te from "node:path";
|
|
23
|
+
import CJS_COMPAT_NODE_MODULE_e6o4wgfr0te from "node:module";
|
|
24
24
|
import { isInNodeModules } from "storybook/internal/common";
|
|
25
25
|
import {
|
|
26
26
|
ComponentMetaManager,
|
|
@@ -36,7 +36,7 @@ import { logger as logger3 } from "storybook/internal/node-logger";
|
|
|
36
36
|
import * as path from "node:path";
|
|
37
37
|
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
38
38
|
import { logger } from "storybook/internal/node-logger";
|
|
39
|
-
var __filename =
|
|
39
|
+
var __filename = CJS_COMPAT_NODE_URL_e6o4wgfr0te.fileURLToPath(import.meta.url), __dirname = CJS_COMPAT_NODE_PATH_e6o4wgfr0te.dirname(__filename), require2 = CJS_COMPAT_NODE_MODULE_e6o4wgfr0te.createRequire(import.meta.url), resolvedSymbol = (ctx, node) => {
|
|
40
40
|
let symbol = ctx.checker.getSymbolAtLocation(node);
|
|
41
41
|
return symbol && symbol.flags & ctx.ts.SymbolFlags.Alias ? ctx.checker.getAliasedSymbol(symbol) : symbol;
|
|
42
42
|
}, resolvedNameSymbol = (ctx, name) => {
|
|
@@ -386,13 +386,10 @@ ${detailLines(lines).join(`
|
|
|
386
386
|
}), argTypes;
|
|
387
387
|
}, isAngularCoreOrUnresolved = (ctx, node) => {
|
|
388
388
|
let symbol = resolvedSymbol(ctx, node);
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
(declaration) => declaration.getSourceFile().fileName.includes("@angular/core")
|
|
394
|
-
) : !0;
|
|
395
|
-
}, importedName = (ctx, target) => {
|
|
389
|
+
return !symbol?.declarations?.length || isDeclaredInAngularCore(symbol);
|
|
390
|
+
}, isDeclaredInAngularCore = (symbol) => symbol.declarations?.some(
|
|
391
|
+
(declaration) => declaration.getSourceFile().fileName.includes("/@angular/core/")
|
|
392
|
+
) ?? !1, importedName = (ctx, target) => {
|
|
396
393
|
let symbol = resolvedSymbol(ctx, target);
|
|
397
394
|
return symbol?.declarations?.length ? symbol.name : ctx.ts.isIdentifier(target) ? ctx.checker.getSymbolAtLocation(target)?.declarations?.find(ctx.ts.isImportSpecifier)?.propertyName?.text ?? target.text : target.name.text;
|
|
398
395
|
}, getDecorators = (ctx, node) => {
|
|
@@ -469,7 +466,57 @@ ${detailLines(lines).join(`
|
|
|
469
466
|
}
|
|
470
467
|
}
|
|
471
468
|
return entries;
|
|
472
|
-
},
|
|
469
|
+
}, PRE_STANDALONE_ARGUMENT_COUNT = 7, readComponentDeclaration = (ctx, classNode) => {
|
|
470
|
+
if (!classNode.getSourceFile().isDeclarationFile)
|
|
471
|
+
return;
|
|
472
|
+
let type = staticCmpType(ctx, classNode), typeArguments = type?.typeArguments;
|
|
473
|
+
if (!type || !typeArguments || typeArguments.length < PRE_STANDALONE_ARGUMENT_COUNT || !isAngularComponentDeclaration(ctx, type.typeName) || !referencesClass(ctx, typeArguments[0], classNode))
|
|
474
|
+
return;
|
|
475
|
+
let standaloneArgument = typeArguments[PRE_STANDALONE_ARGUMENT_COUNT];
|
|
476
|
+
return {
|
|
477
|
+
selector: stringLiteral(ctx, typeArguments[1]),
|
|
478
|
+
standalone: standaloneArgument ? booleanArgument(ctx, standaloneArgument) : !1,
|
|
479
|
+
inputsOutputs: [
|
|
480
|
+
...ioMapEntries(ctx, typeArguments[3], "inputs"),
|
|
481
|
+
...ioMapEntries(ctx, typeArguments[4], "outputs")
|
|
482
|
+
]
|
|
483
|
+
};
|
|
484
|
+
}, staticCmpType = ({ ts }, classNode) => {
|
|
485
|
+
for (let member of classNode.members)
|
|
486
|
+
if (ts.isPropertyDeclaration(member) && ts.isIdentifier(member.name) && member.name.text === "\u0275cmp" && ts.getModifiers(member)?.some((modifier) => modifier.kind === ts.SyntaxKind.StaticKeyword) && member.type && ts.isTypeReferenceNode(member.type))
|
|
487
|
+
return member.type;
|
|
488
|
+
}, entityIdentifier = ({ ts }, name) => ts.isQualifiedName(name) ? name.right : name, isAngularComponentDeclaration = (ctx, typeName) => {
|
|
489
|
+
let symbol = resolvedSymbol(ctx, entityIdentifier(ctx, typeName));
|
|
490
|
+
return symbol?.name === "\u0275\u0275ComponentDeclaration" && isDeclaredInAngularCore(symbol);
|
|
491
|
+
}, referencesClass = (ctx, argument, classNode) => {
|
|
492
|
+
if (!ctx.ts.isTypeReferenceNode(argument) || !classNode.name)
|
|
493
|
+
return !1;
|
|
494
|
+
let classSymbol = ctx.checker.getSymbolAtLocation(classNode.name);
|
|
495
|
+
return classSymbol !== void 0 && resolvedSymbol(ctx, entityIdentifier(ctx, argument.typeName)) === classSymbol;
|
|
496
|
+
}, booleanArgument = ({ ts }, argument) => {
|
|
497
|
+
if (ts.isLiteralTypeNode(argument))
|
|
498
|
+
return argument.literal.kind === ts.SyntaxKind.TrueKeyword ? !0 : argument.literal.kind === ts.SyntaxKind.FalseKeyword ? !1 : void 0;
|
|
499
|
+
}, ioMapEntries = (ctx, map, bucket) => {
|
|
500
|
+
let { ts } = ctx;
|
|
501
|
+
if (!ts.isTypeLiteralNode(map))
|
|
502
|
+
return [];
|
|
503
|
+
let entries = [];
|
|
504
|
+
for (let member of map.members) {
|
|
505
|
+
let name = member.name && propertyNameText(ctx, member.name), value = ts.isPropertySignature(member) ? member.type : void 0;
|
|
506
|
+
if (!name || !value)
|
|
507
|
+
continue;
|
|
508
|
+
let alias = ts.isTypeLiteralNode(value) ? stringLiteral(ctx, objectTypeMember(ctx, value, "alias")) : stringLiteral(ctx, value), required = ts.isTypeLiteralNode(value) ? booleanLiteral(ctx, objectTypeMember(ctx, value, "required")) : void 0;
|
|
509
|
+
entries.push({
|
|
510
|
+
bucket,
|
|
511
|
+
name,
|
|
512
|
+
...alias === void 0 || alias === name ? {} : { alias },
|
|
513
|
+
...required === void 0 ? {} : { required }
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
return entries;
|
|
517
|
+
}, propertyNameText = ({ ts }, name) => ts.isIdentifier(name) || ts.isStringLiteral(name) ? name.text : void 0, objectTypeMember = (ctx, object, key) => object.members.find(
|
|
518
|
+
(member) => ctx.ts.isPropertySignature(member) && propertyNameText(ctx, member.name) === key
|
|
519
|
+
)?.type, stringLiteral = ({ ts }, node) => node && ts.isLiteralTypeNode(node) && ts.isStringLiteral(node.literal) ? node.literal.text : void 0, booleanLiteral = (ctx, node) => node ? booleanArgument(ctx, node) : void 0, unwrapInitializer = (ts, expression) => {
|
|
473
520
|
let unwrapped = expression;
|
|
474
521
|
for (; ts.isParenthesizedExpression(unwrapped) || ts.isAsExpression(unwrapped) || ts.isSatisfiesExpression(unwrapped) || ts.isTypeAssertionExpression(unwrapped) || ts.isNonNullExpression(unwrapped); )
|
|
475
522
|
unwrapped = unwrapped.expression;
|
|
@@ -567,6 +614,28 @@ ${detailLines(lines).join(`
|
|
|
567
614
|
...getJsDocDescription(ts, member),
|
|
568
615
|
...getJsDocTagsField(ts, member)
|
|
569
616
|
};
|
|
617
|
+
}, DECLARED_SIGNAL_KINDS = /* @__PURE__ */ new Map([
|
|
618
|
+
["InputSignal", "input"],
|
|
619
|
+
["InputSignalWithTransform", "input"],
|
|
620
|
+
["ModelSignal", "model"],
|
|
621
|
+
["OutputEmitterRef", "output"]
|
|
622
|
+
]), declaredSignalKind = (ctx, member) => {
|
|
623
|
+
let { ts } = ctx;
|
|
624
|
+
if (!member.getSourceFile().isDeclarationFile || ts.getModifiers(member)?.some((modifier) => modifier.kind === ts.SyntaxKind.StaticKeyword))
|
|
625
|
+
return;
|
|
626
|
+
let type = ctx.checker.getTypeAtLocation(member), symbol = type.aliasSymbol ?? type.getSymbol();
|
|
627
|
+
return symbol && isDeclaredInAngularCore(symbol) ? DECLARED_SIGNAL_KINDS.get(symbol.name) : void 0;
|
|
628
|
+
}, buildDeclaredSignalEntry = (ctx, member) => {
|
|
629
|
+
let { ts } = ctx, type = signalValueTypeFromChecker(ctx, member);
|
|
630
|
+
return {
|
|
631
|
+
name: memberName(ts, member.name),
|
|
632
|
+
...type === void 0 ? {} : { type },
|
|
633
|
+
optional: !1,
|
|
634
|
+
required: !1,
|
|
635
|
+
line: ts.getLineAndCharacterOfPosition(member.getSourceFile(), member.getStart()).line + 1,
|
|
636
|
+
...getJsDocDescription(ts, member),
|
|
637
|
+
...getJsDocTagsField(ts, member)
|
|
638
|
+
};
|
|
570
639
|
}, signalValueTypeFromChecker = (ctx, member) => signalValueTypeFromType(ctx, ctx.checker.getTypeAtLocation(member), member), signalValueTypeFromType = (ctx, type, node) => {
|
|
571
640
|
let { checker, ts } = ctx, symbolName = type.aliasSymbol?.name ?? type.getSymbol()?.name;
|
|
572
641
|
if (!symbolName || !SIGNAL_TYPE_NAMES.has(symbolName) || !(type.flags & ts.TypeFlags.Object && type.objectFlags & ts.ObjectFlags.Reference))
|
|
@@ -614,26 +683,50 @@ function visitClassMembers(ctx, classNode, kind) {
|
|
|
614
683
|
}
|
|
615
684
|
function applyMetadataInputsOutputs(ctx, classNode, members) {
|
|
616
685
|
for (let decoratorName of ["Component", "Directive"])
|
|
617
|
-
for (let entry of readMetadataInputsOutputs(ctx, classNode, decoratorName))
|
|
618
|
-
|
|
619
|
-
|
|
686
|
+
for (let entry of readMetadataInputsOutputs(ctx, classNode, decoratorName))
|
|
687
|
+
reclassify(
|
|
688
|
+
members,
|
|
689
|
+
entry,
|
|
690
|
+
entry.required === void 0 ? {} : { required: entry.required, optional: !entry.required }
|
|
620
691
|
);
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
entry.bucket === "inputs" ? members.inputs.push({
|
|
628
|
-
...renamed,
|
|
629
|
-
value: {
|
|
630
|
-
...renamed.value,
|
|
631
|
-
...entry.required !== void 0 ? { required: entry.required, optional: !entry.required } : {}
|
|
632
|
-
}
|
|
633
|
-
}) : members.outputs.push(renamed);
|
|
634
|
-
}
|
|
692
|
+
for (let entry of readComponentDeclaration(ctx, classNode)?.inputsOutputs ?? [])
|
|
693
|
+
reclassify(members, entry, {
|
|
694
|
+
// `@Input()` and `@Input({ required: false })` compile to the same entry, so only `true` tells.
|
|
695
|
+
...entry.required ? { required: !0, optional: !1 } : {},
|
|
696
|
+
...acceptedInputType(ctx, classNode, entry)
|
|
697
|
+
});
|
|
635
698
|
}
|
|
636
|
-
var
|
|
699
|
+
var reclassify = (members, entry, inputFields) => {
|
|
700
|
+
let bucket = entry.bucket === "inputs" ? members.inputs : members.outputs, isField = (member) => member.declName === entry.name && !member.isStatic, bind = (member) => ({
|
|
701
|
+
...member,
|
|
702
|
+
value: {
|
|
703
|
+
...member.value,
|
|
704
|
+
name: entry.alias ?? entry.name,
|
|
705
|
+
...entry.bucket === "inputs" ? inputFields : {}
|
|
706
|
+
}
|
|
707
|
+
}), index = members.properties.findIndex(isField);
|
|
708
|
+
if (index >= 0) {
|
|
709
|
+
let [property] = members.properties.splice(index, 1);
|
|
710
|
+
bucket.push(bind(property));
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
let signal = bucket.find((member) => isField(member) && member.typeSource?.kind === "signal");
|
|
714
|
+
if (!signal || signal.typeSource?.kind === "signal" && signal.typeSource.signalKind === "model" && entry.bucket === "outputs")
|
|
715
|
+
return;
|
|
716
|
+
let bound = bind(signal);
|
|
717
|
+
for (let list of [members.inputs, members.outputs]) {
|
|
718
|
+
let at = list.indexOf(signal);
|
|
719
|
+
at >= 0 && (list[at] = bound);
|
|
720
|
+
}
|
|
721
|
+
}, acceptedInputType = (ctx, classNode, entry) => {
|
|
722
|
+
let { ts } = ctx;
|
|
723
|
+
if (entry.bucket !== "inputs")
|
|
724
|
+
return {};
|
|
725
|
+
let accepted = classNode.members.find(
|
|
726
|
+
(member) => ts.isPropertyDeclaration(member) && isStatic(ctx, member) && memberName(ts, member.name) === `ngAcceptInputType_${entry.name}`
|
|
727
|
+
), type = accepted && ctx.checker.getTypeAtLocation(accepted);
|
|
728
|
+
return type && !(type.flags & (ts.TypeFlags.Unknown | ts.TypeFlags.Any)) ? { type: ctx.types.renderValueType(type, accepted) } : {};
|
|
729
|
+
}, entryFor = (ctx, member, value, typeSource) => ({
|
|
637
730
|
declName: memberName(ctx.ts, member.name),
|
|
638
731
|
isStatic: isStatic(ctx, member),
|
|
639
732
|
declaration: member,
|
|
@@ -651,18 +744,18 @@ var entryFor = (ctx, member, value, typeSource) => ({
|
|
|
651
744
|
members.outputs.push(entryFor(ctx, member, buildDecoratorOutput(ctx, member, outputDecorator)));
|
|
652
745
|
return;
|
|
653
746
|
}
|
|
654
|
-
let signal = parseSignalCall(ctx, member);
|
|
655
|
-
if (
|
|
747
|
+
let signal = parseSignalCall(ctx, member), signalKind = signal?.kind ?? declaredSignalKind(ctx, member);
|
|
748
|
+
if (signalKind) {
|
|
656
749
|
let entry = entryFor(
|
|
657
750
|
ctx,
|
|
658
751
|
member,
|
|
659
752
|
{
|
|
660
|
-
...buildSignalEntry(ctx, member, signal),
|
|
753
|
+
...signal ? buildSignalEntry(ctx, member, signal) : buildDeclaredSignalEntry(ctx, member),
|
|
661
754
|
...memberApiFields(ctx, member)
|
|
662
755
|
},
|
|
663
|
-
{ kind: "signal", signalKind
|
|
756
|
+
{ kind: "signal", signalKind }
|
|
664
757
|
);
|
|
665
|
-
|
|
758
|
+
signalKind !== "output" && members.inputs.push(entry), signalKind !== "input" && members.outputs.push(entry);
|
|
666
759
|
return;
|
|
667
760
|
}
|
|
668
761
|
members.properties.push(entryFor(ctx, member, buildPlainProperty(ctx, member, decorators)));
|
|
@@ -859,7 +952,7 @@ function walkBases(ctx, classNode, members, kind, visited, substitutions) {
|
|
|
859
952
|
inheritedSubstitutions,
|
|
860
953
|
baseType
|
|
861
954
|
);
|
|
862
|
-
|
|
955
|
+
mergeBucket(ctx, members, baseMembers, "inputs"), mergeBucket(ctx, members, baseMembers, "outputs"), mergeInto(members.properties, baseMembers.properties, members), mergeInto(members.methods, baseMembers.methods, members);
|
|
863
956
|
}
|
|
864
957
|
}
|
|
865
958
|
var extendsClauseFor = (ctx, classNode, declaration) => {
|
|
@@ -1270,17 +1363,19 @@ function analyzeSourceFile(ts, sourceFile, checker, context = analyzerContext(ts
|
|
|
1270
1363
|
logger2.debug(`[angular-cm] ${statement.name.text} left out of docgen: an @NgModule`);
|
|
1271
1364
|
continue;
|
|
1272
1365
|
}
|
|
1366
|
+
if (kind === "class" && sourceFile.isDeclarationFile) {
|
|
1367
|
+
logger2.debug(
|
|
1368
|
+
`[angular-cm] ${statement.name.text} left out of docgen: a declaration-file class with no compiled \u0275cmp`
|
|
1369
|
+
);
|
|
1370
|
+
continue;
|
|
1371
|
+
}
|
|
1273
1372
|
let name = statement.name.text, file = sourceFile.fileName, members = collectClassMembers(ctx, statement, kind), common = {
|
|
1274
1373
|
file,
|
|
1275
1374
|
...getJsDocDescription(ts, statement),
|
|
1276
1375
|
...getJsDocTagsField(ts, statement)
|
|
1277
1376
|
};
|
|
1278
1377
|
if (kind === "component" || kind === "directive") {
|
|
1279
|
-
let
|
|
1280
|
-
ctx,
|
|
1281
|
-
statement,
|
|
1282
|
-
kind === "component" ? "Component" : "Directive"
|
|
1283
|
-
), selector = metadata && decoratorSelector(ctx, metadata), standalone = metadata && decoratorStandalone(ctx, metadata), record = {
|
|
1378
|
+
let { selector, standalone } = componentMetadata(ctx, statement, kind), record = {
|
|
1284
1379
|
name,
|
|
1285
1380
|
type: kind,
|
|
1286
1381
|
...selector === void 0 ? {} : { selector },
|
|
@@ -1338,7 +1433,16 @@ var KNOWN_DECORATORS = {
|
|
|
1338
1433
|
if (kind)
|
|
1339
1434
|
return kind;
|
|
1340
1435
|
}
|
|
1341
|
-
return "class";
|
|
1436
|
+
return readComponentDeclaration(ctx, node) ? "component" : "class";
|
|
1437
|
+
}, componentMetadata = (ctx, node, kind) => {
|
|
1438
|
+
let declared = readComponentDeclaration(ctx, node);
|
|
1439
|
+
if (declared)
|
|
1440
|
+
return declared;
|
|
1441
|
+
let metadata = decoratorObjectArg(ctx, node, kind === "component" ? "Component" : "Directive");
|
|
1442
|
+
return {
|
|
1443
|
+
selector: metadata && decoratorSelector(ctx, metadata),
|
|
1444
|
+
standalone: metadata && decoratorStandalone(ctx, metadata)
|
|
1445
|
+
};
|
|
1342
1446
|
}, decoratorSelector = (ctx, metadata) => {
|
|
1343
1447
|
let selector = objectProperty(ctx, metadata, "selector"), value = selector && resolveInitializer(ctx, selector);
|
|
1344
1448
|
return value && ctx.ts.isStringLiteralLike(value) ? value.text : void 0;
|
|
@@ -1466,7 +1570,7 @@ var KNOWN_DECORATORS = {
|
|
|
1466
1570
|
let declaration = (exported.flags & SymbolFlags.Alias ? checker.getAliasedSymbol(exported) : exported).declarations?.find(
|
|
1467
1571
|
(candidate) => isClassDeclaration(candidate)
|
|
1468
1572
|
);
|
|
1469
|
-
if (!declaration?.name
|
|
1573
|
+
if (!declaration?.name)
|
|
1470
1574
|
continue;
|
|
1471
1575
|
let declarationFile = declaration.getSourceFile(), targetContext = declarationFile === sourceFile ? context : analyzerContext(this.typescript, declarationFile, checker), targetMeta = declarationFile === sourceFile ? fileMeta : analyzeSourceFile(this.typescript, declarationFile, checker, targetContext), entry = findRecord(targetMeta, declaration.name.text);
|
|
1472
1576
|
if (entry)
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/node/vitest.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_b0bsiznc3rb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_b0bsiznc3rb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_b0bsiznc3rb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_b0bsiznc3rb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_b0bsiznc3rb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_b0bsiznc3rb.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
|
findTsconfigUp
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-ELK5QDJM.js";
|
|
15
15
|
import {
|
|
16
16
|
parseStoryFile
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-E3INC42D.js";
|
|
18
18
|
|
|
19
19
|
// src/preset.ts
|
|
20
20
|
import { findConfigFile } from "storybook/internal/common";
|
|
21
21
|
import {
|
|
22
|
-
babelParser,
|
|
23
22
|
extractMockCalls,
|
|
24
23
|
findMockRedirect,
|
|
25
24
|
getAutomockCode,
|
|
@@ -269,7 +268,6 @@ import { createWorkerGatedStoryDocsProvider, getService } from "storybook/intern
|
|
|
269
268
|
import { logger as logger4 } from "storybook/internal/node-logger";
|
|
270
269
|
|
|
271
270
|
// src/docgen/story-docs-build.ts
|
|
272
|
-
import { types as t4 } from "storybook/internal/babel";
|
|
273
271
|
import { getComponentIdFromEntry, getStoryImportPathFromEntry } from "storybook/internal/common";
|
|
274
272
|
import { storyNameFromExport } from "storybook/internal/csf/csf-utils";
|
|
275
273
|
import {
|
|
@@ -288,8 +286,14 @@ import {
|
|
|
288
286
|
import { resolve as resolve3 } from "node:path";
|
|
289
287
|
|
|
290
288
|
// src/docgen/story-docs-args.ts
|
|
291
|
-
import {
|
|
292
|
-
|
|
289
|
+
import {
|
|
290
|
+
textOf,
|
|
291
|
+
parseExpression,
|
|
292
|
+
staticKey,
|
|
293
|
+
parseModule,
|
|
294
|
+
reindent,
|
|
295
|
+
unwrapExpression
|
|
296
|
+
} from "storybook/internal/csf-tools";
|
|
293
297
|
|
|
294
298
|
// src/template-grammar.ts
|
|
295
299
|
var isValidIdentifier = (name) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name), formatPropInTemplate = (propertyName) => isValidIdentifier(propertyName) ? propertyName : `this['${propertyName}']`;
|
|
@@ -398,30 +402,49 @@ ${innerTemplate}
|
|
|
398
402
|
// src/docgen/story-docs-args.ts
|
|
399
403
|
var EVAL_FAILED = /* @__PURE__ */ Symbol("story-docs-eval-failed"), createArgExternalizer = (enums) => (node) => {
|
|
400
404
|
let value = evaluateNode(node, enums);
|
|
401
|
-
return value === EVAL_FAILED ? void 0 :
|
|
402
|
-
}, evaluateArgExpression = (node, enums) => {
|
|
403
|
-
let literal = evaluateArgLiteral(node, enums);
|
|
404
|
-
return escapeAttributeExpression(literal ?? printArgSource(unwrapExpression(node)));
|
|
405
|
+
return value === EVAL_FAILED ? void 0 : parseExpression(printExpressionValue(value, /* @__PURE__ */ new Set()));
|
|
405
406
|
}, evaluateArgLiteral = (node, enums) => {
|
|
406
407
|
let value = evaluateNode(unwrapExpression(node), enums);
|
|
407
408
|
return value === EVAL_FAILED ? void 0 : printExpressionValue(value, /* @__PURE__ */ new Set());
|
|
408
|
-
}, argFieldValue = (node) => printArgSource(unwrapExpression(node)),
|
|
409
|
+
}, argFieldValue = (node) => printArgSource(textOf(unwrapExpression(node))), evaluateArgExpression = (node, enums) => {
|
|
410
|
+
let literal = evaluateArgLiteral(node, enums);
|
|
411
|
+
return escapeAttributeExpression(
|
|
412
|
+
literal ?? printArgSource(withoutComments(textOf(unwrapExpression(node))))
|
|
413
|
+
);
|
|
414
|
+
}, printArgSource = (code) => {
|
|
415
|
+
let lines = code.split(`
|
|
416
|
+
`).slice(1), last = lines.at(-1), indents = lines.filter((line) => line.trim()).map((line) => /^[ \t]*/.exec(line)[0]), indent = last && /^[ \t]*[)\]}]/.test(last) ? /^[ \t]*/.exec(last)[0] : indents.reduce(
|
|
417
|
+
(shortest, current) => current.length < shortest.length ? current : shortest,
|
|
418
|
+
indents[0] ?? ""
|
|
419
|
+
), result = reindent(code, indent, ""), deepest = Math.max(0, ...result.split(`
|
|
420
|
+
`).map((line) => /^\t*/.exec(line)[0].length));
|
|
421
|
+
for (let depth = deepest; depth > 0; depth--)
|
|
422
|
+
result = reindent(result, " ".repeat(depth), " ".repeat(depth));
|
|
423
|
+
return result;
|
|
424
|
+
}, withoutComments = (code) => {
|
|
425
|
+
let { code: wrapped, comments } = parseModule(`(${code}
|
|
426
|
+
)`), result = "", cursor = 0;
|
|
427
|
+
for (let comment of comments)
|
|
428
|
+
result += wrapped.slice(cursor, comment.start), cursor = comment.end + /^[ \t]*/.exec(wrapped.slice(comment.end))[0].length, wrapped[cursor] === `
|
|
429
|
+
` ? result = result.replace(/[ \t]+$/, "") : /[\w$]$/.test(result) && /[\w$]/.test(wrapped[cursor]) && (result += " ");
|
|
430
|
+
return result += wrapped.slice(cursor), result.slice(1, -2);
|
|
431
|
+
}, quoteExpressionString = (value) => `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r")}'`, printExpressionValue = (value, seen) => typeof value == "string" ? quoteExpressionString(value) : typeof value != "object" || value === null ? `${value}` : seen.has(value) ? quoteExpressionString("[Circular]") : (seen.add(value), Array.isArray(value) ? `[${value.map((element) => printExpressionValue(element ?? null, seen)).join(", ")}]` : `{${Object.entries(value).filter(([, entryValue]) => entryValue !== void 0).map(
|
|
409
432
|
([key, entryValue]) => `${isValidIdentifier(key) ? key : quoteExpressionString(key)}: ${printExpressionValue(entryValue, seen)}`
|
|
410
433
|
).join(", ")}}`), escapeAttributeExpression = (expression) => expression.replace(/&(?=#|\w+;)/g, "&").replace(/"/g, """), evaluateNode = (node, enums) => {
|
|
411
434
|
let unwrapped = unwrapExpression(node);
|
|
412
|
-
if (
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
if (!(
|
|
417
|
-
if (
|
|
435
|
+
if (unwrapped.type === "Literal") {
|
|
436
|
+
let { value } = unwrapped;
|
|
437
|
+
return typeof value == "string" || typeof value == "number" || typeof value == "boolean" ? value : "regex" in unwrapped || "bigint" in unwrapped ? EVAL_FAILED : null;
|
|
438
|
+
}
|
|
439
|
+
if (!(unwrapped.type === "Identifier" && unwrapped.name === "undefined") && !(unwrapped.type === "UnaryExpression" && unwrapped.operator === "void")) {
|
|
440
|
+
if (unwrapped.type === "UnaryExpression" && unwrapped.operator === "-" && unwrapped.argument.type === "Literal" && typeof unwrapped.argument.value == "number")
|
|
418
441
|
return -unwrapped.argument.value;
|
|
419
|
-
if (
|
|
442
|
+
if (unwrapped.type === "TemplateLiteral" && unwrapped.expressions.length === 0)
|
|
420
443
|
return unwrapped.quasis[0]?.value.cooked ?? EVAL_FAILED;
|
|
421
|
-
if (
|
|
444
|
+
if (unwrapped.type === "ArrayExpression") {
|
|
422
445
|
let values = [];
|
|
423
446
|
for (let element of unwrapped.elements) {
|
|
424
|
-
if (element === null ||
|
|
447
|
+
if (element === null || element.type === "SpreadElement")
|
|
425
448
|
return EVAL_FAILED;
|
|
426
449
|
let value = evaluateNode(element, enums);
|
|
427
450
|
if (value === EVAL_FAILED)
|
|
@@ -430,13 +453,13 @@ var EVAL_FAILED = /* @__PURE__ */ Symbol("story-docs-eval-failed"), createArgExt
|
|
|
430
453
|
}
|
|
431
454
|
return values;
|
|
432
455
|
}
|
|
433
|
-
if (
|
|
456
|
+
if (unwrapped.type === "ObjectExpression") {
|
|
434
457
|
let value = {};
|
|
435
458
|
for (let property of unwrapped.properties) {
|
|
436
|
-
if (
|
|
459
|
+
if (property.type !== "Property" || property.method || property.kind !== "init")
|
|
437
460
|
return EVAL_FAILED;
|
|
438
|
-
let key =
|
|
439
|
-
if (key ===
|
|
461
|
+
let key = staticKey(property);
|
|
462
|
+
if (key === void 0)
|
|
440
463
|
return EVAL_FAILED;
|
|
441
464
|
let propertyValue = evaluateNode(property.value, enums);
|
|
442
465
|
if (propertyValue === EVAL_FAILED)
|
|
@@ -445,7 +468,7 @@ var EVAL_FAILED = /* @__PURE__ */ Symbol("story-docs-eval-failed"), createArgExt
|
|
|
445
468
|
}
|
|
446
469
|
return value;
|
|
447
470
|
}
|
|
448
|
-
if (
|
|
471
|
+
if (unwrapped.type === "MemberExpression" && !unwrapped.computed && unwrapped.object.type === "Identifier" && unwrapped.property.type === "Identifier") {
|
|
449
472
|
let objectName = unwrapped.object.name, propertyName = unwrapped.property.name;
|
|
450
473
|
return enums.find((enumeration) => enumeration.name === objectName)?.members.find((candidate) => candidate.name === propertyName)?.value ?? EVAL_FAILED;
|
|
451
474
|
}
|
|
@@ -454,11 +477,12 @@ var EVAL_FAILED = /* @__PURE__ */ Symbol("story-docs-eval-failed"), createArgExt
|
|
|
454
477
|
};
|
|
455
478
|
|
|
456
479
|
// src/docgen/story-docs-markup.ts
|
|
457
|
-
import { types as t2 } from "storybook/internal/babel";
|
|
458
480
|
import {
|
|
481
|
+
importedName,
|
|
459
482
|
isCanonicalCsf2BindCall,
|
|
460
|
-
|
|
461
|
-
|
|
483
|
+
isStringLiteral,
|
|
484
|
+
oneLineTextOf,
|
|
485
|
+
staticKey as staticKey2,
|
|
462
486
|
templateParts,
|
|
463
487
|
unwrapExpression as unwrapExpression2
|
|
464
488
|
} from "storybook/internal/csf-tools";
|
|
@@ -484,7 +508,7 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
484
508
|
if (csf2) {
|
|
485
509
|
let templateProperty = resolvedProperty(csf2.returned, "template");
|
|
486
510
|
if (templateProperty.kind === "unresolvable")
|
|
487
|
-
return { kind: "unresolvable", source:
|
|
511
|
+
return { kind: "unresolvable", source: oneLineTextOf(csf2.returned) };
|
|
488
512
|
let fromCsf2 = templateFrom(
|
|
489
513
|
templateProperty.kind === "value" ? templateProperty.node : void 0,
|
|
490
514
|
shape,
|
|
@@ -498,7 +522,10 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
498
522
|
}, shapeTemplate = (members, shape, bindings) => {
|
|
499
523
|
let template = resolvedMember(members, "template");
|
|
500
524
|
if (template.kind === "unresolvable")
|
|
501
|
-
return {
|
|
525
|
+
return {
|
|
526
|
+
kind: "unresolvable",
|
|
527
|
+
...template.node ? { source: oneLineTextOf(template.node) } : {}
|
|
528
|
+
};
|
|
502
529
|
if (template.kind === "value") {
|
|
503
530
|
let own = templateFrom(declaredValue(shape, template.node), shape, bindings, NO_SCOPE);
|
|
504
531
|
if (own)
|
|
@@ -508,28 +535,28 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
508
535
|
if (render.kind === "missing")
|
|
509
536
|
return;
|
|
510
537
|
if (render.kind === "unresolvable")
|
|
511
|
-
return { kind: "unresolvable", ...render.node ? { source:
|
|
538
|
+
return { kind: "unresolvable", ...render.node ? { source: oneLineTextOf(render.node) } : {} };
|
|
512
539
|
let fn = declaredValue(shape, render.node), returned = returnedObject(fn);
|
|
513
540
|
if (!returned)
|
|
514
|
-
return { kind: "unresolvable", source: `render: ${
|
|
541
|
+
return { kind: "unresolvable", source: `render: ${oneLineTextOf(render.node)}` };
|
|
515
542
|
let templateProperty = resolvedProperty(returned, "template");
|
|
516
|
-
return templateProperty.kind === "unresolvable" ? { kind: "unresolvable", source: `render: ${
|
|
543
|
+
return templateProperty.kind === "unresolvable" ? { kind: "unresolvable", source: `render: ${oneLineTextOf(render.node)}` } : templateFrom(
|
|
517
544
|
templateProperty.kind === "value" ? templateProperty.node : void 0,
|
|
518
545
|
shape,
|
|
519
546
|
bindings,
|
|
520
547
|
functionScope(fn)
|
|
521
548
|
);
|
|
522
549
|
}, templateFrom = (node, shape, bindings, scope) => {
|
|
523
|
-
if (node === void 0 ||
|
|
550
|
+
if (node === void 0 || isNullLiteral(node) || node.type === "Identifier" && node.name === "undefined")
|
|
524
551
|
return;
|
|
525
|
-
if (
|
|
552
|
+
if (isStringLiteral(node))
|
|
526
553
|
return literalTemplate(node.value, /* @__PURE__ */ new Set(), []);
|
|
527
554
|
let parts = templateParts(node);
|
|
528
555
|
if (parts) {
|
|
529
556
|
let representedArgs = /* @__PURE__ */ new Set(), expansions = [], markup = interpolate(parts, shape, bindings, scope, representedArgs, expansions);
|
|
530
|
-
return markup === void 0 ? { kind: "unresolvable", source:
|
|
557
|
+
return markup === void 0 ? { kind: "unresolvable", source: oneLineTextOf(node) } : literalTemplate(markup, representedArgs, expansions);
|
|
531
558
|
}
|
|
532
|
-
return { kind: "unresolvable", source:
|
|
559
|
+
return { kind: "unresolvable", source: oneLineTextOf(node) };
|
|
533
560
|
}, literalTemplate = (markup, representedArgs, expansions) => ({
|
|
534
561
|
kind: "literal",
|
|
535
562
|
markup,
|
|
@@ -556,8 +583,8 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
556
583
|
}
|
|
557
584
|
return markup;
|
|
558
585
|
}, substituteExpression = (expression, shape, bindings, scope, representedArgs, marker, expansions) => {
|
|
559
|
-
if (
|
|
560
|
-
let argument = expression.arguments[0], excluded =
|
|
586
|
+
if (expression.type === "CallExpression" && isImportedArgsToTemplate(expression, shape)) {
|
|
587
|
+
let argument = expression.arguments[0], excluded = argument?.type === "Identifier" ? scope.argsExpansions.get(argument.name) : void 0;
|
|
561
588
|
if (!bindings || excluded === void 0)
|
|
562
589
|
return;
|
|
563
590
|
let filter = bindingFilterOf(expression.arguments[1]);
|
|
@@ -566,7 +593,7 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
566
593
|
let withRest = { ...filter, exclude: [...filter.exclude ?? [], ...excluded] }, allowed = filter.include ? { ...withRest, include: filter.include.filter((name) => !excluded.includes(name)) } : withRest;
|
|
567
594
|
return expansions.push({ marker, ...bindingAttributes(bindings, allowed, representedArgs) }), marker;
|
|
568
595
|
}
|
|
569
|
-
if (
|
|
596
|
+
if (expression.type !== "Identifier")
|
|
570
597
|
return;
|
|
571
598
|
let argName = scope.argBindings.get(expression.name);
|
|
572
599
|
if (argName !== void 0) {
|
|
@@ -578,18 +605,15 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
578
605
|
let declared = declaredValue(shape, expression);
|
|
579
606
|
return declared === expression ? void 0 : literalText(declared);
|
|
580
607
|
}, ARGS_TO_TEMPLATE_MODULES = /* @__PURE__ */ new Set(["@storybook/angular", "@storybook/angular-vite"]), isImportedArgsToTemplate = (call, shape) => {
|
|
581
|
-
if (
|
|
608
|
+
if (call.callee.type !== "Identifier")
|
|
582
609
|
return !1;
|
|
583
|
-
let binding = shape.csf.
|
|
584
|
-
|
|
585
|
-
return !1;
|
|
586
|
-
let specifier = binding?.path.node, declaration = binding?.path.findParent((path) => t2.isImportDeclaration(path.node))?.node;
|
|
587
|
-
return !t2.isImportSpecifier(specifier) || !t2.isImportDeclaration(declaration) ? !1 : (t2.isIdentifier(specifier.imported) ? specifier.imported.name : specifier.imported.value) === "argsToTemplate" && ARGS_TO_TEMPLATE_MODULES.has(declaration.source.value);
|
|
610
|
+
let binding = shape.csf.editor.scopes.bindingOf(call.callee), specifier = binding?.node, declaration = binding?.declaration;
|
|
611
|
+
return specifier?.type !== "ImportSpecifier" || declaration?.type !== "ImportDeclaration" ? !1 : importedName(specifier.imported) === "argsToTemplate" && ARGS_TO_TEMPLATE_MODULES.has(declaration.source.value);
|
|
588
612
|
}, bindingFilterOf = (options) => {
|
|
589
613
|
if (options === void 0)
|
|
590
614
|
return {};
|
|
591
615
|
let unwrapped = unwrapExpression2(options);
|
|
592
|
-
if (
|
|
616
|
+
if (unwrapped.type !== "ObjectExpression" || unwrapped.properties.some((property) => property.type === "SpreadElement"))
|
|
593
617
|
return;
|
|
594
618
|
let filter = {};
|
|
595
619
|
for (let key of ["include", "exclude"]) {
|
|
@@ -604,38 +628,42 @@ var bindingAttributes = ({ inputs, outputs }, filter, representedArgs) => {
|
|
|
604
628
|
}
|
|
605
629
|
}
|
|
606
630
|
return filter;
|
|
607
|
-
}, stringArray = (node) =>
|
|
631
|
+
}, stringArray = (node) => node?.type === "ArrayExpression" && node.elements.every(isStringLiteral) ? node.elements.map((element) => element.value) : void 0, literalText = (node) => {
|
|
608
632
|
let unwrapped = node && unwrapExpression2(node);
|
|
609
|
-
|
|
610
|
-
|
|
633
|
+
if (unwrapped?.type !== "Literal")
|
|
634
|
+
return;
|
|
635
|
+
let { value } = unwrapped;
|
|
636
|
+
return typeof value == "string" ? value : typeof value == "number" || typeof value == "boolean" ? String(value) : void 0;
|
|
637
|
+
}, isNullLiteral = (node) => node.type === "Literal" && node.value === null && !("regex" in node) && !("bigint" in node), resolvedMember = (members, key) => {
|
|
611
638
|
let node = members.properties[key];
|
|
612
639
|
return node !== void 0 ? members.shadowed.includes(key) ? { kind: "unresolvable", node } : { kind: "value", node } : members.unresolved.length > 0 ? { kind: "unresolvable" } : { kind: "missing" };
|
|
613
640
|
}, resolvedProperty = (object, key) => {
|
|
614
641
|
let found, opaqueAfter;
|
|
615
642
|
return object.properties.forEach((property) => {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
found = property, opaqueAfter = void 0;
|
|
643
|
+
if (property.type === "SpreadElement") {
|
|
644
|
+
opaqueAfter = property;
|
|
619
645
|
return;
|
|
620
646
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
},
|
|
624
|
-
|
|
625
|
-
let
|
|
626
|
-
if (!
|
|
647
|
+
let name = staticKey2(property);
|
|
648
|
+
name === key ? (found = property, opaqueAfter = void 0) : name === void 0 && (opaqueAfter = property);
|
|
649
|
+
}), found ? opaqueAfter ? { kind: "unresolvable", node: opaqueAfter } : found.method || found.kind !== "init" ? isPlainMethod(found) ? { kind: "value", node: found } : { kind: "unresolvable", node: found } : { kind: "value", node: found.value } : opaqueAfter ? { kind: "unresolvable", node: opaqueAfter } : { kind: "missing" };
|
|
650
|
+
}, isPlainMethod = (node) => node?.type === "Property" && node.method && node.kind === "init" && node.value.type === "FunctionExpression" && !node.value.generator, functionOf = (node) => isPlainMethod(node) ? node.value : node?.type === "ArrowFunctionExpression" || node?.type === "FunctionExpression" || node?.type === "FunctionDeclaration" ? node : void 0, returnedObject = (node) => {
|
|
651
|
+
let fn = functionOf(node);
|
|
652
|
+
if (!fn?.body)
|
|
627
653
|
return;
|
|
628
|
-
if (
|
|
654
|
+
if (fn.body.type !== "BlockStatement") {
|
|
629
655
|
let unwrapped2 = unwrapExpression2(fn.body);
|
|
630
|
-
return
|
|
656
|
+
return unwrapped2.type === "ObjectExpression" ? unwrapped2 : void 0;
|
|
631
657
|
}
|
|
632
658
|
let statements = fn.body.body, last = statements.at(-1);
|
|
633
|
-
if (
|
|
659
|
+
if (last?.type !== "ReturnStatement" || !last.argument || !statements.slice(0, -1).every(
|
|
660
|
+
(statement) => statement.type === "VariableDeclaration" || statement.type === "ExpressionStatement"
|
|
661
|
+
))
|
|
634
662
|
return;
|
|
635
663
|
let unwrapped = unwrapExpression2(last.argument);
|
|
636
|
-
return
|
|
664
|
+
return unwrapped.type === "ObjectExpression" ? unwrapped : void 0;
|
|
637
665
|
}, csf2Shape = (shape) => {
|
|
638
|
-
let declared = shape.csf._storyExports[shape.exportName], candidates =
|
|
666
|
+
let declared = shape.csf._storyExports[shape.exportName], candidates = declared?.type === "VariableDeclarator" ? [declared.init] : (
|
|
639
667
|
// `export { S }` records no declarator; the statement is the initializer it resolved to.
|
|
640
668
|
[declared, shape.csf._storyStatements[shape.exportName]]
|
|
641
669
|
);
|
|
@@ -646,88 +674,91 @@ var returnedObject = (fn) => {
|
|
|
646
674
|
if (fn && returned)
|
|
647
675
|
return { fn, returned };
|
|
648
676
|
}
|
|
649
|
-
}, functionScope = (
|
|
650
|
-
|
|
677
|
+
}, functionScope = (node) => {
|
|
678
|
+
let fn = functionOf(node?.type === "Property" ? node.value : node);
|
|
679
|
+
if (!fn)
|
|
651
680
|
return NO_SCOPE;
|
|
652
|
-
let [firstParam] = fn.params, argsPattern =
|
|
681
|
+
let [firstParam] = fn.params, argsPattern = firstParam?.type === "AssignmentPattern" ? firstParam.left : firstParam, parameterNames = /* @__PURE__ */ new Set();
|
|
653
682
|
fn.params.forEach((param) => collectPatternNames(param, parameterNames));
|
|
654
683
|
let argBindings = /* @__PURE__ */ new Map();
|
|
655
|
-
if (
|
|
684
|
+
if (argsPattern?.type === "ObjectPattern")
|
|
656
685
|
for (let property of argsPattern.properties) {
|
|
657
|
-
if (
|
|
686
|
+
if (property.type !== "Property" || property.computed)
|
|
658
687
|
continue;
|
|
659
|
-
let argName =
|
|
660
|
-
argName !== void 0 &&
|
|
688
|
+
let argName = staticKey2(property), local = property.value.type === "AssignmentPattern" ? property.value.left : property.value;
|
|
689
|
+
argName !== void 0 && local.type === "Identifier" && argBindings.set(local.name, argName);
|
|
661
690
|
}
|
|
662
691
|
let bodyDeclared = /* @__PURE__ */ new Set();
|
|
663
|
-
if (
|
|
692
|
+
if (fn.body?.type === "BlockStatement") {
|
|
664
693
|
for (let statement of fn.body.body)
|
|
665
|
-
if (
|
|
694
|
+
if (statement.type === "VariableDeclaration")
|
|
666
695
|
for (let declarator of statement.declarations)
|
|
667
696
|
collectPatternNames(declarator.id, bodyDeclared);
|
|
668
697
|
}
|
|
669
698
|
let argsExpansions = /* @__PURE__ */ new Map();
|
|
670
|
-
if (
|
|
699
|
+
if (argsPattern?.type === "Identifier")
|
|
671
700
|
argsExpansions.set(argsPattern.name, []);
|
|
672
|
-
else if (
|
|
701
|
+
else if (argsPattern?.type === "ObjectPattern") {
|
|
673
702
|
let destructured = [], rest, knownKeys = !0;
|
|
674
703
|
for (let property of argsPattern.properties)
|
|
675
|
-
if (
|
|
704
|
+
if (property.type === "RestElement" && property.argument.type === "Identifier")
|
|
676
705
|
rest = property.argument.name;
|
|
677
|
-
else if (
|
|
678
|
-
let key = property.computed ? void 0 :
|
|
706
|
+
else if (property.type === "Property") {
|
|
707
|
+
let key = property.computed ? void 0 : staticKey2(property);
|
|
679
708
|
key !== void 0 ? destructured.push(key) : knownKeys = !1;
|
|
680
709
|
}
|
|
681
710
|
rest !== void 0 && knownKeys && argsExpansions.set(rest, destructured);
|
|
682
711
|
}
|
|
683
712
|
return { argBindings, parameterNames, bodyDeclared, argsExpansions };
|
|
684
713
|
}, collectPatternNames = (pattern, into) => {
|
|
685
|
-
if (
|
|
714
|
+
if (pattern.type === "Identifier")
|
|
686
715
|
into.add(pattern.name);
|
|
687
|
-
else if (
|
|
716
|
+
else if (pattern.type === "ObjectPattern")
|
|
688
717
|
for (let property of pattern.properties)
|
|
689
|
-
collectPatternNames(
|
|
690
|
-
|
|
718
|
+
collectPatternNames(
|
|
719
|
+
property.type === "RestElement" ? property.argument : property.value,
|
|
720
|
+
into
|
|
721
|
+
);
|
|
722
|
+
else pattern.type === "ArrayPattern" ? pattern.elements.forEach((element) => element && collectPatternNames(element, into)) : pattern.type === "AssignmentPattern" ? collectPatternNames(pattern.left, into) : pattern.type === "RestElement" && collectPatternNames(pattern.argument, into);
|
|
691
723
|
}, declaredValue = (shape, node) => {
|
|
692
|
-
if (
|
|
724
|
+
if (node?.type !== "Identifier")
|
|
693
725
|
return node;
|
|
694
|
-
let binding = shape.csf.
|
|
726
|
+
let binding = shape.csf.editor.scopes.program.bindings.get(node.name);
|
|
695
727
|
if (!binding?.constant)
|
|
696
728
|
return node;
|
|
697
|
-
let declaration = binding.
|
|
698
|
-
return
|
|
729
|
+
let declaration = binding.node;
|
|
730
|
+
return declaration.type === "VariableDeclarator" ? declaration.init ?? node : declaration.type === "FunctionDeclaration" ? declaration : node;
|
|
699
731
|
};
|
|
700
732
|
|
|
701
733
|
// src/docgen/story-docs-ng-modules.ts
|
|
702
|
-
import { types as t3 } from "storybook/internal/babel";
|
|
703
734
|
import {
|
|
704
735
|
buildImportStatements,
|
|
705
|
-
|
|
736
|
+
staticKey as staticKey3,
|
|
706
737
|
resolveComponentImport,
|
|
707
738
|
unwrapExpression as unwrapExpression3
|
|
708
739
|
} from "storybook/internal/csf-tools";
|
|
709
740
|
var ngModulesFromDecorators = (decorators, componentName) => {
|
|
710
741
|
let result = { names: [], declaresComponent: !1 }, list = decorators === void 0 ? void 0 : unwrapExpression3(decorators);
|
|
711
|
-
if (
|
|
742
|
+
if (list?.type !== "ArrayExpression")
|
|
712
743
|
return result;
|
|
713
744
|
for (let element of list.elements) {
|
|
714
|
-
if (!element ||
|
|
745
|
+
if (!element || element.type === "SpreadElement")
|
|
715
746
|
continue;
|
|
716
747
|
let call = unwrapExpression3(element);
|
|
717
|
-
if (
|
|
748
|
+
if (call.type !== "CallExpression" || call.callee.type !== "Identifier" || call.callee.name !== "moduleMetadata")
|
|
718
749
|
continue;
|
|
719
|
-
let [metadataArg] = call.arguments, metadata = metadataArg &&
|
|
720
|
-
if (
|
|
750
|
+
let [metadataArg] = call.arguments, metadata = metadataArg && metadataArg.type !== "SpreadElement" ? unwrapExpression3(metadataArg) : void 0;
|
|
751
|
+
if (metadata?.type === "ObjectExpression")
|
|
721
752
|
for (let property of metadata.properties) {
|
|
722
|
-
if (
|
|
753
|
+
if (property.type !== "Property" || property.method || property.kind !== "init")
|
|
723
754
|
continue;
|
|
724
|
-
let key =
|
|
725
|
-
if (!(key !== "imports" && key !== "declarations" ||
|
|
755
|
+
let key = staticKey3(property), value = unwrapExpression3(property.value);
|
|
756
|
+
if (!(key !== "imports" && key !== "declarations" || value.type !== "ArrayExpression"))
|
|
726
757
|
for (let item of value.elements) {
|
|
727
|
-
if (!item ||
|
|
758
|
+
if (!item || item.type === "SpreadElement")
|
|
728
759
|
continue;
|
|
729
760
|
let entry = unwrapExpression3(item);
|
|
730
|
-
|
|
761
|
+
entry.type === "Identifier" && (key === "imports" ? entry.name !== componentName && !result.names.includes(entry.name) && result.names.push(entry.name) : entry.name === componentName && (result.declaresComponent = !0));
|
|
731
762
|
}
|
|
732
763
|
}
|
|
733
764
|
}
|
|
@@ -826,7 +857,7 @@ var buildStoryDocsPayload = async (input, context) => {
|
|
|
826
857
|
let target = resolveImport(fromFile, specifier);
|
|
827
858
|
return target === void 0 ? void 0 : parseReferenceModule(target);
|
|
828
859
|
} : openStoryReferences().resolveModule
|
|
829
|
-
}, componentName = componentNameOf(componentNode), importBindings = collectImportBindings(csf.
|
|
860
|
+
}, componentName = componentNameOf(componentNode), importBindings = collectImportBindings(csf.program), deps = {
|
|
830
861
|
csf,
|
|
831
862
|
resolveStoryArgs: createStoryArgsResolver(csf, references),
|
|
832
863
|
snippetMeta: docgenPayload?.angularComponentMeta,
|
|
@@ -853,12 +884,15 @@ var buildStoryDocsPayload = async (input, context) => {
|
|
|
853
884
|
return buildImportStatements2({ refs: [{ ...ref, importOverride }] }).join(`
|
|
854
885
|
`) || void 0;
|
|
855
886
|
}, componentNameOf = (node) => {
|
|
856
|
-
let identifier = node
|
|
857
|
-
return identifier
|
|
887
|
+
let identifier = node?.type === "TSInstantiationExpression" ? node.expression : node;
|
|
888
|
+
return identifier?.type === "Identifier" ? identifier.name : void 0;
|
|
858
889
|
}, openStoryReferences = createStoryReferenceResolver(), buildStoryDoc = async (exportName, story, deps) => {
|
|
859
890
|
let { csf } = deps, name = story.name ?? storyNameFromExport(exportName);
|
|
860
891
|
try {
|
|
861
|
-
let { description, summary } = extractStoryJSDocInfo(
|
|
892
|
+
let { description, summary } = extractStoryJSDocInfo(
|
|
893
|
+
csf._storyStatements[exportName],
|
|
894
|
+
csf.editor
|
|
895
|
+
), rendered = await renderedSnippet(storyShape(exportName, deps), deps);
|
|
862
896
|
return {
|
|
863
897
|
id: story.id,
|
|
864
898
|
name,
|
|
@@ -890,7 +924,7 @@ var buildStoryDocsPayload = async (input, context) => {
|
|
|
890
924
|
}, storyShape = (exportName, deps) => {
|
|
891
925
|
let resolved = deps.resolveStoryArgs.resolve(exportName), enums = deps.snippetMeta?.enums ?? [], unresolved = [...resolved.unresolved];
|
|
892
926
|
for (let value of Object.values(resolved.args))
|
|
893
|
-
evaluateArgLiteral(value, enums) === void 0 && !isSelfContained(value) && unresolved.push(
|
|
927
|
+
evaluateArgLiteral(value, enums) === void 0 && !isSelfContained(value) && unresolved.push(oneLineTextOf(value));
|
|
894
928
|
return {
|
|
895
929
|
csf: deps.csf,
|
|
896
930
|
exportName,
|
|
@@ -911,7 +945,7 @@ var buildStoryDocsPayload = async (input, context) => {
|
|
|
911
945
|
fields: fields2
|
|
912
946
|
});
|
|
913
947
|
if (userMarkup?.kind === "literal") {
|
|
914
|
-
let { analyzeStoryTemplate } = await import("./_node-chunks/story-docs-template-analysis-
|
|
948
|
+
let { analyzeStoryTemplate } = await import("./_node-chunks/story-docs-template-analysis-RYLJZDK3.js"), analysis = analyzeStoryTemplate(userMarkup.markup, userMarkup.expansions), referencedNames = new Set(analysis.kind === "resolved" ? analysis.referencedNames : []), boundOutputs = analysis.kind === "resolved" ? snippetMeta.outputs.filter((name) => analysis.boundOutputs.includes(name)) : [], hostArgs = referencedArgFields(
|
|
915
949
|
referencedNames,
|
|
916
950
|
userMarkup.representedArgs,
|
|
917
951
|
shape,
|
|
@@ -957,7 +991,7 @@ var buildStoryDocsPayload = async (input, context) => {
|
|
|
957
991
|
continue;
|
|
958
992
|
let value = evaluateArgLiteral(node, enums);
|
|
959
993
|
if (value === void 0) {
|
|
960
|
-
unresolved.push(
|
|
994
|
+
unresolved.push(oneLineTextOf(node));
|
|
961
995
|
continue;
|
|
962
996
|
}
|
|
963
997
|
fields.push({ name, value });
|
|
@@ -995,10 +1029,10 @@ var buildStoryDocsPayload = async (input, context) => {
|
|
|
995
1029
|
return { inputs, outputs };
|
|
996
1030
|
}, isFunctionValue = (node) => {
|
|
997
1031
|
let unwrapped = unwrapExpression4(node);
|
|
998
|
-
return
|
|
1032
|
+
return unwrapped.type === "ArrowFunctionExpression" || unwrapped.type === "FunctionExpression" || unwrapped.type === "FunctionDeclaration";
|
|
999
1033
|
}, isUndefinedValue = (node) => {
|
|
1000
1034
|
let unwrapped = unwrapExpression4(node);
|
|
1001
|
-
return
|
|
1035
|
+
return unwrapped.type === "Identifier" && unwrapped.name === "undefined" || unwrapped.type === "UnaryExpression" && unwrapped.operator === "void";
|
|
1002
1036
|
};
|
|
1003
1037
|
|
|
1004
1038
|
// src/docgen/story-docs-preset.ts
|
|
@@ -1312,7 +1346,6 @@ function angularViteRedirectReapplyPlugin(options) {
|
|
|
1312
1346
|
try {
|
|
1313
1347
|
let calls = extractMockCalls(
|
|
1314
1348
|
{ previewConfigPath, configDir: options.configDir },
|
|
1315
|
-
babelParser,
|
|
1316
1349
|
viteConfig.root ?? process.cwd(),
|
|
1317
1350
|
findMockRedirect
|
|
1318
1351
|
);
|
|
@@ -1341,7 +1374,7 @@ function angularViteRedirectReapplyPlugin(options) {
|
|
|
1341
1374
|
if (code.includes("__vitest_current_es_module__"))
|
|
1342
1375
|
return null;
|
|
1343
1376
|
try {
|
|
1344
|
-
let automocked = getAutomockCode(code, a.spy,
|
|
1377
|
+
let automocked = getAutomockCode(code, a.spy, id);
|
|
1345
1378
|
return {
|
|
1346
1379
|
code: automocked.toString(),
|
|
1347
1380
|
map: automocked.generateMap()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular-vite",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.8",
|
|
4
4
|
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"!src/**/*"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@storybook/builder-vite": "11.0.0-alpha.
|
|
66
|
+
"@storybook/builder-vite": "11.0.0-alpha.8",
|
|
67
67
|
"@storybook/global": "^5.0.0",
|
|
68
68
|
"telejson": "8.0.0",
|
|
69
69
|
"ts-dedent": "^2.2.0",
|
|
@@ -81,9 +81,8 @@
|
|
|
81
81
|
"@angular/forms": "^21.2.14",
|
|
82
82
|
"@angular/platform-browser": "^21.2.14",
|
|
83
83
|
"@angular/platform-browser-dynamic": "^21.2.14",
|
|
84
|
-
"@
|
|
85
|
-
"@storybook/angular-
|
|
86
|
-
"@storybook/angular-compodoc": "11.0.0-alpha.7",
|
|
84
|
+
"@storybook/angular-cm": "11.0.0-alpha.8",
|
|
85
|
+
"@storybook/angular-compodoc": "11.0.0-alpha.8",
|
|
87
86
|
"@types/node": "^22.19.1",
|
|
88
87
|
"empathic": "^2.0.0",
|
|
89
88
|
"memfs": "^4.11.1",
|
|
@@ -106,7 +105,7 @@
|
|
|
106
105
|
"rxjs": "^7.4.0",
|
|
107
106
|
"sass": "^1.0.0",
|
|
108
107
|
"sass-embedded": "^1.0.0",
|
|
109
|
-
"storybook": "^11.0.0-alpha.
|
|
108
|
+
"storybook": "^11.0.0-alpha.8",
|
|
110
109
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
111
110
|
"vite": ">=8.0.0",
|
|
112
111
|
"zone.js": ">=0.14.0"
|