@angular-eslint/bundled-angular-compiler 20.6.1-alpha.1 → 20.6.1-alpha.10

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 +72 -44
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -281,7 +281,7 @@ __export(index_exports, {
281
281
  });
282
282
  module.exports = __toCommonJS(index_exports);
283
283
 
284
- // ../../node_modules/.pnpm/@angular+compiler@20.3.9/node_modules/@angular/compiler/fesm2022/compiler.mjs
284
+ // ../../node_modules/.pnpm/@angular+compiler@20.3.11/node_modules/@angular/compiler/fesm2022/compiler.mjs
285
285
  var _SELECTOR_REGEXP = new RegExp(
286
286
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
287
287
  // 8: ","
@@ -7830,11 +7830,11 @@ var ShadowCss = class {
7830
7830
  return cssText.replace(_cssColonHostRe, (_, hostSelectors, otherSelectors) => {
7831
7831
  if (hostSelectors) {
7832
7832
  const convertedSelectors = [];
7833
- const hostSelectorArray = hostSelectors.split(",").map((p) => p.trim());
7834
- for (const hostSelector of hostSelectorArray) {
7835
- if (!hostSelector)
7833
+ for (const hostSelector of this._splitOnTopLevelCommas(hostSelectors)) {
7834
+ const trimmedHostSelector = hostSelector.trim();
7835
+ if (!trimmedHostSelector)
7836
7836
  break;
7837
- const convertedSelector = _polyfillHostNoCombinator + hostSelector.replace(_polyfillHost, "") + otherSelectors;
7837
+ const convertedSelector = _polyfillHostNoCombinator + trimmedHostSelector.replace(_polyfillHost, "") + otherSelectors;
7838
7838
  convertedSelectors.push(convertedSelector);
7839
7839
  }
7840
7840
  return convertedSelectors.join(",");
@@ -7843,6 +7843,33 @@ var ShadowCss = class {
7843
7843
  }
7844
7844
  });
7845
7845
  }
7846
+ /**
7847
+ * Generator function that splits a string on top-level commas (commas that are not inside parentheses).
7848
+ * Yields each part of the string between top-level commas. Terminates if an extra closing paren is found.
7849
+ *
7850
+ * @param text The string to split
7851
+ */
7852
+ *_splitOnTopLevelCommas(text2) {
7853
+ const length = text2.length;
7854
+ let parens = 0;
7855
+ let prev = 0;
7856
+ for (let i = 0; i < length; i++) {
7857
+ const charCode = text2.charCodeAt(i);
7858
+ if (charCode === $LPAREN) {
7859
+ parens++;
7860
+ } else if (charCode === $RPAREN) {
7861
+ parens--;
7862
+ if (parens < 0) {
7863
+ yield text2.slice(prev, i);
7864
+ return;
7865
+ }
7866
+ } else if (charCode === $COMMA && parens === 0) {
7867
+ yield text2.slice(prev, i);
7868
+ prev = i + 1;
7869
+ }
7870
+ }
7871
+ yield text2.slice(prev);
7872
+ }
7846
7873
  /*
7847
7874
  * convert a rule like :host-context(.foo) > .bar { }
7848
7875
  *
@@ -7859,35 +7886,32 @@ var ShadowCss = class {
7859
7886
  * .foo<scopeName> .bar { ... }
7860
7887
  */
7861
7888
  _convertColonHostContext(cssText) {
7862
- const length = cssText.length;
7863
- let parens = 0;
7864
- let prev = 0;
7865
- let result = "";
7866
- for (let i = 0; i < length; i++) {
7867
- const char = cssText[i];
7868
- if (char === "," && parens === 0) {
7869
- result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ",";
7870
- prev = i + 1;
7871
- continue;
7872
- }
7873
- if (i === length - 1) {
7874
- result += this._convertColonHostContextInSelectorPart(cssText.slice(prev));
7875
- break;
7876
- }
7877
- if (char === "(") {
7878
- parens++;
7879
- } else if (char === ")") {
7880
- parens--;
7881
- }
7889
+ const results = [];
7890
+ for (const part of this._splitOnTopLevelCommas(cssText)) {
7891
+ results.push(this._convertColonHostContextInSelectorPart(part));
7882
7892
  }
7883
- return result;
7893
+ return results.join(",");
7884
7894
  }
7885
7895
  _convertColonHostContextInSelectorPart(cssText) {
7886
7896
  return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
7887
7897
  const contextSelectorGroups = [[]];
7888
- let match;
7889
- while (match = _cssColonHostContextRe.exec(selectorText)) {
7890
- const newContextSelectors = (match[1] ?? "").trim().split(",").map((m) => m.trim()).filter((m) => m !== "");
7898
+ let startIndex = selectorText.indexOf(_polyfillHostContext);
7899
+ while (startIndex !== -1) {
7900
+ const afterPrefix = selectorText.substring(startIndex + _polyfillHostContext.length);
7901
+ if (!afterPrefix || afterPrefix[0] !== "(") {
7902
+ selectorText = afterPrefix;
7903
+ startIndex = selectorText.indexOf(_polyfillHostContext);
7904
+ continue;
7905
+ }
7906
+ const newContextSelectors = [];
7907
+ let endIndex = 0;
7908
+ for (const selector of this._splitOnTopLevelCommas(afterPrefix.substring(1))) {
7909
+ endIndex = endIndex + selector.length + 1;
7910
+ const trimmed = selector.trim();
7911
+ if (trimmed) {
7912
+ newContextSelectors.push(trimmed);
7913
+ }
7914
+ }
7891
7915
  const contextSelectorGroupsLength = contextSelectorGroups.length;
7892
7916
  repeatGroups(contextSelectorGroups, newContextSelectors.length);
7893
7917
  for (let i = 0; i < newContextSelectors.length; i++) {
@@ -7895,7 +7919,8 @@ var ShadowCss = class {
7895
7919
  contextSelectorGroups[j + i * contextSelectorGroupsLength].push(newContextSelectors[i]);
7896
7920
  }
7897
7921
  }
7898
- selectorText = match[2];
7922
+ selectorText = afterPrefix.substring(endIndex + 1);
7923
+ startIndex = selectorText.indexOf(_polyfillHostContext);
7899
7924
  }
7900
7925
  return contextSelectorGroups.map((contextSelectors) => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix)).join(", ");
7901
7926
  });
@@ -8124,9 +8149,9 @@ var SafeSelector = class {
8124
8149
  this.index++;
8125
8150
  return replaceBy;
8126
8151
  });
8127
- this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
8152
+ this._content = selector.replace(nthRegex, (_, pseudo, exp) => {
8128
8153
  const replaceBy = `__ph-${this.index}__`;
8129
- this.placeholders.push(exp);
8154
+ this.placeholders.push(`(${exp})`);
8130
8155
  this.index++;
8131
8156
  return pseudo + replaceBy;
8132
8157
  });
@@ -8157,11 +8182,14 @@ var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[
8157
8182
  var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
8158
8183
  var _polyfillHost = "-shadowcsshost";
8159
8184
  var _polyfillHostContext = "-shadowcsscontext";
8160
- var _parenSuffix = "(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))";
8185
+ var _noParens = "[^)(]*";
8186
+ var _level1Parens = String.raw`(?:\(${_noParens}\)|${_noParens})+?`;
8187
+ var _level2Parens = String.raw`(?:\(${_level1Parens}\)|${_noParens})+?`;
8188
+ var _parenSuffix = String.raw`(?:\((${_level2Parens})\))`;
8189
+ var nthRegex = new RegExp(String.raw`(:nth-[-\w]+)` + _parenSuffix, "g");
8161
8190
  var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + "?([^,{]*)", "gim");
8162
8191
  var _hostContextPattern = _polyfillHostContext + _parenSuffix + "?([^{]*)";
8163
8192
  var _cssColonHostContextReGlobal = new RegExp(`${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`, "gim");
8164
- var _cssColonHostContextRe = new RegExp(_hostContextPattern, "im");
8165
8193
  var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
8166
8194
  var _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(`${_polyfillHostNoCombinator}(?![^(]*\\))`, "g");
8167
8195
  var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s,]*)/;
@@ -30983,7 +31011,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
30983
31011
  function compileDeclareClassMetadata(metadata) {
30984
31012
  const definitionMap = new DefinitionMap();
30985
31013
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
30986
- definitionMap.set("version", literal("20.3.9"));
31014
+ definitionMap.set("version", literal("20.3.11"));
30987
31015
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30988
31016
  definitionMap.set("type", metadata.type);
30989
31017
  definitionMap.set("decorators", metadata.decorators);
@@ -31002,7 +31030,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
31002
31030
  callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
31003
31031
  callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
31004
31032
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
31005
- definitionMap.set("version", literal("20.3.9"));
31033
+ definitionMap.set("version", literal("20.3.11"));
31006
31034
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31007
31035
  definitionMap.set("type", metadata.type);
31008
31036
  definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
@@ -31071,7 +31099,7 @@ function createDirectiveDefinitionMap(meta) {
31071
31099
  const definitionMap = new DefinitionMap();
31072
31100
  const minVersion = getMinimumVersionForPartialOutput(meta);
31073
31101
  definitionMap.set("minVersion", literal(minVersion));
31074
- definitionMap.set("version", literal("20.3.9"));
31102
+ definitionMap.set("version", literal("20.3.11"));
31075
31103
  definitionMap.set("type", meta.type.value);
31076
31104
  if (meta.isStandalone !== void 0) {
31077
31105
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -31398,7 +31426,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
31398
31426
  function compileDeclareFactoryFunction(meta) {
31399
31427
  const definitionMap = new DefinitionMap();
31400
31428
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
31401
- definitionMap.set("version", literal("20.3.9"));
31429
+ definitionMap.set("version", literal("20.3.11"));
31402
31430
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31403
31431
  definitionMap.set("type", meta.type.value);
31404
31432
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -31421,7 +31449,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
31421
31449
  function createInjectableDefinitionMap(meta) {
31422
31450
  const definitionMap = new DefinitionMap();
31423
31451
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
31424
- definitionMap.set("version", literal("20.3.9"));
31452
+ definitionMap.set("version", literal("20.3.11"));
31425
31453
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31426
31454
  definitionMap.set("type", meta.type.value);
31427
31455
  if (meta.providedIn !== void 0) {
@@ -31459,7 +31487,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
31459
31487
  function createInjectorDefinitionMap(meta) {
31460
31488
  const definitionMap = new DefinitionMap();
31461
31489
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
31462
- definitionMap.set("version", literal("20.3.9"));
31490
+ definitionMap.set("version", literal("20.3.11"));
31463
31491
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31464
31492
  definitionMap.set("type", meta.type.value);
31465
31493
  definitionMap.set("providers", meta.providers);
@@ -31483,7 +31511,7 @@ function createNgModuleDefinitionMap(meta) {
31483
31511
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
31484
31512
  }
31485
31513
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
31486
- definitionMap.set("version", literal("20.3.9"));
31514
+ definitionMap.set("version", literal("20.3.11"));
31487
31515
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31488
31516
  definitionMap.set("type", meta.type.value);
31489
31517
  if (meta.bootstrap.length > 0) {
@@ -31518,7 +31546,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
31518
31546
  function createPipeDefinitionMap(meta) {
31519
31547
  const definitionMap = new DefinitionMap();
31520
31548
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
31521
- definitionMap.set("version", literal("20.3.9"));
31549
+ definitionMap.set("version", literal("20.3.11"));
31522
31550
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31523
31551
  definitionMap.set("type", meta.type.value);
31524
31552
  if (meta.isStandalone !== void 0) {
@@ -31615,7 +31643,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
31615
31643
  return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
31616
31644
  }
31617
31645
  __name(compileHmrUpdateCallback, "compileHmrUpdateCallback");
31618
- var VERSION = new Version("20.3.9");
31646
+ var VERSION = new Version("20.3.11");
31619
31647
  publishFacade(_global);
31620
31648
  // Annotate the CommonJS export names for ESM import in node:
31621
31649
  0 && (module.exports = {
@@ -31881,7 +31909,7 @@ publishFacade(_global);
31881
31909
 
31882
31910
  @angular/compiler/fesm2022/compiler.mjs:
31883
31911
  (**
31884
- * @license Angular v20.3.9
31912
+ * @license Angular v20.3.11
31885
31913
  * (c) 2010-2025 Google LLC. https://angular.dev/
31886
31914
  * License: MIT
31887
31915
  *)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "20.6.1-alpha.1",
3
+ "version": "20.6.1-alpha.10",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",