@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,222 +0,0 @@
1
- import { AbsoluteFsPath, PathManipulation, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
2
- import { PackageJsonFormatPropertiesMap } from './entry_point';
3
- /**
4
- * The format of a project level configuration file.
5
- */
6
- export interface NgccProjectConfig {
7
- /**
8
- * The packages that are configured by this project config.
9
- */
10
- packages?: {
11
- [packagePath: string]: RawNgccPackageConfig | undefined;
12
- };
13
- /**
14
- * Options that control how locking the process is handled.
15
- */
16
- locking?: ProcessLockingConfiguration;
17
- /**
18
- * Name of hash algorithm used to generate hashes of the configuration.
19
- *
20
- * Defaults to `sha256`.
21
- */
22
- hashAlgorithm?: string;
23
- }
24
- /**
25
- * Options that control how locking the process is handled.
26
- */
27
- export interface ProcessLockingConfiguration {
28
- /**
29
- * The number of times the AsyncLocker will attempt to lock the process before failing.
30
- * Defaults to 500.
31
- */
32
- retryAttempts?: number;
33
- /**
34
- * The number of milliseconds between attempts to lock the process.
35
- * Defaults to 500ms.
36
- * */
37
- retryDelay?: number;
38
- }
39
- /**
40
- * The raw format of a package level configuration (as it appears in configuration files).
41
- */
42
- export interface RawNgccPackageConfig {
43
- /**
44
- * The entry-points to configure for this package.
45
- *
46
- * In the config file the keys are paths relative to the package path.
47
- */
48
- entryPoints?: {
49
- [entryPointPath: string]: NgccEntryPointConfig;
50
- };
51
- /**
52
- * A collection of regexes that match deep imports to ignore, for this package, rather than
53
- * displaying a warning.
54
- */
55
- ignorableDeepImportMatchers?: RegExp[];
56
- }
57
- /**
58
- * Configuration options for an entry-point.
59
- *
60
- * The existence of a configuration for a path tells ngcc that this should be considered for
61
- * processing as an entry-point.
62
- */
63
- export interface NgccEntryPointConfig {
64
- /** Do not process (or even acknowledge the existence of) this entry-point, if true. */
65
- ignore?: boolean;
66
- /**
67
- * This property, if provided, holds values that will override equivalent properties in an
68
- * entry-point's package.json file.
69
- */
70
- override?: PackageJsonFormatPropertiesMap;
71
- /**
72
- * Normally, ngcc will skip compilation of entrypoints that contain imports that can't be resolved
73
- * or understood. If this option is specified, ngcc will proceed with compiling the entrypoint
74
- * even in the face of such missing dependencies.
75
- */
76
- ignoreMissingDependencies?: boolean;
77
- /**
78
- * Enabling this option for an entrypoint tells ngcc that deep imports might be used for the files
79
- * it contains, and that it should generate private re-exports alongside the NgModule of all the
80
- * directives/pipes it makes available in support of those imports.
81
- */
82
- generateDeepReexports?: boolean;
83
- }
84
- interface VersionedPackageConfig extends RawNgccPackageConfig {
85
- versionRange: string;
86
- }
87
- /**
88
- * The internal representation of a configuration file. Configured packages are transformed into
89
- * `ProcessedNgccPackageConfig` when a certain version is requested.
90
- */
91
- export declare class PartiallyProcessedConfig {
92
- /**
93
- * The packages that are configured by this project config, keyed by package name.
94
- */
95
- packages: Map<string, VersionedPackageConfig[]>;
96
- /**
97
- * Options that control how locking the process is handled.
98
- */
99
- locking: ProcessLockingConfiguration;
100
- /**
101
- * Name of hash algorithm used to generate hashes of the configuration.
102
- *
103
- * Defaults to `sha256`.
104
- */
105
- hashAlgorithm: string;
106
- constructor(projectConfig: NgccProjectConfig);
107
- private splitNameAndVersion;
108
- /**
109
- * Registers the configuration for a particular version of the provided package.
110
- */
111
- private addPackageConfig;
112
- /**
113
- * Finds the configuration for a particular version of the provided package.
114
- */
115
- findPackageConfig(packageName: string, version: string | null): VersionedPackageConfig | null;
116
- /**
117
- * Converts the configuration into a JSON representation that is used to compute a hash of the
118
- * configuration.
119
- */
120
- toJson(): string;
121
- }
122
- /**
123
- * The default configuration for ngcc.
124
- *
125
- * This is the ultimate fallback configuration that ngcc will use if there is no configuration
126
- * for a package at the package level or project level.
127
- *
128
- * This configuration is for packages that are "dead" - i.e. no longer maintained and so are
129
- * unlikely to be fixed to work with ngcc, nor provide a package level config of their own.
130
- *
131
- * The fallback process for looking up configuration is:
132
- *
133
- * Project -> Package -> Default
134
- *
135
- * If a package provides its own configuration then that would override this default one.
136
- *
137
- * Also application developers can always provide configuration at their project level which
138
- * will override everything else.
139
- *
140
- * Note that the fallback is package based not entry-point based.
141
- * For example, if a there is configuration for a package at the project level this will replace all
142
- * entry-point configurations that may have been provided in the package level or default level
143
- * configurations, even if the project level configuration does not provide for a given entry-point.
144
- */
145
- export declare const DEFAULT_NGCC_CONFIG: NgccProjectConfig;
146
- /**
147
- * The processed package level configuration as a result of processing a raw package level config.
148
- */
149
- export declare class ProcessedNgccPackageConfig implements Omit<RawNgccPackageConfig, 'entryPoints'> {
150
- /**
151
- * The absolute path to this instance of the package.
152
- * Note that there may be multiple instances of a package inside a project in nested
153
- * `node_modules/`. For example, one at `<project-root>/node_modules/some-package/` and one at
154
- * `<project-root>/node_modules/other-package/node_modules/some-package/`.
155
- */
156
- packagePath: AbsoluteFsPath;
157
- /**
158
- * The entry-points to configure for this package.
159
- *
160
- * In contrast to `RawNgccPackageConfig`, the paths are absolute and take the path of the specific
161
- * instance of the package into account.
162
- */
163
- entryPoints: Map<AbsoluteFsPath, NgccEntryPointConfig>;
164
- /**
165
- * A collection of regexes that match deep imports to ignore, for this package, rather than
166
- * displaying a warning.
167
- */
168
- ignorableDeepImportMatchers: RegExp[];
169
- constructor(fs: PathManipulation, packagePath: AbsoluteFsPath, { entryPoints, ignorableDeepImportMatchers, }: RawNgccPackageConfig);
170
- }
171
- /**
172
- * Ngcc has a hierarchical configuration system that lets us "fix up" packages that do not
173
- * work with ngcc out of the box.
174
- *
175
- * There are three levels at which configuration can be declared:
176
- *
177
- * * Default level - ngcc comes with built-in configuration for well known cases.
178
- * * Package level - a library author publishes a configuration with their package to fix known
179
- * issues.
180
- * * Project level - the application developer provides a configuration that fixes issues specific
181
- * to the libraries used in their application.
182
- *
183
- * Ngcc will match configuration based on the package name but also on its version. This allows
184
- * configuration to provide different fixes to different version ranges of a package.
185
- *
186
- * * Package level configuration is specific to the package version where the configuration is
187
- * found.
188
- * * Default and project level configuration should provide version ranges to ensure that the
189
- * configuration is only applied to the appropriate versions of a package.
190
- *
191
- * When getting a configuration for a package (via `getConfig()`) the caller should provide the
192
- * version of the package in question, if available. If it is not provided then the first available
193
- * configuration for a package is returned.
194
- */
195
- export declare class NgccConfiguration {
196
- private fs;
197
- private defaultConfig;
198
- private projectConfig;
199
- private cache;
200
- readonly hash: string;
201
- readonly hashAlgorithm: string;
202
- constructor(fs: ReadonlyFileSystem, baseDir: AbsoluteFsPath);
203
- /**
204
- * Get the configuration options for locking the ngcc process.
205
- */
206
- getLockingConfig(): Required<ProcessLockingConfiguration>;
207
- /**
208
- * Get a configuration for the given `version` of a package at `packagePath`.
209
- *
210
- * @param packageName The name of the package whose config we want.
211
- * @param packagePath The path to the package whose config we want.
212
- * @param version The version of the package whose config we want, or `null` if the package's
213
- * package.json did not exist or was invalid.
214
- */
215
- getPackageConfig(packageName: string, packagePath: AbsoluteFsPath, version: string | null): ProcessedNgccPackageConfig;
216
- private getRawPackageConfig;
217
- private loadProjectConfig;
218
- private loadPackageConfig;
219
- private evalSrcFile;
220
- private computeHash;
221
- }
222
- export {};
@@ -1,109 +0,0 @@
1
- import { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
2
- import { Logger } from '../../../src/ngtsc/logging';
3
- import { JsonObject } from '../utils';
4
- import { NgccConfiguration } from './configuration';
5
- /**
6
- * The possible values for the format of an entry-point.
7
- */
8
- export type EntryPointFormat = 'esm5' | 'esm2015' | 'umd' | 'commonjs';
9
- /**
10
- * An object containing information about an entry-point, including paths
11
- * to each of the possible entry-point formats.
12
- */
13
- export interface EntryPoint extends JsonObject {
14
- /** The name of the entry-point (e.g. `@angular/core` or `@angular/common/http`). */
15
- name: string;
16
- /** The path to this entry point. */
17
- path: AbsoluteFsPath;
18
- /**
19
- * The name of the package that contains this entry-point (e.g. `@angular/core` or
20
- * `@angular/common`).
21
- */
22
- packageName: string;
23
- /** The path to the package that contains this entry-point. */
24
- packagePath: AbsoluteFsPath;
25
- /** The URL of the repository. */
26
- repositoryUrl: string;
27
- /** The parsed package.json file for this entry-point. */
28
- packageJson: EntryPointPackageJson;
29
- /** The path to a typings (.d.ts) file for this entry-point. */
30
- typings: AbsoluteFsPath;
31
- /** Is this EntryPoint compiled with the Angular View Engine compiler? */
32
- compiledByAngular: boolean;
33
- /** Should ngcc ignore missing dependencies and process this entrypoint anyway? */
34
- ignoreMissingDependencies: boolean;
35
- /** Should ngcc generate deep re-exports for this entrypoint? */
36
- generateDeepReexports: boolean;
37
- }
38
- export interface PackageJsonFormatPropertiesMap {
39
- browser?: string;
40
- fesm2015?: string;
41
- fesm5?: string;
42
- es2015?: string;
43
- esm2015?: string;
44
- esm5?: string;
45
- main?: string;
46
- module?: string;
47
- types?: string;
48
- typings?: string;
49
- }
50
- export type PackageJsonFormatProperties = keyof PackageJsonFormatPropertiesMap;
51
- /**
52
- * The properties that may be loaded from the `package.json` file.
53
- */
54
- export interface EntryPointPackageJson extends JsonObject, PackageJsonFormatPropertiesMap {
55
- name: string;
56
- version?: string;
57
- scripts?: Record<string, string>;
58
- repository?: string | {
59
- url: string;
60
- };
61
- __processed_by_ivy_ngcc__?: Record<string, string>;
62
- }
63
- export type EntryPointJsonProperty = Exclude<PackageJsonFormatProperties, 'types' | 'typings'>;
64
- export declare const SUPPORTED_FORMAT_PROPERTIES: EntryPointJsonProperty[];
65
- /**
66
- * The path does not represent an entry-point, i.e. there is no package.json at the path and there
67
- * is no config to force an entry-point.
68
- */
69
- export declare const NO_ENTRY_POINT = "no-entry-point";
70
- /**
71
- * The path represents an entry-point that is `ignored` by an ngcc config.
72
- */
73
- export declare const IGNORED_ENTRY_POINT = "ignored-entry-point";
74
- /**
75
- * The path has a package.json, but it is not a valid entry-point for ngcc processing.
76
- */
77
- export declare const INCOMPATIBLE_ENTRY_POINT = "incompatible-entry-point";
78
- /**
79
- * The result of calling `getEntryPointInfo()`.
80
- *
81
- * This will be an `EntryPoint` object if an Angular entry-point was identified;
82
- * Otherwise it will be a flag indicating one of:
83
- * * NO_ENTRY_POINT - the path is not an entry-point or ngcc is configured to ignore it
84
- * * INCOMPATIBLE_ENTRY_POINT - the path was a non-processable entry-point that should be searched
85
- * for sub-entry-points
86
- */
87
- export type GetEntryPointResult = EntryPoint | typeof IGNORED_ENTRY_POINT | typeof INCOMPATIBLE_ENTRY_POINT | typeof NO_ENTRY_POINT;
88
- /**
89
- * Try to create an entry-point from the given paths and properties.
90
- *
91
- * @param packagePath the absolute path to the containing npm package
92
- * @param entryPointPath the absolute path to the potential entry-point.
93
- * @returns
94
- * - An entry-point if it is valid and not ignored.
95
- * - `NO_ENTRY_POINT` when there is no package.json at the path and there is no config to force an
96
- * entry-point,
97
- * - `IGNORED_ENTRY_POINT` when the entry-point is ignored by an ngcc config.
98
- * - `INCOMPATIBLE_ENTRY_POINT` when there is a package.json but it is not a valid Angular compiled
99
- * entry-point.
100
- */
101
- export declare function getEntryPointInfo(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, packagePath: AbsoluteFsPath, entryPointPath: AbsoluteFsPath): GetEntryPointResult;
102
- export declare function isEntryPoint(result: GetEntryPointResult): result is EntryPoint;
103
- /**
104
- * Convert a package.json property into an entry-point format.
105
- *
106
- * @param property The property to convert to a format.
107
- * @returns An entry-point format or `undefined` if none match the given property.
108
- */
109
- export declare function getEntryPointFormat(fs: ReadonlyFileSystem, entryPoint: EntryPoint, property: EntryPointJsonProperty): EntryPointFormat | undefined;
@@ -1,46 +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, FileSystem } from '../../../src/ngtsc/file_system';
10
- import { DtsProcessing } from '../execution/tasks/api';
11
- import { PathMappings } from '../path_mappings';
12
- import { BundleProgram } from './bundle_program';
13
- import { EntryPoint, EntryPointFormat } from './entry_point';
14
- import { SharedFileCache } from './source_file_cache';
15
- /**
16
- * A bundle of files and paths (and TS programs) that correspond to a particular
17
- * format of a package entry-point.
18
- */
19
- export interface EntryPointBundle {
20
- entryPoint: EntryPoint;
21
- format: EntryPointFormat;
22
- isCore: boolean;
23
- isFlatCore: boolean;
24
- rootDirs: AbsoluteFsPath[];
25
- src: BundleProgram;
26
- dts: BundleProgram | null;
27
- dtsProcessing: DtsProcessing;
28
- enableI18nLegacyMessageIdFormat: boolean;
29
- }
30
- /**
31
- * Get an object that describes a formatted bundle for an entry-point.
32
- * @param fs The current file-system being used.
33
- * @param entryPoint The entry-point that contains the bundle.
34
- * @param sharedFileCache The cache to use for source files that are shared across all entry-points.
35
- * @param moduleResolutionCache The module resolution cache to use.
36
- * @param formatPath The path to the source files for this bundle.
37
- * @param isCore This entry point is the Angular core package.
38
- * @param format The underlying format of the bundle.
39
- * @param dtsProcessing Whether to transform the typings along with this bundle.
40
- * @param pathMappings An optional set of mappings to use when compiling files.
41
- * @param mirrorDtsFromSrc If true then the `dts` program will contain additional files that
42
- * were guessed by mapping the `src` files to `dts` files.
43
- * @param enableI18nLegacyMessageIdFormat Whether to render legacy message ids for i18n messages in
44
- * component templates.
45
- */
46
- export declare function makeEntryPointBundle(fs: FileSystem, entryPoint: EntryPoint, sharedFileCache: SharedFileCache, moduleResolutionCache: ts.ModuleResolutionCache, formatPath: string, isCore: boolean, format: EntryPointFormat, dtsProcessing: DtsProcessing, pathMappings?: PathMappings, mirrorDtsFromSrc?: boolean, enableI18nLegacyMessageIdFormat?: boolean): EntryPointBundle;
@@ -1,79 +0,0 @@
1
- import { AbsoluteFsPath, FileSystem, PathSegment } from '../../../src/ngtsc/file_system';
2
- import { Logger } from '../../../src/ngtsc/logging';
3
- import { EntryPointWithDependencies } from '../dependencies/dependency_host';
4
- import { NgccConfiguration } from './configuration';
5
- import { PackageJsonFormatProperties } from './entry_point';
6
- /**
7
- * Manages reading and writing a manifest file that contains a list of all the entry-points that
8
- * were found below a given basePath.
9
- *
10
- * This is a super-set of the entry-points that are actually processed for a given run of ngcc,
11
- * since some may already be processed, or excluded if they do not have the required format.
12
- */
13
- export declare class EntryPointManifest {
14
- private fs;
15
- private config;
16
- private logger;
17
- constructor(fs: FileSystem, config: NgccConfiguration, logger: Logger);
18
- /**
19
- * Try to get the entry-point info from a manifest file for the given `basePath` if it exists and
20
- * is not out of date.
21
- *
22
- * Reasons for the manifest to be out of date are:
23
- *
24
- * * the file does not exist
25
- * * the ngcc version has changed
26
- * * the package lock-file (i.e. yarn.lock or package-lock.json) has changed
27
- * * the project configuration has changed
28
- * * one or more entry-points in the manifest are not valid
29
- *
30
- * @param basePath The path that would contain the entry-points and the manifest file.
31
- * @returns an array of entry-point information for all entry-points found below the given
32
- * `basePath` or `null` if the manifest was out of date.
33
- */
34
- readEntryPointsUsingManifest(basePath: AbsoluteFsPath): EntryPointWithDependencies[] | null;
35
- /**
36
- * Write a manifest file at the given `basePath`.
37
- *
38
- * The manifest includes the current ngcc version and hashes of the package lock-file and current
39
- * project config. These will be used to check whether the manifest file is out of date. See
40
- * `readEntryPointsUsingManifest()`.
41
- *
42
- * @param basePath The path where the manifest file is to be written.
43
- * @param entryPoints A collection of entry-points to record in the manifest.
44
- */
45
- writeEntryPointManifest(basePath: AbsoluteFsPath, entryPoints: EntryPointWithDependencies[]): void;
46
- private getEntryPointManifestPath;
47
- private computeLockFileHash;
48
- }
49
- /**
50
- * A specialized implementation of the `EntryPointManifest` that can be used to invalidate the
51
- * current manifest file.
52
- *
53
- * It always returns `null` from the `readEntryPointsUsingManifest()` method, which forces a new
54
- * manifest to be created, which will overwrite the current file when `writeEntryPointManifest()`
55
- * is called.
56
- */
57
- export declare class InvalidatingEntryPointManifest extends EntryPointManifest {
58
- readEntryPointsUsingManifest(_basePath: AbsoluteFsPath): EntryPointWithDependencies[] | null;
59
- }
60
- export type EntryPointPaths = [
61
- string,
62
- string,
63
- Array<AbsoluteFsPath>?,
64
- Array<AbsoluteFsPath | PathSegment>?,
65
- Array<AbsoluteFsPath>?
66
- ];
67
- /**
68
- * The JSON format of the manifest file that is written to disk.
69
- */
70
- export interface EntryPointManifestFile {
71
- ngccVersion: string;
72
- configFileHash: string;
73
- lockFileHash: string;
74
- entryPointPaths: EntryPointPaths[];
75
- }
76
- /** The JSON format of the entrypoint properties. */
77
- export type NewEntryPointPropertiesMap = {
78
- [Property in PackageJsonFormatProperties as `${Property}_ivy_ngcc`]?: string;
79
- };
@@ -1,36 +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, FileSystem, NgtscCompilerHost } from '../../../src/ngtsc/file_system';
10
- import { EntryPointFileCache } from './source_file_cache';
11
- /**
12
- * Represents a compiler host that resolves a module import as a JavaScript source file if
13
- * available, instead of the .d.ts typings file that would have been resolved by TypeScript. This
14
- * is necessary for packages that have their typings in the same directory as the sources, which
15
- * would otherwise let TypeScript prefer the .d.ts file instead of the JavaScript source file.
16
- */
17
- export declare class NgccSourcesCompilerHost extends NgtscCompilerHost {
18
- private cache;
19
- private moduleResolutionCache;
20
- protected packagePath: AbsoluteFsPath;
21
- constructor(fs: FileSystem, options: ts.CompilerOptions, cache: EntryPointFileCache, moduleResolutionCache: ts.ModuleResolutionCache, packagePath: AbsoluteFsPath);
22
- getSourceFile(fileName: string, languageVersion: ts.ScriptTarget): ts.SourceFile | undefined;
23
- resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ts.ResolvedProjectReference): Array<ts.ResolvedModule | undefined>;
24
- }
25
- /**
26
- * A compiler host implementation that is used for the typings program. It leverages the entry-point
27
- * cache for source files and module resolution, as these results can be reused across the sources
28
- * program.
29
- */
30
- export declare class NgccDtsCompilerHost extends NgtscCompilerHost {
31
- private cache;
32
- private moduleResolutionCache;
33
- constructor(fs: FileSystem, options: ts.CompilerOptions, cache: EntryPointFileCache, moduleResolutionCache: ts.ModuleResolutionCache);
34
- getSourceFile(fileName: string, languageVersion: ts.ScriptTarget): ts.SourceFile | undefined;
35
- resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ts.ResolvedProjectReference): Array<ts.ResolvedModule | undefined>;
36
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Consider the following ES5 code that may have been generated for a class:
3
- *
4
- * ```
5
- * var A = (function(){
6
- * function A() {}
7
- * return A;
8
- * }());
9
- * A.staticProp = true;
10
- * ```
11
- *
12
- * Here, TypeScript marks the symbol for "A" as a so-called "expando symbol", which causes
13
- * "staticProp" to be added as an export of the "A" symbol.
14
- *
15
- * In the example above, symbol "A" has been assigned some flags to indicate that it represents a
16
- * class. Due to this flag, the symbol is considered an expando symbol and as such, "staticProp" is
17
- * stored in `ts.Symbol.exports`.
18
- *
19
- * A problem arises when "A" is not at the top-level, i.e. in UMD bundles. In that case, the symbol
20
- * does not have the flag that marks the symbol as a class. Therefore, TypeScript inspects "A"'s
21
- * initializer expression, which is an IIFE in the above example. Unfortunately however, only IIFEs
22
- * of the form `(function(){})()` qualify as initializer for an "expando symbol"; the slightly
23
- * different form seen in the example above, `(function(){}())`, does not. This prevents the "A"
24
- * symbol from being considered an expando symbol, in turn preventing "staticProp" from being stored
25
- * in `ts.Symbol.exports`.
26
- *
27
- * The logic for identifying symbols as "expando symbols" can be found here:
28
- * https://github.com/microsoft/TypeScript/blob/v3.4.5/src/compiler/binder.ts#L2656-L2685
29
- *
30
- * Notice how the `getExpandoInitializer` function is available on the "ts" namespace in the
31
- * compiled bundle, so we are able to override this function to accommodate for the alternative
32
- * IIFE notation. The original implementation can be found at:
33
- * https://github.com/Microsoft/TypeScript/blob/v3.4.5/src/compiler/utilities.ts#L1864-L1887
34
- *
35
- * Issue tracked in https://github.com/microsoft/TypeScript/issues/31778
36
- *
37
- * @returns the function to pass to `restoreGetExpandoInitializer` to undo the patch, or null if
38
- * the issue is known to have been fixed.
39
- */
40
- export declare function patchTsGetExpandoInitializer(): unknown;
41
- export declare function restoreGetExpandoInitializer(originalGetExpandoInitializer: unknown): void;
@@ -1,97 +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
- /**
11
- * A cache that holds on to source files that can be shared for processing all entry-points in a
12
- * single invocation of ngcc. In particular, the following files are shared across all entry-points
13
- * through this cache:
14
- *
15
- * 1. Default library files such as `lib.dom.d.ts` and `lib.es5.d.ts`. These files don't change
16
- * and some are very large, so parsing is expensive. Therefore, the parsed `ts.SourceFile`s for
17
- * the default library files are cached.
18
- * 2. The typings of @angular scoped packages. The typing files for @angular packages are typically
19
- * used in the entry-points that ngcc processes, so benefit from a single source file cache.
20
- * Especially `@angular/core/core.d.ts` is large and expensive to parse repeatedly. In contrast
21
- * to default library files, we have to account for these files to be invalidated during a single
22
- * invocation of ngcc, as ngcc will overwrite the .d.ts files during its processing.
23
- *
24
- * The lifecycle of this cache corresponds with a single invocation of ngcc. Separate invocations,
25
- * e.g. the CLI's synchronous module resolution fallback will therefore all have their own cache.
26
- * This allows for the source file cache to be garbage collected once ngcc processing has completed.
27
- */
28
- export declare class SharedFileCache {
29
- private fs;
30
- private sfCache;
31
- constructor(fs: ReadonlyFileSystem);
32
- /**
33
- * Loads a `ts.SourceFile` if the provided `fileName` is deemed appropriate to be cached. To
34
- * optimize for memory usage, only files that are generally used in all entry-points are cached.
35
- * If `fileName` is not considered to benefit from caching or the requested file does not exist,
36
- * then `undefined` is returned.
37
- */
38
- getCachedSourceFile(fileName: string): ts.SourceFile | undefined;
39
- /**
40
- * Attempts to load the source file from the cache, or parses the file into a `ts.SourceFile` if
41
- * it's not yet cached. This method assumes that the file will not be modified for the duration
42
- * that this cache is valid for. If that assumption does not hold, the `getVolatileCachedFile`
43
- * method is to be used instead.
44
- */
45
- private getStableCachedFile;
46
- /**
47
- * In contrast to `getStableCachedFile`, this method always verifies that the cached source file
48
- * is the same as what's stored on disk. This is done for files that are expected to change during
49
- * ngcc's processing, such as @angular scoped packages for which the .d.ts files are overwritten
50
- * by ngcc. If the contents on disk have changed compared to a previously cached source file, the
51
- * content from disk is re-parsed and the cache entry is replaced.
52
- */
53
- private getVolatileCachedFile;
54
- }
55
- /**
56
- * Determines whether the provided path corresponds with a default library file inside of the
57
- * typescript package.
58
- *
59
- * @param absPath The path for which to determine if it corresponds with a default library file.
60
- * @param fs The filesystem to use for inspecting the path.
61
- */
62
- export declare function isDefaultLibrary(absPath: AbsoluteFsPath, fs: ReadonlyFileSystem): boolean;
63
- /**
64
- * Determines whether the provided path corresponds with a .d.ts file inside of an @angular
65
- * scoped package. This logic only accounts for the .d.ts files in the root, which is sufficient
66
- * to find the large, flattened entry-point files that benefit from caching.
67
- *
68
- * @param absPath The path for which to determine if it corresponds with an @angular .d.ts file.
69
- * @param fs The filesystem to use for inspecting the path.
70
- */
71
- export declare function isAngularDts(absPath: AbsoluteFsPath, fs: ReadonlyFileSystem): boolean;
72
- /**
73
- * A cache for processing a single entry-point. This exists to share `ts.SourceFile`s between the
74
- * source and typing programs that are created for a single program.
75
- */
76
- export declare class EntryPointFileCache {
77
- private fs;
78
- private sharedFileCache;
79
- private processSourceText;
80
- private readonly sfCache;
81
- constructor(fs: ReadonlyFileSystem, sharedFileCache: SharedFileCache, processSourceText: (sourceText: string) => string);
82
- /**
83
- * Returns and caches a parsed `ts.SourceFile` for the provided `fileName`. If the `fileName` is
84
- * cached in the shared file cache, that result is used. Otherwise, the source file is cached
85
- * internally. This method returns `undefined` if the requested file does not exist.
86
- *
87
- * @param fileName The path of the file to retrieve a source file for.
88
- * @param languageVersion The language version to use for parsing the file.
89
- */
90
- getCachedSourceFile(fileName: string, languageVersion: ts.ScriptTarget): ts.SourceFile | undefined;
91
- }
92
- /**
93
- * Creates a `ts.ModuleResolutionCache` that uses the provided filesystem for path operations.
94
- *
95
- * @param fs The filesystem to use for path operations.
96
- */
97
- export declare function createModuleResolutionCache(fs: ReadonlyFileSystem): ts.ModuleResolutionCache;