@angular/compiler-cli 14.0.0-next.1 → 14.0.0-next.12

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 (130) hide show
  1. package/bundles/{chunk-7PY7XEFH.js → chunk-5K2JLFXT.js} +7 -7
  2. package/bundles/chunk-5K2JLFXT.js.map +6 -0
  3. package/bundles/{chunk-XNYP2SFR.js → chunk-6356XFP6.js} +98 -91
  4. package/bundles/chunk-6356XFP6.js.map +6 -0
  5. package/bundles/{chunk-Z2HS4HDG.js → chunk-BRHP6XKM.js} +4 -4
  6. package/bundles/chunk-BRHP6XKM.js.map +6 -0
  7. package/bundles/{chunk-JMLPLN5C.js → chunk-GAGUQCGV.js} +41 -41
  8. package/bundles/chunk-GAGUQCGV.js.map +6 -0
  9. package/bundles/{chunk-C44PYKVA.js → chunk-GMECRI4A.js} +2638 -1880
  10. package/bundles/chunk-GMECRI4A.js.map +6 -0
  11. package/bundles/{chunk-WQ3TNYTD.js → chunk-GMSUYBZP.js} +8 -11
  12. package/bundles/{chunk-WQ3TNYTD.js.map → chunk-GMSUYBZP.js.map} +0 -0
  13. package/bundles/{chunk-GLCRIILX.js → chunk-LC26KH5A.js} +5 -5
  14. package/bundles/chunk-LC26KH5A.js.map +6 -0
  15. package/bundles/{chunk-4KQK6VRA.js → chunk-LV3S6HFU.js} +80 -80
  16. package/bundles/chunk-LV3S6HFU.js.map +6 -0
  17. package/bundles/{chunk-CKFLH7L7.js → chunk-MGNOHKS6.js} +522 -934
  18. package/bundles/chunk-MGNOHKS6.js.map +6 -0
  19. package/bundles/{chunk-QDWL7SZJ.js → chunk-SJL5HBUW.js} +2 -2
  20. package/bundles/chunk-SJL5HBUW.js.map +6 -0
  21. package/bundles/{chunk-ALKVYGAK.js → chunk-T7KW7P7D.js} +74 -67
  22. package/bundles/chunk-T7KW7P7D.js.map +6 -0
  23. package/bundles/{chunk-FXU7FMZC.js → chunk-TD64C4QJ.js} +9 -9
  24. package/bundles/chunk-TD64C4QJ.js.map +6 -0
  25. package/bundles/{chunk-A5PL3TE6.js → chunk-TV7VZNWL.js} +36 -36
  26. package/bundles/chunk-TV7VZNWL.js.map +6 -0
  27. package/bundles/{chunk-PKOZO2VO.js → chunk-TXPPTZTK.js} +6 -6
  28. package/bundles/chunk-TXPPTZTK.js.map +6 -0
  29. package/bundles/{chunk-K2Z44JHH.js → chunk-WH4QSABR.js} +9 -9
  30. package/bundles/chunk-WH4QSABR.js.map +6 -0
  31. package/bundles/{chunk-SKBLJA43.js → chunk-ZCDB56AX.js} +7 -7
  32. package/bundles/chunk-ZCDB56AX.js.map +6 -0
  33. package/bundles/index.js +13 -13
  34. package/bundles/index.js.map +1 -1
  35. package/bundles/linker/babel/index.js +19 -19
  36. package/bundles/linker/babel/index.js.map +1 -1
  37. package/bundles/linker/index.js +5 -5
  38. package/bundles/ngcc/index.js +13 -13
  39. package/bundles/ngcc/index.js.map +1 -1
  40. package/bundles/ngcc/main-ngcc.js +14 -14
  41. package/bundles/ngcc/main-ngcc.js.map +1 -1
  42. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +14 -14
  43. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
  44. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +5 -5
  45. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +1 -1
  46. package/bundles/private/bazel.js +2 -2
  47. package/bundles/private/localize.js +4 -4
  48. package/bundles/private/migrations.js +6 -6
  49. package/bundles/private/tooling.js +3 -3
  50. package/bundles/src/bin/ng_xi18n.js +11 -11
  51. package/bundles/src/bin/ng_xi18n.js.map +1 -1
  52. package/bundles/src/bin/ngc.js +9 -9
  53. package/bundles/src/bin/ngc.js.map +1 -1
  54. package/bundles_metadata.json +1 -1
  55. package/linker/babel/src/babel_core.d.ts +1 -0
  56. package/linker/babel/src/babel_declaration_scope.d.ts +1 -1
  57. package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +7 -3
  58. package/linker/src/file_linker/emit_scopes/{iife_emit_scope.d.ts → local_emit_scope.d.ts} +7 -11
  59. package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.d.ts +3 -3
  60. package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +3 -3
  61. package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.d.ts +3 -3
  62. package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.d.ts +3 -3
  63. package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.d.ts +3 -3
  64. package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.d.ts +3 -3
  65. package/linker/src/file_linker/partial_linkers/partial_linker.d.ts +8 -1
  66. package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.d.ts +4 -4
  67. package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.d.ts +3 -3
  68. package/ngcc/src/packages/build_marker.d.ts +1 -1
  69. package/package.json +6 -6
  70. package/private/babel.d.ts +42 -0
  71. package/src/ngtsc/annotations/common/index.d.ts +16 -0
  72. package/src/ngtsc/annotations/{src → common/src}/api.d.ts +1 -1
  73. package/src/ngtsc/annotations/common/src/di.d.ts +38 -0
  74. package/src/ngtsc/annotations/{src → common/src}/diagnostics.d.ts +15 -7
  75. package/src/ngtsc/annotations/common/src/evaluation.d.ts +18 -0
  76. package/src/ngtsc/annotations/{src → common/src}/factory.d.ts +2 -2
  77. package/src/ngtsc/annotations/{src → common/src}/metadata.d.ts +2 -2
  78. package/src/ngtsc/annotations/{src → common/src}/references_registry.d.ts +3 -3
  79. package/src/ngtsc/annotations/{src → common/src}/util.d.ts +7 -43
  80. package/src/ngtsc/annotations/component/index.d.ts +9 -0
  81. package/src/ngtsc/annotations/component/src/diagnostics.d.ts +20 -0
  82. package/src/ngtsc/annotations/component/src/handler.d.ts +92 -0
  83. package/src/ngtsc/annotations/component/src/metadata.d.ts +61 -0
  84. package/src/ngtsc/annotations/component/src/resources.d.ts +123 -0
  85. package/src/ngtsc/annotations/component/src/scope.d.ts +20 -0
  86. package/src/ngtsc/annotations/component/src/symbol.d.ts +20 -0
  87. package/src/ngtsc/annotations/component/src/util.d.ts +26 -0
  88. package/src/ngtsc/annotations/directive/index.d.ts +11 -0
  89. package/src/ngtsc/annotations/directive/src/handler.d.ts +59 -0
  90. package/src/ngtsc/annotations/directive/src/shared.d.ts +30 -0
  91. package/src/ngtsc/annotations/directive/src/symbol.d.ts +27 -0
  92. package/src/ngtsc/annotations/index.d.ts +4 -6
  93. package/src/ngtsc/annotations/ng_module/index.d.ts +9 -0
  94. package/src/ngtsc/annotations/{src/ng_module.d.ts → ng_module/src/handler.d.ts} +13 -11
  95. package/src/ngtsc/diagnostics/src/error_code.d.ts +23 -0
  96. package/src/ngtsc/metadata/src/api.d.ts +19 -0
  97. package/src/ngtsc/scope/index.d.ts +4 -3
  98. package/src/ngtsc/scope/src/api.d.ts +21 -5
  99. package/src/ngtsc/scope/src/component_scope.d.ts +1 -15
  100. package/src/ngtsc/scope/src/local.d.ts +4 -11
  101. package/src/ngtsc/scope/src/typecheck.d.ts +1 -1
  102. package/src/ngtsc/scope/src/util.d.ts +14 -0
  103. package/src/ngtsc/shims/api.d.ts +0 -1
  104. package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -4
  105. package/src/ngtsc/tsc_plugin.d.ts +1 -1
  106. package/src/ngtsc/typecheck/api/checker.d.ts +6 -6
  107. package/src/ngtsc/typecheck/api/completion.d.ts +3 -3
  108. package/src/ngtsc/typecheck/api/symbols.d.ts +23 -16
  109. package/src/ngtsc/typecheck/src/checker.d.ts +5 -4
  110. package/src/ngtsc/typecheck/src/completion.d.ts +6 -5
  111. package/src/ngtsc/typecheck/src/diagnostics.d.ts +6 -5
  112. package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +4 -3
  113. package/src/ngtsc/util/src/typescript.d.ts +0 -5
  114. package/bundles/chunk-4KQK6VRA.js.map +0 -6
  115. package/bundles/chunk-7PY7XEFH.js.map +0 -6
  116. package/bundles/chunk-A5PL3TE6.js.map +0 -6
  117. package/bundles/chunk-ALKVYGAK.js.map +0 -6
  118. package/bundles/chunk-C44PYKVA.js.map +0 -6
  119. package/bundles/chunk-CKFLH7L7.js.map +0 -6
  120. package/bundles/chunk-FXU7FMZC.js.map +0 -6
  121. package/bundles/chunk-GLCRIILX.js.map +0 -6
  122. package/bundles/chunk-JMLPLN5C.js.map +0 -6
  123. package/bundles/chunk-K2Z44JHH.js.map +0 -6
  124. package/bundles/chunk-PKOZO2VO.js.map +0 -6
  125. package/bundles/chunk-QDWL7SZJ.js.map +0 -6
  126. package/bundles/chunk-SKBLJA43.js.map +0 -6
  127. package/bundles/chunk-XNYP2SFR.js.map +0 -6
  128. package/bundles/chunk-Z2HS4HDG.js.map +0 -6
  129. package/src/ngtsc/annotations/src/component.d.ts +0 -246
  130. package/src/ngtsc/annotations/src/directive.d.ts +0 -99
@@ -28,6 +28,7 @@
28
28
  import * as _babelNamespace from '@babel/core';
29
29
  import _typesNamespace = _babelNamespace.types;
30
30
  export import types = _typesNamespace;
31
+ export declare type BabelFile = _babelNamespace.BabelFile;
31
32
  export declare type PluginObj = _babelNamespace.PluginObj;
32
33
  export declare type ConfigAPI = _babelNamespace.ConfigAPI;
33
34
  export declare type NodePath<T = _babelNamespace.Node> = _babelNamespace.NodePath<T>;
@@ -9,7 +9,7 @@
9
9
  import { NodePath, Scope } from '@babel/traverse';
10
10
  import { DeclarationScope } from '../../../linker';
11
11
  import { types as t } from './babel_core';
12
- export declare type ConstantScopePath = NodePath<t.Function | t.Program>;
12
+ export declare type ConstantScopePath = NodePath<t.FunctionDeclaration> | NodePath<t.FunctionExpression> | NodePath<t.Program>;
13
13
  /**
14
14
  * This class represents the lexical scope of a partial declaration in Babel source code.
15
15
  *
@@ -6,7 +6,9 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o } from '@angular/compiler';
9
+ import { ConstantPool } from '@angular/compiler';
10
+ import { AstFactory } from '../../../../src/ngtsc/translator';
11
+ import { LinkedDefinition } from '../partial_linkers/partial_linker';
10
12
  import { Translator } from '../translator';
11
13
  /**
12
14
  * This class represents (from the point of view of the `FileLinker`) the scope in which
@@ -20,16 +22,18 @@ import { Translator } from '../translator';
20
22
  export declare class EmitScope<TStatement, TExpression> {
21
23
  protected readonly ngImport: TExpression;
22
24
  protected readonly translator: Translator<TStatement, TExpression>;
25
+ private readonly factory;
23
26
  readonly constantPool: ConstantPool;
24
- constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>);
27
+ constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>, factory: AstFactory<TStatement, TExpression>);
25
28
  /**
26
29
  * Translate the given Output AST definition expression into a generic `TExpression`.
27
30
  *
28
31
  * Use a `LinkerImportGenerator` to handle any imports in the definition.
29
32
  */
30
- translateDefinition(definition: o.Expression): TExpression;
33
+ translateDefinition(definition: LinkedDefinition): TExpression;
31
34
  /**
32
35
  * Return any constant statements that are shared between all uses of this `EmitScope`.
33
36
  */
34
37
  getConstantStatements(): TStatement[];
38
+ private wrapInIifeWithStatements;
35
39
  }
@@ -1,4 +1,3 @@
1
- /// <amd-module name="@angular/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope" />
2
1
  /**
3
2
  * @license
4
3
  * Copyright Google LLC All Rights Reserved.
@@ -6,25 +5,22 @@
6
5
  * Use of this source code is governed by an MIT-style license that can be
7
6
  * found in the LICENSE file at https://angular.io/license
8
7
  */
9
- import { outputAst as o } from '@angular/compiler';
10
- import { AstFactory } from '../../../../src/ngtsc/translator';
11
- import { Translator } from '../translator';
8
+ /// <amd-module name="@angular/compiler-cli/linker/src/file_linker/emit_scopes/local_emit_scope" />
9
+ import { LinkedDefinition } from '../partial_linkers/partial_linker';
12
10
  import { EmitScope } from './emit_scope';
13
11
  /**
14
12
  * This class is a specialization of the `EmitScope` class that is designed for the situation where
15
13
  * there is no clear shared scope for constant statements. In this case they are bundled with the
16
- * translated definition inside an IIFE.
14
+ * translated definition and will be emitted into an IIFE.
17
15
  */
18
- export declare class IifeEmitScope<TStatement, TExpression> extends EmitScope<TStatement, TExpression> {
19
- private readonly factory;
20
- constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>, factory: AstFactory<TStatement, TExpression>);
16
+ export declare class LocalEmitScope<TStatement, TExpression> extends EmitScope<TStatement, TExpression> {
21
17
  /**
22
18
  * Translate the given Output AST definition expression into a generic `TExpression`.
23
19
  *
24
- * Wraps the output from `EmitScope.translateDefinition()` and `EmitScope.getConstantStatements()`
25
- * in an IIFE.
20
+ * Merges the `ConstantPool` statements with the definition statements when generating the
21
+ * definition expression. This means that `ConstantPool` statements will be emitted into an IIFE.
26
22
  */
27
- translateDefinition(definition: o.Expression): TExpression;
23
+ translateDefinition(definition: LinkedDefinition): TExpression;
28
24
  /**
29
25
  * It is not valid to call this method, since there will be no shared constant statements - they
30
26
  * are already emitted in the IIFE alongside the translated definition.
@@ -6,14 +6,14 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3ClassMetadata, R3DeclareClassMetadata, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, R3ClassMetadata, R3DeclareClassMetadata, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
- import { PartialLinker } from './partial_linker';
11
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
12
12
  /**
13
13
  * A `PartialLinker` that is designed to process `ɵɵngDeclareClassMetadata()` call expressions.
14
14
  */
15
15
  export declare class PartialClassMetadataLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
16
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
16
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
17
17
  }
18
18
  /**
19
19
  * Derives the `R3ClassMetadata` structure from the AST object.
@@ -6,11 +6,11 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
11
11
  import { AstObject } from '../../ast/ast_value';
12
12
  import { GetSourceFileFn } from '../get_source_file';
13
- import { PartialLinker } from './partial_linker';
13
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
14
14
  /**
15
15
  * A `PartialLinker` that is designed to process `ɵɵngDeclareComponent()` call expressions.
16
16
  */
@@ -19,7 +19,7 @@ export declare class PartialComponentLinkerVersion1<TStatement, TExpression> imp
19
19
  private sourceUrl;
20
20
  private code;
21
21
  constructor(getSourceFile: GetSourceFileFn, sourceUrl: AbsoluteFsPath, code: string);
22
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
22
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
23
23
  /**
24
24
  * This function derives the `R3ComponentMetadata` from the provided AST object.
25
25
  */
@@ -6,11 +6,11 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, ParseSourceSpan, R3DeclareDirectiveMetadata, R3DirectiveMetadata, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, ParseSourceSpan, R3DeclareDirectiveMetadata, R3DirectiveMetadata, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
11
11
  import { Range } from '../../ast/ast_host';
12
12
  import { AstObject } from '../../ast/ast_value';
13
- import { PartialLinker } from './partial_linker';
13
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
14
14
  /**
15
15
  * A `PartialLinker` that is designed to process `ɵɵngDeclareDirective()` call expressions.
16
16
  */
@@ -18,7 +18,7 @@ export declare class PartialDirectiveLinkerVersion1<TExpression> implements Part
18
18
  private sourceUrl;
19
19
  private code;
20
20
  constructor(sourceUrl: AbsoluteFsPath, code: string);
21
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
21
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
22
22
  }
23
23
  /**
24
24
  * Derives the `R3DirectiveMetadata` structure from the AST object.
@@ -6,14 +6,14 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3DeclareFactoryMetadata, R3FactoryMetadata, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, R3DeclareFactoryMetadata, R3FactoryMetadata, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
- import { PartialLinker } from './partial_linker';
11
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
12
12
  /**
13
13
  * A `PartialLinker` that is designed to process `ɵɵngDeclareFactory()` call expressions.
14
14
  */
15
15
  export declare class PartialFactoryLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
16
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
16
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
17
17
  }
18
18
  /**
19
19
  * Derives the `R3FactoryMetadata` structure from the AST object.
@@ -6,14 +6,14 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3DeclareInjectableMetadata, R3InjectableMetadata, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, R3DeclareInjectableMetadata, R3InjectableMetadata, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
- import { PartialLinker } from './partial_linker';
11
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
12
12
  /**
13
13
  * A `PartialLinker` that is designed to process `ɵɵngDeclareInjectable()` call expressions.
14
14
  */
15
15
  export declare class PartialInjectableLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
16
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
16
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
17
17
  }
18
18
  /**
19
19
  * Derives the `R3InjectableMetadata` structure from the AST object.
@@ -6,14 +6,14 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3DeclareInjectorMetadata, R3InjectorMetadata, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, R3DeclareInjectorMetadata, R3InjectorMetadata, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
- import { PartialLinker } from './partial_linker';
11
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
12
12
  /**
13
13
  * A `PartialLinker` that is designed to process `ɵɵngDeclareInjector()` call expressions.
14
14
  */
15
15
  export declare class PartialInjectorLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
16
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
16
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
17
17
  }
18
18
  /**
19
19
  * Derives the `R3InjectorMetadata` structure from the AST object.
@@ -8,6 +8,13 @@
8
8
  */
9
9
  import { ConstantPool, outputAst as o, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
+ /**
12
+ * A definition generated by a `PartialLinker`, ready to emit.
13
+ */
14
+ export interface LinkedDefinition {
15
+ expression: o.Expression;
16
+ statements: o.Statement[];
17
+ }
11
18
  /**
12
19
  * An interface for classes that can link partial declarations into full definitions.
13
20
  */
@@ -18,5 +25,5 @@ export interface PartialLinker<TExpression> {
18
25
  * @param metaObj An object that fits one of the `R3DeclareDirectiveMetadata` or
19
26
  * `R3DeclareComponentMetadata` interfaces.
20
27
  */
21
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
28
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
22
29
  }
@@ -6,9 +6,9 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3DeclareNgModuleMetadata, R3NgModuleMetadata, R3PartialDeclaration } from '@angular/compiler';
9
+ import { ConstantPool, R3DeclareNgModuleMetadata, R3NgModuleMetadata, R3PartialDeclaration } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
- import { PartialLinker } from './partial_linker';
11
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
12
12
  /**
13
13
  * A `PartialLinker` that is designed to process `ɵɵngDeclareNgModule()` call expressions.
14
14
  */
@@ -24,9 +24,9 @@ export declare class PartialNgModuleLinkerVersion1<TExpression> implements Parti
24
24
  * definition. These are only used by JIT compilation.
25
25
  */
26
26
  emitInline: boolean);
27
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
27
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
28
28
  }
29
29
  /**
30
30
  * Derives the `R3NgModuleMetadata` structure from the AST object.
31
31
  */
32
- export declare function toR3NgModuleMeta<TExpression>(metaObj: AstObject<R3DeclareNgModuleMetadata, TExpression>, emitInline: boolean): R3NgModuleMetadata;
32
+ export declare function toR3NgModuleMeta<TExpression>(metaObj: AstObject<R3DeclareNgModuleMetadata, TExpression>, supportJit: boolean): R3NgModuleMetadata;
@@ -6,15 +6,15 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- import { ConstantPool, outputAst as o, R3DeclarePipeMetadata, R3PartialDeclaration, R3PipeMetadata } from '@angular/compiler';
9
+ import { ConstantPool, R3DeclarePipeMetadata, R3PartialDeclaration, R3PipeMetadata } from '@angular/compiler';
10
10
  import { AstObject } from '../../ast/ast_value';
11
- import { PartialLinker } from './partial_linker';
11
+ import { LinkedDefinition, PartialLinker } from './partial_linker';
12
12
  /**
13
13
  * A `PartialLinker` that is designed to process `ɵɵngDeclarePipe()` call expressions.
14
14
  */
15
15
  export declare class PartialPipeLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
16
16
  constructor();
17
- linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
17
+ linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
18
18
  }
19
19
  /**
20
20
  * Derives the `R3PipeMetadata` structure from the AST object.
@@ -9,7 +9,7 @@
9
9
  import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
10
10
  import { PackageJsonUpdater } from '../writing/package_json_updater';
11
11
  import { EntryPointPackageJson, PackageJsonFormatProperties } from './entry_point';
12
- export declare const NGCC_VERSION = "14.0.0-next.1";
12
+ export declare const NGCC_VERSION = "14.0.0-next.12";
13
13
  /**
14
14
  * Returns true if there is a format in this entry-point that was compiled with an outdated version
15
15
  * of ngcc.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "14.0.0-next.1",
3
+ "version": "14.0.0-next.12",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -53,20 +53,20 @@
53
53
  }
54
54
  },
55
55
  "dependencies": {
56
- "@babel/core": "^7.8.6",
56
+ "@babel/core": "^7.17.2",
57
57
  "reflect-metadata": "^0.1.2",
58
58
  "chokidar": "^3.0.0",
59
59
  "convert-source-map": "^1.5.1",
60
60
  "dependency-graph": "^0.11.0",
61
- "magic-string": "^0.25.0",
61
+ "magic-string": "^0.26.0",
62
62
  "semver": "^7.0.0",
63
63
  "sourcemap-codec": "^1.4.8",
64
64
  "tslib": "^2.3.0",
65
65
  "yargs": "^17.2.1"
66
66
  },
67
67
  "peerDependencies": {
68
- "@angular/compiler": "14.0.0-next.1",
69
- "typescript": ">=4.4.2 <4.6"
68
+ "@angular/compiler": "14.0.0-next.12",
69
+ "typescript": ">=4.6.2 <4.7"
70
70
  },
71
71
  "repository": {
72
72
  "type": "git",
@@ -79,7 +79,7 @@
79
79
  ],
80
80
  "license": "MIT",
81
81
  "engines": {
82
- "node": "^12.20.0 || ^14.15.0 || >=16.10.0"
82
+ "node": "^14.15.0 || >=16.10.0"
83
83
  },
84
84
  "bugs": {
85
85
  "url": "https://github.com/angular/angular/issues"
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { BabelFile, types as t } from '@babel/core';
9
+
10
+ /**
11
+ * Augment some Babel types to add symbols that we rely on, but are not included in the Babel typings.
12
+ */
13
+
14
+ declare module '@babel/traverse' {
15
+ interface Hub {
16
+ file: BabelFile;
17
+ }
18
+ }
19
+
20
+ declare module '@babel/core' {
21
+ interface BabelFile {
22
+ buildCodeFrameError(node: t.Node, message: string): Error;
23
+ }
24
+ }
25
+
26
+ // The following modules are declared to work around a limitation in tsc_wrapped's `strict_deps`
27
+ // check. Since Babel uses scoped packages, the corresponding lookup for declaration files in the
28
+ // `node_modules/@types/` directory follows a special strategy: the `@types` package has to be
29
+ // named `{scope}__{package}`, e.g. `@types/babel__generator`. When `tsc` performs module
30
+ // resolution for the `@babel/generator` module specifier, it will first try the `paths` mappings
31
+ // but resolution through path mappings does _not_ apply this special naming convention rule for
32
+ // `@types` packages, `tsc` only applies that rule in its `@types` resolution step. Consequently,
33
+ // the path mapping into Bazel's private `node_modules` directory fails to resolve, causing `tsc`
34
+ // to find the nearest `node_modules` directory in an ancestor directory of the origin source
35
+ // file. This finds the `node_modules` directory in the workspace, _not_ Bazel's private copy of
36
+ // `node_modules` and therefore the `@types` end up being resolved from a `node_modules` tree
37
+ // that is not governed by Bazel, and therefore not expected by the `strict_deps` rule.
38
+ // Declaring the modules here allows `strict_deps` to always find a declaration of the modules
39
+ // in an input file to the compilation, therefore accepting the module import.
40
+ declare module '@babel/generator' {}
41
+ declare module '@babel/template' {}
42
+ declare module '@babel/parser' {}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common" />
9
+ export * from './src/api';
10
+ export * from './src/di';
11
+ export * from './src/diagnostics';
12
+ export * from './src/evaluation';
13
+ export * from './src/factory';
14
+ export * from './src/metadata';
15
+ export * from './src/references_registry';
16
+ export * from './src/util';
@@ -5,7 +5,7 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/api" />
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/api" />
9
9
  /**
10
10
  * Resolves and loads resource files that are referenced in Angular metadata.
11
11
  *
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/di" />
9
+ import { R3DependencyMetadata } from '@angular/compiler';
10
+ import { ClassDeclaration, CtorParameter, ReflectionHost, UnavailableValue } from '../../../reflection';
11
+ export declare type ConstructorDeps = {
12
+ deps: R3DependencyMetadata[];
13
+ } | {
14
+ deps: null;
15
+ errors: ConstructorDepError[];
16
+ };
17
+ export interface ConstructorDepError {
18
+ index: number;
19
+ param: CtorParameter;
20
+ reason: UnavailableValue;
21
+ }
22
+ export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): ConstructorDeps | null;
23
+ /**
24
+ * Convert `ConstructorDeps` into the `R3DependencyMetadata` array for those deps if they're valid,
25
+ * or into an `'invalid'` signal if they're not.
26
+ *
27
+ * This is a companion function to `validateConstructorDependencies` which accepts invalid deps.
28
+ */
29
+ export declare function unwrapConstructorDependencies(deps: ConstructorDeps | null): R3DependencyMetadata[] | 'invalid' | null;
30
+ export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): R3DependencyMetadata[] | null;
31
+ /**
32
+ * Validate that `ConstructorDeps` does not have any invalid dependencies and convert them into the
33
+ * `R3DependencyMetadata` array if so, or raise a diagnostic if some deps are invalid.
34
+ *
35
+ * This is a companion function to `unwrapConstructorDependencies` which does not accept invalid
36
+ * deps.
37
+ */
38
+ export declare function validateConstructorDependencies(clazz: ClassDeclaration, deps: ConstructorDeps | null): R3DependencyMetadata[] | null;
@@ -5,14 +5,22 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/diagnostics" />
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/diagnostics" />
9
9
  import ts from 'typescript';
10
- import { FatalDiagnosticError } from '../../diagnostics';
11
- import { Reference } from '../../imports';
12
- import { InjectableClassRegistry, MetadataReader } from '../../metadata';
13
- import { PartialEvaluator, ResolvedValue } from '../../partial_evaluator';
14
- import { ClassDeclaration, ReflectionHost } from '../../reflection';
15
- import { LocalModuleScopeRegistry } from '../../scope';
10
+ import { FatalDiagnosticError } from '../../../diagnostics';
11
+ import { Reference } from '../../../imports';
12
+ import { InjectableClassRegistry, MetadataReader } from '../../../metadata';
13
+ import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
14
+ import { ClassDeclaration, ReflectionHost } from '../../../reflection';
15
+ import { DeclarationData, LocalModuleScopeRegistry } from '../../../scope';
16
+ /**
17
+ * Create a `ts.Diagnostic` which indicates the given class is part of the declarations of two or
18
+ * more NgModules.
19
+ *
20
+ * The resulting `ts.Diagnostic` will have a context entry for each NgModule showing the point where
21
+ * the directive/pipe exists in its `declarations` (if possible).
22
+ */
23
+ export declare function makeDuplicateDeclarationError(node: ClassDeclaration, data: DeclarationData[], kind: string): ts.Diagnostic;
16
24
  /**
17
25
  * Creates a `FatalDiagnosticError` for a node that did not evaluate to the expected type. The
18
26
  * diagnostic that is created will include details on why the value is incorrect, i.e. it includes
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/evaluation" />
9
+ import ts from 'typescript';
10
+ import { Reference } from '../../../imports';
11
+ import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
12
+ import { ClassDeclaration, Decorator } from '../../../reflection';
13
+ export declare function resolveEnumValue(evaluator: PartialEvaluator, metadata: Map<string, ts.Expression>, field: string, enumSymbolName: string): number | null;
14
+ /** Determines if the result of an evaluation is a string array. */
15
+ export declare function isStringArray(resolvedValue: ResolvedValue): resolvedValue is string[];
16
+ export declare function isClassReferenceArray(resolvedValue: ResolvedValue): resolvedValue is Reference<ClassDeclaration>[];
17
+ export declare function isArray(value: ResolvedValue): value is Array<ResolvedValue>;
18
+ export declare function resolveLiteral(decorator: Decorator, literalCache: Map<Decorator, ts.ObjectLiteralExpression>): ts.ObjectLiteralExpression;
@@ -5,9 +5,9 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/factory" />
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/factory" />
9
9
  import { R3FactoryMetadata } from '@angular/compiler';
10
- import { CompileResult } from '../../transform';
10
+ import { CompileResult } from '../../../transform';
11
11
  export declare type CompileFactoryFn = (metadata: R3FactoryMetadata) => CompileResult;
12
12
  export declare function compileNgFactoryDefField(metadata: R3FactoryMetadata): CompileResult;
13
13
  export declare function compileDeclareFactory(metadata: R3FactoryMetadata): CompileResult;
@@ -5,9 +5,9 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/metadata" />
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/metadata" />
9
9
  import { R3ClassMetadata } from '@angular/compiler';
10
- import { DeclarationNode, Decorator, ReflectionHost } from '../../reflection';
10
+ import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
11
11
  /**
12
12
  * Given a class declaration, generate a call to `setClassMetadata` with the Angular metadata
13
13
  * present on the class or its member fields. An ngDevMode guard is used to allow the call to be
@@ -5,9 +5,9 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/references_registry" />
9
- import { Reference } from '../../imports';
10
- import { DeclarationNode } from '../../reflection';
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/references_registry" />
9
+ import { Reference } from '../../../imports';
10
+ import { DeclarationNode } from '../../../reflection';
11
11
  /**
12
12
  * Implement this interface if you want DecoratorHandlers to register
13
13
  * references that they find in their analysis of the code.
@@ -5,26 +5,13 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/util" />
9
- import { Expression, FactoryTarget, ParseSourceSpan, R3CompiledExpression, R3DependencyMetadata, R3FactoryMetadata, R3Reference, Statement, WrappedNodeExpr } from '@angular/compiler';
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/util" />
9
+ import { Expression, FactoryTarget, ParseSourceSpan, R3CompiledExpression, R3FactoryMetadata, R3Reference, Statement, WrappedNodeExpr } from '@angular/compiler';
10
10
  import ts from 'typescript';
11
- import { Reference, ReferenceEmitter } from '../../imports';
12
- import { ForeignFunctionResolver, PartialEvaluator } from '../../partial_evaluator';
13
- import { ClassDeclaration, CtorParameter, Decorator, Import, ImportedTypeValueReference, LocalTypeValueReference, ReflectionHost, TypeValueReference, UnavailableValue } from '../../reflection';
14
- import { DeclarationData } from '../../scope';
15
- import { CompileResult } from '../../transform';
16
- export declare type ConstructorDeps = {
17
- deps: R3DependencyMetadata[];
18
- } | {
19
- deps: null;
20
- errors: ConstructorDepError[];
21
- };
22
- export interface ConstructorDepError {
23
- index: number;
24
- param: CtorParameter;
25
- reason: UnavailableValue;
26
- }
27
- export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): ConstructorDeps | null;
11
+ import { ImportedFile, ModuleResolver, Reference, ReferenceEmitter } from '../../../imports';
12
+ import { ForeignFunctionResolver, PartialEvaluator } from '../../../partial_evaluator';
13
+ import { ClassDeclaration, Decorator, Import, ImportedTypeValueReference, LocalTypeValueReference, ReflectionHost, TypeValueReference } from '../../../reflection';
14
+ import { CompileResult } from '../../../transform';
28
15
  /**
29
16
  * Convert a `TypeValueReference` to an `Expression` which refers to the type as a value.
30
17
  *
@@ -34,22 +21,6 @@ export declare function getConstructorDependencies(clazz: ClassDeclaration, refl
34
21
  */
35
22
  export declare function valueReferenceToExpression(valueRef: LocalTypeValueReference | ImportedTypeValueReference): Expression;
36
23
  export declare function valueReferenceToExpression(valueRef: TypeValueReference): Expression | null;
37
- /**
38
- * Convert `ConstructorDeps` into the `R3DependencyMetadata` array for those deps if they're valid,
39
- * or into an `'invalid'` signal if they're not.
40
- *
41
- * This is a companion function to `validateConstructorDependencies` which accepts invalid deps.
42
- */
43
- export declare function unwrapConstructorDependencies(deps: ConstructorDeps | null): R3DependencyMetadata[] | 'invalid' | null;
44
- export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): R3DependencyMetadata[] | null;
45
- /**
46
- * Validate that `ConstructorDeps` does not have any invalid dependencies and convert them into the
47
- * `R3DependencyMetadata` array if so, or raise a diagnostic if some deps are invalid.
48
- *
49
- * This is a companion function to `unwrapConstructorDependencies` which does not accept invalid
50
- * deps.
51
- */
52
- export declare function validateConstructorDependencies(clazz: ClassDeclaration, deps: ConstructorDeps | null): R3DependencyMetadata[] | null;
53
24
  export declare function toR3Reference(origin: ts.Node, valueRef: Reference, typeRef: Reference, valueContext: ts.SourceFile, typeContext: ts.SourceFile, refEmitter: ReferenceEmitter): R3Reference;
54
25
  export declare function isAngularCore(decorator: Decorator): decorator is Decorator & {
55
26
  import: Import;
@@ -102,14 +73,6 @@ export declare function readBaseClass(node: ClassDeclaration, reflector: Reflect
102
73
  * @param expression Expression where functions should be wrapped in parentheses
103
74
  */
104
75
  export declare function wrapFunctionExpressionsInParens(expression: ts.Expression): ts.Expression;
105
- /**
106
- * Create a `ts.Diagnostic` which indicates the given class is part of the declarations of two or
107
- * more NgModules.
108
- *
109
- * The resulting `ts.Diagnostic` will have a context entry for each NgModule showing the point where
110
- * the directive/pipe exists in its `declarations` (if possible).
111
- */
112
- export declare function makeDuplicateDeclarationError(node: ClassDeclaration, data: DeclarationData[], kind: string): ts.Diagnostic;
113
76
  /**
114
77
  * Resolves the given `rawProviders` into `ClassDeclarations` and returns
115
78
  * a set containing those that are known to require a factory definition.
@@ -130,3 +93,4 @@ export declare function createSourceSpan(node: ts.Node): ParseSourceSpan;
130
93
  */
131
94
  export declare function compileResults(fac: CompileResult, def: R3CompiledExpression, metadataStmt: Statement | null, propName: string): CompileResult[];
132
95
  export declare function toFactoryMetadata(meta: Omit<R3FactoryMetadata, 'target'>, target: FactoryTarget): R3FactoryMetadata;
96
+ export declare function resolveImportedFile(moduleResolver: ModuleResolver, importedFile: ImportedFile, expr: Expression, origin: ts.SourceFile): ts.SourceFile | null;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component" />
9
+ export { ComponentDecoratorHandler } from './src/handler';