@angular-eslint/bundled-angular-compiler 19.0.3-alpha.8 → 19.1.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.
Files changed (2) hide show
  1. package/dist/index.js +142 -301
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -27,8 +27,6 @@ __export(index_exports, {
27
27
  AbsoluteSourceSpan: () => AbsoluteSourceSpan,
28
28
  ArrayType: () => ArrayType,
29
29
  ArrowFunctionExpr: () => ArrowFunctionExpr,
30
- AstMemoryEfficientTransformer: () => AstMemoryEfficientTransformer,
31
- AstTransformer: () => AstTransformer,
32
30
  Attribute: () => Attribute,
33
31
  Binary: () => Binary,
34
32
  BinaryOperator: () => BinaryOperator,
@@ -267,7 +265,7 @@ __export(index_exports, {
267
265
  });
268
266
  module.exports = __toCommonJS(index_exports);
269
267
 
270
- // ../../node_modules/.pnpm/@angular+compiler@19.0.6/node_modules/@angular/compiler/fesm2022/compiler.mjs
268
+ // ../../node_modules/.pnpm/@angular+compiler@19.1.5/node_modules/@angular/compiler/fesm2022/compiler.mjs
271
269
  var _SELECTOR_REGEXP = new RegExp(
272
270
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
273
271
  // 8: ","
@@ -3259,6 +3257,10 @@ var Identifiers = class {
3259
3257
  static declareLet = { name: "\u0275\u0275declareLet", moduleName: CORE };
3260
3258
  static storeLet = { name: "\u0275\u0275storeLet", moduleName: CORE };
3261
3259
  static readContextLet = { name: "\u0275\u0275readContextLet", moduleName: CORE };
3260
+ static attachSourceLocations = {
3261
+ name: "\u0275\u0275attachSourceLocations",
3262
+ moduleName: CORE
3263
+ };
3262
3264
  static NgOnChangesFeature = { name: "\u0275\u0275NgOnChangesFeature", moduleName: CORE };
3263
3265
  static InheritDefinitionFeature = {
3264
3266
  name: "\u0275\u0275InheritDefinitionFeature",
@@ -4643,7 +4645,7 @@ var TypeofExpression = class extends AST {
4643
4645
  this.expression = expression;
4644
4646
  }
4645
4647
  visit(visitor, context = null) {
4646
- return visitor.visitTypeofExpresion(this, context);
4648
+ return visitor.visitTypeofExpression(this, context);
4647
4649
  }
4648
4650
  };
4649
4651
  var NonNullAssert = class extends AST {
@@ -4823,7 +4825,7 @@ var RecursiveAstVisitor = class {
4823
4825
  visitPrefixNot(ast, context) {
4824
4826
  this.visit(ast.expression, context);
4825
4827
  }
4826
- visitTypeofExpresion(ast, context) {
4828
+ visitTypeofExpression(ast, context) {
4827
4829
  this.visit(ast.expression, context);
4828
4830
  }
4829
4831
  visitNonNullAssert(ast, context) {
@@ -4858,266 +4860,6 @@ var RecursiveAstVisitor = class {
4858
4860
  }
4859
4861
  }
4860
4862
  };
4861
- var AstTransformer = class {
4862
- static {
4863
- __name(this, "AstTransformer");
4864
- }
4865
- visitImplicitReceiver(ast, context) {
4866
- return ast;
4867
- }
4868
- visitThisReceiver(ast, context) {
4869
- return ast;
4870
- }
4871
- visitInterpolation(ast, context) {
4872
- return new Interpolation$1(ast.span, ast.sourceSpan, ast.strings, this.visitAll(ast.expressions));
4873
- }
4874
- visitLiteralPrimitive(ast, context) {
4875
- return new LiteralPrimitive(ast.span, ast.sourceSpan, ast.value);
4876
- }
4877
- visitPropertyRead(ast, context) {
4878
- return new PropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name);
4879
- }
4880
- visitPropertyWrite(ast, context) {
4881
- return new PropertyWrite(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name, ast.value.visit(this));
4882
- }
4883
- visitSafePropertyRead(ast, context) {
4884
- return new SafePropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name);
4885
- }
4886
- visitLiteralArray(ast, context) {
4887
- return new LiteralArray(ast.span, ast.sourceSpan, this.visitAll(ast.expressions));
4888
- }
4889
- visitLiteralMap(ast, context) {
4890
- return new LiteralMap(ast.span, ast.sourceSpan, ast.keys, this.visitAll(ast.values));
4891
- }
4892
- visitUnary(ast, context) {
4893
- switch (ast.operator) {
4894
- case "+":
4895
- return Unary.createPlus(ast.span, ast.sourceSpan, ast.expr.visit(this));
4896
- case "-":
4897
- return Unary.createMinus(ast.span, ast.sourceSpan, ast.expr.visit(this));
4898
- default:
4899
- throw new Error(`Unknown unary operator ${ast.operator}`);
4900
- }
4901
- }
4902
- visitBinary(ast, context) {
4903
- return new Binary(ast.span, ast.sourceSpan, ast.operation, ast.left.visit(this), ast.right.visit(this));
4904
- }
4905
- visitPrefixNot(ast, context) {
4906
- return new PrefixNot(ast.span, ast.sourceSpan, ast.expression.visit(this));
4907
- }
4908
- visitTypeofExpresion(ast, context) {
4909
- return new TypeofExpression(ast.span, ast.sourceSpan, ast.expression.visit(this));
4910
- }
4911
- visitNonNullAssert(ast, context) {
4912
- return new NonNullAssert(ast.span, ast.sourceSpan, ast.expression.visit(this));
4913
- }
4914
- visitConditional(ast, context) {
4915
- return new Conditional(ast.span, ast.sourceSpan, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));
4916
- }
4917
- visitPipe(ast, context) {
4918
- return new BindingPipe(ast.span, ast.sourceSpan, ast.exp.visit(this), ast.name, this.visitAll(ast.args), ast.nameSpan);
4919
- }
4920
- visitKeyedRead(ast, context) {
4921
- return new KeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));
4922
- }
4923
- visitKeyedWrite(ast, context) {
4924
- return new KeyedWrite(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this), ast.value.visit(this));
4925
- }
4926
- visitCall(ast, context) {
4927
- return new Call(ast.span, ast.sourceSpan, ast.receiver.visit(this), this.visitAll(ast.args), ast.argumentSpan);
4928
- }
4929
- visitSafeCall(ast, context) {
4930
- return new SafeCall(ast.span, ast.sourceSpan, ast.receiver.visit(this), this.visitAll(ast.args), ast.argumentSpan);
4931
- }
4932
- visitAll(asts) {
4933
- const res = [];
4934
- for (let i = 0; i < asts.length; ++i) {
4935
- res[i] = asts[i].visit(this);
4936
- }
4937
- return res;
4938
- }
4939
- visitChain(ast, context) {
4940
- return new Chain(ast.span, ast.sourceSpan, this.visitAll(ast.expressions));
4941
- }
4942
- visitSafeKeyedRead(ast, context) {
4943
- return new SafeKeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));
4944
- }
4945
- };
4946
- var AstMemoryEfficientTransformer = class {
4947
- static {
4948
- __name(this, "AstMemoryEfficientTransformer");
4949
- }
4950
- visitImplicitReceiver(ast, context) {
4951
- return ast;
4952
- }
4953
- visitThisReceiver(ast, context) {
4954
- return ast;
4955
- }
4956
- visitInterpolation(ast, context) {
4957
- const expressions = this.visitAll(ast.expressions);
4958
- if (expressions !== ast.expressions)
4959
- return new Interpolation$1(ast.span, ast.sourceSpan, ast.strings, expressions);
4960
- return ast;
4961
- }
4962
- visitLiteralPrimitive(ast, context) {
4963
- return ast;
4964
- }
4965
- visitPropertyRead(ast, context) {
4966
- const receiver = ast.receiver.visit(this);
4967
- if (receiver !== ast.receiver) {
4968
- return new PropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name);
4969
- }
4970
- return ast;
4971
- }
4972
- visitPropertyWrite(ast, context) {
4973
- const receiver = ast.receiver.visit(this);
4974
- const value = ast.value.visit(this);
4975
- if (receiver !== ast.receiver || value !== ast.value) {
4976
- return new PropertyWrite(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name, value);
4977
- }
4978
- return ast;
4979
- }
4980
- visitSafePropertyRead(ast, context) {
4981
- const receiver = ast.receiver.visit(this);
4982
- if (receiver !== ast.receiver) {
4983
- return new SafePropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name);
4984
- }
4985
- return ast;
4986
- }
4987
- visitLiteralArray(ast, context) {
4988
- const expressions = this.visitAll(ast.expressions);
4989
- if (expressions !== ast.expressions) {
4990
- return new LiteralArray(ast.span, ast.sourceSpan, expressions);
4991
- }
4992
- return ast;
4993
- }
4994
- visitLiteralMap(ast, context) {
4995
- const values = this.visitAll(ast.values);
4996
- if (values !== ast.values) {
4997
- return new LiteralMap(ast.span, ast.sourceSpan, ast.keys, values);
4998
- }
4999
- return ast;
5000
- }
5001
- visitUnary(ast, context) {
5002
- const expr = ast.expr.visit(this);
5003
- if (expr !== ast.expr) {
5004
- switch (ast.operator) {
5005
- case "+":
5006
- return Unary.createPlus(ast.span, ast.sourceSpan, expr);
5007
- case "-":
5008
- return Unary.createMinus(ast.span, ast.sourceSpan, expr);
5009
- default:
5010
- throw new Error(`Unknown unary operator ${ast.operator}`);
5011
- }
5012
- }
5013
- return ast;
5014
- }
5015
- visitBinary(ast, context) {
5016
- const left = ast.left.visit(this);
5017
- const right = ast.right.visit(this);
5018
- if (left !== ast.left || right !== ast.right) {
5019
- return new Binary(ast.span, ast.sourceSpan, ast.operation, left, right);
5020
- }
5021
- return ast;
5022
- }
5023
- visitPrefixNot(ast, context) {
5024
- const expression = ast.expression.visit(this);
5025
- if (expression !== ast.expression) {
5026
- return new PrefixNot(ast.span, ast.sourceSpan, expression);
5027
- }
5028
- return ast;
5029
- }
5030
- visitTypeofExpresion(ast, context) {
5031
- const expression = ast.expression.visit(this);
5032
- if (expression !== ast.expression) {
5033
- return new TypeofExpression(ast.span, ast.sourceSpan, expression);
5034
- }
5035
- return ast;
5036
- }
5037
- visitNonNullAssert(ast, context) {
5038
- const expression = ast.expression.visit(this);
5039
- if (expression !== ast.expression) {
5040
- return new NonNullAssert(ast.span, ast.sourceSpan, expression);
5041
- }
5042
- return ast;
5043
- }
5044
- visitConditional(ast, context) {
5045
- const condition = ast.condition.visit(this);
5046
- const trueExp = ast.trueExp.visit(this);
5047
- const falseExp = ast.falseExp.visit(this);
5048
- if (condition !== ast.condition || trueExp !== ast.trueExp || falseExp !== ast.falseExp) {
5049
- return new Conditional(ast.span, ast.sourceSpan, condition, trueExp, falseExp);
5050
- }
5051
- return ast;
5052
- }
5053
- visitPipe(ast, context) {
5054
- const exp = ast.exp.visit(this);
5055
- const args = this.visitAll(ast.args);
5056
- if (exp !== ast.exp || args !== ast.args) {
5057
- return new BindingPipe(ast.span, ast.sourceSpan, exp, ast.name, args, ast.nameSpan);
5058
- }
5059
- return ast;
5060
- }
5061
- visitKeyedRead(ast, context) {
5062
- const obj = ast.receiver.visit(this);
5063
- const key = ast.key.visit(this);
5064
- if (obj !== ast.receiver || key !== ast.key) {
5065
- return new KeyedRead(ast.span, ast.sourceSpan, obj, key);
5066
- }
5067
- return ast;
5068
- }
5069
- visitKeyedWrite(ast, context) {
5070
- const obj = ast.receiver.visit(this);
5071
- const key = ast.key.visit(this);
5072
- const value = ast.value.visit(this);
5073
- if (obj !== ast.receiver || key !== ast.key || value !== ast.value) {
5074
- return new KeyedWrite(ast.span, ast.sourceSpan, obj, key, value);
5075
- }
5076
- return ast;
5077
- }
5078
- visitAll(asts) {
5079
- const res = [];
5080
- let modified = false;
5081
- for (let i = 0; i < asts.length; ++i) {
5082
- const original = asts[i];
5083
- const value = original.visit(this);
5084
- res[i] = value;
5085
- modified = modified || value !== original;
5086
- }
5087
- return modified ? res : asts;
5088
- }
5089
- visitChain(ast, context) {
5090
- const expressions = this.visitAll(ast.expressions);
5091
- if (expressions !== ast.expressions) {
5092
- return new Chain(ast.span, ast.sourceSpan, expressions);
5093
- }
5094
- return ast;
5095
- }
5096
- visitCall(ast, context) {
5097
- const receiver = ast.receiver.visit(this);
5098
- const args = this.visitAll(ast.args);
5099
- if (receiver !== ast.receiver || args !== ast.args) {
5100
- return new Call(ast.span, ast.sourceSpan, receiver, args, ast.argumentSpan);
5101
- }
5102
- return ast;
5103
- }
5104
- visitSafeCall(ast, context) {
5105
- const receiver = ast.receiver.visit(this);
5106
- const args = this.visitAll(ast.args);
5107
- if (receiver !== ast.receiver || args !== ast.args) {
5108
- return new SafeCall(ast.span, ast.sourceSpan, receiver, args, ast.argumentSpan);
5109
- }
5110
- return ast;
5111
- }
5112
- visitSafeKeyedRead(ast, context) {
5113
- const obj = ast.receiver.visit(this);
5114
- const key = ast.key.visit(this);
5115
- if (obj !== ast.receiver || key !== ast.key) {
5116
- return new SafeKeyedRead(ast.span, ast.sourceSpan, obj, key);
5117
- }
5118
- return ast;
5119
- }
5120
- };
5121
4863
  var ParsedProperty = class {
5122
4864
  static {
5123
4865
  __name(this, "ParsedProperty");
@@ -7770,7 +7512,7 @@ var ShadowCss = class {
7770
7512
  *
7771
7513
  * For example, we convert this css:
7772
7514
  *
7773
- * ```
7515
+ * ```scss
7774
7516
  * .box {
7775
7517
  * animation: box-animation 1s forwards;
7776
7518
  * }
@@ -7784,7 +7526,7 @@ var ShadowCss = class {
7784
7526
  *
7785
7527
  * to this:
7786
7528
  *
7787
- * ```
7529
+ * ```scss
7788
7530
  * .box {
7789
7531
  * animation: scopeName_box-animation 1s forwards;
7790
7532
  * }
@@ -7813,7 +7555,7 @@ var ShadowCss = class {
7813
7555
  *
7814
7556
  * For example, it takes a rule such as:
7815
7557
  *
7816
- * ```
7558
+ * ```scss
7817
7559
  * @keyframes box-animation {
7818
7560
  * to {
7819
7561
  * background-color: green;
@@ -7823,7 +7565,7 @@ var ShadowCss = class {
7823
7565
  *
7824
7566
  * and returns:
7825
7567
  *
7826
- * ```
7568
+ * ```scss
7827
7569
  * @keyframes scopeName_box-animation {
7828
7570
  * to {
7829
7571
  * background-color: green;
@@ -8031,6 +7773,30 @@ var ShadowCss = class {
8031
7773
  * .foo<scopeName> .bar { ... }
8032
7774
  */
8033
7775
  _convertColonHostContext(cssText) {
7776
+ const length = cssText.length;
7777
+ let parens = 0;
7778
+ let prev = 0;
7779
+ let result = "";
7780
+ for (let i = 0; i < length; i++) {
7781
+ const char = cssText[i];
7782
+ if (char === "," && parens === 0) {
7783
+ result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ",";
7784
+ prev = i + 1;
7785
+ continue;
7786
+ }
7787
+ if (i === length - 1) {
7788
+ result += this._convertColonHostContextInSelectorPart(cssText.slice(prev));
7789
+ break;
7790
+ }
7791
+ if (char === "(") {
7792
+ parens++;
7793
+ } else if (char === ")") {
7794
+ parens--;
7795
+ }
7796
+ }
7797
+ return result;
7798
+ }
7799
+ _convertColonHostContextInSelectorPart(cssText) {
8034
7800
  return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
8035
7801
  const contextSelectorGroups = [[]];
8036
7802
  let match;
@@ -8305,10 +8071,11 @@ var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[
8305
8071
  var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
8306
8072
  var _polyfillHost = "-shadowcsshost";
8307
8073
  var _polyfillHostContext = "-shadowcsscontext";
8308
- var _parenSuffix = "(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
8309
- var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix, "gim");
8310
- var _cssColonHostContextReGlobal = new RegExp(_cssScopedPseudoFunctionPrefix + "(" + _polyfillHostContext + _parenSuffix + ")", "gim");
8311
- var _cssColonHostContextRe = new RegExp(_polyfillHostContext + _parenSuffix, "im");
8074
+ var _parenSuffix = "(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))";
8075
+ var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + "?([^,{]*)", "gim");
8076
+ var _hostContextPattern = _polyfillHostContext + _parenSuffix + "?([^{]*)";
8077
+ var _cssColonHostContextReGlobal = new RegExp(`${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`, "gim");
8078
+ var _cssColonHostContextRe = new RegExp(_hostContextPattern, "im");
8312
8079
  var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
8313
8080
  var _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(`${_polyfillHostNoCombinator}(?![^(]*\\))`, "g");
8314
8081
  var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s,]*)/;
@@ -8544,6 +8311,7 @@ var OpKind;
8544
8311
  OpKind2[OpKind2["IcuPlaceholder"] = 47] = "IcuPlaceholder";
8545
8312
  OpKind2[OpKind2["I18nContext"] = 48] = "I18nContext";
8546
8313
  OpKind2[OpKind2["I18nAttributes"] = 49] = "I18nAttributes";
8314
+ OpKind2[OpKind2["SourceLocation"] = 50] = "SourceLocation";
8547
8315
  })(OpKind || (OpKind = {}));
8548
8316
  var ExpressionKind;
8549
8317
  (function(ExpressionKind2) {
@@ -9893,6 +9661,7 @@ function transformExpressionsInOp(op, transform2, flags) {
9893
9661
  case OpKind.I18nAttributes:
9894
9662
  case OpKind.IcuPlaceholder:
9895
9663
  case OpKind.DeclareLet:
9664
+ case OpKind.SourceLocation:
9896
9665
  break;
9897
9666
  default:
9898
9667
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -10603,6 +10372,15 @@ function createI18nAttributesOp(xref, handle, target) {
10603
10372
  };
10604
10373
  }
10605
10374
  __name(createI18nAttributesOp, "createI18nAttributesOp");
10375
+ function createSourceLocationOp(templatePath, locations) {
10376
+ return {
10377
+ kind: OpKind.SourceLocation,
10378
+ templatePath,
10379
+ locations,
10380
+ ...NEW_OP
10381
+ };
10382
+ }
10383
+ __name(createSourceLocationOp, "createSourceLocationOp");
10606
10384
  function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, securityContext, sourceSpan) {
10607
10385
  return {
10608
10386
  kind: OpKind.HostProperty,
@@ -10657,12 +10435,16 @@ var ComponentCompilationJob = class extends CompilationJob {
10657
10435
  i18nUseExternalIds;
10658
10436
  deferMeta;
10659
10437
  allDeferrableDepsFn;
10660
- constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn) {
10438
+ relativeTemplatePath;
10439
+ enableDebugLocations;
10440
+ constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
10661
10441
  super(componentName, pool, compatibility);
10662
10442
  this.relativeContextFilePath = relativeContextFilePath;
10663
10443
  this.i18nUseExternalIds = i18nUseExternalIds;
10664
10444
  this.deferMeta = deferMeta;
10665
10445
  this.allDeferrableDepsFn = allDeferrableDepsFn;
10446
+ this.relativeTemplatePath = relativeTemplatePath;
10447
+ this.enableDebugLocations = enableDebugLocations;
10666
10448
  this.root = new ViewCompilationUnit(this, this.allocateXrefId(), null);
10667
10449
  this.views.set(this.root.xref, this.root);
10668
10450
  }
@@ -17038,7 +16820,7 @@ var Parser = class {
17038
16820
  * parsing errors in case the given expression is invalid.
17039
16821
  *
17040
16822
  * For example,
17041
- * ```
16823
+ * ```html
17042
16824
  * <div *ngFor="let item of items">
17043
16825
  * ^ ^ absoluteValueOffset for `templateValue`
17044
16826
  * absoluteKeyOffset for `templateKey`
@@ -17049,7 +16831,7 @@ var Parser = class {
17049
16831
  * 3. ngForOf -> items
17050
16832
  *
17051
16833
  * This is apparent from the de-sugared template:
17052
- * ```
16834
+ * ```html
17053
16835
  * <ng-template ngFor let-item [ngForOf]="items">
17054
16836
  * ```
17055
16837
  *
@@ -17820,7 +17602,7 @@ var _ParseAST = class {
17820
17602
  * parsing errors in case the given expression is invalid.
17821
17603
  *
17822
17604
  * For example,
17823
- * ```
17605
+ * ```html
17824
17606
  * <div *ngFor="let item of items; index as i; trackBy: func">
17825
17607
  * ```
17826
17608
  * contains five bindings:
@@ -18164,7 +17946,7 @@ var SerializeExpressionVisitor = class {
18164
17946
  visitSafeCall(ast, context) {
18165
17947
  return `${ast.receiver.visit(this, context)}?.(${ast.args.map((e) => e.visit(this, context)).join(", ")})`;
18166
17948
  }
18167
- visitTypeofExpresion(ast, context) {
17949
+ visitTypeofExpression(ast, context) {
18168
17950
  return `typeof ${ast.expression.visit(this, context)}`;
18169
17951
  }
18170
17952
  visitASTWithSource(ast, context) {
@@ -21069,6 +20851,10 @@ function pureFunction(varOffset, fn2, args) {
21069
20851
  return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn2], args, [], null);
21070
20852
  }
21071
20853
  __name(pureFunction, "pureFunction");
20854
+ function attachSourceLocation(templatePath, locations) {
20855
+ return call(Identifiers.attachSourceLocations, [literal(templatePath), locations], null);
20856
+ }
20857
+ __name(attachSourceLocation, "attachSourceLocation");
21072
20858
  function collateInterpolationArgs(strings, expressions) {
21073
20859
  if (strings.length < 1 || expressions.length !== strings.length - 1) {
21074
20860
  throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`);
@@ -21442,6 +21228,20 @@ function reifyCreateOperations(unit, ops) {
21442
21228
  }
21443
21229
  OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan));
21444
21230
  break;
21231
+ case OpKind.SourceLocation:
21232
+ const locationsLiteral = literalArr(op.locations.map(({ targetSlot, offset, line, column }) => {
21233
+ if (targetSlot.slot === null) {
21234
+ throw new Error("No slot was assigned for source location");
21235
+ }
21236
+ return literalArr([
21237
+ literal(targetSlot.slot),
21238
+ literal(offset),
21239
+ literal(line),
21240
+ literal(column)
21241
+ ]);
21242
+ }));
21243
+ OpList.replace(op, attachSourceLocation(op.templatePath, locationsLiteral));
21244
+ break;
21445
21245
  case OpKind.Statement:
21446
21246
  break;
21447
21247
  default:
@@ -22861,6 +22661,29 @@ function generateLocalLetReferences(job) {
22861
22661
  }
22862
22662
  }
22863
22663
  __name(generateLocalLetReferences, "generateLocalLetReferences");
22664
+ function attachSourceLocations(job) {
22665
+ if (!job.enableDebugLocations || job.relativeTemplatePath === null) {
22666
+ return;
22667
+ }
22668
+ for (const unit of job.units) {
22669
+ const locations = [];
22670
+ for (const op of unit.create) {
22671
+ if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) {
22672
+ const start = op.startSourceSpan.start;
22673
+ locations.push({
22674
+ targetSlot: op.handle,
22675
+ offset: start.offset,
22676
+ line: start.line,
22677
+ column: start.col
22678
+ });
22679
+ }
22680
+ }
22681
+ if (locations.length > 0) {
22682
+ unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations));
22683
+ }
22684
+ }
22685
+ }
22686
+ __name(attachSourceLocations, "attachSourceLocations");
22864
22687
  var phases = [
22865
22688
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
22866
22689
  { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
@@ -22922,6 +22745,7 @@ var phases = [
22922
22745
  { kind: CompilationJobKind.Tmpl, fn: mergeNextContextExpressions },
22923
22746
  { kind: CompilationJobKind.Tmpl, fn: generateNgContainerOps },
22924
22747
  { kind: CompilationJobKind.Tmpl, fn: collapseEmptyInstructions },
22748
+ { kind: CompilationJobKind.Tmpl, fn: attachSourceLocations },
22925
22749
  { kind: CompilationJobKind.Tmpl, fn: disableBindings$1 },
22926
22750
  { kind: CompilationJobKind.Both, fn: extractPureFunctions },
22927
22751
  { kind: CompilationJobKind.Both, fn: reify },
@@ -23037,8 +22861,8 @@ function isSingleI18nIcu(meta) {
23037
22861
  return isI18nRootNode(meta) && meta.nodes.length === 1 && meta.nodes[0] instanceof Icu;
23038
22862
  }
23039
22863
  __name(isSingleI18nIcu, "isSingleI18nIcu");
23040
- function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn) {
23041
- const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn);
22864
+ function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
22865
+ const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations);
23042
22866
  ingestNodes(job.root, template2);
23043
22867
  return job;
23044
22868
  }
@@ -23833,6 +23657,11 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
23833
23657
  return null;
23834
23658
  }
23835
23659
  __name(ingestControlFlowInsertionPoint, "ingestControlFlowInsertionPoint");
23660
+ var ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
23661
+ function getTemplateSourceLocationsEnabled() {
23662
+ return ENABLE_TEMPLATE_SOURCE_LOCATIONS;
23663
+ }
23664
+ __name(getTemplateSourceLocationsEnabled, "getTemplateSourceLocationsEnabled");
23836
23665
  function renderFlagCheckIfStmt(flags, statements) {
23837
23666
  return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements);
23838
23667
  }
@@ -24114,7 +23943,7 @@ var BindingParser = class {
24114
23943
  }
24115
23944
  /**
24116
23945
  * Parses the bindings in a microsyntax expression, e.g.
24117
- * ```
23946
+ * ```html
24118
23947
  * <tag *tplKey="let value1 = prop; let value2 = localVar">
24119
23948
  * ```
24120
23949
  *
@@ -24348,6 +24177,9 @@ var BindingParser = class {
24348
24177
  if (ast instanceof NonNullAssert) {
24349
24178
  return this._isAllowedAssignmentEvent(ast.expression);
24350
24179
  }
24180
+ if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver && !(ast.receiver.receiver instanceof ThisReceiver)) {
24181
+ return this._isAllowedAssignmentEvent(ast.args[0]);
24182
+ }
24351
24183
  if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
24352
24184
  return true;
24353
24185
  }
@@ -25988,7 +25820,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
25988
25820
  constantPool.statements.push(new DeclareVarStmt(fnName, meta.defer.dependenciesFn, void 0, StmtModifier.Final));
25989
25821
  allDeferrableDepsFn = variable(fnName);
25990
25822
  }
25991
- const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn);
25823
+ const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn, meta.relativeTemplatePath, getTemplateSourceLocationsEnabled());
25992
25824
  transform(tpl, CompilationJobKind.Tmpl);
25993
25825
  const templateFn = emitTemplateFn(tpl, constantPool);
25994
25826
  if (tpl.contentSelectors !== null) {
@@ -27262,7 +27094,8 @@ var CompilerFacadeImpl = class {
27262
27094
  animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
27263
27095
  viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
27264
27096
  relativeContextFilePath: "",
27265
- i18nUseExternalIds: true
27097
+ i18nUseExternalIds: true,
27098
+ relativeTemplatePath: null
27266
27099
  };
27267
27100
  const jitExpressionSourceMap = `ng:///${facade.name}.js`;
27268
27101
  return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
@@ -27517,7 +27350,8 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
27517
27350
  interpolation,
27518
27351
  declarationListEmitMode: 2,
27519
27352
  relativeContextFilePath: "",
27520
- i18nUseExternalIds: true
27353
+ i18nUseExternalIds: true,
27354
+ relativeTemplatePath: null
27521
27355
  };
27522
27356
  }
27523
27357
  __name(convertDeclareComponentFacadeToMetadata, "convertDeclareComponentFacadeToMetadata");
@@ -27781,7 +27615,7 @@ function publishFacade(global) {
27781
27615
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
27782
27616
  }
27783
27617
  __name(publishFacade, "publishFacade");
27784
- var VERSION = new Version("19.0.6");
27618
+ var VERSION = new Version("19.1.5");
27785
27619
  var CompilerConfig = class {
27786
27620
  static {
27787
27621
  __name(this, "CompilerConfig");
@@ -29490,24 +29324,30 @@ function compileClassDebugInfo(debugInfo) {
29490
29324
  __name(compileClassDebugInfo, "compileClassDebugInfo");
29491
29325
  function compileHmrInitializer(meta) {
29492
29326
  const id = encodeURIComponent(`${meta.filePath}@${meta.className}`);
29493
- const urlPartial = `/@ng/component?c=${id}&t=`;
29327
+ const urlPartial = `./@ng/component?c=${id}&t=`;
29494
29328
  const moduleName = "m";
29495
29329
  const dataName = "d";
29496
29330
  const timestampName = "t";
29497
29331
  const importCallbackName = `${meta.className}_HmrLoad`;
29498
- const locals = meta.localDependencies.map((localName) => variable(localName));
29499
29332
  const namespaces = meta.namespaceDependencies.map((dep) => {
29500
29333
  return new ExternalExpr({ moduleName: dep.moduleName, name: null });
29501
29334
  });
29502
29335
  const defaultRead = variable(moduleName).prop("default");
29503
- const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([meta.type, defaultRead, literalArr(namespaces), literalArr(locals)]);
29336
+ const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([
29337
+ meta.type,
29338
+ defaultRead,
29339
+ literalArr(namespaces),
29340
+ literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation))
29341
+ ]);
29504
29342
  const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
29505
29343
  const urlValue = literal(urlPartial).plus(variable("encodeURIComponent").callFn([variable(timestampName)]));
29344
+ const urlBase = variable("import").prop("meta").prop("url");
29345
+ const urlHref = new InstantiateExpr(variable("URL"), [urlValue, urlBase]).prop("href");
29506
29346
  const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [
29507
29347
  // The vite-ignore special comment is required to prevent Vite from generating a superfluous
29508
29348
  // warning for each usage within the development code. If Vite provides a method to
29509
29349
  // programmatically avoid this warning in the future, this added comment can be removed here.
29510
- new DynamicImportExpr(urlValue, null, "@vite-ignore").prop("then").callFn([replaceCallback]).toStmt()
29350
+ new DynamicImportExpr(urlHref, null, "@vite-ignore").prop("then").callFn([replaceCallback]).toStmt()
29511
29351
  ], null, StmtModifier.Final);
29512
29352
  const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop("id").identical(literal(id)).and(variable(importCallbackName).callFn([variable(dataName).prop("timestamp")])));
29513
29353
  const initialCall = variable(importCallbackName).callFn([variable("Date").prop("now").callFn([])]);
@@ -29525,8 +29365,11 @@ function compileHmrInitializer(meta) {
29525
29365
  __name(compileHmrInitializer, "compileHmrInitializer");
29526
29366
  function compileHmrUpdateCallback(definitions, constantStatements, meta) {
29527
29367
  const namespaces = "\u0275\u0275namespaces";
29528
- const params = [meta.className, namespaces, ...meta.localDependencies].map((name) => new FnParam(name, DYNAMIC_TYPE));
29368
+ const params = [meta.className, namespaces].map((name) => new FnParam(name, DYNAMIC_TYPE));
29529
29369
  const body = [];
29370
+ for (const local of meta.localDependencies) {
29371
+ params.push(new FnParam(local.name));
29372
+ }
29530
29373
  for (let i = 0; i < meta.namespaceDependencies.length; i++) {
29531
29374
  body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final));
29532
29375
  }
@@ -29547,7 +29390,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
29547
29390
  function compileDeclareClassMetadata(metadata) {
29548
29391
  const definitionMap = new DefinitionMap();
29549
29392
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
29550
- definitionMap.set("version", literal("19.0.6"));
29393
+ definitionMap.set("version", literal("19.1.5"));
29551
29394
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29552
29395
  definitionMap.set("type", metadata.type);
29553
29396
  definitionMap.set("decorators", metadata.decorators);
@@ -29566,7 +29409,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
29566
29409
  callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
29567
29410
  callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
29568
29411
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
29569
- definitionMap.set("version", literal("19.0.6"));
29412
+ definitionMap.set("version", literal("19.1.5"));
29570
29413
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29571
29414
  definitionMap.set("type", metadata.type);
29572
29415
  definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
@@ -29635,7 +29478,7 @@ function createDirectiveDefinitionMap(meta) {
29635
29478
  const definitionMap = new DefinitionMap();
29636
29479
  const minVersion = getMinimumVersionForPartialOutput(meta);
29637
29480
  definitionMap.set("minVersion", literal(minVersion));
29638
- definitionMap.set("version", literal("19.0.6"));
29481
+ definitionMap.set("version", literal("19.1.5"));
29639
29482
  definitionMap.set("type", meta.type.value);
29640
29483
  if (meta.isStandalone !== void 0) {
29641
29484
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -29963,7 +29806,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
29963
29806
  function compileDeclareFactoryFunction(meta) {
29964
29807
  const definitionMap = new DefinitionMap();
29965
29808
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
29966
- definitionMap.set("version", literal("19.0.6"));
29809
+ definitionMap.set("version", literal("19.1.5"));
29967
29810
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29968
29811
  definitionMap.set("type", meta.type.value);
29969
29812
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -29986,7 +29829,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
29986
29829
  function createInjectableDefinitionMap(meta) {
29987
29830
  const definitionMap = new DefinitionMap();
29988
29831
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
29989
- definitionMap.set("version", literal("19.0.6"));
29832
+ definitionMap.set("version", literal("19.1.5"));
29990
29833
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29991
29834
  definitionMap.set("type", meta.type.value);
29992
29835
  if (meta.providedIn !== void 0) {
@@ -30024,7 +29867,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
30024
29867
  function createInjectorDefinitionMap(meta) {
30025
29868
  const definitionMap = new DefinitionMap();
30026
29869
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
30027
- definitionMap.set("version", literal("19.0.6"));
29870
+ definitionMap.set("version", literal("19.1.5"));
30028
29871
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30029
29872
  definitionMap.set("type", meta.type.value);
30030
29873
  definitionMap.set("providers", meta.providers);
@@ -30048,7 +29891,7 @@ function createNgModuleDefinitionMap(meta) {
30048
29891
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
30049
29892
  }
30050
29893
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
30051
- definitionMap.set("version", literal("19.0.6"));
29894
+ definitionMap.set("version", literal("19.1.5"));
30052
29895
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30053
29896
  definitionMap.set("type", meta.type.value);
30054
29897
  if (meta.bootstrap.length > 0) {
@@ -30083,7 +29926,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
30083
29926
  function createPipeDefinitionMap(meta) {
30084
29927
  const definitionMap = new DefinitionMap();
30085
29928
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
30086
- definitionMap.set("version", literal("19.0.6"));
29929
+ definitionMap.set("version", literal("19.1.5"));
30087
29930
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30088
29931
  definitionMap.set("type", meta.type.value);
30089
29932
  if (meta.isStandalone !== void 0) {
@@ -30105,8 +29948,6 @@ publishFacade(_global);
30105
29948
  AbsoluteSourceSpan,
30106
29949
  ArrayType,
30107
29950
  ArrowFunctionExpr,
30108
- AstMemoryEfficientTransformer,
30109
- AstTransformer,
30110
29951
  Attribute,
30111
29952
  Binary,
30112
29953
  BinaryOperator,
@@ -30347,7 +30188,7 @@ publishFacade(_global);
30347
30188
 
30348
30189
  @angular/compiler/fesm2022/compiler.mjs:
30349
30190
  (**
30350
- * @license Angular v19.0.6
30191
+ * @license Angular v19.1.5
30351
30192
  * (c) 2010-2024 Google LLC. https://angular.io/
30352
30193
  * License: MIT
30353
30194
  *)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "19.0.3-alpha.8",
3
+ "version": "19.1.0",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",