@angular-eslint/bundled-angular-compiler 14.0.3-alpha.0 → 14.0.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [14.0.3](https://github.com/angular-eslint/angular-eslint/compare/v14.0.2...v14.0.3) (2022-08-23)
7
+
8
+ **Note:** Version bump only for package @angular-eslint/bundled-angular-compiler
9
+
6
10
  ## [14.0.2](https://github.com/angular-eslint/angular-eslint/compare/v14.0.1...v14.0.2) (2022-07-09)
7
11
 
8
12
  **Note:** Version bump only for package @angular-eslint/bundled-angular-compiler
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0
2
+ * @license Angular v14.1.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2600,7 +2600,7 @@ class ConstantPool {
2600
2600
  }
2601
2601
  else {
2602
2602
  // Just declare and use the variable directly, without a function call
2603
- // indirection. This saves a few bytes and avoids an unncessary call.
2603
+ // indirection. This saves a few bytes and avoids an unnecessary call.
2604
2604
  definition = variable(name).set(literal);
2605
2605
  usage = variable(name);
2606
2606
  }
@@ -4890,7 +4890,6 @@ function conditionallyCreateMapObjectLiteral(keys, keepDeclared) {
4890
4890
  function mapToExpression(map, keepDeclared) {
4891
4891
  return literalMap(Object.getOwnPropertyNames(map).map(key => {
4892
4892
  // canonical syntax: `dirProp: publicProp`
4893
- // if there is no `:`, use dirProp = elProp
4894
4893
  const value = map[key];
4895
4894
  let declaredName;
4896
4895
  let publicName;
@@ -4902,12 +4901,9 @@ function mapToExpression(map, keepDeclared) {
4902
4901
  needsDeclaredName = publicName !== declaredName;
4903
4902
  }
4904
4903
  else {
4905
- [declaredName, publicName] = splitAtColon(key, [key, value]);
4906
- minifiedName = declaredName;
4907
- // Only include the declared name if extracted from the key, i.e. the key contains a colon.
4908
- // Otherwise the declared name should be omitted even if it is different from the public name,
4909
- // as it may have already been minified.
4910
- needsDeclaredName = publicName !== declaredName && key.includes(':');
4904
+ minifiedName = declaredName = key;
4905
+ publicName = value;
4906
+ needsDeclaredName = false;
4911
4907
  }
4912
4908
  return {
4913
4909
  key: minifiedName,
@@ -5997,10 +5993,13 @@ function compileNgModuleDeclarationExpression(meta) {
5997
5993
  }
5998
5994
  return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]);
5999
5995
  }
6000
- function createNgModuleType({ type: moduleType, declarations, imports, exports }) {
5996
+ function createNgModuleType({ type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes }) {
6001
5997
  return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [
6002
- new ExpressionType(moduleType.type), tupleTypeOf(declarations), tupleTypeOf(imports),
6003
- tupleTypeOf(exports)
5998
+ new ExpressionType(moduleType.type),
5999
+ publicDeclarationTypes === null ? tupleTypeOf(declarations) :
6000
+ tupleOfTypes(publicDeclarationTypes),
6001
+ includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE,
6002
+ tupleTypeOf(exports),
6004
6003
  ]));
6005
6004
  }
6006
6005
  /**
@@ -6044,6 +6043,10 @@ function tupleTypeOf(exp) {
6044
6043
  const types = exp.map(ref => typeofExpr(ref.type));
6045
6044
  return exp.length > 0 ? expressionType(literalArr(types)) : NONE_TYPE;
6046
6045
  }
6046
+ function tupleOfTypes(types) {
6047
+ const typeofTypes = types.map(type => typeofExpr(type));
6048
+ return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
6049
+ }
6047
6050
 
6048
6051
  /**
6049
6052
  * @license
@@ -9851,10 +9854,18 @@ class _ParseAST {
9851
9854
  } // read all semicolons
9852
9855
  }
9853
9856
  else if (this.index < this.tokens.length) {
9857
+ const errorIndex = this.index;
9854
9858
  this.error(`Unexpected token '${this.next}'`);
9859
+ // The `error` call above will skip ahead to the next recovery point in an attempt to
9860
+ // recover part of the expression, but that might be the token we started from which will
9861
+ // lead to an infinite loop. If that's the case, break the loop assuming that we can't
9862
+ // parse further.
9863
+ if (this.index === errorIndex) {
9864
+ break;
9865
+ }
9855
9866
  }
9856
9867
  }
9857
- if (exprs.length == 0) {
9868
+ if (exprs.length === 0) {
9858
9869
  // We have no expressions so create an empty expression that spans the entire input length
9859
9870
  const artificialStart = this.offset;
9860
9871
  const artificialEnd = this.offset + this.input.length;
@@ -15873,7 +15884,7 @@ function setupRegistry() {
15873
15884
  *
15874
15885
  * @param index Instruction index of i18nStart, which initiates this context
15875
15886
  * @param ref Reference to a translation const that represents the content if thus context
15876
- * @param level Nestng level defined for child contexts
15887
+ * @param level Nesting level defined for child contexts
15877
15888
  * @param templateIndex Instruction index of a template which this context belongs to
15878
15889
  * @param meta Meta information (id, meaning, description, etc) associated with this context
15879
15890
  */
@@ -15988,7 +15999,7 @@ class I18nContext {
15988
15999
  const isTemplateTag = key.endsWith('NG-TEMPLATE');
15989
16000
  if (isTemplateTag) {
15990
16001
  // current template's content is placed before or after
15991
- // parent template tag, depending on the open/close atrribute
16002
+ // parent template tag, depending on the open/close attribute
15992
16003
  phs.splice(tmplIdx + (isCloseTag ? 0 : 1), 0, ...values);
15993
16004
  }
15994
16005
  else {
@@ -16683,7 +16694,7 @@ const GOOG_GET_MSG = 'goog.getMsg';
16683
16694
  * original_code: {
16684
16695
  * 'interpolation': '{{ sender }}',
16685
16696
  * 'startTagSpan': '<span class="receiver">',
16686
- * 'interploation_1': '{{ receiver }}',
16697
+ * 'interpolation_1': '{{ receiver }}',
16687
16698
  * 'closeTagSpan': '</span>',
16688
16699
  * },
16689
16700
  * },
@@ -19305,7 +19316,9 @@ class CompilerFacadeImpl {
19305
19316
  name: facade.name,
19306
19317
  type: wrapReference(facade.type),
19307
19318
  internalType: new WrappedNodeExpr(facade.type),
19308
- providers: new WrappedNodeExpr(facade.providers),
19319
+ providers: facade.providers && facade.providers.length > 0 ?
19320
+ new WrappedNodeExpr(facade.providers) :
19321
+ null,
19309
19322
  imports: facade.imports.map(i => new WrappedNodeExpr(i)),
19310
19323
  };
19311
19324
  const res = compileInjector(meta);
@@ -19323,7 +19336,9 @@ class CompilerFacadeImpl {
19323
19336
  adjacentType: new WrappedNodeExpr(facade.type),
19324
19337
  bootstrap: facade.bootstrap.map(wrapReference),
19325
19338
  declarations: facade.declarations.map(wrapReference),
19339
+ publicDeclarationTypes: null,
19326
19340
  imports: facade.imports.map(wrapReference),
19341
+ includeImportTypes: true,
19327
19342
  exports: facade.exports.map(wrapReference),
19328
19343
  selectorScopeMode: exports.R3SelectorScopeMode.Inline,
19329
19344
  containsForwardDecls: false,
@@ -19672,10 +19687,10 @@ function isOutput(value) {
19672
19687
  return value.ngMetadataName === 'Output';
19673
19688
  }
19674
19689
  function parseInputOutputs(values) {
19675
- return values.reduce((map, value) => {
19676
- const [field, property] = value.split(',').map(piece => piece.trim());
19677
- map[field] = property || field;
19678
- return map;
19690
+ return values.reduce((results, value) => {
19691
+ const [field, property] = value.split(':', 2).map(str => str.trim());
19692
+ results[field] = property || field;
19693
+ return results;
19679
19694
  }, {});
19680
19695
  }
19681
19696
  function convertDeclarePipeFacadeToMetadata(declaration) {
@@ -19696,7 +19711,8 @@ function convertDeclareInjectorFacadeToMetadata(declaration) {
19696
19711
  name: declaration.type.name,
19697
19712
  type: wrapReference(declaration.type),
19698
19713
  internalType: new WrappedNodeExpr(declaration.type),
19699
- providers: declaration.providers !== undefined ? new WrappedNodeExpr(declaration.providers) :
19714
+ providers: declaration.providers !== undefined && declaration.providers.length > 0 ?
19715
+ new WrappedNodeExpr(declaration.providers) :
19700
19716
  null,
19701
19717
  imports: declaration.imports !== undefined ?
19702
19718
  declaration.imports.map(i => new WrappedNodeExpr(i)) :
@@ -19715,7 +19731,7 @@ function publishFacade(global) {
19715
19731
  * Use of this source code is governed by an MIT-style license that can be
19716
19732
  * found in the LICENSE file at https://angular.io/license
19717
19733
  */
19718
- const VERSION = new Version('14.0.0');
19734
+ const VERSION = new Version('14.1.3');
19719
19735
 
19720
19736
  /**
19721
19737
  * @license
@@ -21742,7 +21758,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21742
21758
  function compileDeclareClassMetadata(metadata) {
21743
21759
  const definitionMap = new DefinitionMap();
21744
21760
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21745
- definitionMap.set('version', literal('14.0.0'));
21761
+ definitionMap.set('version', literal('14.1.3'));
21746
21762
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21747
21763
  definitionMap.set('type', metadata.type);
21748
21764
  definitionMap.set('decorators', metadata.decorators);
@@ -21859,7 +21875,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
21859
21875
  function createDirectiveDefinitionMap(meta) {
21860
21876
  const definitionMap = new DefinitionMap();
21861
21877
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21862
- definitionMap.set('version', literal('14.0.0'));
21878
+ definitionMap.set('version', literal('14.1.3'));
21863
21879
  // e.g. `type: MyDirective`
21864
21880
  definitionMap.set('type', meta.internalType);
21865
21881
  if (meta.isStandalone) {
@@ -22070,7 +22086,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22070
22086
  function compileDeclareFactoryFunction(meta) {
22071
22087
  const definitionMap = new DefinitionMap();
22072
22088
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22073
- definitionMap.set('version', literal('14.0.0'));
22089
+ definitionMap.set('version', literal('14.1.3'));
22074
22090
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22075
22091
  definitionMap.set('type', meta.internalType);
22076
22092
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22112,7 +22128,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22112
22128
  function createInjectableDefinitionMap(meta) {
22113
22129
  const definitionMap = new DefinitionMap();
22114
22130
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22115
- definitionMap.set('version', literal('14.0.0'));
22131
+ definitionMap.set('version', literal('14.1.3'));
22116
22132
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22117
22133
  definitionMap.set('type', meta.internalType);
22118
22134
  // Only generate providedIn property if it has a non-null value
@@ -22170,7 +22186,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22170
22186
  function createInjectorDefinitionMap(meta) {
22171
22187
  const definitionMap = new DefinitionMap();
22172
22188
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22173
- definitionMap.set('version', literal('14.0.0'));
22189
+ definitionMap.set('version', literal('14.1.3'));
22174
22190
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22175
22191
  definitionMap.set('type', meta.internalType);
22176
22192
  definitionMap.set('providers', meta.providers);
@@ -22207,7 +22223,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22207
22223
  function createNgModuleDefinitionMap(meta) {
22208
22224
  const definitionMap = new DefinitionMap();
22209
22225
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22210
- definitionMap.set('version', literal('14.0.0'));
22226
+ definitionMap.set('version', literal('14.1.3'));
22211
22227
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22212
22228
  definitionMap.set('type', meta.internalType);
22213
22229
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22265,7 +22281,7 @@ function compileDeclarePipeFromMetadata(meta) {
22265
22281
  function createPipeDefinitionMap(meta) {
22266
22282
  const definitionMap = new DefinitionMap();
22267
22283
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22268
- definitionMap.set('version', literal('14.0.0'));
22284
+ definitionMap.set('version', literal('14.1.3'));
22269
22285
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22270
22286
  // e.g. `type: MyPipe`
22271
22287
  definitionMap.set('type', meta.internalType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "14.0.3-alpha.0+56a3450",
3
+ "version": "14.0.3",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -15,5 +15,5 @@
15
15
  "package.json",
16
16
  "README.md"
17
17
  ],
18
- "gitHead": "56a345032bdbd6dc03cdbe4d219156dda73c1e6b"
18
+ "gitHead": "89459be35a922ba5f6146636b02cee508ac88ffb"
19
19
  }