@angular/compiler-cli 19.2.0-rc.0 → 19.2.1
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/bundles/{chunk-E7POVVFX.js → chunk-GYTY2X5V.js} +2 -2
- package/bundles/{chunk-HHTMNOE7.js → chunk-J2ZUZS7X.js} +8 -12
- package/bundles/{chunk-HHTMNOE7.js.map → chunk-J2ZUZS7X.js.map} +1 -1
- package/bundles/chunk-J7S5XIBF.js +1 -1
- package/bundles/{chunk-FTZQEOD7.js → chunk-RQP5TAHR.js} +2 -2
- package/bundles/{chunk-67OPP2P5.js → chunk-YDD3LCLX.js} +157 -156
- package/bundles/chunk-YDD3LCLX.js.map +6 -0
- package/bundles/{chunk-JBQ2W4H2.js → chunk-ZWSJXDI6.js} +2 -2
- package/bundles/index.js +5 -5
- package/bundles/private/migrations.js +1 -1
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/bundles/chunk-67OPP2P5.js.map +0 -6
- /package/bundles/{chunk-E7POVVFX.js.map → chunk-GYTY2X5V.js.map} +0 -0
- /package/bundles/{chunk-FTZQEOD7.js.map → chunk-RQP5TAHR.js.map} +0 -0
- /package/bundles/{chunk-JBQ2W4H2.js.map → chunk-ZWSJXDI6.js.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
angularJitApplicationTransform
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GYTY2X5V.js";
|
|
8
8
|
import {
|
|
9
9
|
CompilationMode,
|
|
10
10
|
ComponentDecoratorHandler,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
retagAllTsFiles,
|
|
52
52
|
tryParseInitializerApi,
|
|
53
53
|
untagAllTsFiles
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-J2ZUZS7X.js";
|
|
55
55
|
import {
|
|
56
56
|
AbsoluteModuleStrategy,
|
|
57
57
|
AliasStrategy,
|
|
@@ -182,10 +182,10 @@ function isDocEntryWithSourceInfo(entry) {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
185
|
-
import
|
|
185
|
+
import ts12 from "typescript";
|
|
186
186
|
|
|
187
187
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
188
|
-
import
|
|
188
|
+
import ts6 from "typescript";
|
|
189
189
|
|
|
190
190
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/filters.mjs
|
|
191
191
|
function isAngularPrivateName(name) {
|
|
@@ -195,7 +195,7 @@ function isAngularPrivateName(name) {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
198
|
-
import
|
|
198
|
+
import ts4 from "typescript";
|
|
199
199
|
|
|
200
200
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/generics_extractor.mjs
|
|
201
201
|
function extractGenerics(declaration) {
|
|
@@ -255,8 +255,9 @@ function unescapeAngularDecorators(comment) {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_extractor.mjs
|
|
258
|
+
import ts3 from "typescript";
|
|
258
259
|
function extractResolvedTypeString(node, checker) {
|
|
259
|
-
return checker.typeToString(checker.getTypeAtLocation(node));
|
|
260
|
+
return checker.typeToString(checker.getTypeAtLocation(node), void 0, ts3.TypeFormatFlags.NoTruncation);
|
|
260
261
|
}
|
|
261
262
|
|
|
262
263
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
@@ -275,7 +276,7 @@ var FunctionExtractor = class {
|
|
|
275
276
|
const returnType = signature ? this.typeChecker.typeToString(
|
|
276
277
|
this.typeChecker.getReturnTypeOfSignature(signature),
|
|
277
278
|
void 0,
|
|
278
|
-
|
|
279
|
+
ts4.TypeFormatFlags.NoTypeReduction | ts4.TypeFormatFlags.NoTruncation
|
|
279
280
|
) : "unknown";
|
|
280
281
|
const implementation = (_a = findImplementationOfFunction(this.exportDeclaration, this.typeChecker)) != null ? _a : this.exportDeclaration;
|
|
281
282
|
const type = this.typeChecker.getTypeAtLocation(this.exportDeclaration);
|
|
@@ -287,7 +288,7 @@ var FunctionExtractor = class {
|
|
|
287
288
|
signatures: overloads,
|
|
288
289
|
implementation: {
|
|
289
290
|
params: extractAllParams(implementation.parameters, this.typeChecker),
|
|
290
|
-
isNewType:
|
|
291
|
+
isNewType: ts4.isConstructSignatureDeclaration(implementation),
|
|
291
292
|
returnType,
|
|
292
293
|
returnDescription: (_b = jsdocsTags.find((tag) => tag.name === "returns")) == null ? void 0 : _b.comment,
|
|
293
294
|
generics: extractGenerics(implementation),
|
|
@@ -317,7 +318,7 @@ function filterSignatureDeclarations(signatures) {
|
|
|
317
318
|
const result = [];
|
|
318
319
|
for (const signature of signatures) {
|
|
319
320
|
const decl = signature.getDeclaration();
|
|
320
|
-
if (
|
|
321
|
+
if (ts4.isFunctionDeclaration(decl) || ts4.isCallSignatureDeclaration(decl) || ts4.isMethodDeclaration(decl)) {
|
|
321
322
|
result.push({ signature, decl });
|
|
322
323
|
}
|
|
323
324
|
}
|
|
@@ -336,7 +337,7 @@ function extractCallSignatures(name, typeChecker, type) {
|
|
|
336
337
|
returnType: typeChecker.typeToString(
|
|
337
338
|
typeChecker.getReturnTypeOfSignature(signature),
|
|
338
339
|
void 0,
|
|
339
|
-
|
|
340
|
+
ts4.TypeFormatFlags.NoTypeReduction | ts4.TypeFormatFlags.NoTruncation
|
|
340
341
|
)
|
|
341
342
|
}));
|
|
342
343
|
}
|
|
@@ -346,19 +347,19 @@ function findImplementationOfFunction(node, typeChecker) {
|
|
|
346
347
|
return node;
|
|
347
348
|
}
|
|
348
349
|
const symbol = typeChecker.getSymbolAtLocation(node.name);
|
|
349
|
-
const implementation = (_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.find((s) =>
|
|
350
|
+
const implementation = (_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.find((s) => ts4.isFunctionDeclaration(s) && s.body !== void 0);
|
|
350
351
|
return implementation;
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/internal.mjs
|
|
354
|
-
import
|
|
355
|
+
import ts5 from "typescript";
|
|
355
356
|
function isInternal(member) {
|
|
356
357
|
return extractJsDocTags(member).some((tag) => tag.name === "internal") || hasLeadingInternalComment(member);
|
|
357
358
|
}
|
|
358
359
|
function hasLeadingInternalComment(member) {
|
|
359
360
|
var _a;
|
|
360
361
|
const memberText = member.getSourceFile().text;
|
|
361
|
-
return (_a =
|
|
362
|
+
return (_a = ts5.reduceEachLeadingCommentRange(
|
|
362
363
|
memberText,
|
|
363
364
|
member.getFullStart(),
|
|
364
365
|
(pos, end, kind, hasTrailingNewLine, containsInternal) => {
|
|
@@ -381,7 +382,7 @@ var ClassExtractor = class {
|
|
|
381
382
|
return {
|
|
382
383
|
name: this.declaration.name.text,
|
|
383
384
|
isAbstract: this.isAbstract(),
|
|
384
|
-
entryType:
|
|
385
|
+
entryType: ts6.isInterfaceDeclaration(this.declaration) ? EntryType.Interface : EntryType.UndecoratedClass,
|
|
385
386
|
members: this.extractSignatures().concat(this.extractAllClassMembers()),
|
|
386
387
|
generics: extractGenerics(this.declaration),
|
|
387
388
|
description: extractJsDocDescription(this.declaration),
|
|
@@ -408,7 +409,7 @@ var ClassExtractor = class {
|
|
|
408
409
|
return this.extractMethod(memberDeclaration);
|
|
409
410
|
} else if (this.isProperty(memberDeclaration) && !this.hasPrivateComputedProperty(memberDeclaration)) {
|
|
410
411
|
return this.extractClassProperty(memberDeclaration);
|
|
411
|
-
} else if (
|
|
412
|
+
} else if (ts6.isAccessor(memberDeclaration)) {
|
|
412
413
|
return this.extractGetterSetter(memberDeclaration);
|
|
413
414
|
}
|
|
414
415
|
return void 0;
|
|
@@ -425,7 +426,7 @@ var ClassExtractor = class {
|
|
|
425
426
|
};
|
|
426
427
|
}
|
|
427
428
|
extractSignature(signature) {
|
|
428
|
-
const functionExtractor = new FunctionExtractor(
|
|
429
|
+
const functionExtractor = new FunctionExtractor(ts6.isConstructSignatureDeclaration(signature) ? "new" : "", signature, this.typeChecker);
|
|
429
430
|
return {
|
|
430
431
|
...functionExtractor.extract(),
|
|
431
432
|
memberType: MemberType.Method,
|
|
@@ -445,7 +446,7 @@ var ClassExtractor = class {
|
|
|
445
446
|
extractGetterSetter(accessor) {
|
|
446
447
|
return {
|
|
447
448
|
...this.extractClassProperty(accessor),
|
|
448
|
-
memberType:
|
|
449
|
+
memberType: ts6.isGetAccessor(accessor) ? MemberType.Getter : MemberType.Setter
|
|
449
450
|
};
|
|
450
451
|
}
|
|
451
452
|
extractInheritance(declaration) {
|
|
@@ -453,7 +454,7 @@ var ClassExtractor = class {
|
|
|
453
454
|
return void 0;
|
|
454
455
|
}
|
|
455
456
|
for (const clause of declaration.heritageClauses) {
|
|
456
|
-
if (clause.token ===
|
|
457
|
+
if (clause.token === ts6.SyntaxKind.ExtendsKeyword) {
|
|
457
458
|
const types = clause.types;
|
|
458
459
|
if (types.length > 0) {
|
|
459
460
|
const baseClass = types[0];
|
|
@@ -465,7 +466,7 @@ var ClassExtractor = class {
|
|
|
465
466
|
}
|
|
466
467
|
extractInterfaceConformance(declaration) {
|
|
467
468
|
var _a, _b;
|
|
468
|
-
const implementClause = (_a = declaration.heritageClauses) == null ? void 0 : _a.find((clause) => clause.token ===
|
|
469
|
+
const implementClause = (_a = declaration.heritageClauses) == null ? void 0 : _a.find((clause) => clause.token === ts6.SyntaxKind.ImplementsKeyword);
|
|
469
470
|
return (_b = implementClause == null ? void 0 : implementClause.types.map((m) => m.getText())) != null ? _b : [];
|
|
470
471
|
}
|
|
471
472
|
getMemberTags(member) {
|
|
@@ -511,9 +512,9 @@ var ClassExtractor = class {
|
|
|
511
512
|
filterMethodOverloads(declarations) {
|
|
512
513
|
return declarations.filter((declaration, index) => {
|
|
513
514
|
var _a;
|
|
514
|
-
if (
|
|
515
|
+
if (ts6.isFunctionDeclaration(declaration) || ts6.isMethodDeclaration(declaration)) {
|
|
515
516
|
const nextDeclaration = declarations[index + 1];
|
|
516
|
-
const isNextAbstractMethodWithSameName = nextDeclaration &&
|
|
517
|
+
const isNextAbstractMethodWithSameName = nextDeclaration && ts6.isMethodDeclaration(nextDeclaration) && nextDeclaration.name.getText() === ((_a = declaration.name) == null ? void 0 : _a.getText());
|
|
517
518
|
return !isNextAbstractMethodWithSameName;
|
|
518
519
|
}
|
|
519
520
|
return true;
|
|
@@ -530,13 +531,13 @@ var ClassExtractor = class {
|
|
|
530
531
|
}
|
|
531
532
|
getTagForMemberModifier(mod) {
|
|
532
533
|
switch (mod.kind) {
|
|
533
|
-
case
|
|
534
|
+
case ts6.SyntaxKind.StaticKeyword:
|
|
534
535
|
return MemberTags.Static;
|
|
535
|
-
case
|
|
536
|
+
case ts6.SyntaxKind.ReadonlyKeyword:
|
|
536
537
|
return MemberTags.Readonly;
|
|
537
|
-
case
|
|
538
|
+
case ts6.SyntaxKind.ProtectedKeyword:
|
|
538
539
|
return MemberTags.Protected;
|
|
539
|
-
case
|
|
540
|
+
case ts6.SyntaxKind.AbstractKeyword:
|
|
540
541
|
return MemberTags.Abstract;
|
|
541
542
|
default:
|
|
542
543
|
return void 0;
|
|
@@ -544,33 +545,33 @@ var ClassExtractor = class {
|
|
|
544
545
|
}
|
|
545
546
|
isMemberExcluded(member) {
|
|
546
547
|
var _a;
|
|
547
|
-
return !member.name || !this.isDocumentableMember(member) || !
|
|
548
|
+
return !member.name || !this.isDocumentableMember(member) || !ts6.isCallSignatureDeclaration(member) && ((_a = member.modifiers) == null ? void 0 : _a.some((mod) => mod.kind === ts6.SyntaxKind.PrivateKeyword)) || member.name.getText() === "prototype" || isAngularPrivateName(member.name.getText()) || isInternal(member);
|
|
548
549
|
}
|
|
549
550
|
isDocumentableMember(member) {
|
|
550
|
-
return this.isMethod(member) || this.isProperty(member) ||
|
|
551
|
+
return this.isMethod(member) || this.isProperty(member) || ts6.isAccessor(member) || ts6.isCallSignatureDeclaration(member);
|
|
551
552
|
}
|
|
552
553
|
isPublicConstructorParameterProperty(node) {
|
|
553
|
-
if (
|
|
554
|
-
return node.modifiers.some((modifier) => modifier.kind ===
|
|
554
|
+
if (ts6.isParameterPropertyDeclaration(node, node.parent) && node.modifiers) {
|
|
555
|
+
return node.modifiers.some((modifier) => modifier.kind === ts6.SyntaxKind.PublicKeyword);
|
|
555
556
|
}
|
|
556
557
|
return false;
|
|
557
558
|
}
|
|
558
559
|
isProperty(member) {
|
|
559
|
-
return
|
|
560
|
+
return ts6.isPropertyDeclaration(member) || ts6.isPropertySignature(member) || this.isPublicConstructorParameterProperty(member);
|
|
560
561
|
}
|
|
561
562
|
isMethod(member) {
|
|
562
|
-
return
|
|
563
|
+
return ts6.isMethodDeclaration(member) || ts6.isMethodSignature(member);
|
|
563
564
|
}
|
|
564
565
|
isDocumentableSignature(signature) {
|
|
565
|
-
return
|
|
566
|
+
return ts6.isConstructSignatureDeclaration(signature) || ts6.isCallSignatureDeclaration(signature);
|
|
566
567
|
}
|
|
567
568
|
isAbstract() {
|
|
568
569
|
var _a;
|
|
569
570
|
const modifiers = (_a = this.declaration.modifiers) != null ? _a : [];
|
|
570
|
-
return modifiers.some((mod) => mod.kind ===
|
|
571
|
+
return modifiers.some((mod) => mod.kind === ts6.SyntaxKind.AbstractKeyword);
|
|
571
572
|
}
|
|
572
573
|
hasPrivateComputedProperty(property) {
|
|
573
|
-
return
|
|
574
|
+
return ts6.isComputedPropertyName(property.name) && property.name.expression.getText().startsWith("\u0275");
|
|
574
575
|
}
|
|
575
576
|
};
|
|
576
577
|
var DirectiveExtractor = class extends ClassExtractor {
|
|
@@ -672,7 +673,7 @@ function extractInterface(declaration, typeChecker) {
|
|
|
672
673
|
}
|
|
673
674
|
|
|
674
675
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/constant_extractor.mjs
|
|
675
|
-
import
|
|
676
|
+
import ts7 from "typescript";
|
|
676
677
|
var LITERAL_AS_ENUM_TAG = "object-literal-as-enum";
|
|
677
678
|
function extractConstant(declaration, typeChecker) {
|
|
678
679
|
const resolvedType = typeChecker.getBaseTypeOfLiteralType(typeChecker.getTypeAtLocation(declaration));
|
|
@@ -704,17 +705,17 @@ function isSyntheticAngularConstant(declaration) {
|
|
|
704
705
|
}
|
|
705
706
|
function extractLiteralPropertiesAsEnumMembers(declaration) {
|
|
706
707
|
let initializer = declaration.initializer;
|
|
707
|
-
while (initializer && (
|
|
708
|
+
while (initializer && (ts7.isAsExpression(initializer) || ts7.isParenthesizedExpression(initializer))) {
|
|
708
709
|
initializer = initializer.expression;
|
|
709
710
|
}
|
|
710
|
-
if (initializer === void 0 || !
|
|
711
|
-
throw new Error(`Declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to an object literal, but received ${initializer ?
|
|
711
|
+
if (initializer === void 0 || !ts7.isObjectLiteralExpression(initializer)) {
|
|
712
|
+
throw new Error(`Declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to an object literal, but received ${initializer ? ts7.SyntaxKind[initializer.kind] : "undefined"}`);
|
|
712
713
|
}
|
|
713
714
|
return initializer.properties.map((prop) => {
|
|
714
|
-
if (!
|
|
715
|
+
if (!ts7.isPropertyAssignment(prop) || !ts7.isIdentifier(prop.name)) {
|
|
715
716
|
throw new Error(`Property in declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be a property assignment with a static name`);
|
|
716
717
|
}
|
|
717
|
-
if (!
|
|
718
|
+
if (!ts7.isNumericLiteral(prop.initializer) && !ts7.isStringLiteralLike(prop.initializer)) {
|
|
718
719
|
throw new Error(`Property in declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to a number or string literal`);
|
|
719
720
|
}
|
|
720
721
|
return {
|
|
@@ -730,7 +731,7 @@ function extractLiteralPropertiesAsEnumMembers(declaration) {
|
|
|
730
731
|
}
|
|
731
732
|
|
|
732
733
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/decorator_extractor.mjs
|
|
733
|
-
import
|
|
734
|
+
import ts8 from "typescript";
|
|
734
735
|
function extractorDecorator(declaration, typeChecker) {
|
|
735
736
|
const documentedNode = getDecoratorJsDocNode(declaration);
|
|
736
737
|
const decoratorType = getDecoratorType(declaration);
|
|
@@ -751,7 +752,7 @@ function isDecoratorDeclaration(declaration) {
|
|
|
751
752
|
return !!getDecoratorType(declaration);
|
|
752
753
|
}
|
|
753
754
|
function isDecoratorOptionsInterface(declaration) {
|
|
754
|
-
return declaration.getSourceFile().statements.some((s) =>
|
|
755
|
+
return declaration.getSourceFile().statements.some((s) => ts8.isVariableStatement(s) && s.declarationList.declarations.some((d) => isDecoratorDeclaration(d) && d.name.getText() === declaration.name.getText()));
|
|
755
756
|
}
|
|
756
757
|
function getDecoratorType(declaration) {
|
|
757
758
|
var _a, _b;
|
|
@@ -768,19 +769,19 @@ function getDecoratorOptions(declaration, typeChecker) {
|
|
|
768
769
|
var _a, _b;
|
|
769
770
|
const name = declaration.name.getText();
|
|
770
771
|
const optionsDeclaration = declaration.getSourceFile().statements.find((node) => {
|
|
771
|
-
return (
|
|
772
|
+
return (ts8.isInterfaceDeclaration(node) || ts8.isTypeAliasDeclaration(node)) && node.name.getText() === name;
|
|
772
773
|
});
|
|
773
774
|
if (!optionsDeclaration) {
|
|
774
775
|
throw new Error(`Decorator "${name}" has no corresponding options interface.`);
|
|
775
776
|
}
|
|
776
777
|
let optionsInterface;
|
|
777
|
-
if (
|
|
778
|
+
if (ts8.isTypeAliasDeclaration(optionsDeclaration)) {
|
|
778
779
|
const aliasedType = typeChecker.getTypeAtLocation(optionsDeclaration.type);
|
|
779
|
-
optionsInterface = ((_b = (_a = aliasedType.getSymbol()) == null ? void 0 : _a.getDeclarations()) != null ? _b : []).find((d) =>
|
|
780
|
+
optionsInterface = ((_b = (_a = aliasedType.getSymbol()) == null ? void 0 : _a.getDeclarations()) != null ? _b : []).find((d) => ts8.isInterfaceDeclaration(d));
|
|
780
781
|
} else {
|
|
781
782
|
optionsInterface = optionsDeclaration;
|
|
782
783
|
}
|
|
783
|
-
if (!optionsInterface || !
|
|
784
|
+
if (!optionsInterface || !ts8.isInterfaceDeclaration(optionsInterface)) {
|
|
784
785
|
throw new Error(`Options for decorator "${name}" is not an interface.`);
|
|
785
786
|
}
|
|
786
787
|
return extractInterface(optionsInterface, typeChecker).members;
|
|
@@ -788,22 +789,22 @@ function getDecoratorOptions(declaration, typeChecker) {
|
|
|
788
789
|
function getDecoratorJsDocNode(declaration) {
|
|
789
790
|
const name = declaration.name.getText();
|
|
790
791
|
const decoratorInterface = declaration.getSourceFile().statements.find((s) => {
|
|
791
|
-
return
|
|
792
|
+
return ts8.isInterfaceDeclaration(s) && s.name.getText() === `${name}Decorator`;
|
|
792
793
|
});
|
|
793
|
-
if (!decoratorInterface || !
|
|
794
|
+
if (!decoratorInterface || !ts8.isInterfaceDeclaration(decoratorInterface)) {
|
|
794
795
|
throw new Error(`No interface "${name}Decorator" found.`);
|
|
795
796
|
}
|
|
796
797
|
const callSignature = decoratorInterface.members.find((node) => {
|
|
797
|
-
return
|
|
798
|
+
return ts8.isCallSignatureDeclaration(node) && extractRawJsDoc(node);
|
|
798
799
|
});
|
|
799
|
-
if (!callSignature || !
|
|
800
|
+
if (!callSignature || !ts8.isCallSignatureDeclaration(callSignature)) {
|
|
800
801
|
throw new Error(`No call signature with JsDoc on "${name}Decorator"`);
|
|
801
802
|
}
|
|
802
803
|
return callSignature;
|
|
803
804
|
}
|
|
804
805
|
|
|
805
806
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/enum_extractor.mjs
|
|
806
|
-
import
|
|
807
|
+
import ts9 from "typescript";
|
|
807
808
|
function extractEnum(declaration, typeChecker) {
|
|
808
809
|
return {
|
|
809
810
|
name: declaration.name.getText(),
|
|
@@ -828,37 +829,37 @@ function extractEnumMembers(declaration, checker) {
|
|
|
828
829
|
function getEnumMemberValue(memberNode) {
|
|
829
830
|
var _a;
|
|
830
831
|
const literal = memberNode.getChildren().find((n) => {
|
|
831
|
-
return
|
|
832
|
+
return ts9.isNumericLiteral(n) || ts9.isStringLiteral(n) || ts9.isPrefixUnaryExpression(n) && n.operator === ts9.SyntaxKind.MinusToken && ts9.isNumericLiteral(n.operand);
|
|
832
833
|
});
|
|
833
834
|
return (_a = literal == null ? void 0 : literal.getText()) != null ? _a : "";
|
|
834
835
|
}
|
|
835
836
|
|
|
836
837
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/initializer_api_function_extractor.mjs
|
|
837
|
-
import
|
|
838
|
+
import ts10 from "typescript";
|
|
838
839
|
var initializerApiTag = "initializerApiFunction";
|
|
839
840
|
function isInitializerApiFunction(node, typeChecker) {
|
|
840
|
-
if (
|
|
841
|
+
if (ts10.isFunctionDeclaration(node) && node.name !== void 0 && node.body === void 0) {
|
|
841
842
|
const implementation = findImplementationOfFunction(node, typeChecker);
|
|
842
843
|
if (implementation !== void 0) {
|
|
843
844
|
node = implementation;
|
|
844
845
|
}
|
|
845
846
|
}
|
|
846
|
-
if (!
|
|
847
|
+
if (!ts10.isFunctionDeclaration(node) && !ts10.isVariableDeclaration(node)) {
|
|
847
848
|
return false;
|
|
848
849
|
}
|
|
849
|
-
let tagContainer =
|
|
850
|
+
let tagContainer = ts10.isFunctionDeclaration(node) ? node : getContainerVariableStatement(node);
|
|
850
851
|
if (tagContainer === null) {
|
|
851
852
|
return false;
|
|
852
853
|
}
|
|
853
|
-
const tags =
|
|
854
|
+
const tags = ts10.getJSDocTags(tagContainer);
|
|
854
855
|
return tags.some((t) => t.tagName.text === initializerApiTag);
|
|
855
856
|
}
|
|
856
857
|
function extractInitializerApiFunction(node, typeChecker) {
|
|
857
858
|
var _a;
|
|
858
|
-
if (node.name === void 0 || !
|
|
859
|
+
if (node.name === void 0 || !ts10.isIdentifier(node.name)) {
|
|
859
860
|
throw new Error(`Initializer API: Expected literal variable name.`);
|
|
860
861
|
}
|
|
861
|
-
const container =
|
|
862
|
+
const container = ts10.isFunctionDeclaration(node) ? node : getContainerVariableStatement(node);
|
|
862
863
|
if (container === null) {
|
|
863
864
|
throw new Error("Initializer API: Could not find container AST node of variable.");
|
|
864
865
|
}
|
|
@@ -869,7 +870,7 @@ function extractInitializerApiFunction(node, typeChecker) {
|
|
|
869
870
|
for (const property of type.getProperties()) {
|
|
870
871
|
const subName = property.getName();
|
|
871
872
|
const subDecl = (_a = property.getDeclarations()) == null ? void 0 : _a[0];
|
|
872
|
-
if (subDecl === void 0 || !
|
|
873
|
+
if (subDecl === void 0 || !ts10.isPropertySignature(subDecl)) {
|
|
873
874
|
throw new Error(`Initializer API: Could not resolve declaration of sub-property: ${name}.${subName}`);
|
|
874
875
|
}
|
|
875
876
|
const subType = typeChecker.getTypeAtLocation(subDecl);
|
|
@@ -878,7 +879,7 @@ function extractInitializerApiFunction(node, typeChecker) {
|
|
|
878
879
|
let jsdocTags;
|
|
879
880
|
let description;
|
|
880
881
|
let rawComment;
|
|
881
|
-
if (
|
|
882
|
+
if (ts10.isFunctionDeclaration(node)) {
|
|
882
883
|
const implementation = findImplementationOfFunction(node, typeChecker);
|
|
883
884
|
if (implementation === void 0) {
|
|
884
885
|
throw new Error(`Initializer API: Could not find implementation of function: ${name}`);
|
|
@@ -926,10 +927,10 @@ function extractInitializerApiFunction(node, typeChecker) {
|
|
|
926
927
|
};
|
|
927
928
|
}
|
|
928
929
|
function getContainerVariableStatement(node) {
|
|
929
|
-
if (!
|
|
930
|
+
if (!ts10.isVariableDeclarationList(node.parent)) {
|
|
930
931
|
return null;
|
|
931
932
|
}
|
|
932
|
-
if (!
|
|
933
|
+
if (!ts10.isVariableStatement(node.parent.parent)) {
|
|
933
934
|
return null;
|
|
934
935
|
}
|
|
935
936
|
return node.parent.parent;
|
|
@@ -956,16 +957,16 @@ function extractTypeAlias(declaration) {
|
|
|
956
957
|
}
|
|
957
958
|
|
|
958
959
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/import_extractor.mjs
|
|
959
|
-
import
|
|
960
|
+
import ts11 from "typescript";
|
|
960
961
|
function getImportedSymbols(sourceFile) {
|
|
961
962
|
const importSpecifiers = /* @__PURE__ */ new Map();
|
|
962
963
|
function visit(node) {
|
|
963
964
|
var _a;
|
|
964
|
-
if (
|
|
965
|
+
if (ts11.isImportDeclaration(node)) {
|
|
965
966
|
let moduleSpecifier = node.moduleSpecifier.getText(sourceFile).replace(/['"]/g, "");
|
|
966
967
|
if (moduleSpecifier.startsWith("@angular/")) {
|
|
967
968
|
const namedBindings = (_a = node.importClause) == null ? void 0 : _a.namedBindings;
|
|
968
|
-
if (namedBindings &&
|
|
969
|
+
if (namedBindings && ts11.isNamedImports(namedBindings)) {
|
|
969
970
|
namedBindings.elements.forEach((importSpecifier) => {
|
|
970
971
|
const importName = importSpecifier.name.text;
|
|
971
972
|
const importAlias = importSpecifier.propertyName ? importSpecifier.propertyName.text : void 0;
|
|
@@ -974,7 +975,7 @@ function getImportedSymbols(sourceFile) {
|
|
|
974
975
|
}
|
|
975
976
|
}
|
|
976
977
|
}
|
|
977
|
-
|
|
978
|
+
ts11.forEachChild(node, visit);
|
|
978
979
|
}
|
|
979
980
|
visit(sourceFile);
|
|
980
981
|
return importSpecifiers;
|
|
@@ -1011,8 +1012,8 @@ var DocsExtractor = class {
|
|
|
1011
1012
|
});
|
|
1012
1013
|
entry.source = {
|
|
1013
1014
|
filePath: getRelativeFilePath(realSourceFile, rootDir),
|
|
1014
|
-
startLine:
|
|
1015
|
-
endLine:
|
|
1015
|
+
startLine: ts12.getLineAndCharacterOfPosition(realSourceFile, node.getStart()).line + 1,
|
|
1016
|
+
endLine: ts12.getLineAndCharacterOfPosition(realSourceFile, node.getEnd()).line + 1
|
|
1016
1017
|
};
|
|
1017
1018
|
entries.push({ ...entry, name: exportName });
|
|
1018
1019
|
}
|
|
@@ -1026,20 +1027,20 @@ var DocsExtractor = class {
|
|
|
1026
1027
|
if (isInitializerApiFunction(node, this.typeChecker)) {
|
|
1027
1028
|
return extractInitializerApiFunction(node, this.typeChecker);
|
|
1028
1029
|
}
|
|
1029
|
-
if (
|
|
1030
|
+
if (ts12.isInterfaceDeclaration(node) && !isIgnoredInterface(node)) {
|
|
1030
1031
|
return extractInterface(node, this.typeChecker);
|
|
1031
1032
|
}
|
|
1032
|
-
if (
|
|
1033
|
+
if (ts12.isFunctionDeclaration(node)) {
|
|
1033
1034
|
const functionExtractor = new FunctionExtractor(node.name.getText(), node, this.typeChecker);
|
|
1034
1035
|
return functionExtractor.extract();
|
|
1035
1036
|
}
|
|
1036
|
-
if (
|
|
1037
|
+
if (ts12.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
|
|
1037
1038
|
return isDecoratorDeclaration(node) ? extractorDecorator(node, this.typeChecker) : extractConstant(node, this.typeChecker);
|
|
1038
1039
|
}
|
|
1039
|
-
if (
|
|
1040
|
+
if (ts12.isTypeAliasDeclaration(node)) {
|
|
1040
1041
|
return extractTypeAlias(node);
|
|
1041
1042
|
}
|
|
1042
|
-
if (
|
|
1043
|
+
if (ts12.isEnumDeclaration(node)) {
|
|
1043
1044
|
return extractEnum(node, this.typeChecker);
|
|
1044
1045
|
}
|
|
1045
1046
|
return null;
|
|
@@ -1070,7 +1071,7 @@ function getRelativeFilePath(sourceFile, rootDir) {
|
|
|
1070
1071
|
|
|
1071
1072
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
1072
1073
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
1073
|
-
import
|
|
1074
|
+
import ts27 from "typescript";
|
|
1074
1075
|
|
|
1075
1076
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
1076
1077
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
@@ -1124,7 +1125,7 @@ function getPathNormalizer(basePath) {
|
|
|
1124
1125
|
}
|
|
1125
1126
|
|
|
1126
1127
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
1127
|
-
import
|
|
1128
|
+
import ts13 from "typescript";
|
|
1128
1129
|
|
|
1129
1130
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
|
|
1130
1131
|
function toNumbers(value) {
|
|
@@ -1164,7 +1165,7 @@ function compareVersions(v1, v2) {
|
|
|
1164
1165
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
1165
1166
|
var MIN_TS_VERSION = "5.5.0";
|
|
1166
1167
|
var MAX_TS_VERSION = "5.9.0";
|
|
1167
|
-
var tsVersion =
|
|
1168
|
+
var tsVersion = ts13.version;
|
|
1168
1169
|
function checkVersion(version, minVersion, maxVersion) {
|
|
1169
1170
|
if (compareVersions(version, minVersion) < 0 || compareVersions(version, maxVersion) >= 0) {
|
|
1170
1171
|
throw new Error(`The Angular Compiler requires TypeScript >=${minVersion} and <${maxVersion} but ${version} was found instead.`);
|
|
@@ -1176,7 +1177,7 @@ function verifySupportedTypeScriptVersion() {
|
|
|
1176
1177
|
|
|
1177
1178
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
1178
1179
|
import { R3Identifiers } from "@angular/compiler";
|
|
1179
|
-
import
|
|
1180
|
+
import ts25 from "typescript";
|
|
1180
1181
|
|
|
1181
1182
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
1182
1183
|
var CycleAnalyzer = class {
|
|
@@ -1256,7 +1257,7 @@ var Cycle = class {
|
|
|
1256
1257
|
};
|
|
1257
1258
|
|
|
1258
1259
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
1259
|
-
import
|
|
1260
|
+
import ts14 from "typescript";
|
|
1260
1261
|
var ImportGraph = class {
|
|
1261
1262
|
checker;
|
|
1262
1263
|
perf;
|
|
@@ -1302,10 +1303,10 @@ var ImportGraph = class {
|
|
|
1302
1303
|
return this.perf.inPhase(PerfPhase.CycleDetection, () => {
|
|
1303
1304
|
const imports = /* @__PURE__ */ new Set();
|
|
1304
1305
|
for (const stmt of sf.statements) {
|
|
1305
|
-
if (!
|
|
1306
|
+
if (!ts14.isImportDeclaration(stmt) && !ts14.isExportDeclaration(stmt) || stmt.moduleSpecifier === void 0) {
|
|
1306
1307
|
continue;
|
|
1307
1308
|
}
|
|
1308
|
-
if (
|
|
1309
|
+
if (ts14.isImportDeclaration(stmt) && stmt.importClause !== void 0 && isTypeOnlyImportClause(stmt.importClause)) {
|
|
1309
1310
|
continue;
|
|
1310
1311
|
}
|
|
1311
1312
|
const symbol = this.checker.getSymbolAtLocation(stmt.moduleSpecifier);
|
|
@@ -1313,7 +1314,7 @@ var ImportGraph = class {
|
|
|
1313
1314
|
continue;
|
|
1314
1315
|
}
|
|
1315
1316
|
const moduleFile = symbol.valueDeclaration;
|
|
1316
|
-
if (
|
|
1317
|
+
if (ts14.isSourceFile(moduleFile) && isLocalFile(moduleFile)) {
|
|
1317
1318
|
imports.add(moduleFile);
|
|
1318
1319
|
}
|
|
1319
1320
|
}
|
|
@@ -1328,7 +1329,7 @@ function isTypeOnlyImportClause(node) {
|
|
|
1328
1329
|
if (node.isTypeOnly) {
|
|
1329
1330
|
return true;
|
|
1330
1331
|
}
|
|
1331
|
-
if (node.namedBindings !== void 0 &&
|
|
1332
|
+
if (node.namedBindings !== void 0 && ts14.isNamedImports(node.namedBindings) && node.namedBindings.elements.every((specifier) => specifier.isTypeOnly)) {
|
|
1332
1333
|
return true;
|
|
1333
1334
|
}
|
|
1334
1335
|
return false;
|
|
@@ -1352,7 +1353,7 @@ var Found = class {
|
|
|
1352
1353
|
};
|
|
1353
1354
|
|
|
1354
1355
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
1355
|
-
import
|
|
1356
|
+
import ts15 from "typescript";
|
|
1356
1357
|
var FlatIndexGenerator = class {
|
|
1357
1358
|
entryPoint;
|
|
1358
1359
|
moduleName;
|
|
@@ -1371,7 +1372,7 @@ var FlatIndexGenerator = class {
|
|
|
1371
1372
|
|
|
1372
1373
|
export * from '${relativeEntryPoint}';
|
|
1373
1374
|
`;
|
|
1374
|
-
const genFile =
|
|
1375
|
+
const genFile = ts15.createSourceFile(this.flatIndexPath, contents, ts15.ScriptTarget.ES2015, true, ts15.ScriptKind.TS);
|
|
1375
1376
|
if (this.moduleName !== null) {
|
|
1376
1377
|
genFile.moduleName = this.moduleName;
|
|
1377
1378
|
}
|
|
@@ -1396,7 +1397,7 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
1396
1397
|
}
|
|
1397
1398
|
|
|
1398
1399
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
1399
|
-
import
|
|
1400
|
+
import ts16 from "typescript";
|
|
1400
1401
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
1401
1402
|
const diagnostics = [];
|
|
1402
1403
|
const topLevelExports = /* @__PURE__ */ new Set();
|
|
@@ -1406,7 +1407,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
1406
1407
|
}
|
|
1407
1408
|
const exportedSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
1408
1409
|
exportedSymbols.forEach((symbol) => {
|
|
1409
|
-
if (symbol.flags &
|
|
1410
|
+
if (symbol.flags & ts16.SymbolFlags.Alias) {
|
|
1410
1411
|
symbol = checker.getAliasedSymbol(symbol);
|
|
1411
1412
|
}
|
|
1412
1413
|
const decl = symbol.valueDeclaration;
|
|
@@ -1430,7 +1431,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
1430
1431
|
visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
|
|
1431
1432
|
}
|
|
1432
1433
|
const diagnostic = {
|
|
1433
|
-
category:
|
|
1434
|
+
category: ts16.DiagnosticCategory.Error,
|
|
1434
1435
|
code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
|
|
1435
1436
|
file: transitiveReference.getSourceFile(),
|
|
1436
1437
|
...getPosOfDeclaration(transitiveReference),
|
|
@@ -1450,7 +1451,7 @@ function getPosOfDeclaration(decl) {
|
|
|
1450
1451
|
};
|
|
1451
1452
|
}
|
|
1452
1453
|
function getIdentifierOfDeclaration(decl) {
|
|
1453
|
-
if ((
|
|
1454
|
+
if ((ts16.isClassDeclaration(decl) || ts16.isVariableDeclaration(decl) || ts16.isFunctionDeclaration(decl)) && decl.name !== void 0 && ts16.isIdentifier(decl.name)) {
|
|
1454
1455
|
return decl.name;
|
|
1455
1456
|
} else {
|
|
1456
1457
|
return null;
|
|
@@ -1462,13 +1463,13 @@ function getNameOfDeclaration(decl) {
|
|
|
1462
1463
|
}
|
|
1463
1464
|
function getDescriptorOfDeclaration(decl) {
|
|
1464
1465
|
switch (decl.kind) {
|
|
1465
|
-
case
|
|
1466
|
+
case ts16.SyntaxKind.ClassDeclaration:
|
|
1466
1467
|
return "class";
|
|
1467
|
-
case
|
|
1468
|
+
case ts16.SyntaxKind.FunctionDeclaration:
|
|
1468
1469
|
return "function";
|
|
1469
|
-
case
|
|
1470
|
+
case ts16.SyntaxKind.VariableDeclaration:
|
|
1470
1471
|
return "variable";
|
|
1471
|
-
case
|
|
1472
|
+
case ts16.SyntaxKind.EnumDeclaration:
|
|
1472
1473
|
return "enum";
|
|
1473
1474
|
default:
|
|
1474
1475
|
return "declaration";
|
|
@@ -2300,7 +2301,7 @@ var NgModuleIndexImpl = class {
|
|
|
2300
2301
|
};
|
|
2301
2302
|
|
|
2302
2303
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
2303
|
-
import
|
|
2304
|
+
import ts17 from "typescript";
|
|
2304
2305
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
2305
2306
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
2306
2307
|
var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
|
|
@@ -2422,7 +2423,7 @@ var AdapterResourceLoader = class {
|
|
|
2422
2423
|
return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
|
|
2423
2424
|
}
|
|
2424
2425
|
getResolvedCandidateLocations(url, fromFile) {
|
|
2425
|
-
const failedLookup =
|
|
2426
|
+
const failedLookup = ts17.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
|
|
2426
2427
|
if (failedLookup.failedLookupLocations === void 0) {
|
|
2427
2428
|
throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
|
|
2428
2429
|
}
|
|
@@ -2560,7 +2561,7 @@ var StandaloneComponentScopeReader = class {
|
|
|
2560
2561
|
import { ASTWithSource as ASTWithSource3, BindingType, Interpolation, PropertyRead as PropertyRead2, TmplAstBoundAttribute } from "@angular/compiler";
|
|
2561
2562
|
|
|
2562
2563
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
|
|
2563
|
-
import
|
|
2564
|
+
import ts18 from "typescript";
|
|
2564
2565
|
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
2565
2566
|
"WritableSignal",
|
|
2566
2567
|
"Signal",
|
|
@@ -2575,7 +2576,7 @@ function isSignalSymbol(symbol) {
|
|
|
2575
2576
|
const declarations = symbol.getDeclarations();
|
|
2576
2577
|
return declarations !== void 0 && declarations.some((decl) => {
|
|
2577
2578
|
const fileName = decl.getSourceFile().fileName;
|
|
2578
|
-
return (
|
|
2579
|
+
return (ts18.isInterfaceDeclaration(decl) || ts18.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
|
|
2579
2580
|
});
|
|
2580
2581
|
}
|
|
2581
2582
|
|
|
@@ -2862,7 +2863,7 @@ var factory4 = {
|
|
|
2862
2863
|
|
|
2863
2864
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
2864
2865
|
import { Binary } from "@angular/compiler";
|
|
2865
|
-
import
|
|
2866
|
+
import ts19 from "typescript";
|
|
2866
2867
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
2867
2868
|
canVisitStructuralAttributes = false;
|
|
2868
2869
|
code = ErrorCode.NULLISH_COALESCING_NOT_NULLABLE;
|
|
@@ -2874,7 +2875,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
2874
2875
|
return [];
|
|
2875
2876
|
}
|
|
2876
2877
|
const typeLeft = symbolLeft.tsType;
|
|
2877
|
-
if (typeLeft.flags & (
|
|
2878
|
+
if (typeLeft.flags & (ts19.TypeFlags.Any | ts19.TypeFlags.Unknown)) {
|
|
2878
2879
|
return [];
|
|
2879
2880
|
}
|
|
2880
2881
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -2905,7 +2906,7 @@ var factory5 = {
|
|
|
2905
2906
|
|
|
2906
2907
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.mjs
|
|
2907
2908
|
import { SafeCall, SafeKeyedRead, SafePropertyRead } from "@angular/compiler";
|
|
2908
|
-
import
|
|
2909
|
+
import ts20 from "typescript";
|
|
2909
2910
|
var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
2910
2911
|
canVisitStructuralAttributes = false;
|
|
2911
2912
|
code = ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
|
|
@@ -2917,7 +2918,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
2917
2918
|
return [];
|
|
2918
2919
|
}
|
|
2919
2920
|
const typeLeft = symbolLeft.tsType;
|
|
2920
|
-
if (typeLeft.flags & (
|
|
2921
|
+
if (typeLeft.flags & (ts20.TypeFlags.Any | ts20.TypeFlags.Unknown)) {
|
|
2921
2922
|
return [];
|
|
2922
2923
|
}
|
|
2923
2924
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -3122,7 +3123,7 @@ var factory11 = {
|
|
|
3122
3123
|
};
|
|
3123
3124
|
|
|
3124
3125
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
3125
|
-
import
|
|
3126
|
+
import ts21 from "typescript";
|
|
3126
3127
|
|
|
3127
3128
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
3128
3129
|
var DiagnosticCategoryLabel;
|
|
@@ -3173,9 +3174,9 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
3173
3174
|
function diagnosticLabelToCategory(label) {
|
|
3174
3175
|
switch (label) {
|
|
3175
3176
|
case DiagnosticCategoryLabel.Warning:
|
|
3176
|
-
return
|
|
3177
|
+
return ts21.DiagnosticCategory.Warning;
|
|
3177
3178
|
case DiagnosticCategoryLabel.Error:
|
|
3178
|
-
return
|
|
3179
|
+
return ts21.DiagnosticCategory.Error;
|
|
3179
3180
|
case DiagnosticCategoryLabel.Suppress:
|
|
3180
3181
|
return null;
|
|
3181
3182
|
default:
|
|
@@ -3209,7 +3210,7 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
|
3209
3210
|
|
|
3210
3211
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
|
|
3211
3212
|
import { ASTWithSource as ASTWithSource6, ImplicitReceiver as ImplicitReceiver2, ParsedEventType as ParsedEventType2, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstLetDeclaration as TmplAstLetDeclaration2, TmplAstRecursiveVisitor as TmplAstRecursiveVisitor2, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
|
|
3212
|
-
import
|
|
3213
|
+
import ts22 from "typescript";
|
|
3213
3214
|
var TemplateSemanticsCheckerImpl = class {
|
|
3214
3215
|
templateTypeChecker;
|
|
3215
3216
|
constructor(templateTypeChecker) {
|
|
@@ -3289,7 +3290,7 @@ var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor3 {
|
|
|
3289
3290
|
}
|
|
3290
3291
|
makeIllegalTemplateVarDiagnostic(target, expressionNode, errorMessage) {
|
|
3291
3292
|
const span = target instanceof TmplAstVariable2 ? target.valueSpan || target.sourceSpan : target.sourceSpan;
|
|
3292
|
-
return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan,
|
|
3293
|
+
return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, ts22.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [
|
|
3293
3294
|
{
|
|
3294
3295
|
text: `'${target.name}' is declared here.`,
|
|
3295
3296
|
start: span.start.offset,
|
|
@@ -3304,7 +3305,7 @@ function unwrapAstWithSource(ast) {
|
|
|
3304
3305
|
}
|
|
3305
3306
|
|
|
3306
3307
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/validation/src/rules/initializer_api_usage_rule.mjs
|
|
3307
|
-
import
|
|
3308
|
+
import ts23 from "typescript";
|
|
3308
3309
|
var APIS_TO_CHECK = [
|
|
3309
3310
|
INPUT_INITIALIZER_FN,
|
|
3310
3311
|
MODEL_INITIALIZER_FN,
|
|
@@ -3324,13 +3325,13 @@ var InitializerApiUsageRule = class {
|
|
|
3324
3325
|
});
|
|
3325
3326
|
}
|
|
3326
3327
|
checkNode(node) {
|
|
3327
|
-
if (!
|
|
3328
|
+
if (!ts23.isCallExpression(node)) {
|
|
3328
3329
|
return null;
|
|
3329
3330
|
}
|
|
3330
|
-
while (node.parent && (
|
|
3331
|
+
while (node.parent && (ts23.isParenthesizedExpression(node.parent) || ts23.isAsExpression(node.parent))) {
|
|
3331
3332
|
node = node.parent;
|
|
3332
3333
|
}
|
|
3333
|
-
if (!node.parent || !
|
|
3334
|
+
if (!node.parent || !ts23.isCallExpression(node)) {
|
|
3334
3335
|
return null;
|
|
3335
3336
|
}
|
|
3336
3337
|
const identifiedInitializer = tryParseInitializerApi(APIS_TO_CHECK, node, this.reflector, this.importedSymbolsTracker);
|
|
@@ -3338,12 +3339,12 @@ var InitializerApiUsageRule = class {
|
|
|
3338
3339
|
return null;
|
|
3339
3340
|
}
|
|
3340
3341
|
const functionName = identifiedInitializer.api.functionName + (identifiedInitializer.isRequired ? ".required" : "");
|
|
3341
|
-
if (
|
|
3342
|
+
if (ts23.isPropertyDeclaration(node.parent) && node.parent.initializer === node) {
|
|
3342
3343
|
let closestClass = node.parent;
|
|
3343
|
-
while (closestClass && !
|
|
3344
|
+
while (closestClass && !ts23.isClassDeclaration(closestClass)) {
|
|
3344
3345
|
closestClass = closestClass.parent;
|
|
3345
3346
|
}
|
|
3346
|
-
if (closestClass &&
|
|
3347
|
+
if (closestClass && ts23.isClassDeclaration(closestClass)) {
|
|
3347
3348
|
const decorators = this.reflector.getDecoratorsOfDeclaration(closestClass);
|
|
3348
3349
|
const isComponentOrDirective = decorators !== null && decorators.some((decorator) => {
|
|
3349
3350
|
var _a;
|
|
@@ -3357,7 +3358,7 @@ var InitializerApiUsageRule = class {
|
|
|
3357
3358
|
};
|
|
3358
3359
|
|
|
3359
3360
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/validation/src/rules/unused_standalone_imports_rule.mjs
|
|
3360
|
-
import
|
|
3361
|
+
import ts24 from "typescript";
|
|
3361
3362
|
var UnusedStandaloneImportsRule = class {
|
|
3362
3363
|
templateTypeChecker;
|
|
3363
3364
|
typeCheckingConfig;
|
|
@@ -3371,7 +3372,7 @@ var UnusedStandaloneImportsRule = class {
|
|
|
3371
3372
|
return this.typeCheckingConfig.unusedStandaloneImports !== "suppress" && (this.importedSymbolsTracker.hasNamedImport(sourceFile, "Component", "@angular/core") || this.importedSymbolsTracker.hasNamespaceImport(sourceFile, "@angular/core"));
|
|
3372
3373
|
}
|
|
3373
3374
|
checkNode(node) {
|
|
3374
|
-
if (!
|
|
3375
|
+
if (!ts24.isClassDeclaration(node)) {
|
|
3375
3376
|
return null;
|
|
3376
3377
|
}
|
|
3377
3378
|
const metadata = this.templateTypeChecker.getDirectiveMetadata(node);
|
|
@@ -3387,8 +3388,8 @@ var UnusedStandaloneImportsRule = class {
|
|
|
3387
3388
|
if (unused === null) {
|
|
3388
3389
|
return null;
|
|
3389
3390
|
}
|
|
3390
|
-
const propertyAssignment = closestNode(metadata.rawImports,
|
|
3391
|
-
const category = this.typeCheckingConfig.unusedStandaloneImports === "error" ?
|
|
3391
|
+
const propertyAssignment = closestNode(metadata.rawImports, ts24.isPropertyAssignment);
|
|
3392
|
+
const category = this.typeCheckingConfig.unusedStandaloneImports === "error" ? ts24.DiagnosticCategory.Error : ts24.DiagnosticCategory.Warning;
|
|
3392
3393
|
if (unused.length === metadata.imports.length && propertyAssignment !== null) {
|
|
3393
3394
|
return makeDiagnostic(ErrorCode.UNUSED_STANDALONE_IMPORTS, propertyAssignment.name, "All imports are unused", void 0, category);
|
|
3394
3395
|
}
|
|
@@ -3428,8 +3429,8 @@ var UnusedStandaloneImportsRule = class {
|
|
|
3428
3429
|
}
|
|
3429
3430
|
let current = reference.getIdentityIn(rawImports.getSourceFile());
|
|
3430
3431
|
while (current !== null) {
|
|
3431
|
-
if (
|
|
3432
|
-
return !!((_a = current.modifiers) == null ? void 0 : _a.some((m) => m.kind ===
|
|
3432
|
+
if (ts24.isVariableStatement(current)) {
|
|
3433
|
+
return !!((_a = current.modifiers) == null ? void 0 : _a.some((m) => m.kind === ts24.SyntaxKind.ExportKeyword));
|
|
3433
3434
|
}
|
|
3434
3435
|
current = (_b = current.parent) != null ? _b : null;
|
|
3435
3436
|
}
|
|
@@ -3640,7 +3641,7 @@ var NgCompiler = class {
|
|
|
3640
3641
|
this.currentProgram = inputProgram;
|
|
3641
3642
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
3642
3643
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
3643
|
-
const moduleResolutionCache =
|
|
3644
|
+
const moduleResolutionCache = ts25.createModuleResolutionCache(
|
|
3644
3645
|
this.adapter.getCurrentDirectory(),
|
|
3645
3646
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
3646
3647
|
);
|
|
@@ -3684,7 +3685,7 @@ var NgCompiler = class {
|
|
|
3684
3685
|
}
|
|
3685
3686
|
for (const clazz of classesToUpdate) {
|
|
3686
3687
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
3687
|
-
if (!
|
|
3688
|
+
if (!ts25.isClassDeclaration(clazz)) {
|
|
3688
3689
|
continue;
|
|
3689
3690
|
}
|
|
3690
3691
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -3838,12 +3839,12 @@ var NgCompiler = class {
|
|
|
3838
3839
|
if (compilation.supportJitMode && compilation.jitDeclarationRegistry.jitDeclarations.size > 0) {
|
|
3839
3840
|
const { jitDeclarations } = compilation.jitDeclarationRegistry;
|
|
3840
3841
|
const jitDeclarationsArray = Array.from(jitDeclarations);
|
|
3841
|
-
const jitDeclarationOriginalNodes = new Set(jitDeclarationsArray.map((d) =>
|
|
3842
|
+
const jitDeclarationOriginalNodes = new Set(jitDeclarationsArray.map((d) => ts25.getOriginalNode(d)));
|
|
3842
3843
|
const sourceFilesWithJit = new Set(jitDeclarationsArray.map((d) => d.getSourceFile().fileName));
|
|
3843
3844
|
before.push((ctx) => {
|
|
3844
3845
|
const reflectionHost = new TypeScriptReflectionHost(this.inputProgram.getTypeChecker());
|
|
3845
3846
|
const jitTransform = angularJitApplicationTransform(this.inputProgram, compilation.isCore, (node) => {
|
|
3846
|
-
node =
|
|
3847
|
+
node = ts25.getOriginalNode(node, ts25.isClassDeclaration);
|
|
3847
3848
|
return reflectionHost.isClass(node) && jitDeclarationOriginalNodes.has(node);
|
|
3848
3849
|
})(ctx);
|
|
3849
3850
|
return (sourceFile) => {
|
|
@@ -3896,9 +3897,9 @@ var NgCompiler = class {
|
|
|
3896
3897
|
return null;
|
|
3897
3898
|
}
|
|
3898
3899
|
const sourceFile = node.getSourceFile();
|
|
3899
|
-
const printer =
|
|
3900
|
-
const nodeText = printer.printNode(
|
|
3901
|
-
return
|
|
3900
|
+
const printer = ts25.createPrinter();
|
|
3901
|
+
const nodeText = printer.printNode(ts25.EmitHint.Unspecified, callback, sourceFile);
|
|
3902
|
+
return ts25.transpileModule(nodeText, {
|
|
3902
3903
|
compilerOptions: this.options,
|
|
3903
3904
|
fileName: sourceFile.fileName,
|
|
3904
3905
|
reportDiagnostics: false
|
|
@@ -4243,18 +4244,18 @@ function isAngularCorePackage(program) {
|
|
|
4243
4244
|
return false;
|
|
4244
4245
|
}
|
|
4245
4246
|
return r3Symbols.statements.some((stmt) => {
|
|
4246
|
-
if (!
|
|
4247
|
+
if (!ts25.isVariableStatement(stmt)) {
|
|
4247
4248
|
return false;
|
|
4248
4249
|
}
|
|
4249
|
-
const modifiers =
|
|
4250
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
4250
|
+
const modifiers = ts25.getModifiers(stmt);
|
|
4251
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts25.SyntaxKind.ExportKeyword)) {
|
|
4251
4252
|
return false;
|
|
4252
4253
|
}
|
|
4253
4254
|
return stmt.declarationList.declarations.some((decl) => {
|
|
4254
|
-
if (!
|
|
4255
|
+
if (!ts25.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
4255
4256
|
return false;
|
|
4256
4257
|
}
|
|
4257
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
4258
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts25.SyntaxKind.TrueKeyword) {
|
|
4258
4259
|
return false;
|
|
4259
4260
|
}
|
|
4260
4261
|
return true;
|
|
@@ -4268,7 +4269,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
4268
4269
|
var _a, _b, _c;
|
|
4269
4270
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
4270
4271
|
yield makeConfigDiagnostic({
|
|
4271
|
-
category:
|
|
4272
|
+
category: ts25.DiagnosticCategory.Error,
|
|
4272
4273
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
4273
4274
|
messageText: `
|
|
4274
4275
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -4287,7 +4288,7 @@ https://angular.dev/tools/cli/template-typecheck
|
|
|
4287
4288
|
}
|
|
4288
4289
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
4289
4290
|
yield makeConfigDiagnostic({
|
|
4290
|
-
category:
|
|
4291
|
+
category: ts25.DiagnosticCategory.Error,
|
|
4291
4292
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
4292
4293
|
messageText: `
|
|
4293
4294
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -4304,7 +4305,7 @@ One of the following actions is required:
|
|
|
4304
4305
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
4305
4306
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
4306
4307
|
yield makeConfigDiagnostic({
|
|
4307
|
-
category:
|
|
4308
|
+
category: ts25.DiagnosticCategory.Error,
|
|
4308
4309
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
4309
4310
|
messageText: `
|
|
4310
4311
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -4317,7 +4318,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
4317
4318
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
4318
4319
|
if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
|
|
4319
4320
|
yield makeConfigDiagnostic({
|
|
4320
|
-
category:
|
|
4321
|
+
category: ts25.DiagnosticCategory.Error,
|
|
4321
4322
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
4322
4323
|
messageText: `
|
|
4323
4324
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -4329,7 +4330,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
|
|
|
4329
4330
|
}
|
|
4330
4331
|
if (!allowedCategoryLabels.includes(category)) {
|
|
4331
4332
|
yield makeConfigDiagnostic({
|
|
4332
|
-
category:
|
|
4333
|
+
category: ts25.DiagnosticCategory.Error,
|
|
4333
4334
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
4334
4335
|
messageText: `
|
|
4335
4336
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -4360,7 +4361,7 @@ var ReferenceGraphAdapter = class {
|
|
|
4360
4361
|
for (const { node } of references) {
|
|
4361
4362
|
let sourceFile = node.getSourceFile();
|
|
4362
4363
|
if (sourceFile === void 0) {
|
|
4363
|
-
sourceFile =
|
|
4364
|
+
sourceFile = ts25.getOriginalNode(node).getSourceFile();
|
|
4364
4365
|
}
|
|
4365
4366
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
4366
4367
|
this.graph.add(source, node);
|
|
@@ -4402,7 +4403,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
4402
4403
|
}
|
|
4403
4404
|
|
|
4404
4405
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
4405
|
-
import
|
|
4406
|
+
import ts26 from "typescript";
|
|
4406
4407
|
var DelegatingCompilerHost = class {
|
|
4407
4408
|
delegate;
|
|
4408
4409
|
createHash;
|
|
@@ -4522,7 +4523,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost {
|
|
|
4522
4523
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
4523
4524
|
if (entryPoint === null) {
|
|
4524
4525
|
diagnostics.push({
|
|
4525
|
-
category:
|
|
4526
|
+
category: ts26.DiagnosticCategory.Error,
|
|
4526
4527
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
4527
4528
|
file: void 0,
|
|
4528
4529
|
start: void 0,
|
|
@@ -4565,10 +4566,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost {
|
|
|
4565
4566
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
4566
4567
|
}
|
|
4567
4568
|
createCachedResolveModuleNamesFunction() {
|
|
4568
|
-
const moduleResolutionCache =
|
|
4569
|
+
const moduleResolutionCache = ts26.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
4569
4570
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
4570
4571
|
return moduleNames.map((moduleName) => {
|
|
4571
|
-
const module =
|
|
4572
|
+
const module = ts26.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
4572
4573
|
return module.resolvedModule;
|
|
4573
4574
|
});
|
|
4574
4575
|
};
|
|
@@ -4597,7 +4598,7 @@ var NgtscProgram = class {
|
|
|
4597
4598
|
if (reuseProgram !== void 0) {
|
|
4598
4599
|
retagAllTsFiles(reuseProgram);
|
|
4599
4600
|
}
|
|
4600
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
4601
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts27.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
4601
4602
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
4602
4603
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
4603
4604
|
this.host.postProgramCreationCleanup();
|
|
@@ -4812,16 +4813,16 @@ function createProgram({ rootNames, options, host, oldProgram }) {
|
|
|
4812
4813
|
}
|
|
4813
4814
|
|
|
4814
4815
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
4815
|
-
import
|
|
4816
|
+
import ts29 from "typescript";
|
|
4816
4817
|
|
|
4817
4818
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
4818
|
-
import
|
|
4819
|
+
import ts28 from "typescript";
|
|
4819
4820
|
function createMessageDiagnostic(messageText) {
|
|
4820
4821
|
return {
|
|
4821
4822
|
file: void 0,
|
|
4822
4823
|
start: void 0,
|
|
4823
4824
|
length: void 0,
|
|
4824
|
-
category:
|
|
4825
|
+
category: ts28.DiagnosticCategory.Message,
|
|
4825
4826
|
messageText,
|
|
4826
4827
|
code: DEFAULT_ERROR_CODE,
|
|
4827
4828
|
source: SOURCE
|
|
@@ -4830,13 +4831,13 @@ function createMessageDiagnostic(messageText) {
|
|
|
4830
4831
|
|
|
4831
4832
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
4832
4833
|
var defaultFormatHost = {
|
|
4833
|
-
getCurrentDirectory: () =>
|
|
4834
|
+
getCurrentDirectory: () => ts29.sys.getCurrentDirectory(),
|
|
4834
4835
|
getCanonicalFileName: (fileName) => fileName,
|
|
4835
|
-
getNewLine: () =>
|
|
4836
|
+
getNewLine: () => ts29.sys.newLine
|
|
4836
4837
|
};
|
|
4837
4838
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
4838
4839
|
if (diags && diags.length) {
|
|
4839
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
4840
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts29.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
4840
4841
|
} else {
|
|
4841
4842
|
return "";
|
|
4842
4843
|
}
|
|
@@ -4853,7 +4854,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
4853
4854
|
var _a;
|
|
4854
4855
|
try {
|
|
4855
4856
|
const fs = getFileSystem();
|
|
4856
|
-
const readConfigFile = (configFile) =>
|
|
4857
|
+
const readConfigFile = (configFile) => ts29.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
4857
4858
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
4858
4859
|
var _a2, _b;
|
|
4859
4860
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
@@ -4890,7 +4891,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
4890
4891
|
...existingOptions
|
|
4891
4892
|
};
|
|
4892
4893
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
4893
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
4894
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts29.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
4894
4895
|
let emitFlags = EmitFlags.Default;
|
|
4895
4896
|
if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
|
|
4896
4897
|
emitFlags |= EmitFlags.Metadata;
|
|
@@ -4902,7 +4903,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
4902
4903
|
} catch (e) {
|
|
4903
4904
|
const errors = [
|
|
4904
4905
|
{
|
|
4905
|
-
category:
|
|
4906
|
+
category: ts29.DiagnosticCategory.Error,
|
|
4906
4907
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
4907
4908
|
file: void 0,
|
|
4908
4909
|
start: void 0,
|
|
@@ -4937,7 +4938,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
4937
4938
|
}
|
|
4938
4939
|
} else {
|
|
4939
4940
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
4940
|
-
const { resolvedModule } =
|
|
4941
|
+
const { resolvedModule } = ts29.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts29.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
|
|
4941
4942
|
if (resolvedModule) {
|
|
4942
4943
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
4943
4944
|
}
|
|
@@ -4947,7 +4948,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
4947
4948
|
function exitCodeFromResult(diags) {
|
|
4948
4949
|
if (!diags)
|
|
4949
4950
|
return 0;
|
|
4950
|
-
if (diags.every((diag) => diag.category !==
|
|
4951
|
+
if (diags.every((diag) => diag.category !== ts29.DiagnosticCategory.Error)) {
|
|
4951
4952
|
return 0;
|
|
4952
4953
|
}
|
|
4953
4954
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -4986,7 +4987,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
4986
4987
|
} catch (e) {
|
|
4987
4988
|
program = void 0;
|
|
4988
4989
|
allDiagnostics.push({
|
|
4989
|
-
category:
|
|
4990
|
+
category: ts29.DiagnosticCategory.Error,
|
|
4990
4991
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
4991
4992
|
code: UNKNOWN_ERROR_CODE,
|
|
4992
4993
|
file: void 0,
|
|
@@ -5016,7 +5017,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
5016
5017
|
return allDiagnostics;
|
|
5017
5018
|
}
|
|
5018
5019
|
function hasErrors(diags) {
|
|
5019
|
-
return diags.some((d) => d.category ===
|
|
5020
|
+
return diags.some((d) => d.category === ts29.DiagnosticCategory.Error);
|
|
5020
5021
|
}
|
|
5021
5022
|
|
|
5022
5023
|
export {
|
|
@@ -5061,4 +5062,4 @@ export {
|
|
|
5061
5062
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5062
5063
|
* found in the LICENSE file at https://angular.dev/license
|
|
5063
5064
|
*/
|
|
5064
|
-
//# sourceMappingURL=chunk-
|
|
5065
|
+
//# sourceMappingURL=chunk-YDD3LCLX.js.map
|