@angular/compiler-cli 14.1.0-next.4 → 14.1.0-rc.0
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-JRBVL2HZ.js → chunk-24DFPZCS.js} +8 -2
- package/bundles/chunk-24DFPZCS.js.map +6 -0
- package/bundles/{chunk-W6KM7BUM.js → chunk-4JF5LVDW.js} +5 -8
- package/bundles/chunk-4JF5LVDW.js.map +6 -0
- package/bundles/{chunk-R4NY3TJC.js → chunk-ACXPVP2W.js} +1 -1
- package/bundles/chunk-ACXPVP2W.js.map +6 -0
- package/bundles/{chunk-TUMJDJFX.js → chunk-ATB3HJXN.js} +8 -11
- package/bundles/chunk-ATB3HJXN.js.map +6 -0
- package/bundles/{chunk-WGBFSDVQ.js → chunk-CYVTLM4Z.js} +2 -6
- package/bundles/chunk-CYVTLM4Z.js.map +6 -0
- package/bundles/{chunk-LX5Q27EF.js → chunk-E7NQQTT7.js} +1 -1
- package/bundles/{chunk-LX5Q27EF.js.map → chunk-E7NQQTT7.js.map} +1 -1
- package/bundles/{chunk-NJ7YQMH6.js → chunk-F2UCYAES.js} +19 -23
- package/bundles/chunk-F2UCYAES.js.map +6 -0
- package/bundles/{chunk-OLGEBPBY.js → chunk-FM6NPN5V.js} +3 -3
- package/bundles/{chunk-OLGEBPBY.js.map → chunk-FM6NPN5V.js.map} +0 -0
- package/bundles/{chunk-JXRNV3VY.js → chunk-GDAOEMFN.js} +11 -12
- package/bundles/chunk-GDAOEMFN.js.map +6 -0
- package/bundles/{chunk-QEIAOLAL.js → chunk-J6ZMRNVQ.js} +5 -9
- package/bundles/chunk-J6ZMRNVQ.js.map +6 -0
- package/bundles/{chunk-RUNC33XY.js → chunk-LPUQQ2CH.js} +56 -49
- package/bundles/chunk-LPUQQ2CH.js.map +6 -0
- package/bundles/{chunk-2IMT6JFI.js → chunk-NFCN3OZI.js} +1 -1
- package/bundles/chunk-NFCN3OZI.js.map +6 -0
- package/bundles/{chunk-T7MYRXIE.js → chunk-TOKOIIBI.js} +2 -2
- package/bundles/chunk-TOKOIIBI.js.map +6 -0
- package/bundles/{chunk-K4XEMWX4.js → chunk-WAXJ3P3Y.js} +213 -93
- package/bundles/chunk-WAXJ3P3Y.js.map +6 -0
- package/bundles/{chunk-GMSUYBZP.js → chunk-XYNRD7NE.js} +1 -33
- package/bundles/{chunk-GMSUYBZP.js.map → chunk-XYNRD7NE.js.map} +0 -0
- package/bundles/index.js +11 -13
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +13 -17
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +11 -11
- package/bundles/ngcc/main-ngcc.js +12 -12
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +11 -11
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +3 -3
- package/bundles/private/bazel.js +2 -2
- package/bundles/private/localize.js +4 -4
- package/bundles/private/migrations.js +6 -6
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +9 -12
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/linker/src/linker_import_generator.d.ts +1 -1
- package/ngcc/src/host/commonjs_umd_utils.d.ts +2 -2
- package/ngcc/src/host/esm5_host.d.ts +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +1 -1
- package/src/ngtsc/core/src/compiler.d.ts +2 -2
- package/src/ngtsc/diagnostics/src/error_code.d.ts +33 -1
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +4 -1
- package/src/ngtsc/incremental/src/state.d.ts +1 -1
- package/src/ngtsc/indexer/src/context.d.ts +1 -1
- package/src/ngtsc/metadata/src/registry.d.ts +2 -1
- package/src/ngtsc/perf/src/recorder.d.ts +1 -1
- package/src/ngtsc/reflection/src/host.d.ts +1 -1
- package/src/ngtsc/scope/src/dependency.d.ts +1 -1
- package/src/ngtsc/translator/src/api/ast_factory.d.ts +2 -2
- package/src/ngtsc/translator/src/import_manager.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/api/extended_template_checker.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/checks/missing_ngforof_let/index.d.ts +11 -0
- package/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.d.ts +11 -0
- package/src/ngtsc/typecheck/extended/checks/suffix_not_supported/index.d.ts +11 -0
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
- package/src/transformers/api.d.ts +2 -2
- package/bundles/chunk-2IMT6JFI.js.map +0 -6
- package/bundles/chunk-JRBVL2HZ.js.map +0 -6
- package/bundles/chunk-JXRNV3VY.js.map +0 -6
- package/bundles/chunk-K4XEMWX4.js.map +0 -6
- package/bundles/chunk-NJ7YQMH6.js.map +0 -6
- package/bundles/chunk-QEIAOLAL.js.map +0 -6
- package/bundles/chunk-R4NY3TJC.js.map +0 -6
- package/bundles/chunk-RUNC33XY.js.map +0 -6
- package/bundles/chunk-T7MYRXIE.js.map +0 -6
- package/bundles/chunk-TUMJDJFX.js.map +0 -6
- package/bundles/chunk-W6KM7BUM.js.map +0 -6
- package/bundles/chunk-WGBFSDVQ.js.map +0 -6
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
aliasTransformFactory,
|
|
31
31
|
declarationTransformFactory,
|
|
32
32
|
ivyTransformFactory
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LPUQQ2CH.js";
|
|
34
34
|
import {
|
|
35
35
|
TypeScriptReflectionHost,
|
|
36
36
|
isNamedClassDeclaration
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-NFCN3OZI.js";
|
|
38
38
|
import {
|
|
39
39
|
AbsoluteModuleStrategy,
|
|
40
40
|
AliasStrategy,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
toUnredirectedSourceFile,
|
|
74
74
|
translateExpression,
|
|
75
75
|
translateType
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-24DFPZCS.js";
|
|
77
77
|
import {
|
|
78
78
|
LogicalFileSystem,
|
|
79
79
|
absoluteFrom,
|
|
@@ -84,18 +84,14 @@ import {
|
|
|
84
84
|
getSourceFileOrError,
|
|
85
85
|
join,
|
|
86
86
|
resolve
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-TOKOIIBI.js";
|
|
88
88
|
import {
|
|
89
89
|
ActivePerfRecorder,
|
|
90
90
|
DelegatingPerfRecorder,
|
|
91
91
|
PerfCheckpoint,
|
|
92
92
|
PerfEvent,
|
|
93
93
|
PerfPhase
|
|
94
|
-
} from "./chunk-
|
|
95
|
-
import {
|
|
96
|
-
__spreadProps,
|
|
97
|
-
__spreadValues
|
|
98
|
-
} from "./chunk-GMSUYBZP.js";
|
|
94
|
+
} from "./chunk-ACXPVP2W.js";
|
|
99
95
|
|
|
100
96
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
101
97
|
var DEFAULT_ERROR_CODE = 100;
|
|
@@ -157,7 +153,7 @@ var SymbolKind;
|
|
|
157
153
|
|
|
158
154
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
159
155
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
160
|
-
import
|
|
156
|
+
import ts34 from "typescript";
|
|
161
157
|
|
|
162
158
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
163
159
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
@@ -262,7 +258,7 @@ function verifySupportedTypeScriptVersion() {
|
|
|
262
258
|
}
|
|
263
259
|
|
|
264
260
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
265
|
-
import
|
|
261
|
+
import ts32 from "typescript";
|
|
266
262
|
|
|
267
263
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
268
264
|
var CycleAnalyzer = class {
|
|
@@ -502,13 +498,13 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
502
498
|
if (transitivePath !== null) {
|
|
503
499
|
visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
|
|
504
500
|
}
|
|
505
|
-
const diagnostic =
|
|
501
|
+
const diagnostic = {
|
|
506
502
|
category: ts5.DiagnosticCategory.Error,
|
|
507
503
|
code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
|
|
508
|
-
file: transitiveReference.getSourceFile()
|
|
509
|
-
|
|
504
|
+
file: transitiveReference.getSourceFile(),
|
|
505
|
+
...getPosOfDeclaration(transitiveReference),
|
|
510
506
|
messageText: `Unsupported private ${descriptor} ${name}. This ${descriptor} is visible to consumers via ${visibleVia}, but is not exported from the top-level library entrypoint.`
|
|
511
|
-
}
|
|
507
|
+
};
|
|
512
508
|
diagnostics.push(diagnostic);
|
|
513
509
|
}
|
|
514
510
|
});
|
|
@@ -1567,11 +1563,11 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
|
|
|
1567
1563
|
this.visitExpression(text.value);
|
|
1568
1564
|
}
|
|
1569
1565
|
visitReference(reference) {
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1566
|
+
const referenceIdentifier = this.targetToIdentifier(reference);
|
|
1567
|
+
if (referenceIdentifier === null) {
|
|
1572
1568
|
return;
|
|
1573
1569
|
}
|
|
1574
|
-
this.identifiers.add(
|
|
1570
|
+
this.identifiers.add(referenceIdentifier);
|
|
1575
1571
|
}
|
|
1576
1572
|
visitVariable(variable) {
|
|
1577
1573
|
const variableIdentifier = this.targetToIdentifier(variable);
|
|
@@ -1909,19 +1905,19 @@ var StandaloneComponentScopeReader = class {
|
|
|
1909
1905
|
seen.add(ref.node);
|
|
1910
1906
|
const dirMeta = this.metaReader.getDirectiveMetadata(ref);
|
|
1911
1907
|
if (dirMeta !== null) {
|
|
1912
|
-
dependencies.add(
|
|
1908
|
+
dependencies.add({ ...dirMeta, ref });
|
|
1913
1909
|
isPoisoned = isPoisoned || dirMeta.isPoisoned || !dirMeta.isStandalone;
|
|
1914
1910
|
continue;
|
|
1915
1911
|
}
|
|
1916
1912
|
const pipeMeta = this.metaReader.getPipeMetadata(ref);
|
|
1917
1913
|
if (pipeMeta !== null) {
|
|
1918
|
-
dependencies.add(
|
|
1914
|
+
dependencies.add({ ...pipeMeta, ref });
|
|
1919
1915
|
isPoisoned = isPoisoned || !pipeMeta.isStandalone;
|
|
1920
1916
|
continue;
|
|
1921
1917
|
}
|
|
1922
1918
|
const ngModuleMeta = this.metaReader.getNgModuleMetadata(ref);
|
|
1923
1919
|
if (ngModuleMeta !== null) {
|
|
1924
|
-
dependencies.add(
|
|
1920
|
+
dependencies.add({ ...ngModuleMeta, ref });
|
|
1925
1921
|
let ngModuleScope;
|
|
1926
1922
|
if (ref.node.getSourceFile().isDeclarationFile) {
|
|
1927
1923
|
ngModuleScope = this.dtsModuleReader.resolve(ref);
|
|
@@ -2604,7 +2600,7 @@ function requiresInlineTypeCheckBlock(ref, env, usedPipes, reflector) {
|
|
|
2604
2600
|
return TcbInliningRequirement.MustInline;
|
|
2605
2601
|
} else if (!checkIfGenericTypeBoundsCanBeEmitted(ref.node, reflector, env)) {
|
|
2606
2602
|
return TcbInliningRequirement.ShouldInlineForGenericBounds;
|
|
2607
|
-
} else if (
|
|
2603
|
+
} else if (usedPipes.some((pipeRef) => !env.canReferenceType(pipeRef))) {
|
|
2608
2604
|
return TcbInliningRequirement.MustInline;
|
|
2609
2605
|
} else {
|
|
2610
2606
|
return TcbInliningRequirement.None;
|
|
@@ -2961,10 +2957,11 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
2961
2957
|
}
|
|
2962
2958
|
};
|
|
2963
2959
|
function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
|
|
2964
|
-
return
|
|
2960
|
+
return {
|
|
2961
|
+
...makeDiagnostic(code, node, messageText, relatedInformation),
|
|
2965
2962
|
componentFile: node.getSourceFile(),
|
|
2966
2963
|
templateId
|
|
2967
|
-
}
|
|
2964
|
+
};
|
|
2968
2965
|
}
|
|
2969
2966
|
|
|
2970
2967
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
@@ -4534,7 +4531,14 @@ var TypeCheckContextImpl = class {
|
|
|
4534
4531
|
boundTarget,
|
|
4535
4532
|
templateDiagnostics
|
|
4536
4533
|
});
|
|
4537
|
-
const
|
|
4534
|
+
const usedPipes = [];
|
|
4535
|
+
for (const name of boundTarget.getUsedPipes()) {
|
|
4536
|
+
if (!pipes.has(name)) {
|
|
4537
|
+
continue;
|
|
4538
|
+
}
|
|
4539
|
+
usedPipes.push(pipes.get(name));
|
|
4540
|
+
}
|
|
4541
|
+
const inliningRequirement = requiresInlineTypeCheckBlock(ref, shimData.file, usedPipes, this.reflector);
|
|
4538
4542
|
if (this.inlining === InliningMode.Error && inliningRequirement === TcbInliningRequirement.MustInline) {
|
|
4539
4543
|
shimData.oobRecorder.requiresInlineTcb(templateId, ref.node);
|
|
4540
4544
|
this.perf.eventCount(PerfEvent.SkipGenerateTcbNoInline);
|
|
@@ -4857,11 +4861,12 @@ var SymbolBuilder = class {
|
|
|
4857
4861
|
return null;
|
|
4858
4862
|
}
|
|
4859
4863
|
const directives = this.getDirectivesOfNode(element);
|
|
4860
|
-
return
|
|
4864
|
+
return {
|
|
4865
|
+
...symbolFromDeclaration,
|
|
4861
4866
|
kind: SymbolKind.Element,
|
|
4862
4867
|
directives,
|
|
4863
4868
|
templateNode: element
|
|
4864
|
-
}
|
|
4869
|
+
};
|
|
4865
4870
|
}
|
|
4866
4871
|
getDirectivesOfNode(element) {
|
|
4867
4872
|
var _a;
|
|
@@ -4884,14 +4889,15 @@ var SymbolBuilder = class {
|
|
|
4884
4889
|
return null;
|
|
4885
4890
|
}
|
|
4886
4891
|
const isComponent = (_a2 = meta.isComponent) != null ? _a2 : null;
|
|
4887
|
-
const directiveSymbol =
|
|
4892
|
+
const directiveSymbol = {
|
|
4893
|
+
...symbol,
|
|
4888
4894
|
tsSymbol: symbol.tsSymbol,
|
|
4889
4895
|
selector: meta.selector,
|
|
4890
4896
|
isComponent,
|
|
4891
4897
|
ngModule,
|
|
4892
4898
|
kind: SymbolKind.Directive,
|
|
4893
4899
|
isStructural: meta.isStructural
|
|
4894
|
-
}
|
|
4900
|
+
};
|
|
4895
4901
|
return directiveSymbol;
|
|
4896
4902
|
}).filter((d) => d !== null);
|
|
4897
4903
|
}
|
|
@@ -5028,11 +5034,12 @@ var SymbolBuilder = class {
|
|
|
5028
5034
|
if (target === null) {
|
|
5029
5035
|
continue;
|
|
5030
5036
|
}
|
|
5031
|
-
bindings.push(
|
|
5037
|
+
bindings.push({
|
|
5038
|
+
...symbolInfo,
|
|
5032
5039
|
tsSymbol: symbolInfo.tsSymbol,
|
|
5033
5040
|
kind: SymbolKind.Binding,
|
|
5034
5041
|
target
|
|
5035
|
-
})
|
|
5042
|
+
});
|
|
5036
5043
|
}
|
|
5037
5044
|
if (bindings.length === 0) {
|
|
5038
5045
|
return null;
|
|
@@ -5149,13 +5156,14 @@ var SymbolBuilder = class {
|
|
|
5149
5156
|
if (symbolInfo === null) {
|
|
5150
5157
|
return null;
|
|
5151
5158
|
}
|
|
5152
|
-
return
|
|
5153
|
-
kind: SymbolKind.Pipe
|
|
5154
|
-
|
|
5155
|
-
classSymbol:
|
|
5159
|
+
return {
|
|
5160
|
+
kind: SymbolKind.Pipe,
|
|
5161
|
+
...symbolInfo,
|
|
5162
|
+
classSymbol: {
|
|
5163
|
+
...pipeInstance,
|
|
5156
5164
|
tsSymbol: pipeInstance.tsSymbol
|
|
5157
|
-
}
|
|
5158
|
-
}
|
|
5165
|
+
}
|
|
5166
|
+
};
|
|
5159
5167
|
}
|
|
5160
5168
|
getSymbolOfTemplateExpression(expression) {
|
|
5161
5169
|
if (expression instanceof ASTWithSource3) {
|
|
@@ -5187,13 +5195,14 @@ var SymbolBuilder = class {
|
|
|
5187
5195
|
if (whenTrueSymbol === null) {
|
|
5188
5196
|
return null;
|
|
5189
5197
|
}
|
|
5190
|
-
return
|
|
5198
|
+
return {
|
|
5199
|
+
...whenTrueSymbol,
|
|
5191
5200
|
kind: SymbolKind.Expression,
|
|
5192
5201
|
tsType: this.getTypeChecker().getTypeAtLocation(node)
|
|
5193
|
-
}
|
|
5202
|
+
};
|
|
5194
5203
|
} else {
|
|
5195
5204
|
const symbolInfo = this.getSymbolOfTsNode(node);
|
|
5196
|
-
return symbolInfo === null ? null :
|
|
5205
|
+
return symbolInfo === null ? null : { ...symbolInfo, kind: SymbolKind.Expression };
|
|
5197
5206
|
}
|
|
5198
5207
|
}
|
|
5199
5208
|
getSymbolOfTsNode(node) {
|
|
@@ -5442,9 +5451,10 @@ var TemplateTypeCheckerImpl = class {
|
|
|
5442
5451
|
const fileRecord = this.state.get(sfPath);
|
|
5443
5452
|
const templateId = fileRecord.sourceManager.getTemplateId(clazz);
|
|
5444
5453
|
const mapping = fileRecord.sourceManager.getSourceMapping(templateId);
|
|
5445
|
-
return
|
|
5454
|
+
return {
|
|
5455
|
+
...makeTemplateDiagnostic(templateId, mapping, sourceSpan, category, ngErrorCode(errorCode), message, relatedInformation),
|
|
5446
5456
|
__ngCode: errorCode
|
|
5447
|
-
}
|
|
5457
|
+
};
|
|
5448
5458
|
}
|
|
5449
5459
|
getOrCreateCompletionEngine(component) {
|
|
5450
5460
|
if (this.completionCache.has(component)) {
|
|
@@ -5922,6 +5932,39 @@ var factory2 = {
|
|
|
5922
5932
|
}
|
|
5923
5933
|
};
|
|
5924
5934
|
|
|
5935
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_ngforof_let/index.mjs
|
|
5936
|
+
import { TmplAstTemplate as TmplAstTemplate5 } from "@angular/compiler";
|
|
5937
|
+
var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
|
|
5938
|
+
constructor() {
|
|
5939
|
+
super(...arguments);
|
|
5940
|
+
this.code = ErrorCode.MISSING_NGFOROF_LET;
|
|
5941
|
+
}
|
|
5942
|
+
visitNode(ctx, component, node) {
|
|
5943
|
+
const isTemplate = node instanceof TmplAstTemplate5;
|
|
5944
|
+
if (!(node instanceof TmplAstTemplate5)) {
|
|
5945
|
+
return [];
|
|
5946
|
+
}
|
|
5947
|
+
if (node.templateAttrs.length === 0) {
|
|
5948
|
+
return [];
|
|
5949
|
+
}
|
|
5950
|
+
const attr = node.templateAttrs.find((x) => x.name === "ngFor");
|
|
5951
|
+
if (attr === void 0) {
|
|
5952
|
+
return [];
|
|
5953
|
+
}
|
|
5954
|
+
if (node.variables.length > 0) {
|
|
5955
|
+
return [];
|
|
5956
|
+
}
|
|
5957
|
+
const errorString = "Your ngFor is missing a value. Did you forget to add the `let` keyword?";
|
|
5958
|
+
const diagnostic = ctx.makeTemplateDiagnostic(attr.sourceSpan, errorString);
|
|
5959
|
+
return [diagnostic];
|
|
5960
|
+
}
|
|
5961
|
+
};
|
|
5962
|
+
var factory3 = {
|
|
5963
|
+
code: ErrorCode.MISSING_NGFOROF_LET,
|
|
5964
|
+
name: ExtendedTemplateDiagnosticName.MISSING_NGFOROF_LET,
|
|
5965
|
+
create: () => new MissingNgForOfLetCheck()
|
|
5966
|
+
};
|
|
5967
|
+
|
|
5925
5968
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
5926
5969
|
import { Binary } from "@angular/compiler";
|
|
5927
5970
|
import ts29 from "typescript";
|
|
@@ -5955,7 +5998,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
5955
5998
|
return [diagnostic];
|
|
5956
5999
|
}
|
|
5957
6000
|
};
|
|
5958
|
-
var
|
|
6001
|
+
var factory4 = {
|
|
5959
6002
|
code: ErrorCode.NULLISH_COALESCING_NOT_NULLABLE,
|
|
5960
6003
|
name: ExtendedTemplateDiagnosticName.NULLISH_COALESCING_NOT_NULLABLE,
|
|
5961
6004
|
create: (options) => {
|
|
@@ -5967,6 +6010,76 @@ var factory3 = {
|
|
|
5967
6010
|
}
|
|
5968
6011
|
};
|
|
5969
6012
|
|
|
6013
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.mjs
|
|
6014
|
+
import { SafeCall as SafeCall2, SafeKeyedRead as SafeKeyedRead2, SafePropertyRead as SafePropertyRead5 } from "@angular/compiler";
|
|
6015
|
+
import ts30 from "typescript";
|
|
6016
|
+
var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
6017
|
+
constructor() {
|
|
6018
|
+
super(...arguments);
|
|
6019
|
+
this.code = ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
|
|
6020
|
+
}
|
|
6021
|
+
visitNode(ctx, component, node) {
|
|
6022
|
+
if (!(node instanceof SafeCall2) && !(node instanceof SafePropertyRead5) && !(node instanceof SafeKeyedRead2))
|
|
6023
|
+
return [];
|
|
6024
|
+
const symbolLeft = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
|
|
6025
|
+
if (symbolLeft === null || symbolLeft.kind !== SymbolKind.Expression) {
|
|
6026
|
+
return [];
|
|
6027
|
+
}
|
|
6028
|
+
const typeLeft = symbolLeft.tsType;
|
|
6029
|
+
if (typeLeft.flags & (ts30.TypeFlags.Any | ts30.TypeFlags.Unknown)) {
|
|
6030
|
+
return [];
|
|
6031
|
+
}
|
|
6032
|
+
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
6033
|
+
return [];
|
|
6034
|
+
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
|
|
6035
|
+
if (symbol.kind !== SymbolKind.Expression) {
|
|
6036
|
+
return [];
|
|
6037
|
+
}
|
|
6038
|
+
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbol.tcbLocation);
|
|
6039
|
+
if (templateMapping === null) {
|
|
6040
|
+
return [];
|
|
6041
|
+
}
|
|
6042
|
+
const advice = node instanceof SafePropertyRead5 ? `the '?.' operator can be replaced with the '.' operator` : `the '?.' operator can be safely removed`;
|
|
6043
|
+
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, `The left side of this optional chain operation does not include 'null' or 'undefined' in its type, therefore ${advice}.`);
|
|
6044
|
+
return [diagnostic];
|
|
6045
|
+
}
|
|
6046
|
+
};
|
|
6047
|
+
var factory5 = {
|
|
6048
|
+
code: ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE,
|
|
6049
|
+
name: ExtendedTemplateDiagnosticName.OPTIONAL_CHAIN_NOT_NULLABLE,
|
|
6050
|
+
create: (options) => {
|
|
6051
|
+
const strictNullChecks = options.strictNullChecks === void 0 ? !!options.strict : !!options.strictNullChecks;
|
|
6052
|
+
if (!strictNullChecks) {
|
|
6053
|
+
return null;
|
|
6054
|
+
}
|
|
6055
|
+
return new OptionalChainNotNullableCheck();
|
|
6056
|
+
}
|
|
6057
|
+
};
|
|
6058
|
+
|
|
6059
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/suffix_not_supported/index.mjs
|
|
6060
|
+
import { TmplAstBoundAttribute as TmplAstBoundAttribute3 } from "@angular/compiler";
|
|
6061
|
+
var STYLE_SUFFIXES = ["px", "%", "em"];
|
|
6062
|
+
var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
|
|
6063
|
+
constructor() {
|
|
6064
|
+
super(...arguments);
|
|
6065
|
+
this.code = ErrorCode.SUFFIX_NOT_SUPPORTED;
|
|
6066
|
+
}
|
|
6067
|
+
visitNode(ctx, component, node) {
|
|
6068
|
+
if (!(node instanceof TmplAstBoundAttribute3))
|
|
6069
|
+
return [];
|
|
6070
|
+
if (!node.keySpan.toString().startsWith("attr.") || !STYLE_SUFFIXES.some((suffix) => node.name.endsWith(`.${suffix}`))) {
|
|
6071
|
+
return [];
|
|
6072
|
+
}
|
|
6073
|
+
const diagnostic = ctx.makeTemplateDiagnostic(node.keySpan, `The ${STYLE_SUFFIXES.map((suffix) => `'.${suffix}'`).join(", ")} suffixes are only supported on style bindings.`);
|
|
6074
|
+
return [diagnostic];
|
|
6075
|
+
}
|
|
6076
|
+
};
|
|
6077
|
+
var factory6 = {
|
|
6078
|
+
code: ErrorCode.SUFFIX_NOT_SUPPORTED,
|
|
6079
|
+
name: ExtendedTemplateDiagnosticName.SUFFIX_NOT_SUPPORTED,
|
|
6080
|
+
create: () => new SuffixNotSupportedCheck()
|
|
6081
|
+
};
|
|
6082
|
+
|
|
5970
6083
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/text_attribute_not_binding/index.mjs
|
|
5971
6084
|
import { TmplAstTextAttribute as TmplAstTextAttribute4 } from "@angular/compiler";
|
|
5972
6085
|
var TextAttributeNotBindingSpec = class extends TemplateCheckWithVisitor {
|
|
@@ -6000,14 +6113,14 @@ var TextAttributeNotBindingSpec = class extends TemplateCheckWithVisitor {
|
|
|
6000
6113
|
return [diagnostic];
|
|
6001
6114
|
}
|
|
6002
6115
|
};
|
|
6003
|
-
var
|
|
6116
|
+
var factory7 = {
|
|
6004
6117
|
code: ErrorCode.TEXT_ATTRIBUTE_NOT_BINDING,
|
|
6005
6118
|
name: ExtendedTemplateDiagnosticName.TEXT_ATTRIBUTE_NOT_BINDING,
|
|
6006
6119
|
create: () => new TextAttributeNotBindingSpec()
|
|
6007
6120
|
};
|
|
6008
6121
|
|
|
6009
6122
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
6010
|
-
import
|
|
6123
|
+
import ts31 from "typescript";
|
|
6011
6124
|
|
|
6012
6125
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
6013
6126
|
var DiagnosticCategoryLabel;
|
|
@@ -6023,12 +6136,12 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
6023
6136
|
var _a, _b, _c, _d, _e;
|
|
6024
6137
|
this.partialCtx = { templateTypeChecker, typeChecker };
|
|
6025
6138
|
this.templateChecks = /* @__PURE__ */ new Map();
|
|
6026
|
-
for (const
|
|
6027
|
-
const category = diagnosticLabelToCategory((_e = (_d = (_b = (_a = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a.checks) == null ? void 0 : _b[
|
|
6139
|
+
for (const factory8 of templateCheckFactories) {
|
|
6140
|
+
const category = diagnosticLabelToCategory((_e = (_d = (_b = (_a = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a.checks) == null ? void 0 : _b[factory8.name]) != null ? _d : (_c = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c.defaultCategory) != null ? _e : DiagnosticCategoryLabel.Warning);
|
|
6028
6141
|
if (category === null) {
|
|
6029
6142
|
continue;
|
|
6030
6143
|
}
|
|
6031
|
-
const check =
|
|
6144
|
+
const check = factory8.create(options);
|
|
6032
6145
|
if (check === null) {
|
|
6033
6146
|
continue;
|
|
6034
6147
|
}
|
|
@@ -6042,11 +6155,12 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
6042
6155
|
}
|
|
6043
6156
|
const diagnostics = [];
|
|
6044
6157
|
for (const [check, category] of this.templateChecks.entries()) {
|
|
6045
|
-
const ctx =
|
|
6158
|
+
const ctx = {
|
|
6159
|
+
...this.partialCtx,
|
|
6046
6160
|
makeTemplateDiagnostic: (span, message, relatedInformation) => {
|
|
6047
6161
|
return this.partialCtx.templateTypeChecker.makeTemplateDiagnostic(component, span, category, check.code, message, relatedInformation);
|
|
6048
6162
|
}
|
|
6049
|
-
}
|
|
6163
|
+
};
|
|
6050
6164
|
diagnostics.push(...check.run(ctx, component, template));
|
|
6051
6165
|
}
|
|
6052
6166
|
return diagnostics;
|
|
@@ -6055,9 +6169,9 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
6055
6169
|
function diagnosticLabelToCategory(label) {
|
|
6056
6170
|
switch (label) {
|
|
6057
6171
|
case DiagnosticCategoryLabel.Warning:
|
|
6058
|
-
return
|
|
6172
|
+
return ts31.DiagnosticCategory.Warning;
|
|
6059
6173
|
case DiagnosticCategoryLabel.Error:
|
|
6060
|
-
return
|
|
6174
|
+
return ts31.DiagnosticCategory.Error;
|
|
6061
6175
|
case DiagnosticCategoryLabel.Suppress:
|
|
6062
6176
|
return null;
|
|
6063
6177
|
default:
|
|
@@ -6072,9 +6186,12 @@ ${value}`);
|
|
|
6072
6186
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
|
|
6073
6187
|
var ALL_DIAGNOSTIC_FACTORIES = [
|
|
6074
6188
|
factory,
|
|
6075
|
-
|
|
6189
|
+
factory4,
|
|
6190
|
+
factory5,
|
|
6076
6191
|
factory2,
|
|
6077
|
-
|
|
6192
|
+
factory7,
|
|
6193
|
+
factory3,
|
|
6194
|
+
factory6
|
|
6078
6195
|
];
|
|
6079
6196
|
|
|
6080
6197
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
@@ -6154,7 +6271,7 @@ var NgCompiler = class {
|
|
|
6154
6271
|
this.currentProgram = inputProgram;
|
|
6155
6272
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
6156
6273
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
6157
|
-
const moduleResolutionCache =
|
|
6274
|
+
const moduleResolutionCache = ts32.createModuleResolutionCache(this.adapter.getCurrentDirectory(), this.adapter.getCanonicalFileName.bind(this.adapter));
|
|
6158
6275
|
this.moduleResolver = new ModuleResolver(inputProgram, this.options, this.adapter, moduleResolutionCache);
|
|
6159
6276
|
this.resourceManager = new AdapterResourceLoader(adapter, this.options);
|
|
6160
6277
|
this.cycleAnalyzer = new CycleAnalyzer(new ImportGraph(inputProgram.getTypeChecker(), this.delegatingPerfRecorder));
|
|
@@ -6210,7 +6327,7 @@ var NgCompiler = class {
|
|
|
6210
6327
|
}
|
|
6211
6328
|
for (const clazz of classesToUpdate) {
|
|
6212
6329
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
6213
|
-
if (!
|
|
6330
|
+
if (!ts32.isClassDeclaration(clazz)) {
|
|
6214
6331
|
continue;
|
|
6215
6332
|
}
|
|
6216
6333
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -6251,9 +6368,10 @@ var NgCompiler = class {
|
|
|
6251
6368
|
addMessageTextDetails(diagnostics) {
|
|
6252
6369
|
return diagnostics.map((diag) => {
|
|
6253
6370
|
if (diag.code && COMPILER_ERRORS_WITH_GUIDES.has(ngErrorCode(diag.code))) {
|
|
6254
|
-
return
|
|
6371
|
+
return {
|
|
6372
|
+
...diag,
|
|
6255
6373
|
messageText: diag.messageText + `. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG${ngErrorCode(diag.code)}`
|
|
6256
|
-
}
|
|
6374
|
+
};
|
|
6257
6375
|
}
|
|
6258
6376
|
return diag;
|
|
6259
6377
|
});
|
|
@@ -6620,17 +6738,17 @@ function isAngularCorePackage(program) {
|
|
|
6620
6738
|
return false;
|
|
6621
6739
|
}
|
|
6622
6740
|
return r3Symbols.statements.some((stmt) => {
|
|
6623
|
-
if (!
|
|
6741
|
+
if (!ts32.isVariableStatement(stmt)) {
|
|
6624
6742
|
return false;
|
|
6625
6743
|
}
|
|
6626
|
-
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind ===
|
|
6744
|
+
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind === ts32.SyntaxKind.ExportKeyword)) {
|
|
6627
6745
|
return false;
|
|
6628
6746
|
}
|
|
6629
6747
|
return stmt.declarationList.declarations.some((decl) => {
|
|
6630
|
-
if (!
|
|
6748
|
+
if (!ts32.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
6631
6749
|
return false;
|
|
6632
6750
|
}
|
|
6633
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
6751
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts32.SyntaxKind.TrueKeyword) {
|
|
6634
6752
|
return false;
|
|
6635
6753
|
}
|
|
6636
6754
|
return true;
|
|
@@ -6644,7 +6762,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
6644
6762
|
var _a, _b, _c;
|
|
6645
6763
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
6646
6764
|
yield makeConfigDiagnostic({
|
|
6647
|
-
category:
|
|
6765
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6648
6766
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
6649
6767
|
messageText: `
|
|
6650
6768
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -6663,7 +6781,7 @@ https://angular.io/guide/template-typecheck
|
|
|
6663
6781
|
}
|
|
6664
6782
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
6665
6783
|
yield makeConfigDiagnostic({
|
|
6666
|
-
category:
|
|
6784
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6667
6785
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
6668
6786
|
messageText: `
|
|
6669
6787
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -6680,7 +6798,7 @@ One of the following actions is required:
|
|
|
6680
6798
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
6681
6799
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
6682
6800
|
yield makeConfigDiagnostic({
|
|
6683
|
-
category:
|
|
6801
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6684
6802
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
6685
6803
|
messageText: `
|
|
6686
6804
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -6690,11 +6808,11 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
6690
6808
|
`.trim()
|
|
6691
6809
|
});
|
|
6692
6810
|
}
|
|
6693
|
-
const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((
|
|
6811
|
+
const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((factory8) => factory8.name);
|
|
6694
6812
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
6695
6813
|
if (!allExtendedDiagnosticNames.includes(checkName)) {
|
|
6696
6814
|
yield makeConfigDiagnostic({
|
|
6697
|
-
category:
|
|
6815
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6698
6816
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
6699
6817
|
messageText: `
|
|
6700
6818
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -6706,7 +6824,7 @@ ${allExtendedDiagnosticNames.join("\n")}
|
|
|
6706
6824
|
}
|
|
6707
6825
|
if (!allowedCategoryLabels.includes(category)) {
|
|
6708
6826
|
yield makeConfigDiagnostic({
|
|
6709
|
-
category:
|
|
6827
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6710
6828
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
6711
6829
|
messageText: `
|
|
6712
6830
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -6736,7 +6854,7 @@ var ReferenceGraphAdapter = class {
|
|
|
6736
6854
|
for (const { node } of references) {
|
|
6737
6855
|
let sourceFile = node.getSourceFile();
|
|
6738
6856
|
if (sourceFile === void 0) {
|
|
6739
|
-
sourceFile =
|
|
6857
|
+
sourceFile = ts32.getOriginalNode(node).getSourceFile();
|
|
6740
6858
|
}
|
|
6741
6859
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
6742
6860
|
this.graph.add(source, node);
|
|
@@ -6775,7 +6893,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
6775
6893
|
}
|
|
6776
6894
|
|
|
6777
6895
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
6778
|
-
import
|
|
6896
|
+
import ts33 from "typescript";
|
|
6779
6897
|
var DelegatingCompilerHost2 = class {
|
|
6780
6898
|
constructor(delegate) {
|
|
6781
6899
|
this.delegate = delegate;
|
|
@@ -6865,7 +6983,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6865
6983
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
6866
6984
|
if (entryPoint === null) {
|
|
6867
6985
|
diagnostics.push({
|
|
6868
|
-
category:
|
|
6986
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6869
6987
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
6870
6988
|
file: void 0,
|
|
6871
6989
|
start: void 0,
|
|
@@ -6908,10 +7026,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6908
7026
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
6909
7027
|
}
|
|
6910
7028
|
createCachedResolveModuleNamesFunction() {
|
|
6911
|
-
const moduleResolutionCache =
|
|
7029
|
+
const moduleResolutionCache = ts33.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
6912
7030
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
6913
7031
|
return moduleNames.map((moduleName) => {
|
|
6914
|
-
const module =
|
|
7032
|
+
const module = ts33.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
6915
7033
|
return module.resolvedModule;
|
|
6916
7034
|
});
|
|
6917
7035
|
};
|
|
@@ -6932,7 +7050,7 @@ var NgtscProgram = class {
|
|
|
6932
7050
|
if (reuseProgram !== void 0) {
|
|
6933
7051
|
retagAllTsFiles(reuseProgram);
|
|
6934
7052
|
}
|
|
6935
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
7053
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts34.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
6936
7054
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
6937
7055
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
6938
7056
|
this.host.postProgramCreationCleanup();
|
|
@@ -7133,17 +7251,17 @@ function createProgram({ rootNames, options, host, oldProgram }) {
|
|
|
7133
7251
|
}
|
|
7134
7252
|
|
|
7135
7253
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
7136
|
-
import
|
|
7254
|
+
import ts36 from "typescript";
|
|
7137
7255
|
|
|
7138
7256
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
7139
|
-
import
|
|
7257
|
+
import ts35 from "typescript";
|
|
7140
7258
|
var GENERATED_FILES = /(.*?)\.(ngfactory|shim\.ngstyle|ngstyle|ngsummary)\.(js|d\.ts|ts)$/;
|
|
7141
7259
|
function createMessageDiagnostic(messageText) {
|
|
7142
7260
|
return {
|
|
7143
7261
|
file: void 0,
|
|
7144
7262
|
start: void 0,
|
|
7145
7263
|
length: void 0,
|
|
7146
|
-
category:
|
|
7264
|
+
category: ts35.DiagnosticCategory.Message,
|
|
7147
7265
|
messageText,
|
|
7148
7266
|
code: DEFAULT_ERROR_CODE,
|
|
7149
7267
|
source: SOURCE
|
|
@@ -7152,13 +7270,13 @@ function createMessageDiagnostic(messageText) {
|
|
|
7152
7270
|
|
|
7153
7271
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
7154
7272
|
var defaultFormatHost = {
|
|
7155
|
-
getCurrentDirectory: () =>
|
|
7273
|
+
getCurrentDirectory: () => ts36.sys.getCurrentDirectory(),
|
|
7156
7274
|
getCanonicalFileName: (fileName) => fileName,
|
|
7157
|
-
getNewLine: () =>
|
|
7275
|
+
getNewLine: () => ts36.sys.newLine
|
|
7158
7276
|
};
|
|
7159
7277
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
7160
7278
|
if (diags && diags.length) {
|
|
7161
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
7279
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts36.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
7162
7280
|
} else {
|
|
7163
7281
|
return "";
|
|
7164
7282
|
}
|
|
@@ -7175,13 +7293,13 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7175
7293
|
var _a, _b;
|
|
7176
7294
|
try {
|
|
7177
7295
|
const fs = getFileSystem();
|
|
7178
|
-
const readConfigFile = (configFile) =>
|
|
7296
|
+
const readConfigFile = (configFile) => ts36.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
7179
7297
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
7180
7298
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
7181
7299
|
if (error2) {
|
|
7182
7300
|
return parentOptions;
|
|
7183
7301
|
}
|
|
7184
|
-
const existingNgCompilerOptions =
|
|
7302
|
+
const existingNgCompilerOptions = { ...config2.angularCompilerOptions, ...parentOptions };
|
|
7185
7303
|
if (config2.extends && typeof config2.extends === "string") {
|
|
7186
7304
|
const extendedConfigPath = getExtendedConfigPath(configFile, config2.extends, host, fs);
|
|
7187
7305
|
if (extendedConfigPath !== null) {
|
|
@@ -7202,12 +7320,14 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7202
7320
|
emitFlags: EmitFlags.Default
|
|
7203
7321
|
};
|
|
7204
7322
|
}
|
|
7205
|
-
const existingCompilerOptions =
|
|
7323
|
+
const existingCompilerOptions = {
|
|
7206
7324
|
genDir: basePath,
|
|
7207
|
-
basePath
|
|
7208
|
-
|
|
7325
|
+
basePath,
|
|
7326
|
+
...readAngularCompilerOptions(configFileName),
|
|
7327
|
+
...existingOptions
|
|
7328
|
+
};
|
|
7209
7329
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
7210
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
7330
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts36.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
7211
7331
|
options.enableIvy = !!((_a = options.enableIvy) != null ? _a : true);
|
|
7212
7332
|
let emitFlags = EmitFlags.Default;
|
|
7213
7333
|
if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
|
|
@@ -7219,7 +7339,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7219
7339
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
7220
7340
|
} catch (e) {
|
|
7221
7341
|
const errors = [{
|
|
7222
|
-
category:
|
|
7342
|
+
category: ts36.DiagnosticCategory.Error,
|
|
7223
7343
|
messageText: (_b = e.stack) != null ? _b : e.message,
|
|
7224
7344
|
file: void 0,
|
|
7225
7345
|
start: void 0,
|
|
@@ -7233,7 +7353,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7233
7353
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
7234
7354
|
return {
|
|
7235
7355
|
fileExists: host.exists.bind(host),
|
|
7236
|
-
readDirectory:
|
|
7356
|
+
readDirectory: ts36.sys.readDirectory,
|
|
7237
7357
|
readFile: host.readFile.bind(host),
|
|
7238
7358
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
7239
7359
|
};
|
|
@@ -7253,7 +7373,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
7253
7373
|
}
|
|
7254
7374
|
} else {
|
|
7255
7375
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
7256
|
-
const { resolvedModule } =
|
|
7376
|
+
const { resolvedModule } = ts36.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts36.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost);
|
|
7257
7377
|
if (resolvedModule) {
|
|
7258
7378
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
7259
7379
|
}
|
|
@@ -7263,7 +7383,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
7263
7383
|
function exitCodeFromResult(diags) {
|
|
7264
7384
|
if (!diags)
|
|
7265
7385
|
return 0;
|
|
7266
|
-
if (diags.every((diag) => diag.category !==
|
|
7386
|
+
if (diags.every((diag) => diag.category !== ts36.DiagnosticCategory.Error)) {
|
|
7267
7387
|
return 0;
|
|
7268
7388
|
}
|
|
7269
7389
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -7296,7 +7416,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
7296
7416
|
} catch (e) {
|
|
7297
7417
|
program = void 0;
|
|
7298
7418
|
allDiagnostics.push({
|
|
7299
|
-
category:
|
|
7419
|
+
category: ts36.DiagnosticCategory.Error,
|
|
7300
7420
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
7301
7421
|
code: UNKNOWN_ERROR_CODE,
|
|
7302
7422
|
file: void 0,
|
|
@@ -7323,7 +7443,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
7323
7443
|
return allDiagnostics;
|
|
7324
7444
|
}
|
|
7325
7445
|
function hasErrors(diags) {
|
|
7326
|
-
return diags.some((d) => d.category ===
|
|
7446
|
+
return diags.some((d) => d.category === ts36.DiagnosticCategory.Error);
|
|
7327
7447
|
}
|
|
7328
7448
|
|
|
7329
7449
|
export {
|
|
@@ -7363,4 +7483,4 @@ export {
|
|
|
7363
7483
|
* found in the LICENSE file at https://angular.io/license
|
|
7364
7484
|
*/
|
|
7365
7485
|
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
7366
|
-
//# sourceMappingURL=chunk-
|
|
7486
|
+
//# sourceMappingURL=chunk-WAXJ3P3Y.js.map
|