@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
@@ -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
- }
@@ -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 { Logger } from '../../../../../src/ngtsc/logging';
9
- import { PartiallyOrderedTasks, Task, TaskDependencies } from '../api';
10
- import { BaseTaskQueue } from './base_task_queue';
11
- /**
12
- * A `TaskQueue` implementation that assumes tasks are processed in parallel, thus has to ensure a
13
- * task's dependencies have been processed before processing the task.
14
- */
15
- export declare class ParallelTaskQueue extends BaseTaskQueue {
16
- /**
17
- * A map from Tasks to the Tasks that it depends upon.
18
- *
19
- * This is the reverse mapping of `TaskDependencies`.
20
- */
21
- private blockedTasks;
22
- constructor(logger: Logger, tasks: PartiallyOrderedTasks, dependencies: TaskDependencies);
23
- computeNextTask(): Task | null;
24
- markAsCompleted(task: Task): void;
25
- toString(): string;
26
- private stringifyBlockedTasks;
27
- }
@@ -1,16 +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 { Task } from '../api';
9
- import { BaseTaskQueue } from './base_task_queue';
10
- /**
11
- * A `TaskQueue` implementation that assumes tasks are processed serially and each one is completed
12
- * before requesting the next one.
13
- */
14
- export declare class SerialTaskQueue extends BaseTaskQueue {
15
- computeNextTask(): Task | null;
16
- }
@@ -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 { DepGraph } from 'dependency-graph';
9
- import { EntryPoint } from '../../packages/entry_point';
10
- import { PartiallyOrderedTasks, Task, TaskDependencies } from './api';
11
- /** Stringify a task for debugging purposes. */
12
- export declare const stringifyTask: (task: Task) => string;
13
- /**
14
- * Compute a mapping of tasks to the tasks that are dependent on them (if any).
15
- *
16
- * Task A can depend upon task B, if either:
17
- *
18
- * * A and B have the same entry-point _and_ B is generating the typings for that entry-point
19
- * (i.e. has `processDts: true`).
20
- * * A's entry-point depends on B's entry-point _and_ B is also generating typings.
21
- *
22
- * NOTE: If a task is not generating typings, then it cannot affect anything which depends on its
23
- * entry-point, regardless of the dependency graph. To put this another way, only the task
24
- * which produces the typings for a dependency needs to have been completed.
25
- *
26
- * As a performance optimization, we take into account the fact that `tasks` are sorted in such a
27
- * way that a task can only depend on earlier tasks (i.e. dependencies always come before
28
- * dependents in the list of tasks).
29
- *
30
- * @param tasks A (partially ordered) list of tasks.
31
- * @param graph The dependency graph between entry-points.
32
- * @return A map from each task to those tasks directly dependent upon it.
33
- */
34
- export declare function computeTaskDependencies(tasks: PartiallyOrderedTasks, graph: DepGraph<EntryPoint>): TaskDependencies;
35
- export declare function getDependentsSet(map: TaskDependencies, task: Task): Set<Task>;
36
- /**
37
- * Invert the given mapping of Task dependencies.
38
- *
39
- * @param dependencies The mapping of tasks to the tasks that depend upon them.
40
- * @returns A mapping of tasks to the tasks that they depend upon.
41
- */
42
- export declare function getBlockedTasks(dependencies: TaskDependencies): Map<Task, Set<Task>>;
43
- /**
44
- * Sort a list of tasks by priority.
45
- *
46
- * Priority is determined by the number of other tasks that a task is (transitively) blocking:
47
- * The more tasks a task is blocking the higher its priority is, because processing it will
48
- * potentially unblock more tasks.
49
- *
50
- * To keep the behavior predictable, if two tasks block the same number of other tasks, their
51
- * relative order in the original `tasks` lists is preserved.
52
- *
53
- * @param tasks A (partially ordered) list of tasks.
54
- * @param dependencies The mapping of tasks to the tasks that depend upon them.
55
- * @return The list of tasks sorted by priority.
56
- */
57
- export declare function sortTasksByPriority(tasks: PartiallyOrderedTasks, dependencies: TaskDependencies): PartiallyOrderedTasks;