@angular/compiler-cli 13.2.0-rc.0 → 13.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/bundles/{chunk-RDTZZXLZ.js → chunk-3WNAIXKA.js} +1 -1
  2. package/bundles/{chunk-RDTZZXLZ.js.map → chunk-3WNAIXKA.js.map} +1 -1
  3. package/bundles/{chunk-SJCYXGJE.js → chunk-5ABOWRRP.js} +3 -3
  4. package/bundles/{chunk-SJCYXGJE.js.map → chunk-5ABOWRRP.js.map} +0 -0
  5. package/bundles/{chunk-PRLCFFMX.js → chunk-5XSC4B4W.js} +111 -77
  6. package/bundles/chunk-5XSC4B4W.js.map +6 -0
  7. package/bundles/{chunk-VUEDWBJP.js → chunk-6ESPQED7.js} +8 -3
  8. package/bundles/chunk-6ESPQED7.js.map +6 -0
  9. package/bundles/{chunk-N2FK756V.js → chunk-B5DWKBQ7.js} +2 -2
  10. package/bundles/{chunk-N2FK756V.js.map → chunk-B5DWKBQ7.js.map} +0 -0
  11. package/bundles/{chunk-7UHLQOIO.js → chunk-LL4S3DRM.js} +2 -2
  12. package/bundles/{chunk-7UHLQOIO.js.map → chunk-LL4S3DRM.js.map} +0 -0
  13. package/bundles/{chunk-XDDLTG6N.js → chunk-OSTNYZ2E.js} +4 -4
  14. package/bundles/{chunk-XDDLTG6N.js.map → chunk-OSTNYZ2E.js.map} +1 -1
  15. package/bundles/{chunk-RGGJJ7ZZ.js → chunk-QZBA4KSX.js} +5 -5
  16. package/bundles/{chunk-RGGJJ7ZZ.js.map → chunk-QZBA4KSX.js.map} +1 -1
  17. package/bundles/{chunk-XDGHBAZ6.js → chunk-VMLZST3Q.js} +6 -6
  18. package/bundles/{chunk-XDGHBAZ6.js.map → chunk-VMLZST3Q.js.map} +1 -1
  19. package/bundles/{chunk-KU4D2JVX.js → chunk-VXXCHVAH.js} +5 -5
  20. package/bundles/{chunk-KU4D2JVX.js.map → chunk-VXXCHVAH.js.map} +0 -0
  21. package/bundles/index.js +5 -5
  22. package/bundles/linker/babel/index.js +4 -4
  23. package/bundles/linker/babel/index.js.map +1 -1
  24. package/bundles/linker/index.js +4 -4
  25. package/bundles/ngcc/index.js +7 -7
  26. package/bundles/ngcc/main-ngcc.js +8 -8
  27. package/bundles/ngcc/main-ngcc.js.map +1 -1
  28. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +7 -7
  29. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
  30. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +1 -1
  31. package/bundles/private/localize.js +2 -2
  32. package/bundles/private/migrations.js +3 -3
  33. package/bundles/src/bin/ng_xi18n.js +5 -5
  34. package/bundles/src/bin/ngc.js +5 -5
  35. package/bundles_metadata.json +1 -1
  36. package/ngcc/src/packages/build_marker.d.ts +1 -1
  37. package/package.json +2 -3
  38. package/src/ngtsc/core/api/src/options.d.ts +0 -4
  39. package/src/ngtsc/imports/src/emitter.d.ts +16 -2
  40. package/src/ngtsc/indexer/src/api.d.ts +1 -0
  41. package/src/ngtsc/indexer/src/template.d.ts +4 -1
  42. package/bundles/chunk-PRLCFFMX.js.map +0 -6
  43. package/bundles/chunk-VUEDWBJP.js.map +0 -6
@@ -34,7 +34,7 @@ import {
34
34
  ivyTransformFactory,
35
35
  retagAllTsFiles,
36
36
  untagAllTsFiles
37
- } from "./chunk-SJCYXGJE.js";
37
+ } from "./chunk-5ABOWRRP.js";
38
38
  import {
39
39
  TypeScriptReflectionHost,
40
40
  isNamedClassDeclaration
@@ -79,7 +79,7 @@ import {
79
79
  toUnredirectedSourceFile,
80
80
  translateExpression,
81
81
  translateType
82
- } from "./chunk-VUEDWBJP.js";
82
+ } from "./chunk-6ESPQED7.js";
83
83
  import {
84
84
  LogicalFileSystem,
85
85
  absoluteFrom,
@@ -89,7 +89,7 @@ import {
89
89
  getSourceFileOrError,
90
90
  join,
91
91
  resolve
92
- } from "./chunk-RGGJJ7ZZ.js";
92
+ } from "./chunk-QZBA4KSX.js";
93
93
  import {
94
94
  ActivePerfRecorder,
95
95
  DelegatingPerfRecorder,
@@ -162,7 +162,7 @@ var SymbolKind;
162
162
 
163
163
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
164
164
  import { HtmlParser, MessageBundle } from "@angular/compiler";
165
- import ts31 from "typescript";
165
+ import ts32 from "typescript";
166
166
 
167
167
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
168
168
  import { Xliff, Xliff2, Xmb } from "@angular/compiler";
@@ -267,7 +267,7 @@ function verifySupportedTypeScriptVersion() {
267
267
  }
268
268
 
269
269
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
270
- import ts29 from "typescript";
270
+ import ts30 from "typescript";
271
271
 
272
272
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
273
273
  var CycleAnalyzer = class {
@@ -1079,11 +1079,12 @@ var ExpressionVisitor = class extends RecursiveAstVisitor {
1079
1079
  this.boundTemplate = boundTemplate;
1080
1080
  this.targetToIdentifier = targetToIdentifier;
1081
1081
  this.identifiers = [];
1082
+ this.errors = [];
1082
1083
  }
1083
1084
  static getIdentifiers(ast, source, absoluteOffset, boundTemplate, targetToIdentifier) {
1084
1085
  const visitor = new ExpressionVisitor(source, absoluteOffset, boundTemplate, targetToIdentifier);
1085
1086
  visitor.visit(ast);
1086
- return visitor.identifiers;
1087
+ return { identifiers: visitor.identifiers, errors: visitor.errors };
1087
1088
  }
1088
1089
  visit(ast) {
1089
1090
  ast.visit(this);
@@ -1105,7 +1106,8 @@ var ExpressionVisitor = class extends RecursiveAstVisitor {
1105
1106
  identifierStart = ast.nameSpan.start - this.absoluteOffset;
1106
1107
  }
1107
1108
  if (!this.expressionStr.substring(identifierStart).startsWith(ast.name)) {
1108
- throw new Error(`Impossible state: "${ast.name}" not found in "${this.expressionStr}" at location ${identifierStart}`);
1109
+ this.errors.push(new Error(`Impossible state: "${ast.name}" not found in "${this.expressionStr}" at location ${identifierStart}`));
1110
+ return;
1109
1111
  }
1110
1112
  const absoluteStart = this.absoluteOffset + identifierStart;
1111
1113
  const span = new AbsoluteSourceSpan(absoluteStart, absoluteStart + ast.name.length);
@@ -1125,6 +1127,7 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1125
1127
  super();
1126
1128
  this.boundTemplate = boundTemplate;
1127
1129
  this.identifiers = /* @__PURE__ */ new Set();
1130
+ this.errors = [];
1128
1131
  this.targetIdentifierCache = /* @__PURE__ */ new Map();
1129
1132
  this.elementAndTemplateIdentifierCache = /* @__PURE__ */ new Map();
1130
1133
  }
@@ -1136,7 +1139,9 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1136
1139
  }
1137
1140
  visitElement(element) {
1138
1141
  const elementIdentifier = this.elementOrTemplateToIdentifier(element);
1139
- this.identifiers.add(elementIdentifier);
1142
+ if (elementIdentifier !== null) {
1143
+ this.identifiers.add(elementIdentifier);
1144
+ }
1140
1145
  this.visitAll(element.references);
1141
1146
  this.visitAll(element.inputs);
1142
1147
  this.visitAll(element.attributes);
@@ -1145,7 +1150,9 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1145
1150
  }
1146
1151
  visitTemplate(template) {
1147
1152
  const templateIdentifier = this.elementOrTemplateToIdentifier(template);
1148
- this.identifiers.add(templateIdentifier);
1153
+ if (templateIdentifier !== null) {
1154
+ this.identifiers.add(templateIdentifier);
1155
+ }
1149
1156
  this.visitAll(template.variables);
1150
1157
  this.visitAll(template.attributes);
1151
1158
  this.visitAll(template.templateAttrs);
@@ -1156,8 +1163,9 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1156
1163
  if (attribute.valueSpan === void 0) {
1157
1164
  return;
1158
1165
  }
1159
- const identifiers = ExpressionVisitor.getIdentifiers(attribute.value, attribute.valueSpan.toString(), attribute.valueSpan.start.offset, this.boundTemplate, this.targetToIdentifier.bind(this));
1166
+ const { identifiers, errors } = ExpressionVisitor.getIdentifiers(attribute.value, attribute.valueSpan.toString(), attribute.valueSpan.start.offset, this.boundTemplate, this.targetToIdentifier.bind(this));
1160
1167
  identifiers.forEach((id) => this.identifiers.add(id));
1168
+ this.errors.push(...errors);
1161
1169
  }
1162
1170
  visitBoundEvent(attribute) {
1163
1171
  this.visitExpression(attribute.handler);
@@ -1167,31 +1175,40 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1167
1175
  }
1168
1176
  visitReference(reference) {
1169
1177
  const referenceIdentifer = this.targetToIdentifier(reference);
1178
+ if (referenceIdentifer === null) {
1179
+ return;
1180
+ }
1170
1181
  this.identifiers.add(referenceIdentifer);
1171
1182
  }
1172
1183
  visitVariable(variable) {
1173
1184
  const variableIdentifier = this.targetToIdentifier(variable);
1185
+ if (variableIdentifier === null) {
1186
+ return;
1187
+ }
1174
1188
  this.identifiers.add(variableIdentifier);
1175
1189
  }
1176
1190
  elementOrTemplateToIdentifier(node) {
1191
+ var _a;
1177
1192
  if (this.elementAndTemplateIdentifierCache.has(node)) {
1178
1193
  return this.elementAndTemplateIdentifierCache.get(node);
1179
1194
  }
1180
1195
  let name;
1181
1196
  let kind;
1182
1197
  if (node instanceof TmplAstTemplate) {
1183
- name = node.tagName;
1198
+ name = (_a = node.tagName) != null ? _a : "ng-template";
1184
1199
  kind = IdentifierKind.Template;
1185
1200
  } else {
1186
- if (node.name.startsWith(":")) {
1187
- name = node.name.split(":").pop();
1188
- } else {
1189
- name = node.name;
1190
- }
1201
+ name = node.name;
1191
1202
  kind = IdentifierKind.Element;
1192
1203
  }
1204
+ if (name.startsWith(":")) {
1205
+ name = name.split(":").pop();
1206
+ }
1193
1207
  const sourceSpan = node.startSourceSpan;
1194
1208
  const start = this.getStartLocation(name, sourceSpan);
1209
+ if (start === null) {
1210
+ return null;
1211
+ }
1195
1212
  const absoluteSpan = new AbsoluteSourceSpan(start, start + name.length);
1196
1213
  const attributes = node.attributes.map(({ name: name2, sourceSpan: sourceSpan2 }) => {
1197
1214
  return {
@@ -1222,23 +1239,30 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1222
1239
  }
1223
1240
  const { name, sourceSpan } = node;
1224
1241
  const start = this.getStartLocation(name, sourceSpan);
1242
+ if (start === null) {
1243
+ return null;
1244
+ }
1225
1245
  const span = new AbsoluteSourceSpan(start, start + name.length);
1226
1246
  let identifier;
1227
1247
  if (node instanceof TmplAstReference) {
1228
1248
  const refTarget = this.boundTemplate.getReferenceTarget(node);
1229
1249
  let target = null;
1230
1250
  if (refTarget) {
1251
+ let node2 = null;
1252
+ let directive = null;
1231
1253
  if (refTarget instanceof TmplAstElement || refTarget instanceof TmplAstTemplate) {
1232
- target = {
1233
- node: this.elementOrTemplateToIdentifier(refTarget),
1234
- directive: null
1235
- };
1254
+ node2 = this.elementOrTemplateToIdentifier(refTarget);
1236
1255
  } else {
1237
- target = {
1238
- node: this.elementOrTemplateToIdentifier(refTarget.node),
1239
- directive: refTarget.directive.ref.node
1240
- };
1256
+ node2 = this.elementOrTemplateToIdentifier(refTarget.node);
1257
+ directive = refTarget.directive.ref.node;
1241
1258
  }
1259
+ if (node2 === null) {
1260
+ return null;
1261
+ }
1262
+ target = {
1263
+ node: node2,
1264
+ directive
1265
+ };
1242
1266
  }
1243
1267
  identifier = {
1244
1268
  name,
@@ -1259,7 +1283,8 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1259
1283
  getStartLocation(name, context) {
1260
1284
  const localStr = context.toString();
1261
1285
  if (!localStr.includes(name)) {
1262
- throw new Error(`Impossible state: "${name}" not found in "${localStr}"`);
1286
+ this.errors.push(new Error(`Impossible state: "${name}" not found in "${localStr}"`));
1287
+ return null;
1263
1288
  }
1264
1289
  return context.start.offset + localStr.indexOf(name);
1265
1290
  }
@@ -1267,8 +1292,9 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
1267
1292
  if (ast instanceof ASTWithSource && ast.source !== null) {
1268
1293
  const targetToIdentifier = this.targetToIdentifier.bind(this);
1269
1294
  const absoluteOffset = ast.sourceSpan.start;
1270
- const identifiers = ExpressionVisitor.getIdentifiers(ast, ast.source, absoluteOffset, this.boundTemplate, targetToIdentifier);
1295
+ const { identifiers, errors } = ExpressionVisitor.getIdentifiers(ast, ast.source, absoluteOffset, this.boundTemplate, targetToIdentifier);
1271
1296
  identifiers.forEach((id) => this.identifiers.add(id));
1297
+ this.errors.push(...errors);
1272
1298
  }
1273
1299
  }
1274
1300
  };
@@ -1277,7 +1303,7 @@ function getTemplateIdentifiers(boundTemplate) {
1277
1303
  if (boundTemplate.target.template !== void 0) {
1278
1304
  visitor.visitAll(boundTemplate.target.template);
1279
1305
  }
1280
- return visitor.identifiers;
1306
+ return { identifiers: visitor.identifiers, errors: visitor.errors };
1281
1307
  }
1282
1308
 
1283
1309
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
@@ -1299,16 +1325,18 @@ function generateAnalysis(context) {
1299
1325
  } else {
1300
1326
  templateFile = templateMeta.file;
1301
1327
  }
1328
+ const { identifiers, errors } = getTemplateIdentifiers(boundTemplate);
1302
1329
  analysis.set(declaration, {
1303
1330
  name,
1304
1331
  selector,
1305
1332
  file: componentFile,
1306
1333
  template: {
1307
- identifiers: getTemplateIdentifiers(boundTemplate),
1334
+ identifiers,
1308
1335
  usedComponents,
1309
1336
  isInline: templateMeta.isInline,
1310
1337
  file: templateFile
1311
- }
1338
+ },
1339
+ errors
1312
1340
  });
1313
1341
  });
1314
1342
  return analysis;
@@ -2778,11 +2806,11 @@ var Environment = class {
2778
2806
  return translateExpression(ngExpr.expression, this.importManager);
2779
2807
  }
2780
2808
  canReferenceType(ref) {
2781
- const result = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports);
2809
+ const result = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowRelativeDtsImports);
2782
2810
  return result.kind === 0;
2783
2811
  }
2784
2812
  referenceType(ref) {
2785
- const ngExpr = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports);
2813
+ const ngExpr = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowRelativeDtsImports);
2786
2814
  assertSuccessfulReferenceEmit(ngExpr, this.contextFile, "symbol");
2787
2815
  return translateType(new ExpressionType(ngExpr.expression), this.importManager);
2788
2816
  }
@@ -5815,6 +5843,7 @@ var factory = {
5815
5843
 
5816
5844
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
5817
5845
  import { Binary } from "@angular/compiler";
5846
+ import ts28 from "typescript";
5818
5847
  var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
5819
5848
  constructor() {
5820
5849
  super(...arguments);
@@ -5828,6 +5857,9 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
5828
5857
  return [];
5829
5858
  }
5830
5859
  const typeLeft = symbolLeft.tsType;
5860
+ if (typeLeft.flags & (ts28.TypeFlags.Any | ts28.TypeFlags.Unknown)) {
5861
+ return [];
5862
+ }
5831
5863
  if (typeLeft.getNonNullableType() !== typeLeft)
5832
5864
  return [];
5833
5865
  const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
@@ -5843,7 +5875,8 @@ var factory2 = {
5843
5875
  code: ErrorCode.NULLISH_COALESCING_NOT_NULLABLE,
5844
5876
  name: ExtendedTemplateDiagnosticName.NULLISH_COALESCING_NOT_NULLABLE,
5845
5877
  create: (options) => {
5846
- if (options.strictNullChecks === false) {
5878
+ const strictNullChecks = options.strictNullChecks === void 0 ? !!options.strict : !!options.strictNullChecks;
5879
+ if (!strictNullChecks) {
5847
5880
  return null;
5848
5881
  }
5849
5882
  return new NullishCoalescingNotNullableCheck();
@@ -5851,7 +5884,7 @@ var factory2 = {
5851
5884
  };
5852
5885
 
5853
5886
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
5854
- import ts28 from "typescript";
5887
+ import ts29 from "typescript";
5855
5888
 
5856
5889
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
5857
5890
  var DiagnosticCategoryLabel;
@@ -5899,9 +5932,9 @@ var ExtendedTemplateCheckerImpl = class {
5899
5932
  function diagnosticLabelToCategory(label) {
5900
5933
  switch (label) {
5901
5934
  case DiagnosticCategoryLabel.Warning:
5902
- return ts28.DiagnosticCategory.Warning;
5935
+ return ts29.DiagnosticCategory.Warning;
5903
5936
  case DiagnosticCategoryLabel.Error:
5904
- return ts28.DiagnosticCategory.Error;
5937
+ return ts29.DiagnosticCategory.Error;
5905
5938
  case DiagnosticCategoryLabel.Suppress:
5906
5939
  return null;
5907
5940
  default:
@@ -5992,14 +6025,11 @@ var NgCompiler = class {
5992
6025
  this.constructionDiagnostics = [];
5993
6026
  this.nonTemplateDiagnostics = null;
5994
6027
  this.delegatingPerfRecorder = new DelegatingPerfRecorder(this.perfRecorder);
5995
- if (this.options._extendedTemplateDiagnostics === true && this.options.strictTemplates === false) {
5996
- throw new Error("The '_extendedTemplateDiagnostics' option requires 'strictTemplates' to also be enabled.");
5997
- }
5998
6028
  this.constructionDiagnostics.push(...this.adapter.constructionDiagnostics, ...verifyCompatibleTypeCheckOptions(this.options));
5999
6029
  this.currentProgram = inputProgram;
6000
6030
  this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
6001
6031
  this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
6002
- const moduleResolutionCache = ts29.createModuleResolutionCache(this.adapter.getCurrentDirectory(), this.adapter.getCanonicalFileName.bind(this.adapter));
6032
+ const moduleResolutionCache = ts30.createModuleResolutionCache(this.adapter.getCurrentDirectory(), this.adapter.getCanonicalFileName.bind(this.adapter));
6003
6033
  this.moduleResolver = new ModuleResolver(inputProgram, this.options, this.adapter, moduleResolutionCache);
6004
6034
  this.resourceManager = new AdapterResourceLoader(adapter, this.options);
6005
6035
  this.cycleAnalyzer = new CycleAnalyzer(new ImportGraph(inputProgram.getTypeChecker(), this.delegatingPerfRecorder));
@@ -6055,7 +6085,7 @@ var NgCompiler = class {
6055
6085
  }
6056
6086
  for (const clazz of classesToUpdate) {
6057
6087
  this.compilation.traitCompiler.updateResources(clazz);
6058
- if (!ts29.isClassDeclaration(clazz)) {
6088
+ if (!ts30.isClassDeclaration(clazz)) {
6059
6089
  continue;
6060
6090
  }
6061
6091
  this.compilation.templateTypeChecker.invalidateClass(clazz);
@@ -6077,7 +6107,7 @@ var NgCompiler = class {
6077
6107
  getDiagnosticsForFile(file, optimizeFor) {
6078
6108
  const diagnostics = [];
6079
6109
  diagnostics.push(...this.getNonTemplateDiagnostics().filter((diag) => diag.file === file), ...this.getTemplateDiagnosticsForFile(file, optimizeFor));
6080
- if (this.options._extendedTemplateDiagnostics) {
6110
+ if (this.options.strictTemplates) {
6081
6111
  diagnostics.push(...this.getExtendedTemplateDiagnostics(file));
6082
6112
  }
6083
6113
  return this.addMessageTextDetails(diagnostics);
@@ -6087,8 +6117,8 @@ var NgCompiler = class {
6087
6117
  const ttc = compilation.templateTypeChecker;
6088
6118
  const diagnostics = [];
6089
6119
  diagnostics.push(...ttc.getDiagnosticsForComponent(component));
6090
- if (this.options._extendedTemplateDiagnostics) {
6091
- const extendedTemplateChecker = compilation.extendedTemplateChecker;
6120
+ const extendedTemplateChecker = compilation.extendedTemplateChecker;
6121
+ if (this.options.strictTemplates && extendedTemplateChecker) {
6092
6122
  diagnostics.push(...extendedTemplateChecker.getDiagnosticsForComponent(component));
6093
6123
  }
6094
6124
  return this.addMessageTextDetails(diagnostics);
@@ -6362,6 +6392,9 @@ var NgCompiler = class {
6362
6392
  const diagnostics = [];
6363
6393
  const compilation = this.ensureAnalyzed();
6364
6394
  const extendedTemplateChecker = compilation.extendedTemplateChecker;
6395
+ if (!extendedTemplateChecker) {
6396
+ return [];
6397
+ }
6365
6398
  if (sf !== void 0) {
6366
6399
  return compilation.traitCompiler.extendedTemplateCheck(sf, extendedTemplateChecker);
6367
6400
  }
@@ -6436,7 +6469,7 @@ var NgCompiler = class {
6436
6469
  this.currentProgram = program;
6437
6470
  });
6438
6471
  const templateTypeChecker = new TemplateTypeCheckerImpl(this.inputProgram, notifyingDriver, traitCompiler, this.getTypeCheckingConfig(), refEmitter, reflector, this.adapter, this.incrementalCompilation, scopeRegistry, typeCheckScopeRegistry, this.delegatingPerfRecorder);
6439
- const extendedTemplateChecker = new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options);
6472
+ const extendedTemplateChecker = this.constructionDiagnostics.length === 0 ? new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options) : null;
6440
6473
  return {
6441
6474
  isCore,
6442
6475
  traitCompiler,
@@ -6460,17 +6493,17 @@ function isAngularCorePackage(program) {
6460
6493
  return false;
6461
6494
  }
6462
6495
  return r3Symbols.statements.some((stmt) => {
6463
- if (!ts29.isVariableStatement(stmt)) {
6496
+ if (!ts30.isVariableStatement(stmt)) {
6464
6497
  return false;
6465
6498
  }
6466
- if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind === ts29.SyntaxKind.ExportKeyword)) {
6499
+ if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind === ts30.SyntaxKind.ExportKeyword)) {
6467
6500
  return false;
6468
6501
  }
6469
6502
  return stmt.declarationList.declarations.some((decl) => {
6470
- if (!ts29.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
6503
+ if (!ts30.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
6471
6504
  return false;
6472
6505
  }
6473
- if (decl.initializer === void 0 || decl.initializer.kind !== ts29.SyntaxKind.TrueKeyword) {
6506
+ if (decl.initializer === void 0 || decl.initializer.kind !== ts30.SyntaxKind.TrueKeyword) {
6474
6507
  return false;
6475
6508
  }
6476
6509
  return true;
@@ -6484,7 +6517,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
6484
6517
  var _a, _b, _c;
6485
6518
  if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
6486
6519
  yield makeConfigDiagnostic({
6487
- category: ts29.DiagnosticCategory.Error,
6520
+ category: ts30.DiagnosticCategory.Error,
6488
6521
  code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
6489
6522
  messageText: `
6490
6523
  Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
@@ -6503,7 +6536,7 @@ https://angular.io/guide/template-typecheck
6503
6536
  }
6504
6537
  if (options.extendedDiagnostics && options.strictTemplates === false) {
6505
6538
  yield makeConfigDiagnostic({
6506
- category: ts29.DiagnosticCategory.Error,
6539
+ category: ts30.DiagnosticCategory.Error,
6507
6540
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
6508
6541
  messageText: `
6509
6542
  Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
@@ -6520,7 +6553,7 @@ One of the following actions is required:
6520
6553
  const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
6521
6554
  if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
6522
6555
  yield makeConfigDiagnostic({
6523
- category: ts29.DiagnosticCategory.Error,
6556
+ category: ts30.DiagnosticCategory.Error,
6524
6557
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
6525
6558
  messageText: `
6526
6559
  Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
@@ -6534,7 +6567,7 @@ ${allowedCategoryLabels.join("\n")}
6534
6567
  for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
6535
6568
  if (!allExtendedDiagnosticNames.includes(checkName)) {
6536
6569
  yield makeConfigDiagnostic({
6537
- category: ts29.DiagnosticCategory.Error,
6570
+ category: ts30.DiagnosticCategory.Error,
6538
6571
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
6539
6572
  messageText: `
6540
6573
  Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
@@ -6546,7 +6579,7 @@ ${allExtendedDiagnosticNames.join("\n")}
6546
6579
  }
6547
6580
  if (!allowedCategoryLabels.includes(category)) {
6548
6581
  yield makeConfigDiagnostic({
6549
- category: ts29.DiagnosticCategory.Error,
6582
+ category: ts30.DiagnosticCategory.Error,
6550
6583
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
6551
6584
  messageText: `
6552
6585
  Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
@@ -6576,7 +6609,7 @@ var ReferenceGraphAdapter = class {
6576
6609
  for (const { node } of references) {
6577
6610
  let sourceFile = node.getSourceFile();
6578
6611
  if (sourceFile === void 0) {
6579
- sourceFile = ts29.getOriginalNode(node).getSourceFile();
6612
+ sourceFile = ts30.getOriginalNode(node).getSourceFile();
6580
6613
  }
6581
6614
  if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
6582
6615
  this.graph.add(source, node);
@@ -6615,7 +6648,7 @@ function versionMapFromProgram(program, driver) {
6615
6648
  }
6616
6649
 
6617
6650
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
6618
- import ts30 from "typescript";
6651
+ import ts31 from "typescript";
6619
6652
  var DelegatingCompilerHost2 = class {
6620
6653
  constructor(delegate) {
6621
6654
  this.delegate = delegate;
@@ -6705,7 +6738,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
6705
6738
  entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
6706
6739
  if (entryPoint === null) {
6707
6740
  diagnostics.push({
6708
- category: ts30.DiagnosticCategory.Error,
6741
+ category: ts31.DiagnosticCategory.Error,
6709
6742
  code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
6710
6743
  file: void 0,
6711
6744
  start: void 0,
@@ -6745,10 +6778,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
6745
6778
  return this.fileNameToModuleName !== void 0 ? this : null;
6746
6779
  }
6747
6780
  createCachedResolveModuleNamesFunction() {
6748
- const moduleResolutionCache = ts30.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
6781
+ const moduleResolutionCache = ts31.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
6749
6782
  return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
6750
6783
  return moduleNames.map((moduleName) => {
6751
- const module = ts30.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
6784
+ const module = ts31.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
6752
6785
  return module.resolvedModule;
6753
6786
  });
6754
6787
  };
@@ -6769,7 +6802,7 @@ var NgtscProgram = class {
6769
6802
  if (reuseProgram !== void 0) {
6770
6803
  retagAllTsFiles(reuseProgram);
6771
6804
  }
6772
- this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts31.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
6805
+ this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts32.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
6773
6806
  perfRecorder.phase(PerfPhase.Unaccounted);
6774
6807
  perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
6775
6808
  this.host.postProgramCreationCleanup();
@@ -6968,17 +7001,17 @@ function createProgram({ rootNames, options, host, oldProgram }) {
6968
7001
  }
6969
7002
 
6970
7003
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
6971
- import ts33 from "typescript";
7004
+ import ts34 from "typescript";
6972
7005
 
6973
7006
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
6974
- import ts32 from "typescript";
7007
+ import ts33 from "typescript";
6975
7008
  var GENERATED_FILES = /(.*?)\.(ngfactory|shim\.ngstyle|ngstyle|ngsummary)\.(js|d\.ts|ts)$/;
6976
7009
  function createMessageDiagnostic(messageText) {
6977
7010
  return {
6978
7011
  file: void 0,
6979
7012
  start: void 0,
6980
7013
  length: void 0,
6981
- category: ts32.DiagnosticCategory.Message,
7014
+ category: ts33.DiagnosticCategory.Message,
6982
7015
  messageText,
6983
7016
  code: DEFAULT_ERROR_CODE,
6984
7017
  source: SOURCE
@@ -6987,13 +7020,13 @@ function createMessageDiagnostic(messageText) {
6987
7020
 
6988
7021
  // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
6989
7022
  var defaultFormatHost = {
6990
- getCurrentDirectory: () => ts33.sys.getCurrentDirectory(),
7023
+ getCurrentDirectory: () => ts34.sys.getCurrentDirectory(),
6991
7024
  getCanonicalFileName: (fileName) => fileName,
6992
- getNewLine: () => ts33.sys.newLine
7025
+ getNewLine: () => ts34.sys.newLine
6993
7026
  };
6994
7027
  function formatDiagnostics(diags, host = defaultFormatHost) {
6995
7028
  if (diags && diags.length) {
6996
- return diags.map((diagnostic) => replaceTsWithNgInErrors(ts33.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
7029
+ return diags.map((diagnostic) => replaceTsWithNgInErrors(ts34.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
6997
7030
  } else {
6998
7031
  return "";
6999
7032
  }
@@ -7007,10 +7040,10 @@ function calcProjectFileAndBasePath(project, host = getFileSystem()) {
7007
7040
  return { projectFile, basePath };
7008
7041
  }
7009
7042
  function readConfiguration(project, existingOptions, host = getFileSystem()) {
7010
- var _a;
7043
+ var _a, _b;
7011
7044
  try {
7012
7045
  const fs = getFileSystem();
7013
- const readConfigFile = (configFile) => ts33.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
7046
+ const readConfigFile = (configFile) => ts34.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
7014
7047
  const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
7015
7048
  const { config: config2, error: error2 } = readConfigFile(configFile);
7016
7049
  if (error2) {
@@ -7042,7 +7075,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
7042
7075
  basePath
7043
7076
  }, readAngularCompilerOptions(configFileName)), existingOptions);
7044
7077
  const parseConfigHost = createParseConfigHost(host, fs);
7045
- const { options, errors, fileNames: rootNames, projectReferences } = ts33.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
7078
+ const { options, errors, fileNames: rootNames, projectReferences } = ts34.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
7046
7079
  options.enableIvy = !!((_a = options.enableIvy) != null ? _a : true);
7047
7080
  let emitFlags = EmitFlags.Default;
7048
7081
  if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
@@ -7054,8 +7087,8 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
7054
7087
  return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
7055
7088
  } catch (e) {
7056
7089
  const errors = [{
7057
- category: ts33.DiagnosticCategory.Error,
7058
- messageText: e.stack,
7090
+ category: ts34.DiagnosticCategory.Error,
7091
+ messageText: (_b = e.stack) != null ? _b : e.message,
7059
7092
  file: void 0,
7060
7093
  start: void 0,
7061
7094
  length: void 0,
@@ -7068,7 +7101,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
7068
7101
  function createParseConfigHost(host, fs = getFileSystem()) {
7069
7102
  return {
7070
7103
  fileExists: host.exists.bind(host),
7071
- readDirectory: ts33.sys.readDirectory,
7104
+ readDirectory: ts34.sys.readDirectory,
7072
7105
  readFile: host.readFile.bind(host),
7073
7106
  useCaseSensitiveFileNames: fs.isCaseSensitive()
7074
7107
  };
@@ -7088,7 +7121,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
7088
7121
  }
7089
7122
  } else {
7090
7123
  const parseConfigHost = createParseConfigHost(host, fs);
7091
- const { resolvedModule } = ts33.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts33.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost);
7124
+ const { resolvedModule } = ts34.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts34.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost);
7092
7125
  if (resolvedModule) {
7093
7126
  return absoluteFrom(resolvedModule.resolvedFileName);
7094
7127
  }
@@ -7098,12 +7131,13 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
7098
7131
  function exitCodeFromResult(diags) {
7099
7132
  if (!diags)
7100
7133
  return 0;
7101
- if (diags.every((diag) => diag.category !== ts33.DiagnosticCategory.Error)) {
7134
+ if (diags.every((diag) => diag.category !== ts34.DiagnosticCategory.Error)) {
7102
7135
  return 0;
7103
7136
  }
7104
7137
  return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
7105
7138
  }
7106
7139
  function performCompilation({ rootNames, options, host, oldProgram, emitCallback, mergeEmitResultsCallback, gatherDiagnostics = defaultGatherDiagnostics, customTransformers, emitFlags = EmitFlags.Default, modifiedResourceFiles = null }) {
7140
+ var _a;
7107
7141
  let program;
7108
7142
  let emitResult;
7109
7143
  let allDiagnostics = [];
@@ -7130,8 +7164,8 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
7130
7164
  } catch (e) {
7131
7165
  program = void 0;
7132
7166
  allDiagnostics.push({
7133
- category: ts33.DiagnosticCategory.Error,
7134
- messageText: e.stack,
7167
+ category: ts34.DiagnosticCategory.Error,
7168
+ messageText: (_a = e.stack) != null ? _a : e.message,
7135
7169
  code: UNKNOWN_ERROR_CODE,
7136
7170
  file: void 0,
7137
7171
  start: void 0,
@@ -7157,7 +7191,7 @@ function defaultGatherDiagnostics(program) {
7157
7191
  return allDiagnostics;
7158
7192
  }
7159
7193
  function hasErrors(diags) {
7160
- return diags.some((d) => d.category === ts33.DiagnosticCategory.Error);
7194
+ return diags.some((d) => d.category === ts34.DiagnosticCategory.Error);
7161
7195
  }
7162
7196
 
7163
7197
  export {
@@ -7197,4 +7231,4 @@ export {
7197
7231
  * Use of this source code is governed by an MIT-style license that can be
7198
7232
  * found in the LICENSE file at https://angular.io/license
7199
7233
  */
7200
- //# sourceMappingURL=chunk-PRLCFFMX.js.map
7234
+ //# sourceMappingURL=chunk-5XSC4B4W.js.map