@angular/compiler-cli 15.2.1 → 16.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 (161) hide show
  1. package/bundles/{chunk-IJECERTO.js → chunk-6PDKXFWN.js} +110 -152
  2. package/bundles/chunk-6PDKXFWN.js.map +6 -0
  3. package/bundles/{chunk-2NLFVEGY.js → chunk-EKTJ7622.js} +1 -2
  4. package/bundles/{chunk-RMPM4VAI.js → chunk-IE2WWKOE.js} +393 -618
  5. package/bundles/chunk-IE2WWKOE.js.map +6 -0
  6. package/bundles/{chunk-7GNUPQOI.js → chunk-JEQIMWEA.js} +5 -5
  7. package/bundles/{chunk-TGEKDMUX.js → chunk-JKV3J53A.js} +3 -3
  8. package/bundles/{chunk-TGEKDMUX.js.map → chunk-JKV3J53A.js.map} +1 -1
  9. package/bundles/{chunk-YZWN2KWE.js → chunk-N6MSUQVH.js} +1 -2
  10. package/bundles/{chunk-5WBIJMZH.js → chunk-Q2TY6LB3.js} +2 -2
  11. package/bundles/{chunk-ZF3IVDQ2.js → chunk-QQGJEWBQ.js} +1 -10
  12. package/bundles/chunk-QQGJEWBQ.js.map +6 -0
  13. package/bundles/{chunk-IYYB2HTK.js → chunk-TK3GHMT6.js} +1 -6
  14. package/bundles/chunk-TK3GHMT6.js.map +6 -0
  15. package/bundles/{chunk-P5LISIUG.js → chunk-XS6XKZQP.js} +12 -22
  16. package/bundles/chunk-XS6XKZQP.js.map +6 -0
  17. package/bundles/index.js +13 -13
  18. package/bundles/linker/babel/index.js +8 -8
  19. package/bundles/linker/index.js +4 -4
  20. package/bundles/private/bazel.js +1 -1
  21. package/bundles/private/localize.js +1 -1
  22. package/bundles/private/migrations.js +5 -5
  23. package/bundles/private/tooling.js +3 -3
  24. package/bundles/src/bin/ng_xi18n.js +7 -7
  25. package/bundles/src/bin/ngc.js +7 -7
  26. package/bundles_metadata.json +1 -1
  27. package/package.json +4 -17
  28. package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -3
  29. package/src/ngtsc/core/api/src/adapter.d.ts +0 -7
  30. package/src/ngtsc/core/api/src/options.d.ts +2 -2
  31. package/src/ngtsc/core/api/src/public_options.d.ts +0 -25
  32. package/src/ngtsc/core/src/host.d.ts +6 -6
  33. package/src/ngtsc/incremental/semantic_graph/src/graph.d.ts +1 -1
  34. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +3 -1
  35. package/src/ngtsc/shims/api.d.ts +0 -19
  36. package/src/ngtsc/shims/index.d.ts +0 -2
  37. package/src/ngtsc/transform/src/compilation.d.ts +1 -1
  38. package/src/transformers/api.d.ts +0 -5
  39. package/bundles/chunk-B57SP4JB.js +0 -29
  40. package/bundles/chunk-B57SP4JB.js.map +0 -6
  41. package/bundles/chunk-IJECERTO.js.map +0 -6
  42. package/bundles/chunk-IYYB2HTK.js.map +0 -6
  43. package/bundles/chunk-K7P4IHT5.js +0 -115
  44. package/bundles/chunk-K7P4IHT5.js.map +0 -6
  45. package/bundles/chunk-P5LISIUG.js.map +0 -6
  46. package/bundles/chunk-PKXB2WOZ.js +0 -2187
  47. package/bundles/chunk-PKXB2WOZ.js.map +0 -6
  48. package/bundles/chunk-RMPM4VAI.js.map +0 -6
  49. package/bundles/chunk-WN75SNW4.js +0 -5265
  50. package/bundles/chunk-WN75SNW4.js.map +0 -6
  51. package/bundles/chunk-ZF3IVDQ2.js.map +0 -6
  52. package/bundles/ngcc/index.js +0 -52
  53. package/bundles/ngcc/index.js.map +0 -6
  54. package/bundles/ngcc/main-ngcc.js +0 -49
  55. package/bundles/ngcc/main-ngcc.js.map +0 -6
  56. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -114
  57. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +0 -6
  58. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +0 -34
  59. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +0 -6
  60. package/ngcc/index.d.ts +0 -19
  61. package/ngcc/main-ngcc.d.ts +0 -2
  62. package/ngcc/src/analysis/decoration_analyzer.d.ts +0 -80
  63. package/ngcc/src/analysis/migration_host.d.ts +0 -22
  64. package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +0 -61
  65. package/ngcc/src/analysis/ngcc_references_registry.d.ts +0 -34
  66. package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +0 -42
  67. package/ngcc/src/analysis/private_declarations_analyzer.d.ts +0 -29
  68. package/ngcc/src/analysis/types.d.ts +0 -29
  69. package/ngcc/src/analysis/util.d.ts +0 -11
  70. package/ngcc/src/command_line_options.d.ts +0 -3
  71. package/ngcc/src/constants.d.ts +0 -9
  72. package/ngcc/src/dependencies/commonjs_dependency_host.d.ts +0 -20
  73. package/ngcc/src/dependencies/dependency_host.d.ts +0 -77
  74. package/ngcc/src/dependencies/dependency_resolver.d.ts +0 -102
  75. package/ngcc/src/dependencies/dts_dependency_host.d.ts +0 -20
  76. package/ngcc/src/dependencies/esm_dependency_host.d.ts +0 -93
  77. package/ngcc/src/dependencies/module_resolver.d.ts +0 -134
  78. package/ngcc/src/dependencies/umd_dependency_host.d.ts +0 -9
  79. package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.d.ts +0 -41
  80. package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +0 -41
  81. package/ngcc/src/entry_point_finder/interface.d.ts +0 -14
  82. package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +0 -61
  83. package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +0 -95
  84. package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +0 -67
  85. package/ngcc/src/entry_point_finder/utils.d.ts +0 -38
  86. package/ngcc/src/execution/analyze_entry_points.d.ts +0 -9
  87. package/ngcc/src/execution/api.d.ts +0 -27
  88. package/ngcc/src/execution/cluster/api.d.ts +0 -51
  89. package/ngcc/src/execution/cluster/executor.d.ts +0 -29
  90. package/ngcc/src/execution/cluster/master.d.ts +0 -57
  91. package/ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts +0 -8
  92. package/ngcc/src/execution/cluster/package_json_updater.d.ts +0 -22
  93. package/ngcc/src/execution/cluster/utils.d.ts +0 -44
  94. package/ngcc/src/execution/cluster/worker.d.ts +0 -10
  95. package/ngcc/src/execution/create_compile_function.d.ts +0 -10
  96. package/ngcc/src/execution/single_process_executor.d.ts +0 -34
  97. package/ngcc/src/execution/tasks/api.d.ts +0 -141
  98. package/ngcc/src/execution/tasks/completion.d.ts +0 -41
  99. package/ngcc/src/execution/tasks/queues/base_task_queue.d.ts +0 -38
  100. package/ngcc/src/execution/tasks/queues/parallel_task_queue.d.ts +0 -27
  101. package/ngcc/src/execution/tasks/queues/serial_task_queue.d.ts +0 -16
  102. package/ngcc/src/execution/tasks/utils.d.ts +0 -57
  103. package/ngcc/src/host/commonjs_host.d.ts +0 -69
  104. package/ngcc/src/host/commonjs_umd_utils.d.ts +0 -146
  105. package/ngcc/src/host/delegating_host.d.ts +0 -43
  106. package/ngcc/src/host/esm2015_host.d.ts +0 -935
  107. package/ngcc/src/host/esm5_host.d.ts +0 -299
  108. package/ngcc/src/host/ngcc_host.d.ts +0 -87
  109. package/ngcc/src/host/umd_host.d.ts +0 -85
  110. package/ngcc/src/host/utils.d.ts +0 -9
  111. package/ngcc/src/locking/async_locker.d.ts +0 -34
  112. package/ngcc/src/locking/lock_file.d.ts +0 -31
  113. package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +0 -44
  114. package/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.d.ts +0 -1
  115. package/ngcc/src/locking/lock_file_with_child_process/util.d.ts +0 -16
  116. package/ngcc/src/locking/sync_locker.d.ts +0 -35
  117. package/ngcc/src/main.d.ts +0 -17
  118. package/ngcc/src/migrations/migration.d.ts +0 -59
  119. package/ngcc/src/migrations/missing_injectable_migration.d.ts +0 -35
  120. package/ngcc/src/migrations/undecorated_child_migration.d.ts +0 -15
  121. package/ngcc/src/migrations/undecorated_parent_migration.d.ts +0 -51
  122. package/ngcc/src/migrations/utils.d.ts +0 -41
  123. package/ngcc/src/ngcc_options.d.ts +0 -155
  124. package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +0 -16
  125. package/ngcc/src/packages/build_marker.d.ts +0 -44
  126. package/ngcc/src/packages/bundle_program.d.ts +0 -35
  127. package/ngcc/src/packages/configuration.d.ts +0 -222
  128. package/ngcc/src/packages/entry_point.d.ts +0 -109
  129. package/ngcc/src/packages/entry_point_bundle.d.ts +0 -46
  130. package/ngcc/src/packages/entry_point_manifest.d.ts +0 -79
  131. package/ngcc/src/packages/ngcc_compiler_host.d.ts +0 -36
  132. package/ngcc/src/packages/patch_ts_expando_initializer.d.ts +0 -41
  133. package/ngcc/src/packages/source_file_cache.d.ts +0 -97
  134. package/ngcc/src/packages/transformer.d.ts +0 -70
  135. package/ngcc/src/path_mappings.d.ts +0 -19
  136. package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +0 -34
  137. package/ngcc/src/rendering/dts_renderer.d.ts +0 -51
  138. package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +0 -35
  139. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +0 -84
  140. package/ngcc/src/rendering/ngcc_import_rewriter.d.ts +0 -13
  141. package/ngcc/src/rendering/renderer.d.ts +0 -72
  142. package/ngcc/src/rendering/rendering_formatter.d.ts +0 -37
  143. package/ngcc/src/rendering/source_maps.d.ts +0 -23
  144. package/ngcc/src/rendering/umd_rendering_formatter.d.ts +0 -54
  145. package/ngcc/src/rendering/utils.d.ts +0 -24
  146. package/ngcc/src/utils.d.ts +0 -112
  147. package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +0 -44
  148. package/ngcc/src/writing/cleaning/package_cleaner.d.ts +0 -38
  149. package/ngcc/src/writing/cleaning/utils.d.ts +0 -15
  150. package/ngcc/src/writing/file_writer.d.ts +0 -28
  151. package/ngcc/src/writing/in_place_file_writer.d.ts +0 -28
  152. package/ngcc/src/writing/new_entry_point_file_writer.d.ts +0 -48
  153. package/ngcc/src/writing/package_json_updater.d.ts +0 -98
  154. package/src/ngtsc/shims/src/factory_generator.d.ts +0 -24
  155. package/src/ngtsc/shims/src/summary_generator.d.ts +0 -15
  156. package/src/ngtsc/ts_compatibility/index.d.ts +0 -8
  157. package/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +0 -45
  158. /package/bundles/{chunk-2NLFVEGY.js.map → chunk-EKTJ7622.js.map} +0 -0
  159. /package/bundles/{chunk-7GNUPQOI.js.map → chunk-JEQIMWEA.js.map} +0 -0
  160. /package/bundles/{chunk-YZWN2KWE.js.map → chunk-N6MSUQVH.js.map} +0 -0
  161. /package/bundles/{chunk-5WBIJMZH.js.map → chunk-Q2TY6LB3.js.map} +0 -0
package/ngcc/index.d.ts DELETED
@@ -1,19 +0,0 @@
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 { AsyncNgccOptions, SyncNgccOptions } from './src/ngcc_options';
9
- export { ConsoleLogger, Logger, LogLevel } from '../src/ngtsc/logging';
10
- export { AsyncNgccOptions, clearTsConfigCache, NgccOptions, SyncNgccOptions } from './src/ngcc_options';
11
- export { PathMappings } from './src/path_mappings';
12
- export declare function process<T extends AsyncNgccOptions | SyncNgccOptions>(options: T): T extends AsyncNgccOptions ? Promise<void> : void;
13
- /**
14
- * Absolute file path that points to the `ngcc` command line entry-point.
15
- *
16
- * This can be used by the Angular CLI to spawn a process running ngcc using
17
- * command line options.
18
- */
19
- export declare const ngccMainFilePath: string;
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,80 +0,0 @@
1
- import ts from 'typescript';
2
- import { ParsedConfiguration } from '../../..';
3
- import { ReferencesRegistry, ResourceLoader } from '../../../src/ngtsc/annotations';
4
- import { InjectableClassRegistry } from '../../../src/ngtsc/annotations/common';
5
- import { CycleAnalyzer, ImportGraph } from '../../../src/ngtsc/cycles';
6
- import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
7
- import { ModuleResolver, PrivateExportAliasingHost, ReferenceEmitter } from '../../../src/ngtsc/imports';
8
- import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
9
- import { CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, HostDirectivesResolver, LocalMetadataRegistry } from '../../../src/ngtsc/metadata';
10
- import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
11
- import { LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver, TypeCheckScopeRegistry } from '../../../src/ngtsc/scope';
12
- import { DecoratorHandler } from '../../../src/ngtsc/transform';
13
- import { NgccReflectionHost } from '../host/ngcc_host';
14
- import { Migration } from '../migrations/migration';
15
- import { EntryPointBundle } from '../packages/entry_point_bundle';
16
- import { NgccTraitCompiler } from './ngcc_trait_compiler';
17
- import { CompiledFile, DecorationAnalyses } from './types';
18
- /**
19
- * Simple class that resolves and loads files directly from the filesystem.
20
- */
21
- declare class NgccResourceLoader implements ResourceLoader {
22
- private fs;
23
- constructor(fs: ReadonlyFileSystem);
24
- canPreload: boolean;
25
- canPreprocess: boolean;
26
- preload(): undefined | Promise<void>;
27
- preprocessInline(): Promise<string>;
28
- load(url: string): string;
29
- resolve(url: string, containingFile: string): string;
30
- }
31
- /**
32
- * This Analyzer will analyze the files that have decorated classes that need to be transformed.
33
- */
34
- export declare class DecorationAnalyzer {
35
- private fs;
36
- private bundle;
37
- private reflectionHost;
38
- private referencesRegistry;
39
- private diagnosticHandler;
40
- private tsConfig;
41
- private program;
42
- private options;
43
- private host;
44
- private typeChecker;
45
- private rootDirs;
46
- private packagePath;
47
- private isCore;
48
- private compilerOptions;
49
- moduleResolver: ModuleResolver;
50
- resourceManager: NgccResourceLoader;
51
- metaRegistry: LocalMetadataRegistry;
52
- dtsMetaReader: DtsMetadataReader;
53
- fullMetaReader: CompoundMetadataReader;
54
- refEmitter: ReferenceEmitter;
55
- aliasingHost: PrivateExportAliasingHost | null;
56
- dtsModuleScopeResolver: MetadataDtsModuleScopeResolver;
57
- scopeRegistry: LocalModuleScopeRegistry;
58
- fullRegistry: CompoundMetadataRegistry;
59
- evaluator: PartialEvaluator;
60
- importGraph: ImportGraph;
61
- cycleAnalyzer: CycleAnalyzer;
62
- injectableRegistry: InjectableClassRegistry;
63
- hostDirectivesResolver: HostDirectivesResolver;
64
- typeCheckScopeRegistry: TypeCheckScopeRegistry;
65
- handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[];
66
- compiler: NgccTraitCompiler;
67
- migrations: Migration[];
68
- constructor(fs: ReadonlyFileSystem, bundle: EntryPointBundle, reflectionHost: NgccReflectionHost, referencesRegistry: ReferencesRegistry, diagnosticHandler?: (error: ts.Diagnostic) => void, tsConfig?: ParsedConfiguration | null);
69
- /**
70
- * Analyze a program to find all the decorated files should be transformed.
71
- *
72
- * @returns a map of the source files to the analysis for those files.
73
- */
74
- analyzeProgram(): DecorationAnalyses;
75
- protected applyMigrations(): void;
76
- protected reportDiagnostics(): void;
77
- protected compileFile(sourceFile: ts.SourceFile): CompiledFile;
78
- private getReexportsForSourceFile;
79
- }
80
- export {};
@@ -1,22 +0,0 @@
1
- import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
2
- import { MetadataReader } from '../../../src/ngtsc/metadata';
3
- import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
4
- import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
5
- import { HandlerFlags } from '../../../src/ngtsc/transform';
6
- import { NgccReflectionHost } from '../host/ngcc_host';
7
- import { MigrationHost } from '../migrations/migration';
8
- import { NgccTraitCompiler } from './ngcc_trait_compiler';
9
- /**
10
- * The standard implementation of `MigrationHost`, which is created by the `DecorationAnalyzer`.
11
- */
12
- export declare class DefaultMigrationHost implements MigrationHost {
13
- readonly reflectionHost: NgccReflectionHost;
14
- readonly metadata: MetadataReader;
15
- readonly evaluator: PartialEvaluator;
16
- private compiler;
17
- private entryPointPath;
18
- constructor(reflectionHost: NgccReflectionHost, metadata: MetadataReader, evaluator: PartialEvaluator, compiler: NgccTraitCompiler, entryPointPath: AbsoluteFsPath);
19
- injectSyntheticDecorator(clazz: ClassDeclaration, decorator: Decorator, flags?: HandlerFlags): void;
20
- getAllDecorators(clazz: ClassDeclaration): Decorator[] | null;
21
- isInScope(clazz: ClassDeclaration): boolean;
22
- }
@@ -1,61 +0,0 @@
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 ts from 'typescript';
9
- import { ReferencesRegistry } from '../../../src/ngtsc/annotations';
10
- import { Reference } from '../../../src/ngtsc/imports';
11
- import { ClassDeclaration, DeclarationNode } from '../../../src/ngtsc/reflection';
12
- import { NgccReflectionHost } from '../host/ngcc_host';
13
- /**
14
- * A structure returned from `getModuleWithProvidersFunctions()` that describes functions
15
- * that return ModuleWithProviders objects.
16
- */
17
- export interface ModuleWithProvidersInfo {
18
- /**
19
- * The name of the declared function.
20
- */
21
- name: string;
22
- /**
23
- * The declaration of the function that returns the `ModuleWithProviders` object.
24
- */
25
- declaration: ts.SignatureDeclaration;
26
- /**
27
- * Declaration of the containing class (if this is a method)
28
- */
29
- container: DeclarationNode | null;
30
- /**
31
- * The declaration of the class that the `ngModule` property on the `ModuleWithProviders` object
32
- * refers to.
33
- */
34
- ngModule: Reference<ClassDeclaration>;
35
- }
36
- export type ModuleWithProvidersAnalyses = Map<ts.SourceFile, ModuleWithProvidersInfo[]>;
37
- export declare const ModuleWithProvidersAnalyses: MapConstructor;
38
- export declare class ModuleWithProvidersAnalyzer {
39
- private host;
40
- private typeChecker;
41
- private referencesRegistry;
42
- private processDts;
43
- private evaluator;
44
- constructor(host: NgccReflectionHost, typeChecker: ts.TypeChecker, referencesRegistry: ReferencesRegistry, processDts: boolean);
45
- analyzeProgram(program: ts.Program): ModuleWithProvidersAnalyses;
46
- private getRootFiles;
47
- private getModuleWithProvidersFunctions;
48
- /**
49
- * Parse a function/method node (or its implementation), to see if it returns a
50
- * `ModuleWithProviders` object.
51
- * @param name The name of the function.
52
- * @param node the node to check - this could be a function, a method or a variable declaration.
53
- * @param implementation the actual function expression if `node` is a variable declaration.
54
- * @param container the class that contains the function, if it is a method.
55
- * @returns info about the function if it does return a `ModuleWithProviders` object; `null`
56
- * otherwise.
57
- */
58
- private parseForModuleWithProviders;
59
- private getDtsModuleWithProvidersFunction;
60
- private resolveNgModuleReference;
61
- }
@@ -1,34 +0,0 @@
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 ts from 'typescript';
9
- import { ReferencesRegistry } from '../../../src/ngtsc/annotations';
10
- import { Reference } from '../../../src/ngtsc/imports';
11
- import { Declaration, DeclarationNode, ReflectionHost } from '../../../src/ngtsc/reflection';
12
- /**
13
- * This is a place for DecoratorHandlers to register references that they
14
- * find in their analysis of the code.
15
- *
16
- * This registry is used to ensure that these references are publicly exported
17
- * from libraries that are compiled by ngcc.
18
- */
19
- export declare class NgccReferencesRegistry implements ReferencesRegistry {
20
- private host;
21
- private map;
22
- constructor(host: ReflectionHost);
23
- /**
24
- * Register one or more references in the registry.
25
- * Only `ResolveReference` references are stored. Other types are ignored.
26
- * @param references A collection of references to register.
27
- */
28
- add(source: DeclarationNode, ...references: Reference<DeclarationNode>[]): void;
29
- /**
30
- * Create and return a mapping for the registered resolved references.
31
- * @returns A map of reference identifiers to reference declarations.
32
- */
33
- getDeclarationMap(): Map<ts.Identifier, Declaration>;
34
- }
@@ -1,42 +0,0 @@
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 ts from 'typescript';
9
- import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
10
- import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
11
- import { DecoratorHandler, HandlerFlags, Trait, TraitCompiler } from '../../../src/ngtsc/transform';
12
- import { NgccReflectionHost } from '../host/ngcc_host';
13
- /**
14
- * Specializes the `TraitCompiler` for ngcc purposes. Mainly, this includes an alternative way of
15
- * scanning for classes to compile using the reflection host's `findClassSymbols`, together with
16
- * support to inject synthetic decorators into the compilation for ad-hoc migrations that ngcc
17
- * performs.
18
- */
19
- export declare class NgccTraitCompiler extends TraitCompiler {
20
- private ngccReflector;
21
- constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], ngccReflector: NgccReflectionHost);
22
- get analyzedFiles(): ts.SourceFile[];
23
- /**
24
- * Analyzes the source file in search for classes to process. For any class that is found in the
25
- * file, a `ClassRecord` is created and the source file is included in the `analyzedFiles` array.
26
- */
27
- analyzeFile(sf: ts.SourceFile): void;
28
- /**
29
- * Associate a new synthesized decorator, which did not appear in the original source, with a
30
- * given class.
31
- * @param clazz the class to receive the new decorator.
32
- * @param decorator the decorator to inject.
33
- * @param flags optional bitwise flag to influence the compilation of the decorator.
34
- */
35
- injectSyntheticDecorator(clazz: ClassDeclaration, decorator: Decorator, flags?: HandlerFlags): Trait<unknown, unknown, SemanticSymbol | null, unknown>[];
36
- /**
37
- * Returns all decorators that have been recognized for the provided class, including any
38
- * synthetically injected decorators.
39
- * @param clazz the declaration for which the decorators are returned.
40
- */
41
- getAllDecorators(clazz: ClassDeclaration): Decorator[] | null;
42
- }
@@ -1,29 +0,0 @@
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 ts from 'typescript';
9
- import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
10
- import { NgccReflectionHost } from '../host/ngcc_host';
11
- import { NgccReferencesRegistry } from './ngcc_references_registry';
12
- export interface ExportInfo {
13
- identifier: string;
14
- from: AbsoluteFsPath;
15
- dtsFrom?: AbsoluteFsPath | null;
16
- }
17
- export type PrivateDeclarationsAnalyses = ExportInfo[];
18
- /**
19
- * This class will analyze a program to find all the declared classes
20
- * (i.e. on an NgModule) that are not publicly exported via an entry-point.
21
- */
22
- export declare class PrivateDeclarationsAnalyzer {
23
- private host;
24
- private referencesRegistry;
25
- constructor(host: NgccReflectionHost, referencesRegistry: NgccReferencesRegistry);
26
- analyzeProgram(program: ts.Program): PrivateDeclarationsAnalyses;
27
- private getRootFiles;
28
- private getPrivateDeclarations;
29
- }
@@ -1,29 +0,0 @@
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 { ConstantPool } from '@angular/compiler';
9
- import ts from 'typescript';
10
- import { Reexport } from '../../../src/ngtsc/imports';
11
- import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
12
- import { CompileResult } from '../../../src/ngtsc/transform';
13
- export interface CompiledClass {
14
- name: string;
15
- decorators: Decorator[] | null;
16
- declaration: ClassDeclaration;
17
- compilation: CompileResult[];
18
- }
19
- export interface CompiledFile {
20
- compiledClasses: CompiledClass[];
21
- sourceFile: ts.SourceFile;
22
- constantPool: ConstantPool;
23
- /**
24
- * Any re-exports which should be added next to this class, both in .js and (if possible) .d.ts.
25
- */
26
- reexports: Reexport[];
27
- }
28
- export type DecorationAnalyses = Map<ts.SourceFile, CompiledFile>;
29
- export declare const DecorationAnalyses: MapConstructor;
@@ -1,11 +0,0 @@
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 { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
9
- import { DependencyTracker } from '../../../src/ngtsc/incremental/api';
10
- export declare function isWithinPackage(packagePath: AbsoluteFsPath, filePath: AbsoluteFsPath): boolean;
11
- export declare const NOOP_DEPENDENCY_TRACKER: DependencyTracker;
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { NgccOptions } from './ngcc_options';
3
- export declare function parseCommandLineOptions(args: string[]): NgccOptions;
@@ -1,9 +0,0 @@
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
- export declare const IMPORT_PREFIX = "\u0275ngcc";
9
- export declare const NGCC_TIMED_OUT_EXIT_CODE = 177;
@@ -1,20 +0,0 @@
1
- import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
2
- import { DependencyHostBase } from './dependency_host';
3
- /**
4
- * Helper functions for computing dependencies.
5
- */
6
- export declare class CommonJsDependencyHost extends DependencyHostBase {
7
- protected canSkipFile(fileContents: string): boolean;
8
- protected extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
9
- }
10
- /**
11
- * Check whether a source file needs to be parsed for imports.
12
- * This is a performance short-circuit, which saves us from creating
13
- * a TypeScript AST unnecessarily.
14
- *
15
- * @param source The content of the source file to check.
16
- *
17
- * @returns false if there are definitely no require calls
18
- * in this file, true otherwise.
19
- */
20
- export declare function hasRequireCalls(source: string): boolean;
@@ -1,77 +0,0 @@
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 { AbsoluteFsPath, PathSegment, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
9
- import { EntryPoint } from '../packages/entry_point';
10
- import { ModuleResolver } from './module_resolver';
11
- export interface DependencyHost {
12
- collectDependencies(entryPointPath: AbsoluteFsPath, { dependencies, missing, deepImports }: DependencyInfo): void;
13
- }
14
- export interface DependencyInfo {
15
- dependencies: Set<AbsoluteFsPath>;
16
- missing: Set<AbsoluteFsPath | PathSegment>;
17
- deepImports: Set<AbsoluteFsPath>;
18
- }
19
- export interface EntryPointWithDependencies {
20
- entryPoint: EntryPoint;
21
- depInfo: DependencyInfo;
22
- }
23
- export declare function createDependencyInfo(): DependencyInfo;
24
- export declare abstract class DependencyHostBase implements DependencyHost {
25
- protected fs: ReadonlyFileSystem;
26
- protected moduleResolver: ModuleResolver;
27
- constructor(fs: ReadonlyFileSystem, moduleResolver: ModuleResolver);
28
- /**
29
- * Find all the dependencies for the entry-point at the given path.
30
- *
31
- * @param entryPointPath The absolute path to the JavaScript file that represents an entry-point.
32
- * @param dependencyInfo An object containing information about the dependencies of the
33
- * entry-point, including those that were missing or deep imports into other entry-points. The
34
- * sets in this object will be updated with new information about the entry-point's dependencies.
35
- */
36
- collectDependencies(entryPointPath: AbsoluteFsPath, { dependencies, missing, deepImports }: DependencyInfo): void;
37
- /**
38
- * Find all the dependencies for the provided paths.
39
- *
40
- * @param files The list of absolute paths of JavaScript files to scan for dependencies.
41
- * @param dependencyInfo An object containing information about the dependencies of the
42
- * entry-point, including those that were missing or deep imports into other entry-points. The
43
- * sets in this object will be updated with new information about the entry-point's dependencies.
44
- */
45
- collectDependenciesInFiles(files: AbsoluteFsPath[], { dependencies, missing, deepImports }: DependencyInfo): void;
46
- /**
47
- * Compute the dependencies of the given file.
48
- *
49
- * @param file An absolute path to the file whose dependencies we want to get.
50
- * @param dependencies A set that will have the absolute paths of resolved entry points added to
51
- * it.
52
- * @param missing A set that will have the dependencies that could not be found added to it.
53
- * @param deepImports A set that will have the import paths that exist but cannot be mapped to
54
- * entry-points, i.e. deep-imports.
55
- * @param alreadySeen A set that is used to track internal dependencies to prevent getting stuck
56
- * in a circular dependency loop.
57
- */
58
- protected recursivelyCollectDependencies(file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): void;
59
- protected abstract canSkipFile(fileContents: string): boolean;
60
- protected abstract extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
61
- /**
62
- * Resolve the given `importPath` from `file` and add it to the appropriate set.
63
- *
64
- * If the import is local to this package then follow it by calling
65
- * `recursivelyCollectDependencies()`.
66
- *
67
- * @returns `true` if the import was resolved (to an entry-point, a local import, or a
68
- * deep-import), `false` otherwise.
69
- */
70
- protected processImport(importPath: string, file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): boolean;
71
- /**
72
- * Processes the file if it has not already been seen. This will also recursively process
73
- * all files that are imported from the file, while taking the set of already seen files
74
- * into account.
75
- */
76
- protected processFile(file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): void;
77
- }
@@ -1,102 +0,0 @@
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 { DepGraph } from 'dependency-graph';
9
- import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
10
- import { Logger } from '../../../src/ngtsc/logging';
11
- import { NgccConfiguration } from '../packages/configuration';
12
- import { EntryPoint, EntryPointFormat } from '../packages/entry_point';
13
- import { PartiallyOrderedList } from '../utils';
14
- import { DependencyHost, EntryPointWithDependencies } from './dependency_host';
15
- /**
16
- * Holds information about entry points that are removed because
17
- * they have dependencies that are missing (directly or transitively).
18
- *
19
- * This might not be an error, because such an entry point might not actually be used
20
- * in the application. If it is used then the `ngc` application compilation would
21
- * fail also, so we don't need ngcc to catch this.
22
- *
23
- * For example, consider an application that uses the `@angular/router` package.
24
- * This package includes an entry-point called `@angular/router/upgrade`, which has a dependency
25
- * on the `@angular/upgrade` package.
26
- * If the application never uses code from `@angular/router/upgrade` then there is no need for
27
- * `@angular/upgrade` to be installed.
28
- * In this case the ngcc tool should just ignore the `@angular/router/upgrade` end-point.
29
- */
30
- export interface InvalidEntryPoint {
31
- entryPoint: EntryPoint;
32
- missingDependencies: string[];
33
- }
34
- /**
35
- * Holds information about dependencies of an entry-point that do not need to be processed
36
- * by the ngcc tool.
37
- *
38
- * For example, the `rxjs` package does not contain any Angular decorators that need to be
39
- * compiled and so this can be safely ignored by ngcc.
40
- */
41
- export interface IgnoredDependency {
42
- entryPoint: EntryPoint;
43
- dependencyPath: string;
44
- }
45
- export interface DependencyDiagnostics {
46
- invalidEntryPoints: InvalidEntryPoint[];
47
- ignoredDependencies: IgnoredDependency[];
48
- }
49
- /**
50
- * Represents a partially ordered list of entry-points.
51
- *
52
- * The entry-points' order/precedence is such that dependent entry-points always come later than
53
- * their dependencies in the list.
54
- *
55
- * See `DependencyResolver#sortEntryPointsByDependency()`.
56
- */
57
- export type PartiallyOrderedEntryPoints = PartiallyOrderedList<EntryPoint>;
58
- /**
59
- * A list of entry-points, sorted by their dependencies, and the dependency graph.
60
- *
61
- * The `entryPoints` array will be ordered so that no entry point depends upon an entry point that
62
- * appears later in the array.
63
- *
64
- * Some entry points or their dependencies may have been ignored. These are captured for
65
- * diagnostic purposes in `invalidEntryPoints` and `ignoredDependencies` respectively.
66
- */
67
- export interface SortedEntryPointsInfo extends DependencyDiagnostics {
68
- entryPoints: PartiallyOrderedEntryPoints;
69
- graph: DepGraph<EntryPoint>;
70
- }
71
- /**
72
- * A class that resolves dependencies between entry-points.
73
- */
74
- export declare class DependencyResolver {
75
- private fs;
76
- private logger;
77
- private config;
78
- private hosts;
79
- private typingsHost;
80
- constructor(fs: ReadonlyFileSystem, logger: Logger, config: NgccConfiguration, hosts: Partial<Record<EntryPointFormat, DependencyHost>>, typingsHost: DependencyHost);
81
- /**
82
- * Sort the array of entry points so that the dependant entry points always come later than
83
- * their dependencies in the array.
84
- * @param entryPoints An array entry points to sort.
85
- * @param target If provided, only return entry-points depended on by this entry-point.
86
- * @returns the result of sorting the entry points by dependency.
87
- */
88
- sortEntryPointsByDependency(entryPoints: EntryPointWithDependencies[], target?: EntryPoint): SortedEntryPointsInfo;
89
- getEntryPointWithDependencies(entryPoint: EntryPoint): EntryPointWithDependencies;
90
- /**
91
- * Computes a dependency graph of the given entry-points.
92
- *
93
- * The graph only holds entry-points that ngcc cares about and whose dependencies
94
- * (direct and transitive) all exist.
95
- */
96
- private computeDependencyGraph;
97
- private getEntryPointFormatInfo;
98
- /**
99
- * Filter out the deepImports that can be ignored, according to this entryPoint's config.
100
- */
101
- private filterIgnorableDeepImports;
102
- }
@@ -1,20 +0,0 @@
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 { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
9
- import { PathMappings } from '../path_mappings';
10
- import { EsmDependencyHost } from './esm_dependency_host';
11
- /**
12
- * Helper functions for computing dependencies via typings files.
13
- */
14
- export declare class DtsDependencyHost extends EsmDependencyHost {
15
- constructor(fs: ReadonlyFileSystem, pathMappings?: PathMappings);
16
- /**
17
- * Attempts to process the `importPath` directly and also inside `@types/...`.
18
- */
19
- protected processImport(importPath: string, file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): boolean;
20
- }