@angular/compiler-cli 16.2.2 → 17.0.0-next.1

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 (45) hide show
  1. package/bundles/{chunk-6SPHWESC.js → chunk-ABAFIH3N.js} +73 -23
  2. package/bundles/chunk-ABAFIH3N.js.map +6 -0
  3. package/bundles/{chunk-WJXW3ICJ.js → chunk-BOXNK2F2.js} +2813 -2744
  4. package/bundles/chunk-BOXNK2F2.js.map +6 -0
  5. package/bundles/{chunk-YKSGHLGM.js → chunk-HEDZI6BK.js} +7 -39
  6. package/bundles/chunk-HEDZI6BK.js.map +6 -0
  7. package/bundles/{chunk-RYGXSEBC.js → chunk-NGWY7NOB.js} +12 -9
  8. package/bundles/{chunk-RYGXSEBC.js.map → chunk-NGWY7NOB.js.map} +1 -1
  9. package/bundles/{chunk-3GVOXFUL.js → chunk-OYEEKZWP.js} +2 -2
  10. package/bundles/{chunk-TBUSSXUA.js → chunk-PCMLSPQF.js} +2 -2
  11. package/bundles/{chunk-CSE6A7DF.js → chunk-QJNBIBVG.js} +2 -2
  12. package/bundles/chunk-XI2RTGAL.js +16 -0
  13. package/bundles/{chunk-7WBWMZKZ.js → chunk-Y4VOTDJT.js} +4 -4
  14. package/bundles/index.js +8 -8
  15. package/bundles/linker/babel/index.js +5 -5
  16. package/bundles/linker/index.js +5 -5
  17. package/bundles/private/bazel.js +1 -1
  18. package/bundles/private/localize.js +2 -2
  19. package/bundles/private/migrations.js +5 -5
  20. package/bundles/private/tooling.js +4 -4
  21. package/bundles/src/bin/ng_xi18n.js +7 -7
  22. package/bundles/src/bin/ngc.js +8 -16
  23. package/bundles/src/bin/ngc.js.map +1 -1
  24. package/bundles_metadata.json +1 -1
  25. package/package.json +3 -3
  26. package/src/main.d.ts +2 -4
  27. package/src/ngtsc/annotations/common/src/di.d.ts +3 -2
  28. package/src/ngtsc/annotations/common/src/metadata.d.ts +7 -0
  29. package/src/ngtsc/annotations/component/src/resources.d.ts +3 -2
  30. package/src/ngtsc/annotations/directive/src/handler.d.ts +3 -2
  31. package/src/ngtsc/annotations/directive/src/shared.d.ts +3 -1
  32. package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -1
  33. package/src/ngtsc/annotations/src/injectable.d.ts +3 -2
  34. package/src/ngtsc/annotations/src/pipe.d.ts +3 -2
  35. package/src/ngtsc/diagnostics/src/error_code.d.ts +11 -1
  36. package/src/ngtsc/logging/src/console_logger.d.ts +3 -3
  37. package/bundles/chunk-6SPHWESC.js.map +0 -6
  38. package/bundles/chunk-SRFZMXHZ.js +0 -35
  39. package/bundles/chunk-WJXW3ICJ.js.map +0 -6
  40. package/bundles/chunk-YKSGHLGM.js.map +0 -6
  41. /package/bundles/{chunk-3GVOXFUL.js.map → chunk-OYEEKZWP.js.map} +0 -0
  42. /package/bundles/{chunk-TBUSSXUA.js.map → chunk-PCMLSPQF.js.map} +0 -0
  43. /package/bundles/{chunk-CSE6A7DF.js.map → chunk-QJNBIBVG.js.map} +0 -0
  44. /package/bundles/{chunk-SRFZMXHZ.js.map → chunk-XI2RTGAL.js.map} +0 -0
  45. /package/bundles/{chunk-7WBWMZKZ.js.map → chunk-Y4VOTDJT.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "16.2.2",
3
+ "version": "17.0.0-next.1",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -53,8 +53,8 @@
53
53
  "yargs": "^17.2.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@angular/compiler": "16.2.2",
57
- "typescript": ">=4.9.3 <5.2"
56
+ "@angular/compiler": "17.0.0-next.1",
57
+ "typescript": ">=4.9.3 <5.3"
58
58
  },
59
59
  "repository": {
60
60
  "type": "git",
package/src/main.d.ts CHANGED
@@ -8,13 +8,12 @@
8
8
  import ts from 'typescript';
9
9
  import { ParsedConfiguration } from './perform_compile';
10
10
  import * as api from './transformers/api';
11
- type TsickleModule = typeof import('tsickle');
12
11
  export declare function main(args: string[], consoleError?: (s: string) => void, config?: NgcParsedConfiguration, customTransformers?: api.CustomTransformers, programReuse?: {
13
12
  program: api.Program | undefined;
14
- }, modifiedResourceFiles?: Set<string> | null, tsickle?: TsickleModule): number;
13
+ }, modifiedResourceFiles?: Set<string> | null): number;
15
14
  export declare function mainDiagnosticsForTest(args: string[], config?: NgcParsedConfiguration, programReuse?: {
16
15
  program: api.Program | undefined;
17
- }, modifiedResourceFiles?: Set<string> | null, tsickle?: TsickleModule): {
16
+ }, modifiedResourceFiles?: Set<string> | null): {
18
17
  exitCode: number;
19
18
  diagnostics: ReadonlyArray<ts.Diagnostic>;
20
19
  };
@@ -28,4 +27,3 @@ export declare function watchMode(project: string, options: api.CompilerOptions,
28
27
  ready: (cb: () => void) => void;
29
28
  firstCompileResult: readonly ts.Diagnostic[];
30
29
  };
31
- export {};
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { R3DependencyMetadata } from '@angular/compiler';
9
9
  import { ClassDeclaration, CtorParameter, ReflectionHost, UnavailableValue } from '../../../reflection';
10
+ import { CompilationMode } from '../../../transform';
10
11
  export type ConstructorDeps = {
11
12
  deps: R3DependencyMetadata[];
12
13
  } | {
@@ -18,7 +19,7 @@ export interface ConstructorDepError {
18
19
  param: CtorParameter;
19
20
  reason: UnavailableValue;
20
21
  }
21
- export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): ConstructorDeps | null;
22
+ export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean, compilationMode: CompilationMode): ConstructorDeps | null;
22
23
  /**
23
24
  * Convert `ConstructorDeps` into the `R3DependencyMetadata` array for those deps if they're valid,
24
25
  * or into an `'invalid'` signal if they're not.
@@ -26,7 +27,7 @@ export declare function getConstructorDependencies(clazz: ClassDeclaration, refl
26
27
  * This is a companion function to `validateConstructorDependencies` which accepts invalid deps.
27
28
  */
28
29
  export declare function unwrapConstructorDependencies(deps: ConstructorDeps | null): R3DependencyMetadata[] | 'invalid' | null;
29
- export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): R3DependencyMetadata[] | null;
30
+ export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean, compilationMode: CompilationMode): R3DependencyMetadata[] | null;
30
31
  /**
31
32
  * Validate that `ConstructorDeps` does not have any invalid dependencies and convert them into the
32
33
  * `R3DependencyMetadata` array if so, or raise a diagnostic if some deps are invalid.
@@ -6,6 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { R3ClassMetadata } from '@angular/compiler';
9
+ import ts from 'typescript';
9
10
  import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
10
11
  /**
11
12
  * Given a class declaration, generate a call to `setClassMetadata` with the Angular metadata
@@ -16,3 +17,9 @@ import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection'
16
17
  * as a `Statement` for inclusion along with the class.
17
18
  */
18
19
  export declare function extractClassMetadata(clazz: DeclarationNode, reflection: ReflectionHost, isCore: boolean, annotateForClosureCompiler?: boolean, angularDecoratorTransform?: (dec: Decorator) => Decorator): R3ClassMetadata | null;
20
+ /**
21
+ * Recursively recreates all of the `Identifier` descendant nodes with a particular name inside
22
+ * of an AST node, thus removing any references to them. Useful if a particular node has to be
23
+ * taken from one place any emitted to another one exactly as it has been written.
24
+ */
25
+ export declare function removeIdentifierReferences<T extends ts.Node>(node: T, names: string | Set<string>): T;
@@ -12,6 +12,7 @@ import { DependencyTracker } from '../../../incremental/api';
12
12
  import { Resource } from '../../../metadata';
13
13
  import { PartialEvaluator } from '../../../partial_evaluator';
14
14
  import { ClassDeclaration, DeclarationNode, Decorator } from '../../../reflection';
15
+ import { CompilationMode } from '../../../transform';
15
16
  import { TemplateSourceMapping } from '../../../typecheck/api';
16
17
  import { ResourceLoader } from '../../common';
17
18
  /**
@@ -100,9 +101,9 @@ export interface ExtractTemplateOptions {
100
101
  i18nNormalizeLineEndingsInICUs: boolean;
101
102
  enabledBlockTypes: Set<string>;
102
103
  }
103
- export declare function extractTemplate(node: ClassDeclaration, template: TemplateDeclaration, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, options: ExtractTemplateOptions): ParsedTemplateWithSource;
104
+ export declare function extractTemplate(node: ClassDeclaration, template: TemplateDeclaration, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, options: ExtractTemplateOptions, compilationMode: CompilationMode): ParsedTemplateWithSource;
104
105
  export declare function parseTemplateDeclaration(node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, defaultPreserveWhitespaces: boolean): TemplateDeclaration;
105
- export declare function preloadAndParseTemplate(evaluator: PartialEvaluator, resourceLoader: ResourceLoader, depTracker: DependencyTracker | null, preanalyzeTemplateCache: Map<DeclarationNode, ParsedTemplateWithSource>, node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, defaultPreserveWhitespaces: boolean, options: ExtractTemplateOptions): Promise<ParsedTemplateWithSource | null>;
106
+ export declare function preloadAndParseTemplate(evaluator: PartialEvaluator, resourceLoader: ResourceLoader, depTracker: DependencyTracker | null, preanalyzeTemplateCache: Map<DeclarationNode, ParsedTemplateWithSource>, node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, defaultPreserveWhitespaces: boolean, options: ExtractTemplateOptions, compilationMode: CompilationMode): Promise<ParsedTemplateWithSource | null>;
106
107
  export declare function makeResourceNotFoundError(file: string, nodeForError: ts.Node, resourceType: ResourceTypeForDiagnostics): FatalDiagnosticError;
107
108
  /**
108
109
  * Transforms the given decorator to inline external resources. i.e. if the decorator
@@ -14,7 +14,7 @@ import { PartialEvaluator } from '../../../partial_evaluator';
14
14
  import { PerfRecorder } from '../../../perf';
15
15
  import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
16
16
  import { LocalModuleScopeRegistry } from '../../../scope';
17
- import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../../transform';
17
+ import { AnalysisOutput, CompilationMode, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../../transform';
18
18
  import { InjectableClassRegistry, ReferencesRegistry } from '../../common';
19
19
  import { DirectiveSymbol } from './symbol';
20
20
  export interface DirectiveHandlerData {
@@ -46,7 +46,8 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
46
46
  private annotateForClosureCompiler;
47
47
  private perf;
48
48
  private includeClassMetadata;
49
- constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, includeClassMetadata: boolean);
49
+ private readonly compilationMode;
50
+ constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, includeClassMetadata: boolean, compilationMode: CompilationMode);
50
51
  readonly precedence = HandlerPrecedence.PRIMARY;
51
52
  readonly name = "DirectiveDecoratorHandler";
52
53
  detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
@@ -11,6 +11,7 @@ import { ReferenceEmitter } from '../../../imports';
11
11
  import { ClassPropertyMapping, HostDirectiveMeta, InputMapping } from '../../../metadata';
12
12
  import { PartialEvaluator } from '../../../partial_evaluator';
13
13
  import { ClassDeclaration, ClassMember, Decorator, ReflectionHost } from '../../../reflection';
14
+ import { CompilationMode } from '../../../transform';
14
15
  import { ReferencesRegistry } from '../../common';
15
16
  /**
16
17
  * Helper function to extract metadata from a `Directive` or `Component`. `Directive`s without a
@@ -18,7 +19,7 @@ import { ReferencesRegistry } from '../../common';
18
19
  * appear in the declarations of an `NgModule` and additional verification is done when processing
19
20
  * the module.
20
21
  */
21
- export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator | null>, reflector: ReflectionHost, evaluator: PartialEvaluator, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, annotateForClosureCompiler: boolean, defaultSelector?: string | null): {
22
+ export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator | null>, reflector: ReflectionHost, evaluator: PartialEvaluator, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, annotateForClosureCompiler: boolean, compilationMode: CompilationMode, defaultSelector?: string | null): {
22
23
  decorator: Map<string, ts.Expression>;
23
24
  metadata: R3DirectiveMetadata;
24
25
  inputs: ClassPropertyMapping<InputMapping>;
@@ -29,4 +30,5 @@ export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decora
29
30
  } | undefined;
30
31
  export declare function extractQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
31
32
  export declare function extractHostBindings(members: ClassMember[], evaluator: PartialEvaluator, coreModule: string | undefined, metadata?: Map<string, ts.Expression>): ParsedHostBindings;
33
+ export declare function parseDirectiveStyles(directive: Map<string, ts.Expression>, evaluator: PartialEvaluator, compilationMode: CompilationMode): null | string[];
32
34
  export declare function parseFieldStringArrayValue(directive: Map<string, ts.Expression>, field: string, evaluator: PartialEvaluator): null | string[];
@@ -18,7 +18,7 @@ import { AnalysisOutput, CompilationMode, CompileResult, DecoratorHandler, Detec
18
18
  import { InjectableClassRegistry, ReferencesRegistry } from '../../common';
19
19
  export interface NgModuleAnalysis {
20
20
  mod: R3NgModuleMetadata;
21
- inj: Omit<R3InjectorMetadata, 'imports'>;
21
+ inj: R3InjectorMetadata;
22
22
  fac: R3FactoryMetadata;
23
23
  classMetadata: R3ClassMetadata | null;
24
24
  declarations: Reference<ClassDeclaration>[];
@@ -10,7 +10,7 @@ import { InjectableClassRegistry } from '../../annotations/common';
10
10
  import { PartialEvaluator } from '../../partial_evaluator';
11
11
  import { PerfRecorder } from '../../perf';
12
12
  import { ClassDeclaration, Decorator, ReflectionHost } from '../../reflection';
13
- import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../transform';
13
+ import { AnalysisOutput, CompilationMode, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../transform';
14
14
  export interface InjectableHandlerData {
15
15
  meta: R3InjectableMetadata;
16
16
  classMetadata: R3ClassMetadata | null;
@@ -28,6 +28,7 @@ export declare class InjectableDecoratorHandler implements DecoratorHandler<Deco
28
28
  private injectableRegistry;
29
29
  private perf;
30
30
  private includeClassMetadata;
31
+ private readonly compilationMode;
31
32
  /**
32
33
  * What to do if the injectable already contains a ɵprov property.
33
34
  *
@@ -35,7 +36,7 @@ export declare class InjectableDecoratorHandler implements DecoratorHandler<Deco
35
36
  * If false then there is no error and a new ɵprov property is not added.
36
37
  */
37
38
  private errorOnDuplicateProv;
38
- constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean, strictCtorDeps: boolean, injectableRegistry: InjectableClassRegistry, perf: PerfRecorder, includeClassMetadata: boolean,
39
+ constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean, strictCtorDeps: boolean, injectableRegistry: InjectableClassRegistry, perf: PerfRecorder, includeClassMetadata: boolean, compilationMode: CompilationMode,
39
40
  /**
40
41
  * What to do if the injectable already contains a ɵprov property.
41
42
  *
@@ -13,7 +13,7 @@ import { PartialEvaluator } from '../../partial_evaluator';
13
13
  import { PerfRecorder } from '../../perf';
14
14
  import { ClassDeclaration, Decorator, ReflectionHost } from '../../reflection';
15
15
  import { LocalModuleScopeRegistry } from '../../scope';
16
- import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../transform';
16
+ import { AnalysisOutput, CompilationMode, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../transform';
17
17
  import { InjectableClassRegistry } from '../common';
18
18
  export interface PipeHandlerData {
19
19
  meta: R3PipeMetadata;
@@ -39,7 +39,8 @@ export declare class PipeDecoratorHandler implements DecoratorHandler<Decorator,
39
39
  private isCore;
40
40
  private perf;
41
41
  private includeClassMetadata;
42
- constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, injectableRegistry: InjectableClassRegistry, isCore: boolean, perf: PerfRecorder, includeClassMetadata: boolean);
42
+ private readonly compilationMode;
43
+ constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, injectableRegistry: InjectableClassRegistry, isCore: boolean, perf: PerfRecorder, includeClassMetadata: boolean, compilationMode: CompilationMode);
43
44
  readonly precedence = HandlerPrecedence.PRIMARY;
44
45
  readonly name = "PipeDecoratorHandler";
45
46
  detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator> | undefined;
@@ -320,5 +320,15 @@ export declare enum ErrorCode {
320
320
  * functionality, but the current template type-checking configuration does not allow its usage in
321
321
  * type inference.
322
322
  */
323
- SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002
323
+ SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002,
324
+ /**
325
+ * A string is imported from another file to be used as template string for a component in local
326
+ * compilation mode.
327
+ */
328
+ LOCAL_COMPILATION_IMPORTED_TEMPLATE_STRING = 11001,
329
+ /**
330
+ * A string is imported from another file to be used as styles string for a component in local
331
+ * compilation mode.
332
+ */
333
+ LOCAL_COMPILATION_IMPORTED_STYLES_STRING = 11002
324
334
  }
@@ -6,9 +6,9 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { Logger, LogLevel } from './logger';
9
- export declare const DEBUG: string;
10
- export declare const WARN: string;
11
- export declare const ERROR: string;
9
+ export declare const DEBUG = "\u001B[36mDebug:\u001B[0m";
10
+ export declare const WARN = "\u001B[33mWarning:\u001B[0m";
11
+ export declare const ERROR = "\u001B[31mError:\u001B[0m";
12
12
  /**
13
13
  * A simple logger that outputs directly to the Console.
14
14
  *