@angular/compiler-cli 15.2.0 → 16.0.0-next.0

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 (154) hide show
  1. package/bundles/{chunk-PKSKJEUS.js → chunk-2DMH5JXJ.js} +9 -18
  2. package/bundles/{chunk-PKSKJEUS.js.map → chunk-2DMH5JXJ.js.map} +1 -1
  3. package/bundles/{chunk-P6SWFK2U.js → chunk-4TCRZYAK.js} +2 -2
  4. package/bundles/{chunk-NJMZRTB6.js → chunk-54RHUHYB.js} +1 -2
  5. package/bundles/{chunk-2PLRZDNU.js → chunk-6CARGXRJ.js} +5 -5
  6. package/bundles/{chunk-O4JLZZWJ.js → chunk-EDWIBG7R.js} +1 -10
  7. package/bundles/chunk-EDWIBG7R.js.map +6 -0
  8. package/bundles/{chunk-6ZJFIQBG.js → chunk-GYHDNUIK.js} +1 -2
  9. package/bundles/{chunk-2OF2AI57.js → chunk-IS6KZYEA.js} +377 -609
  10. package/bundles/chunk-IS6KZYEA.js.map +6 -0
  11. package/bundles/{chunk-J3L7WZP3.js → chunk-JHMH3CX2.js} +3 -3
  12. package/bundles/{chunk-ZCBRXUPO.js → chunk-K2A5WD7L.js} +1 -6
  13. package/bundles/chunk-K2A5WD7L.js.map +6 -0
  14. package/bundles/{chunk-QRHWLC7U.js → chunk-PSGRCFPQ.js} +2 -2
  15. package/bundles/index.js +13 -13
  16. package/bundles/linker/babel/index.js +8 -8
  17. package/bundles/linker/index.js +4 -4
  18. package/bundles/private/bazel.js +1 -1
  19. package/bundles/private/localize.js +1 -1
  20. package/bundles/private/migrations.js +5 -5
  21. package/bundles/private/tooling.js +3 -3
  22. package/bundles/src/bin/ng_xi18n.js +7 -7
  23. package/bundles/src/bin/ngc.js +7 -7
  24. package/bundles_metadata.json +1 -1
  25. package/package.json +2 -15
  26. package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -3
  27. package/src/ngtsc/core/api/src/adapter.d.ts +0 -7
  28. package/src/ngtsc/core/api/src/options.d.ts +2 -2
  29. package/src/ngtsc/core/api/src/public_options.d.ts +0 -25
  30. package/src/ngtsc/core/src/host.d.ts +3 -5
  31. package/src/ngtsc/shims/api.d.ts +0 -19
  32. package/src/ngtsc/shims/index.d.ts +0 -2
  33. package/src/transformers/api.d.ts +0 -5
  34. package/bundles/chunk-2OF2AI57.js.map +0 -6
  35. package/bundles/chunk-7DUI3BSX.js +0 -29
  36. package/bundles/chunk-7DUI3BSX.js.map +0 -6
  37. package/bundles/chunk-MLCT4AWL.js +0 -2187
  38. package/bundles/chunk-MLCT4AWL.js.map +0 -6
  39. package/bundles/chunk-NXCQCU6C.js +0 -5265
  40. package/bundles/chunk-NXCQCU6C.js.map +0 -6
  41. package/bundles/chunk-O4JLZZWJ.js.map +0 -6
  42. package/bundles/chunk-YRDMG3GM.js +0 -115
  43. package/bundles/chunk-YRDMG3GM.js.map +0 -6
  44. package/bundles/chunk-ZCBRXUPO.js.map +0 -6
  45. package/bundles/ngcc/index.js +0 -52
  46. package/bundles/ngcc/index.js.map +0 -6
  47. package/bundles/ngcc/main-ngcc.js +0 -49
  48. package/bundles/ngcc/main-ngcc.js.map +0 -6
  49. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -114
  50. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +0 -6
  51. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +0 -34
  52. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +0 -6
  53. package/ngcc/index.d.ts +0 -19
  54. package/ngcc/main-ngcc.d.ts +0 -2
  55. package/ngcc/src/analysis/decoration_analyzer.d.ts +0 -80
  56. package/ngcc/src/analysis/migration_host.d.ts +0 -22
  57. package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +0 -61
  58. package/ngcc/src/analysis/ngcc_references_registry.d.ts +0 -34
  59. package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +0 -42
  60. package/ngcc/src/analysis/private_declarations_analyzer.d.ts +0 -29
  61. package/ngcc/src/analysis/types.d.ts +0 -29
  62. package/ngcc/src/analysis/util.d.ts +0 -11
  63. package/ngcc/src/command_line_options.d.ts +0 -3
  64. package/ngcc/src/constants.d.ts +0 -9
  65. package/ngcc/src/dependencies/commonjs_dependency_host.d.ts +0 -20
  66. package/ngcc/src/dependencies/dependency_host.d.ts +0 -77
  67. package/ngcc/src/dependencies/dependency_resolver.d.ts +0 -102
  68. package/ngcc/src/dependencies/dts_dependency_host.d.ts +0 -20
  69. package/ngcc/src/dependencies/esm_dependency_host.d.ts +0 -93
  70. package/ngcc/src/dependencies/module_resolver.d.ts +0 -134
  71. package/ngcc/src/dependencies/umd_dependency_host.d.ts +0 -9
  72. package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.d.ts +0 -41
  73. package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +0 -41
  74. package/ngcc/src/entry_point_finder/interface.d.ts +0 -14
  75. package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +0 -61
  76. package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +0 -95
  77. package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +0 -67
  78. package/ngcc/src/entry_point_finder/utils.d.ts +0 -38
  79. package/ngcc/src/execution/analyze_entry_points.d.ts +0 -9
  80. package/ngcc/src/execution/api.d.ts +0 -27
  81. package/ngcc/src/execution/cluster/api.d.ts +0 -51
  82. package/ngcc/src/execution/cluster/executor.d.ts +0 -29
  83. package/ngcc/src/execution/cluster/master.d.ts +0 -57
  84. package/ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts +0 -8
  85. package/ngcc/src/execution/cluster/package_json_updater.d.ts +0 -22
  86. package/ngcc/src/execution/cluster/utils.d.ts +0 -44
  87. package/ngcc/src/execution/cluster/worker.d.ts +0 -10
  88. package/ngcc/src/execution/create_compile_function.d.ts +0 -10
  89. package/ngcc/src/execution/single_process_executor.d.ts +0 -34
  90. package/ngcc/src/execution/tasks/api.d.ts +0 -141
  91. package/ngcc/src/execution/tasks/completion.d.ts +0 -41
  92. package/ngcc/src/execution/tasks/queues/base_task_queue.d.ts +0 -38
  93. package/ngcc/src/execution/tasks/queues/parallel_task_queue.d.ts +0 -27
  94. package/ngcc/src/execution/tasks/queues/serial_task_queue.d.ts +0 -16
  95. package/ngcc/src/execution/tasks/utils.d.ts +0 -57
  96. package/ngcc/src/host/commonjs_host.d.ts +0 -69
  97. package/ngcc/src/host/commonjs_umd_utils.d.ts +0 -146
  98. package/ngcc/src/host/delegating_host.d.ts +0 -43
  99. package/ngcc/src/host/esm2015_host.d.ts +0 -935
  100. package/ngcc/src/host/esm5_host.d.ts +0 -299
  101. package/ngcc/src/host/ngcc_host.d.ts +0 -87
  102. package/ngcc/src/host/umd_host.d.ts +0 -85
  103. package/ngcc/src/host/utils.d.ts +0 -9
  104. package/ngcc/src/locking/async_locker.d.ts +0 -34
  105. package/ngcc/src/locking/lock_file.d.ts +0 -31
  106. package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +0 -44
  107. package/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.d.ts +0 -1
  108. package/ngcc/src/locking/lock_file_with_child_process/util.d.ts +0 -16
  109. package/ngcc/src/locking/sync_locker.d.ts +0 -35
  110. package/ngcc/src/main.d.ts +0 -17
  111. package/ngcc/src/migrations/migration.d.ts +0 -59
  112. package/ngcc/src/migrations/missing_injectable_migration.d.ts +0 -35
  113. package/ngcc/src/migrations/undecorated_child_migration.d.ts +0 -15
  114. package/ngcc/src/migrations/undecorated_parent_migration.d.ts +0 -51
  115. package/ngcc/src/migrations/utils.d.ts +0 -41
  116. package/ngcc/src/ngcc_options.d.ts +0 -155
  117. package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +0 -16
  118. package/ngcc/src/packages/build_marker.d.ts +0 -44
  119. package/ngcc/src/packages/bundle_program.d.ts +0 -35
  120. package/ngcc/src/packages/configuration.d.ts +0 -222
  121. package/ngcc/src/packages/entry_point.d.ts +0 -109
  122. package/ngcc/src/packages/entry_point_bundle.d.ts +0 -46
  123. package/ngcc/src/packages/entry_point_manifest.d.ts +0 -79
  124. package/ngcc/src/packages/ngcc_compiler_host.d.ts +0 -36
  125. package/ngcc/src/packages/patch_ts_expando_initializer.d.ts +0 -41
  126. package/ngcc/src/packages/source_file_cache.d.ts +0 -97
  127. package/ngcc/src/packages/transformer.d.ts +0 -70
  128. package/ngcc/src/path_mappings.d.ts +0 -19
  129. package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +0 -34
  130. package/ngcc/src/rendering/dts_renderer.d.ts +0 -51
  131. package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +0 -35
  132. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +0 -84
  133. package/ngcc/src/rendering/ngcc_import_rewriter.d.ts +0 -13
  134. package/ngcc/src/rendering/renderer.d.ts +0 -72
  135. package/ngcc/src/rendering/rendering_formatter.d.ts +0 -37
  136. package/ngcc/src/rendering/source_maps.d.ts +0 -23
  137. package/ngcc/src/rendering/umd_rendering_formatter.d.ts +0 -54
  138. package/ngcc/src/rendering/utils.d.ts +0 -24
  139. package/ngcc/src/utils.d.ts +0 -112
  140. package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +0 -44
  141. package/ngcc/src/writing/cleaning/package_cleaner.d.ts +0 -38
  142. package/ngcc/src/writing/cleaning/utils.d.ts +0 -15
  143. package/ngcc/src/writing/file_writer.d.ts +0 -28
  144. package/ngcc/src/writing/in_place_file_writer.d.ts +0 -28
  145. package/ngcc/src/writing/new_entry_point_file_writer.d.ts +0 -48
  146. package/ngcc/src/writing/package_json_updater.d.ts +0 -98
  147. package/src/ngtsc/shims/src/factory_generator.d.ts +0 -24
  148. package/src/ngtsc/shims/src/summary_generator.d.ts +0 -15
  149. /package/bundles/{chunk-P6SWFK2U.js.map → chunk-4TCRZYAK.js.map} +0 -0
  150. /package/bundles/{chunk-NJMZRTB6.js.map → chunk-54RHUHYB.js.map} +0 -0
  151. /package/bundles/{chunk-2PLRZDNU.js.map → chunk-6CARGXRJ.js.map} +0 -0
  152. /package/bundles/{chunk-6ZJFIQBG.js.map → chunk-GYHDNUIK.js.map} +0 -0
  153. /package/bundles/{chunk-J3L7WZP3.js.map → chunk-JHMH3CX2.js.map} +0 -0
  154. /package/bundles/{chunk-QRHWLC7U.js.map → chunk-PSGRCFPQ.js.map} +0 -0
@@ -1,67 +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 { Logger } from '../../../src/ngtsc/logging';
10
- import { EntryPointWithDependencies } from '../dependencies/dependency_host';
11
- import { DependencyResolver, SortedEntryPointsInfo } from '../dependencies/dependency_resolver';
12
- import { NgccConfiguration } from '../packages/configuration';
13
- import { PathMappings } from '../path_mappings';
14
- import { EntryPointFinder } from './interface';
15
- /**
16
- * An EntryPointFinder that starts from a set of initial files and only returns entry-points that
17
- * are dependencies of these files.
18
- *
19
- * This is faster than processing all entry-points in the entire file-system, and is used primarily
20
- * by the CLI integration.
21
- *
22
- * There are two concrete implementations of this class.
23
- *
24
- * * `TargetEntryPointFinder` - is given a single entry-point as the initial entry-point. This can
25
- * be used in the synchronous CLI integration where the build tool has identified an external
26
- * import to one of the source files being built.
27
- * * `ProgramBasedEntryPointFinder` - computes the initial entry-points from the source files
28
- * computed from a `tsconfig.json` file. This can be used in the asynchronous CLI integration
29
- * where the `tsconfig.json` to be used to do the build is known.
30
- */
31
- export declare abstract class TracingEntryPointFinder implements EntryPointFinder {
32
- protected fs: ReadonlyFileSystem;
33
- protected config: NgccConfiguration;
34
- protected logger: Logger;
35
- protected resolver: DependencyResolver;
36
- protected basePath: AbsoluteFsPath;
37
- protected pathMappings: PathMappings | undefined;
38
- private basePaths;
39
- constructor(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, resolver: DependencyResolver, basePath: AbsoluteFsPath, pathMappings: PathMappings | undefined);
40
- /**
41
- * Search for Angular package entry-points.
42
- */
43
- findEntryPoints(): SortedEntryPointsInfo;
44
- /**
45
- * Return an array of entry-point paths from which to start the trace.
46
- */
47
- protected abstract getInitialEntryPointPaths(): AbsoluteFsPath[];
48
- /**
49
- * For the given `entryPointPath`, compute, or retrieve, the entry-point information, including
50
- * paths to other entry-points that this entry-point depends upon.
51
- *
52
- * @param entryPointPath the path to the entry-point whose information and dependencies are to be
53
- * retrieved or computed.
54
- *
55
- * @returns the entry-point and its dependencies or `null` if the entry-point is not compiled by
56
- * Angular or cannot be determined.
57
- */
58
- protected abstract getEntryPointWithDeps(entryPointPath: AbsoluteFsPath): EntryPointWithDependencies | null;
59
- /**
60
- * Parse the path-mappings to compute the base-paths that need to be considered when finding
61
- * entry-points.
62
- *
63
- * This processing can be time-consuming if the path-mappings are complex or extensive.
64
- * So the result is cached locally once computed.
65
- */
66
- protected getBasePaths(): AbsoluteFsPath[];
67
- }
@@ -1,38 +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 { Logger } from '../../../src/ngtsc/logging';
10
- import { PathMappings } from '../path_mappings';
11
- /**
12
- * Extract all the base-paths that we need to search for entry-points.
13
- *
14
- * This always contains the standard base-path (`sourceDirectory`).
15
- * But it also parses the `paths` mappings object to guess additional base-paths.
16
- *
17
- * For example:
18
- *
19
- * ```
20
- * getBasePaths('/node_modules', {baseUrl: '/dist', paths: {'*': ['lib/*', 'lib/generated/*']}})
21
- * > ['/node_modules', '/dist/lib']
22
- * ```
23
- *
24
- * Notice that `'/dist'` is not included as there is no `'*'` path,
25
- * and `'/dist/lib/generated'` is not included as it is covered by `'/dist/lib'`.
26
- *
27
- * @param sourceDirectory The standard base-path (e.g. node_modules).
28
- * @param pathMappings Path mapping configuration, from which to extract additional base-paths.
29
- */
30
- export declare function getBasePaths(logger: Logger, sourceDirectory: AbsoluteFsPath, pathMappings: PathMappings | undefined): AbsoluteFsPath[];
31
- /**
32
- * Run a task and track how long it takes.
33
- *
34
- * @param task The task whose duration we are tracking.
35
- * @param log The function to call with the duration of the task.
36
- * @returns The result of calling `task`.
37
- */
38
- export declare function trackDuration<T = void>(task: () => T extends Promise<unknown> ? never : T, log: (duration: number) => void): T;
@@ -1,9 +0,0 @@
1
- import { FileSystem } from '../../../src/ngtsc/file_system';
2
- import { Logger } from '../../../src/ngtsc/logging';
3
- import { EntryPointFinder } from '../entry_point_finder/interface';
4
- import { EntryPointJsonProperty } from '../packages/entry_point';
5
- import { AnalyzeEntryPointsFn } from './api';
6
- /**
7
- * Create the function for performing the analysis of the entry-points.
8
- */
9
- export declare function getAnalyzeEntryPointsFn(logger: Logger, finder: EntryPointFinder, fileSystem: FileSystem, supportedPropertiesToConsider: EntryPointJsonProperty[], typingsOnly: boolean, compileAllFormats: boolean, propertiesToConsider: string[], inParallel: boolean): AnalyzeEntryPointsFn;
@@ -1,27 +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 { FileToWrite } from '../rendering/utils';
9
- import { Task, TaskCompletedCallback, TaskQueue } from './tasks/api';
10
- /**
11
- * The type of the function that analyzes entry-points and creates the list of tasks.
12
- *
13
- * @return A list of tasks that need to be executed in order to process the necessary format
14
- * properties for all entry-points.
15
- */
16
- export type AnalyzeEntryPointsFn = () => TaskQueue;
17
- /** The type of the function that can process/compile a task. */
18
- export type CompileFn<T> = (task: Task) => void | T;
19
- /** The type of the function that creates the `CompileFn` function used to process tasks. */
20
- export type CreateCompileFn = <T extends void | Promise<void>>(beforeWritingFiles: (transformedFiles: FileToWrite[]) => T, onTaskCompleted: TaskCompletedCallback) => CompileFn<T>;
21
- /**
22
- * A class that orchestrates and executes the required work (i.e. analyzes the entry-points,
23
- * processes the resulting tasks, does book-keeping and validates the final outcome).
24
- */
25
- export interface Executor {
26
- execute(analyzeEntryPoints: AnalyzeEntryPointsFn, createCompileFn: CreateCompileFn): void | Promise<void>;
27
- }
@@ -1,51 +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 { JsonObject } from '../../utils';
10
- import { PackageJsonChange } from '../../writing/package_json_updater';
11
- import { Task, TaskProcessingOutcome } from '../tasks/api';
12
- /** A message reporting that the worker is ready for retrieving tasks. */
13
- export interface ReadyMessage extends JsonObject {
14
- type: 'ready';
15
- }
16
- /** A message reporting that an unrecoverable error occurred. */
17
- export interface ErrorMessage extends JsonObject {
18
- type: 'error';
19
- error: string;
20
- }
21
- /** A message requesting the processing of a task. */
22
- export interface ProcessTaskMessage extends JsonObject {
23
- type: 'process-task';
24
- task: Task;
25
- }
26
- /**
27
- * A message reporting the result of processing the currently assigned task.
28
- *
29
- * NOTE: To avoid the communication overhead, the task is not included in the message. Instead, the
30
- * master is responsible for keeping a mapping of workers to their currently assigned tasks.
31
- */
32
- export interface TaskCompletedMessage extends JsonObject {
33
- type: 'task-completed';
34
- outcome: TaskProcessingOutcome;
35
- message: string | null;
36
- }
37
- /** A message listing the paths to transformed files about to be written to disk. */
38
- export interface TransformedFilesMessage extends JsonObject {
39
- type: 'transformed-files';
40
- files: AbsoluteFsPath[];
41
- }
42
- /** A message requesting the update of a `package.json` file. */
43
- export interface UpdatePackageJsonMessage extends JsonObject {
44
- type: 'update-package-json';
45
- packageJsonPath: AbsoluteFsPath;
46
- changes: PackageJsonChange[];
47
- }
48
- /** The type of messages sent from cluster workers to the cluster master. */
49
- export type MessageFromWorker = ReadyMessage | ErrorMessage | TaskCompletedMessage | TransformedFilesMessage | UpdatePackageJsonMessage;
50
- /** The type of messages sent from the cluster master to cluster workers. */
51
- export type MessageToWorker = ProcessTaskMessage;
@@ -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 { PathManipulation } from '../../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../../src/ngtsc/logging';
10
- import { AsyncLocker } from '../../locking/async_locker';
11
- import { FileWriter } from '../../writing/file_writer';
12
- import { PackageJsonUpdater } from '../../writing/package_json_updater';
13
- import { AnalyzeEntryPointsFn, CreateCompileFn, Executor } from '../api';
14
- import { CreateTaskCompletedCallback } from '../tasks/api';
15
- /**
16
- * An `Executor` that processes tasks in parallel (on multiple processes) and completes
17
- * asynchronously.
18
- */
19
- export declare class ClusterExecutor implements Executor {
20
- private workerCount;
21
- private fileSystem;
22
- private logger;
23
- private fileWriter;
24
- private pkgJsonUpdater;
25
- private lockFile;
26
- private createTaskCompletedCallback;
27
- constructor(workerCount: number, fileSystem: PathManipulation, logger: Logger, fileWriter: FileWriter, pkgJsonUpdater: PackageJsonUpdater, lockFile: AsyncLocker, createTaskCompletedCallback: CreateTaskCompletedCallback);
28
- execute(analyzeEntryPoints: AnalyzeEntryPointsFn, _createCompileFn: CreateCompileFn): Promise<void>;
29
- }
@@ -1,57 +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, PathManipulation } from '../../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../../src/ngtsc/logging';
10
- import { FileWriter } from '../../writing/file_writer';
11
- import { PackageJsonUpdater } from '../../writing/package_json_updater';
12
- import { AnalyzeEntryPointsFn } from '../api';
13
- import { CreateTaskCompletedCallback } from '../tasks/api';
14
- /**
15
- * The cluster master is responsible for analyzing all entry-points, planning the work that needs to
16
- * be done, distributing it to worker-processes and collecting/post-processing the results.
17
- */
18
- export declare class ClusterMaster {
19
- private maxWorkerCount;
20
- private fileSystem;
21
- private logger;
22
- private fileWriter;
23
- private pkgJsonUpdater;
24
- private finishedDeferred;
25
- private processingStartTime;
26
- private taskAssignments;
27
- private taskQueue;
28
- private onTaskCompleted;
29
- private remainingRespawnAttempts;
30
- constructor(maxWorkerCount: number, fileSystem: PathManipulation, logger: Logger, fileWriter: FileWriter, pkgJsonUpdater: PackageJsonUpdater, analyzeEntryPoints: AnalyzeEntryPointsFn, createTaskCompletedCallback: CreateTaskCompletedCallback);
31
- run(): Promise<void>;
32
- /** Try to find available (idle) workers and assign them available (non-blocked) tasks. */
33
- private maybeDistributeWork;
34
- /** Handle a worker's exiting. (Might be intentional or not.) */
35
- private onWorkerExit;
36
- /** Handle a message from a worker. */
37
- private onWorkerMessage;
38
- /** Handle a worker's coming online and ready for retrieving IPC messages. */
39
- private onWorkerReady;
40
- /** Handle a worker's having completed their assigned task. */
41
- private onWorkerTaskCompleted;
42
- /** Handle a worker's message regarding the files transformed while processing its task. */
43
- private onWorkerTransformedFiles;
44
- /** Handle a worker's request to update a `package.json` file. */
45
- private onWorkerUpdatePackageJson;
46
- /** Stop all workers and stop listening on cluster events. */
47
- private stopWorkers;
48
- /**
49
- * Wrap an event handler to ensure that `finishedDeferred` will be rejected on error (regardless
50
- * if the handler completes synchronously or asynchronously).
51
- */
52
- private wrapEventHandler;
53
- }
54
- /** Wrapper for resolving the cluster worker script. Useful for test patching. */
55
- export declare class ClusterWorkerScriptResolver {
56
- static resolve(fileSystem: PathManipulation): AbsoluteFsPath;
57
- }
@@ -1,8 +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 {};
@@ -1,22 +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 { JsonObject } from '../../utils';
10
- import { PackageJsonChange, PackageJsonUpdate, PackageJsonUpdater } from '../../writing/package_json_updater';
11
- /**
12
- * A `PackageJsonUpdater` for cluster workers that will send update changes to the master process so
13
- * that it can safely handle update operations on multiple processes.
14
- */
15
- export declare class ClusterWorkerPackageJsonUpdater implements PackageJsonUpdater {
16
- constructor();
17
- createUpdate(): PackageJsonUpdate;
18
- /**
19
- * Apply the changes in-memory (if necessary) and send a message to the master process.
20
- */
21
- writeChanges(changes: PackageJsonChange[], packageJsonPath: AbsoluteFsPath, preExistingParsedJson?: JsonObject): void;
22
- }
@@ -1,44 +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 { MessageFromWorker, MessageToWorker } from './api';
9
- /** Expose a `Promise` instance as well as APIs for resolving/rejecting it. */
10
- export declare class Deferred<T> {
11
- /**
12
- * Resolve the associated promise with the specified value.
13
- * If the value is a rejection (constructed with `Promise.reject()`), the promise will be rejected
14
- * instead.
15
- *
16
- * @param value The value to resolve the promise with.
17
- */
18
- resolve: (value: T) => void;
19
- /**
20
- * Rejects the associated promise with the specified reason.
21
- *
22
- * @param reason The rejection reason.
23
- */
24
- reject: (reason: any) => void;
25
- /** The `Promise` instance associated with this deferred. */
26
- promise: Promise<T>;
27
- }
28
- /**
29
- * Send a message to the cluster master.
30
- * (This function should be invoked from cluster workers only.)
31
- *
32
- * @param msg The message to send to the cluster master.
33
- * @return A promise that is resolved once the message has been sent.
34
- */
35
- export declare const sendMessageToMaster: (msg: MessageFromWorker) => Promise<void>;
36
- /**
37
- * Send a message to a cluster worker.
38
- * (This function should be invoked from the cluster master only.)
39
- *
40
- * @param workerId The ID of the recipient worker.
41
- * @param msg The message to send to the worker.
42
- * @return A promise that is resolved once the message has been sent.
43
- */
44
- export declare const sendMessageToWorker: (workerId: number, msg: MessageToWorker) => Promise<void>;
@@ -1,10 +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 { Logger } from '../../../../src/ngtsc/logging';
9
- import { CreateCompileFn } from '../api';
10
- export declare function startWorker(logger: Logger, createCompileFn: CreateCompileFn): Promise<void>;
@@ -1,10 +0,0 @@
1
- import { FileSystem } from '../../../src/ngtsc/file_system';
2
- import { Logger } from '../../../src/ngtsc/logging';
3
- import { ParsedConfiguration } from '../../../src/perform_compile';
4
- import { PathMappings } from '../path_mappings';
5
- import { FileWriter } from '../writing/file_writer';
6
- import { CreateCompileFn } from './api';
7
- /**
8
- * The function for creating the `compile()` function.
9
- */
10
- export declare function getCreateCompileFn(fileSystem: FileSystem, logger: Logger, fileWriter: FileWriter, enableI18nLegacyMessageIdFormat: boolean, tsConfig: ParsedConfiguration | null, pathMappings: PathMappings | undefined): CreateCompileFn;
@@ -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 { Logger } from '../../../src/ngtsc/logging';
9
- import { AsyncLocker } from '../locking/async_locker';
10
- import { SyncLocker } from '../locking/sync_locker';
11
- import { AnalyzeEntryPointsFn, CreateCompileFn, Executor } from './api';
12
- import { CreateTaskCompletedCallback } from './tasks/api';
13
- export declare abstract class SingleProcessorExecutorBase {
14
- private logger;
15
- private createTaskCompletedCallback;
16
- constructor(logger: Logger, createTaskCompletedCallback: CreateTaskCompletedCallback);
17
- doExecute(analyzeEntryPoints: AnalyzeEntryPointsFn, createCompileFn: CreateCompileFn): void | Promise<void>;
18
- }
19
- /**
20
- * An `Executor` that processes all tasks serially and completes synchronously.
21
- */
22
- export declare class SingleProcessExecutorSync extends SingleProcessorExecutorBase implements Executor {
23
- private lockFile;
24
- constructor(logger: Logger, lockFile: SyncLocker, createTaskCompletedCallback: CreateTaskCompletedCallback);
25
- execute(analyzeEntryPoints: AnalyzeEntryPointsFn, createCompileFn: CreateCompileFn): void;
26
- }
27
- /**
28
- * An `Executor` that processes all tasks serially, but still completes asynchronously.
29
- */
30
- export declare class SingleProcessExecutorAsync extends SingleProcessorExecutorBase implements Executor {
31
- private lockFile;
32
- constructor(logger: Logger, lockFile: AsyncLocker, createTaskCompletedCallback: CreateTaskCompletedCallback);
33
- execute(analyzeEntryPoints: AnalyzeEntryPointsFn, createCompileFn: CreateCompileFn): Promise<void>;
34
- }
@@ -1,141 +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 { EntryPoint, EntryPointJsonProperty } from '../../packages/entry_point';
9
- import { JsonObject, PartiallyOrderedList } from '../../utils';
10
- /**
11
- * Represents a unit of work to be undertaken by an `Executor`.
12
- *
13
- * A task consists of processing a specific format property of an entry-point.
14
- * This may or may not also include processing the typings for that entry-point, which only needs to
15
- * happen once across all the formats.
16
- */
17
- export interface Task extends JsonObject {
18
- /** The `EntryPoint` which needs to be processed as part of the task. */
19
- entryPoint: EntryPoint;
20
- /**
21
- * The `package.json` format property to process (i.e. the property which points to the file that
22
- * is the program entry-point).
23
- */
24
- formatProperty: EntryPointJsonProperty;
25
- /**
26
- * The list of all format properties (including `task.formatProperty`) that should be marked as
27
- * processed once the task has been completed, because they point to the format-path that will be
28
- * processed as part of the task.
29
- */
30
- formatPropertiesToMarkAsProcessed: EntryPointJsonProperty[];
31
- /**
32
- * Whether to process typings for this entry-point as part of the task.
33
- */
34
- processDts: DtsProcessing;
35
- }
36
- /**
37
- * The options for processing Typescript typings (.d.ts) files.
38
- */
39
- export declare enum DtsProcessing {
40
- /**
41
- * Yes, process the typings for this entry point as part of the task.
42
- */
43
- Yes = 0,
44
- /**
45
- * No, do not process the typings as part of this task - they must have already been processed by
46
- * another task or previous ngcc process.
47
- */
48
- No = 1,
49
- /**
50
- * Only process the typings for this entry-point; do not render any JavaScript files for the
51
- * `formatProperty` of this task.
52
- */
53
- Only = 2
54
- }
55
- /**
56
- * Represents a partially ordered list of tasks.
57
- *
58
- * The ordering/precedence of tasks is determined by the inter-dependencies between their associated
59
- * entry-points. Specifically, the tasks' order/precedence is such that tasks associated to
60
- * dependent entry-points always come after tasks associated with their dependencies.
61
- *
62
- * As result of this ordering, it is guaranteed that - by processing tasks in the order in which
63
- * they appear in the list - a task's dependencies will always have been processed before processing
64
- * the task itself.
65
- *
66
- * See `DependencyResolver#sortEntryPointsByDependency()`.
67
- */
68
- export type PartiallyOrderedTasks = PartiallyOrderedList<Task>;
69
- /**
70
- * A mapping from Tasks to the Tasks that depend upon them (dependents).
71
- */
72
- export type TaskDependencies = Map<Task, Set<Task>>;
73
- export declare const TaskDependencies: MapConstructor;
74
- /**
75
- * A function to create a TaskCompletedCallback function.
76
- */
77
- export type CreateTaskCompletedCallback = (taskQueue: TaskQueue) => TaskCompletedCallback;
78
- /**
79
- * A function to be called once a task has been processed.
80
- */
81
- export type TaskCompletedCallback = (task: Task, outcome: TaskProcessingOutcome, message: string | null) => void;
82
- /**
83
- * Represents the outcome of processing a `Task`.
84
- */
85
- export declare const enum TaskProcessingOutcome {
86
- /** Successfully processed the target format property. */
87
- Processed = 0,
88
- /** Failed to process the target format. */
89
- Failed = 1
90
- }
91
- /**
92
- * A wrapper around a list of tasks and providing utility methods for getting the next task of
93
- * interest and determining when all tasks have been completed.
94
- *
95
- * (This allows different implementations to impose different constraints on when a task's
96
- * processing can start.)
97
- */
98
- export interface TaskQueue {
99
- /** Whether all tasks have been completed. */
100
- allTasksCompleted: boolean;
101
- /**
102
- * Get the next task whose processing can start (if any).
103
- *
104
- * This implicitly marks the task as in-progress.
105
- * (This information is used to determine whether all tasks have been completed.)
106
- *
107
- * @return The next task available for processing or `null`, if no task can be processed at the
108
- * moment (including if there are no more unprocessed tasks).
109
- */
110
- getNextTask(): Task | null;
111
- /**
112
- * Mark a task as completed.
113
- *
114
- * This removes the task from the internal list of in-progress tasks.
115
- * (This information is used to determine whether all tasks have been completed.)
116
- *
117
- * @param task The task to mark as completed.
118
- */
119
- markAsCompleted(task: Task): void;
120
- /**
121
- * Mark a task as failed.
122
- *
123
- * Do not process the tasks that depend upon the given task.
124
- */
125
- markAsFailed(task: Task): void;
126
- /**
127
- * Mark a task as not processed (i.e. add an in-progress task back to the queue).
128
- *
129
- * This removes the task from the internal list of in-progress tasks and adds it back to the list
130
- * of pending tasks.
131
- *
132
- * @param task The task to mark as not processed.
133
- */
134
- markAsUnprocessed(task: Task): void;
135
- /**
136
- * Return a string representation of the task queue (for debugging purposes).
137
- *
138
- * @return A string representation of the task queue.
139
- */
140
- toString(): string;
141
- }
@@ -1,41 +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 { PathManipulation, ReadonlyFileSystem } from '../../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../../src/ngtsc/logging';
10
- import { PackageJsonUpdater } from '../../writing/package_json_updater';
11
- import { Task, TaskCompletedCallback, TaskProcessingOutcome, TaskQueue } from './api';
12
- /**
13
- * A function that can handle a specific outcome of a task completion.
14
- *
15
- * These functions can be composed using the `composeTaskCompletedCallbacks()`
16
- * to create a `TaskCompletedCallback` function that can be passed to an `Executor`.
17
- */
18
- export type TaskCompletedHandler = (task: Task, message: string | null) => void;
19
- /**
20
- * Compose a group of TaskCompletedHandlers into a single TaskCompletedCallback.
21
- *
22
- * The compose callback will receive an outcome and will delegate to the appropriate handler based
23
- * on this outcome.
24
- *
25
- * @param callbacks a map of outcomes to handlers.
26
- */
27
- export declare function composeTaskCompletedCallbacks(callbacks: Record<TaskProcessingOutcome, TaskCompletedHandler>): TaskCompletedCallback;
28
- /**
29
- * Create a handler that will mark the entry-points in a package as being processed.
30
- *
31
- * @param pkgJsonUpdater The service used to update the package.json
32
- */
33
- export declare function createMarkAsProcessedHandler(fs: PathManipulation, pkgJsonUpdater: PackageJsonUpdater): TaskCompletedHandler;
34
- /**
35
- * Create a handler that will throw an error.
36
- */
37
- export declare function createThrowErrorHandler(fs: ReadonlyFileSystem): TaskCompletedHandler;
38
- /**
39
- * Create a handler that logs an error and marks the task as failed.
40
- */
41
- export declare function createLogErrorHandler(logger: Logger, fs: ReadonlyFileSystem, taskQueue: TaskQueue): TaskCompletedHandler;
@@ -1,38 +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 { Logger } from '../../../../../src/ngtsc/logging';
9
- import { PartiallyOrderedTasks, Task, TaskDependencies, TaskQueue } from '../api';
10
- /**
11
- * A base `TaskQueue` implementation to be used as base for concrete implementations.
12
- */
13
- export declare abstract class BaseTaskQueue implements TaskQueue {
14
- protected logger: Logger;
15
- protected tasks: PartiallyOrderedTasks;
16
- protected dependencies: TaskDependencies;
17
- get allTasksCompleted(): boolean;
18
- protected inProgressTasks: Set<Task>;
19
- /**
20
- * A map of tasks that should be skipped, mapped to the task that caused them to be skipped.
21
- */
22
- private tasksToSkip;
23
- constructor(logger: Logger, tasks: PartiallyOrderedTasks, dependencies: TaskDependencies);
24
- protected abstract computeNextTask(): Task | null;
25
- getNextTask(): Task | null;
26
- markAsCompleted(task: Task): void;
27
- markAsFailed(task: Task): void;
28
- markAsUnprocessed(task: Task): void;
29
- toString(): string;
30
- /**
31
- * Mark the given `task` as to be skipped, then recursive skip all its dependents.
32
- *
33
- * @param task The task to skip
34
- * @param failedTask The task that failed, causing this task to be skipped
35
- */
36
- protected skipDependentTasks(task: Task, failedTask: Task): void;
37
- protected stringifyTasks(tasks: Task[], indentation: string): string;
38
- }