@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,93 +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, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
10
- import { DependencyHostBase } from './dependency_host';
11
- import { ModuleResolver } from './module_resolver';
12
- /**
13
- * Helper functions for computing dependencies.
14
- */
15
- export declare class EsmDependencyHost extends DependencyHostBase {
16
- private scanImportExpressions;
17
- constructor(fs: ReadonlyFileSystem, moduleResolver: ModuleResolver, scanImportExpressions?: boolean);
18
- private scanner;
19
- protected canSkipFile(fileContents: string): boolean;
20
- /**
21
- * Extract any import paths from imports found in the contents of this file.
22
- *
23
- * This implementation uses the TypeScript scanner, which tokenizes source code,
24
- * to process the string. This is halfway between working with the string directly,
25
- * which is too difficult due to corner cases, and parsing the string into a full
26
- * TypeScript Abstract Syntax Tree (AST), which ends up doing more processing than
27
- * is needed.
28
- *
29
- * The scanning is not trivial because we must hold state between each token since
30
- * the context of the token affects how it should be scanned, and the scanner does
31
- * not manage this for us.
32
- *
33
- * Specifically, backticked strings are particularly challenging since it is possible
34
- * to recursively nest backticks and TypeScript expressions within each other.
35
- */
36
- protected extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
37
- /**
38
- * We have found an `import` token so now try to identify the import path.
39
- *
40
- * This method will use the current state of `this.scanner` to extract a string literal module
41
- * specifier. It expects that the current state of the scanner is that an `import` token has just
42
- * been scanned.
43
- *
44
- * The following forms of import are matched:
45
- *
46
- * * `import "module-specifier";`
47
- * * `import("module-specifier")`
48
- * * `import defaultBinding from "module-specifier";`
49
- * * `import defaultBinding, * as identifier from "module-specifier";`
50
- * * `import defaultBinding, {...} from "module-specifier";`
51
- * * `import * as identifier from "module-specifier";`
52
- * * `import {...} from "module-specifier";`
53
- *
54
- * @returns the import path or null if there is no import or it is not a string literal.
55
- */
56
- protected extractImportPath(): string | null;
57
- /**
58
- * We have found an `export` token so now try to identify a re-export path.
59
- *
60
- * This method will use the current state of `this.scanner` to extract a string literal module
61
- * specifier. It expects that the current state of the scanner is that an `export` token has
62
- * just been scanned.
63
- *
64
- * There are three forms of re-export that are matched:
65
- *
66
- * * `export * from '...';
67
- * * `export * as alias from '...';
68
- * * `export {...} from '...';
69
- */
70
- protected extractReexportPath(): string | null;
71
- protected skipNamespacedClause(): ts.SyntaxKind | null;
72
- protected skipNamedClause(): ts.SyntaxKind;
73
- protected tryStringLiteral(): string | null;
74
- }
75
- /**
76
- * Check whether a source file needs to be parsed for imports.
77
- * This is a performance short-circuit, which saves us from creating
78
- * a TypeScript AST unnecessarily.
79
- *
80
- * @param source The content of the source file to check.
81
- *
82
- * @returns false if there are definitely no import or re-export statements
83
- * in this file, true otherwise.
84
- */
85
- export declare function hasImportOrReexportStatements(source: string): boolean;
86
- /**
87
- * Check whether the given statement is an import with a string literal module specifier.
88
- * @param stmt the statement node to check.
89
- * @returns true if the statement is an import with a string literal module specifier.
90
- */
91
- export declare function isStringImportOrReexport(stmt: ts.Statement): stmt is ts.ImportDeclaration & {
92
- moduleSpecifier: ts.StringLiteral;
93
- };
@@ -1,134 +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
- /**
11
- * This is a very cut-down implementation of the TypeScript module resolution strategy.
12
- *
13
- * It is specific to the needs of ngcc and is not intended to be a drop-in replacement
14
- * for the TS module resolver. It is used to compute the dependencies between entry-points
15
- * that may be compiled by ngcc.
16
- *
17
- * The algorithm only finds `.js` files for internal/relative imports and paths to
18
- * the folder containing the `package.json` of the entry-point for external imports.
19
- *
20
- * It can cope with nested `node_modules` folders and also supports `paths`/`baseUrl`
21
- * configuration properties, as provided in a `ts.CompilerOptions` object.
22
- */
23
- export declare class ModuleResolver {
24
- private fs;
25
- readonly relativeExtensions: string[];
26
- private pathMappings;
27
- constructor(fs: ReadonlyFileSystem, pathMappings?: PathMappings, relativeExtensions?: string[]);
28
- /**
29
- * Resolve an absolute path for the `moduleName` imported into a file at `fromPath`.
30
- * @param moduleName The name of the import to resolve.
31
- * @param fromPath The path to the file containing the import.
32
- * @returns A path to the resolved module or null if missing.
33
- * Specifically:
34
- * * the absolute path to the package.json of an external module
35
- * * a JavaScript file of an internal module
36
- * * null if none exists.
37
- */
38
- resolveModuleImport(moduleName: string, fromPath: AbsoluteFsPath): ResolvedModule | null;
39
- /**
40
- * Convert the `pathMappings` into a collection of `PathMapper` functions.
41
- */
42
- private processPathMappings;
43
- /**
44
- * Try to resolve a module name, as a relative path, from the `fromPath`.
45
- *
46
- * As it is relative, it only looks for files that end in one of the `relativeExtensions`.
47
- * For example: `${moduleName}.js` or `${moduleName}/index.js`.
48
- * If neither of these files exist then the method returns `null`.
49
- */
50
- private resolveAsRelativePath;
51
- /**
52
- * Try to resolve the `moduleName`, by applying the computed `pathMappings` and
53
- * then trying to resolve the mapped path as a relative or external import.
54
- *
55
- * Whether the mapped path is relative is defined as it being "below the `fromPath`" and not
56
- * containing `node_modules`.
57
- *
58
- * If the mapped path is not relative but does not resolve to an external entry-point, then we
59
- * check whether it would have resolved to a relative path, in which case it is marked as a
60
- * "deep-import".
61
- */
62
- private resolveByPathMappings;
63
- /**
64
- * Try to resolve the `moduleName` as an external entry-point by searching the `node_modules`
65
- * folders up the tree for a matching `.../node_modules/${moduleName}`.
66
- *
67
- * If a folder is found but the path is not considered an entry-point (see `isEntryPoint()`) then
68
- * it is marked as a "deep-import".
69
- */
70
- private resolveAsEntryPoint;
71
- /**
72
- * Can we consider the given path as an entry-point to a package?
73
- *
74
- * This is achieved by checking for the existence of `${modulePath}/package.json`.
75
- * If there is no `package.json`, we check whether this is an APF v14+ secondary entry-point,
76
- * which does not have its own `package.json` but has an `exports` entry in the package's primary
77
- * `package.json`.
78
- */
79
- private isEntryPoint;
80
- /**
81
- * Apply the `pathMappers` to the `moduleName` and return all the possible
82
- * paths that match.
83
- *
84
- * The mapped path is computed for each template in `mapping.templates` by
85
- * replacing the `matcher.prefix` and `matcher.postfix` strings in `path with the
86
- * `template.prefix` and `template.postfix` strings.
87
- */
88
- private findMappedPaths;
89
- /**
90
- * Attempt to find a mapped path for the given `path` and a `mapping`.
91
- *
92
- * The `path` matches the `mapping` if if it starts with `matcher.prefix` and ends with
93
- * `matcher.postfix`.
94
- *
95
- * @returns the wildcard segment of a matched `path`, or `null` if no match.
96
- */
97
- private matchMapping;
98
- /**
99
- * Compute the candidate paths from the given mapping's templates using the matched
100
- * string.
101
- */
102
- private computeMappedTemplates;
103
- /**
104
- * Search up the folder tree for the first folder that contains `package.json`
105
- * or `null` if none is found.
106
- */
107
- private findPackagePath;
108
- }
109
- /** The result of resolving an import to a module. */
110
- export type ResolvedModule = ResolvedExternalModule | ResolvedRelativeModule | ResolvedDeepImport;
111
- /**
112
- * A module that is external to the package doing the importing.
113
- * In this case we capture the folder containing the entry-point.
114
- */
115
- export declare class ResolvedExternalModule {
116
- entryPointPath: AbsoluteFsPath;
117
- constructor(entryPointPath: AbsoluteFsPath);
118
- }
119
- /**
120
- * A module that is relative to the module doing the importing, and so internal to the
121
- * source module's package.
122
- */
123
- export declare class ResolvedRelativeModule {
124
- modulePath: AbsoluteFsPath;
125
- constructor(modulePath: AbsoluteFsPath);
126
- }
127
- /**
128
- * A module that is external to the package doing the importing but pointing to a
129
- * module that is deep inside a package, rather than to an entry-point of the package.
130
- */
131
- export declare class ResolvedDeepImport {
132
- importPath: AbsoluteFsPath;
133
- constructor(importPath: AbsoluteFsPath);
134
- }
@@ -1,9 +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 UmdDependencyHost extends DependencyHostBase {
7
- protected canSkipFile(fileContents: string): boolean;
8
- protected extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
9
- }
@@ -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 { AbsoluteFsPath } 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 { EntryPointManifest } from '../packages/entry_point_manifest';
13
- import { PathMappings } from '../path_mappings';
14
- import { EntryPointCollector } from './entry_point_collector';
15
- import { EntryPointFinder } from './interface';
16
- /**
17
- * An EntryPointFinder that searches for all entry-points that can be found given a `basePath` and
18
- * `pathMappings`.
19
- */
20
- export declare class DirectoryWalkerEntryPointFinder implements EntryPointFinder {
21
- private logger;
22
- private resolver;
23
- private entryPointCollector;
24
- private entryPointManifest;
25
- private sourceDirectory;
26
- private pathMappings;
27
- private basePaths;
28
- constructor(logger: Logger, resolver: DependencyResolver, entryPointCollector: EntryPointCollector, entryPointManifest: EntryPointManifest, sourceDirectory: AbsoluteFsPath, pathMappings: PathMappings | undefined);
29
- /**
30
- * Search the `sourceDirectory`, and sub-directories, using `pathMappings` as necessary, to find
31
- * all package entry-points.
32
- */
33
- findEntryPoints(): SortedEntryPointsInfo;
34
- /**
35
- * Search the `basePath` for possible Angular packages and entry-points.
36
- *
37
- * @param basePath The path at which to start the search.
38
- * @returns an array of `EntryPoint`s that were found within `basePath`.
39
- */
40
- walkBasePathForPackages(basePath: AbsoluteFsPath): EntryPointWithDependencies[];
41
- }
@@ -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 { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../src/ngtsc/logging';
10
- import { EntryPointWithDependencies } from '../dependencies/dependency_host';
11
- import { DependencyResolver } from '../dependencies/dependency_resolver';
12
- import { NgccConfiguration } from '../packages/configuration';
13
- /**
14
- * A class that traverses a file-tree, starting at a given path, looking for all entry-points,
15
- * also capturing the dependencies of each entry-point that is found.
16
- */
17
- export declare class EntryPointCollector {
18
- private fs;
19
- private config;
20
- private logger;
21
- private resolver;
22
- constructor(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, resolver: DependencyResolver);
23
- /**
24
- * Look for Angular packages that need to be compiled, starting at the source directory.
25
- * The function will recurse into directories that start with `@...`, e.g. `@angular/...`.
26
- *
27
- * @param sourceDirectory An absolute path to the root directory where searching begins.
28
- * @returns an array of `EntryPoint`s that were found within `sourceDirectory`.
29
- */
30
- walkDirectoryForPackages(sourceDirectory: AbsoluteFsPath): EntryPointWithDependencies[];
31
- /**
32
- * Search the `directory` looking for any secondary entry-points for a package, adding any that
33
- * are found to the `entryPoints` array.
34
- *
35
- * @param entryPoints An array where we will add any entry-points found in this directory.
36
- * @param packagePath The absolute path to the package that may contain entry-points.
37
- * @param directory The current directory being searched.
38
- * @param paths The paths contained in the current `directory`.
39
- */
40
- private collectSecondaryEntryPoints;
41
- }
@@ -1,14 +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 { SortedEntryPointsInfo } from '../dependencies/dependency_resolver';
9
- export interface EntryPointFinder {
10
- /**
11
- * Search for Angular package entry-points.
12
- */
13
- findEntryPoints(): SortedEntryPointsInfo;
14
- }
@@ -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 { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../src/ngtsc/logging';
10
- import { ParsedConfiguration } from '../../../src/perform_compile';
11
- import { EntryPointWithDependencies } from '../dependencies/dependency_host';
12
- import { DependencyResolver } from '../dependencies/dependency_resolver';
13
- import { NgccConfiguration } from '../packages/configuration';
14
- import { EntryPointManifest } from '../packages/entry_point_manifest';
15
- import { EntryPointCollector } from './entry_point_collector';
16
- import { TracingEntryPointFinder } from './tracing_entry_point_finder';
17
- /**
18
- * An EntryPointFinder that starts from the files in the program defined by the given tsconfig.json
19
- * and only returns entry-points that are dependencies of these files.
20
- *
21
- * This is faster than searching the entire file-system for all the entry-points,
22
- * and is used primarily by the CLI integration.
23
- */
24
- export declare class ProgramBasedEntryPointFinder extends TracingEntryPointFinder {
25
- private entryPointCollector;
26
- private entryPointManifest;
27
- private tsConfig;
28
- private entryPointsWithDependencies;
29
- constructor(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, resolver: DependencyResolver, entryPointCollector: EntryPointCollector, entryPointManifest: EntryPointManifest, basePath: AbsoluteFsPath, tsConfig: ParsedConfiguration, projectPath: AbsoluteFsPath);
30
- /**
31
- * Return an array containing the external import paths that were extracted from the source-files
32
- * of the program defined by the tsconfig.json.
33
- */
34
- protected getInitialEntryPointPaths(): AbsoluteFsPath[];
35
- /**
36
- * For the given `entryPointPath`, compute, or retrieve, the entry-point information, including
37
- * paths to other entry-points that this entry-point depends upon.
38
- *
39
- * In this entry-point finder, we use the `EntryPointManifest` to avoid computing each
40
- * entry-point's dependencies in the case that this had been done previously.
41
- *
42
- * @param entryPointPath the path to the entry-point whose information and dependencies are to be
43
- * retrieved or computed.
44
- *
45
- * @returns the entry-point and its dependencies or `null` if the entry-point is not compiled by
46
- * Angular or cannot be determined.
47
- */
48
- protected getEntryPointWithDeps(entryPointPath: AbsoluteFsPath): EntryPointWithDependencies | null;
49
- /**
50
- * Walk the base paths looking for entry-points or load this information from an entry-point
51
- * manifest, if available.
52
- */
53
- private findOrLoadEntryPoints;
54
- /**
55
- * Search the `basePath` for possible Angular packages and entry-points.
56
- *
57
- * @param basePath The path at which to start the search.
58
- * @returns an array of `EntryPoint`s that were found within `basePath`.
59
- */
60
- walkBasePathForPackages(basePath: AbsoluteFsPath): EntryPointWithDependencies[];
61
- }
@@ -1,95 +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 { EntryPointJsonProperty } from '../packages/entry_point';
14
- import { PathMappings } from '../path_mappings';
15
- import { TracingEntryPointFinder } from './tracing_entry_point_finder';
16
- /**
17
- * An EntryPointFinder that starts from a target entry-point and only finds
18
- * entry-points that are dependencies of the target.
19
- *
20
- * This is faster than searching the entire file-system for all the entry-points,
21
- * and is used primarily by the CLI integration.
22
- */
23
- export declare class TargetedEntryPointFinder extends TracingEntryPointFinder {
24
- private targetPath;
25
- constructor(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, resolver: DependencyResolver, basePath: AbsoluteFsPath, pathMappings: PathMappings | undefined, targetPath: AbsoluteFsPath);
26
- /**
27
- * Search for Angular entry-points that can be reached from the entry-point specified by the given
28
- * `targetPath`.
29
- */
30
- findEntryPoints(): SortedEntryPointsInfo;
31
- /**
32
- * Determine whether the entry-point at the given `targetPath` needs to be processed.
33
- *
34
- * @param propertiesToConsider the package.json properties that should be considered for
35
- * processing.
36
- * @param compileAllFormats true if all formats need to be processed, or false if it is enough for
37
- * one of the formats covered by the `propertiesToConsider` is processed.
38
- */
39
- targetNeedsProcessingOrCleaning(propertiesToConsider: EntryPointJsonProperty[], compileAllFormats: boolean): boolean;
40
- /**
41
- * Return an array containing the `targetPath` from which to start the trace.
42
- */
43
- protected getInitialEntryPointPaths(): AbsoluteFsPath[];
44
- /**
45
- * For the given `entryPointPath`, compute, or retrieve, the entry-point information, including
46
- * paths to other entry-points that this entry-point depends upon.
47
- *
48
- * @param entryPointPath the path to the entry-point whose information and dependencies are to be
49
- * retrieved or computed.
50
- *
51
- * @returns the entry-point and its dependencies or `null` if the entry-point is not compiled by
52
- * Angular or cannot be determined.
53
- */
54
- protected getEntryPointWithDeps(entryPointPath: AbsoluteFsPath): EntryPointWithDependencies | null;
55
- /**
56
- * Compute the path to the package that contains the given entry-point.
57
- *
58
- * In this entry-point finder it is not trivial to find the containing package, since it is
59
- * possible that this entry-point is not directly below the directory containing the package.
60
- * Moreover, the import path could be affected by path-mapping.
61
- *
62
- * @param entryPointPath the path to the entry-point, whose package path we want to compute.
63
- */
64
- private computePackagePath;
65
- /**
66
- * Compute whether the `test` path is contained within the `base` path.
67
- *
68
- * Note that this doesn't use a simple `startsWith()` since that would result in a false positive
69
- * for `test` paths such as `a/b/c-x` when the `base` path is `a/b/c`.
70
- *
71
- * Since `fs.relative()` can be quite expensive we check the fast possibilities first.
72
- */
73
- private isPathContainedBy;
74
- /**
75
- * Search down to the `entryPointPath` from the `containingPath` for the first `package.json` that
76
- * we come to. This is the path to the entry-point's containing package. For example if
77
- * `containingPath` is `/a/b/c` and `entryPointPath` is `/a/b/c/d/e` and there exists
78
- * `/a/b/c/d/package.json` and `/a/b/c/d/e/package.json`, then we will return `/a/b/c/d`.
79
- *
80
- * To account for nested `node_modules` we actually start the search at the last `node_modules` in
81
- * the `entryPointPath` that is below the `containingPath`. E.g. if `containingPath` is `/a/b/c`
82
- * and `entryPointPath` is `/a/b/c/d/node_modules/x/y/z`, we start the search at
83
- * `/a/b/c/d/node_modules`.
84
- */
85
- private computePackagePathFromContainingPath;
86
- /**
87
- * Search up the directory tree from the `entryPointPath` looking for a `node_modules` directory
88
- * that we can use as a potential starting point for computing the package path.
89
- */
90
- private computePackagePathFromNearestNodeModules;
91
- /**
92
- * Split the given `path` into path segments using an FS independent algorithm.
93
- */
94
- private splitPath;
95
- }
@@ -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
- }