@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,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 { AbsoluteFsPath, FileSystem, PathSegment } from '../../../../src/ngtsc/file_system';
9
- /**
10
- * Implement this interface to extend the cleaning strategies of the `PackageCleaner`.
11
- */
12
- export interface CleaningStrategy {
13
- canClean(path: AbsoluteFsPath, basename: PathSegment): boolean;
14
- clean(path: AbsoluteFsPath, basename: PathSegment): void;
15
- }
16
- /**
17
- * A CleaningStrategy that reverts changes to package.json files by removing the build marker and
18
- * other properties.
19
- */
20
- export declare class PackageJsonCleaner implements CleaningStrategy {
21
- private fs;
22
- constructor(fs: FileSystem);
23
- canClean(_path: AbsoluteFsPath, basename: PathSegment): boolean;
24
- clean(path: AbsoluteFsPath, _basename: PathSegment): void;
25
- }
26
- /**
27
- * A CleaningStrategy that removes the extra directory containing generated entry-point formats.
28
- */
29
- export declare class NgccDirectoryCleaner implements CleaningStrategy {
30
- private fs;
31
- constructor(fs: FileSystem);
32
- canClean(path: AbsoluteFsPath, basename: PathSegment): boolean;
33
- clean(path: AbsoluteFsPath, _basename: PathSegment): void;
34
- }
35
- /**
36
- * A CleaningStrategy that reverts files that were overwritten and removes the backup files that
37
- * ngcc created.
38
- */
39
- export declare class BackupFileCleaner implements CleaningStrategy {
40
- private fs;
41
- constructor(fs: FileSystem);
42
- canClean(path: AbsoluteFsPath, basename: PathSegment): boolean;
43
- clean(path: AbsoluteFsPath, _basename: PathSegment): void;
44
- }
@@ -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, FileSystem, ReadonlyFileSystem } from '../../../../src/ngtsc/file_system';
9
- import { EntryPoint } from '../../packages/entry_point';
10
- import { CleaningStrategy } from './cleaning_strategies';
11
- /**
12
- * A class that can clean ngcc artifacts from a directory.
13
- */
14
- export declare class PackageCleaner {
15
- private fs;
16
- private cleaners;
17
- constructor(fs: ReadonlyFileSystem, cleaners: CleaningStrategy[]);
18
- /**
19
- * Recurse through the file-system cleaning files and directories as determined by the configured
20
- * cleaning-strategies.
21
- *
22
- * @param directory the current directory to clean
23
- */
24
- clean(directory: AbsoluteFsPath): void;
25
- }
26
- /**
27
- * Iterate through the given `entryPoints` identifying the package for each that has at least one
28
- * outdated processed format, then cleaning those packages.
29
- *
30
- * Note that we have to clean entire packages because there is no clear file-system boundary
31
- * between entry-points within a package. So if one entry-point is outdated we have to clean
32
- * everything within that package.
33
- *
34
- * @param fileSystem the current file-system
35
- * @param entryPoints the entry-points that have been collected for this run of ngcc
36
- * @returns true if packages needed to be cleaned.
37
- */
38
- export declare function cleanOutdatedPackages(fileSystem: FileSystem, entryPoints: EntryPoint[]): boolean;
@@ -1,15 +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
- /**
10
- * Returns true if the given `path` is a directory (not a symlink) and actually exists.
11
- *
12
- * @param fs the current filesystem
13
- * @param path the path to check
14
- */
15
- export declare function isLocalDirectory(fs: ReadonlyFileSystem, path: AbsoluteFsPath): boolean;
@@ -1,28 +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 { EntryPoint, EntryPointJsonProperty } from '../packages/entry_point';
10
- import { EntryPointBundle } from '../packages/entry_point_bundle';
11
- import { FileToWrite } from '../rendering/utils';
12
- /**
13
- * Responsible for writing out the transformed files to disk.
14
- */
15
- export interface FileWriter {
16
- writeBundle(bundle: EntryPointBundle, transformedFiles: FileToWrite[], formatProperties: EntryPointJsonProperty[]): void;
17
- /**
18
- * Revert the changes to an entry-point processed for the specified format-properties by the same
19
- * `FileWriter` implementation.
20
- *
21
- * @param entryPoint The entry-point to revert.
22
- * @param transformedFilePaths The original paths of the transformed files. (The transformed files
23
- * may be written at the same or a different location, depending on the `FileWriter`
24
- * implementation.)
25
- * @param formatProperties The format-properties pointing to the entry-point.
26
- */
27
- revertBundle(entryPoint: EntryPoint, transformedFilePaths: AbsoluteFsPath[], formatProperties: EntryPointJsonProperty[]): void;
28
- }
@@ -1,28 +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, FileSystem } from '../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../src/ngtsc/logging';
10
- import { EntryPoint, EntryPointJsonProperty } from '../packages/entry_point';
11
- import { EntryPointBundle } from '../packages/entry_point_bundle';
12
- import { FileToWrite } from '../rendering/utils';
13
- import { FileWriter } from './file_writer';
14
- export declare const NGCC_BACKUP_EXTENSION = ".__ivy_ngcc_bak";
15
- /**
16
- * This FileWriter overwrites the transformed file, in-place, while creating
17
- * a back-up of the original file with an extra `.__ivy_ngcc_bak` extension.
18
- */
19
- export declare class InPlaceFileWriter implements FileWriter {
20
- protected fs: FileSystem;
21
- protected logger: Logger;
22
- protected errorOnFailedEntryPoint: boolean;
23
- constructor(fs: FileSystem, logger: Logger, errorOnFailedEntryPoint: boolean);
24
- writeBundle(_bundle: EntryPointBundle, transformedFiles: FileToWrite[], _formatProperties?: EntryPointJsonProperty[]): void;
25
- revertBundle(_entryPoint: EntryPoint, transformedFilePaths: AbsoluteFsPath[], _formatProperties: EntryPointJsonProperty[]): void;
26
- protected writeFileAndBackup(file: FileToWrite): void;
27
- protected revertFileAndBackup(filePath: AbsoluteFsPath): void;
28
- }
@@ -1,48 +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, FileSystem } from '../../../src/ngtsc/file_system';
9
- import { Logger } from '../../../src/ngtsc/logging';
10
- import { EntryPoint, EntryPointJsonProperty } from '../packages/entry_point';
11
- import { EntryPointBundle } from '../packages/entry_point_bundle';
12
- import { FileToWrite } from '../rendering/utils';
13
- import { InPlaceFileWriter } from './in_place_file_writer';
14
- import { PackageJsonUpdater } from './package_json_updater';
15
- export declare const NGCC_DIRECTORY = "__ivy_ngcc__";
16
- export declare const NGCC_PROPERTY_EXTENSION = "_ivy_ngcc";
17
- /**
18
- * This FileWriter creates a copy of the original entry-point, then writes the transformed
19
- * files onto the files in this copy, and finally updates the package.json with a new
20
- * entry-point format property that points to this new entry-point.
21
- *
22
- * If there are transformed typings files in this bundle, they are updated in-place (see the
23
- * `InPlaceFileWriter`).
24
- */
25
- export declare class NewEntryPointFileWriter extends InPlaceFileWriter {
26
- private pkgJsonUpdater;
27
- constructor(fs: FileSystem, logger: Logger, errorOnFailedEntryPoint: boolean, pkgJsonUpdater: PackageJsonUpdater);
28
- writeBundle(bundle: EntryPointBundle, transformedFiles: FileToWrite[], formatProperties: EntryPointJsonProperty[]): void;
29
- revertBundle(entryPoint: EntryPoint, transformedFilePaths: AbsoluteFsPath[], formatProperties: EntryPointJsonProperty[]): void;
30
- protected copyBundle(bundle: EntryPointBundle, packagePath: AbsoluteFsPath, ngccFolder: AbsoluteFsPath, transformedFiles: FileToWrite[]): void;
31
- /**
32
- * If a source file has an associated source-map, then copy this, while updating its sourceRoot
33
- * accordingly.
34
- *
35
- * For now don't try to parse the source for inline source-maps or external source-map links,
36
- * since that is more complex and will slow ngcc down.
37
- * Instead just check for a source-map file residing next to the source file, which is by far
38
- * the most common case.
39
- *
40
- * @param originalSrcPath absolute path to the original source file being copied.
41
- * @param newSrcPath absolute path to where the source will be written.
42
- */
43
- protected copyAndUpdateSourceMap(originalSrcPath: AbsoluteFsPath, newSrcPath: AbsoluteFsPath): void;
44
- protected writeFile(file: FileToWrite, packagePath: AbsoluteFsPath, ngccFolder: AbsoluteFsPath): void;
45
- protected revertFile(filePath: AbsoluteFsPath, packagePath: AbsoluteFsPath): void;
46
- protected updatePackageJson(entryPoint: EntryPoint, formatProperties: EntryPointJsonProperty[], ngccFolder: AbsoluteFsPath): void;
47
- protected revertPackageJson(entryPoint: EntryPoint, formatProperties: EntryPointJsonProperty[]): void;
48
- }
@@ -1,98 +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, FileSystem } from '../../../src/ngtsc/file_system';
9
- import { JsonObject, JsonValue } from '../utils';
10
- export type PackageJsonChange = [string[], JsonValue, PackageJsonPropertyPositioning];
11
- export type PackageJsonPropertyPositioning = 'unimportant' | 'alphabetic' | {
12
- before: string;
13
- };
14
- export type WritePackageJsonChangesFn = (changes: PackageJsonChange[], packageJsonPath: AbsoluteFsPath, parsedJson?: JsonObject) => void;
15
- /**
16
- * A utility object that can be used to safely update values in a `package.json` file.
17
- *
18
- * Example usage:
19
- * ```ts
20
- * const updatePackageJson = packageJsonUpdater
21
- * .createUpdate()
22
- * .addChange(['name'], 'package-foo')
23
- * .addChange(['scripts', 'foo'], 'echo FOOOO...', 'unimportant')
24
- * .addChange(['dependencies', 'baz'], '1.0.0', 'alphabetic')
25
- * .addChange(['dependencies', 'bar'], '2.0.0', {before: 'baz'})
26
- * .writeChanges('/foo/package.json');
27
- * // or
28
- * // .writeChanges('/foo/package.json', inMemoryParsedJson);
29
- * ```
30
- */
31
- export interface PackageJsonUpdater {
32
- /**
33
- * Create a `PackageJsonUpdate` object, which provides a fluent API for batching updates to a
34
- * `package.json` file. (Batching the updates is useful, because it avoids unnecessary I/O
35
- * operations.)
36
- */
37
- createUpdate(): PackageJsonUpdate;
38
- /**
39
- * Write a set of changes to the specified `package.json` file (and optionally a pre-existing,
40
- * in-memory representation of it).
41
- *
42
- * @param changes The set of changes to apply.
43
- * @param packageJsonPath The path to the `package.json` file that needs to be updated.
44
- * @param parsedJson A pre-existing, in-memory representation of the `package.json` file that
45
- * needs to be updated as well.
46
- */
47
- writeChanges(changes: PackageJsonChange[], packageJsonPath: AbsoluteFsPath, parsedJson?: JsonObject): void;
48
- }
49
- /**
50
- * A utility class providing a fluent API for recording multiple changes to a `package.json` file
51
- * (and optionally its in-memory parsed representation).
52
- *
53
- * NOTE: This class should generally not be instantiated directly; instances are implicitly created
54
- * via `PackageJsonUpdater#createUpdate()`.
55
- */
56
- export declare class PackageJsonUpdate {
57
- private writeChangesImpl;
58
- private changes;
59
- private applied;
60
- constructor(writeChangesImpl: WritePackageJsonChangesFn);
61
- /**
62
- * Record a change to a `package.json` property.
63
- *
64
- * If the ancestor objects do not yet exist in the `package.json` file, they will be created. The
65
- * positioning of the property can also be specified. (If the property already exists, it will be
66
- * moved accordingly.)
67
- *
68
- * NOTE: Property positioning is only guaranteed to be respected in the serialized `package.json`
69
- * file. Positioning will not be taken into account when updating in-memory representations.
70
- *
71
- * NOTE 2: Property positioning only affects the last property in `propertyPath`. Ancestor
72
- * objects' positioning will not be affected.
73
- *
74
- * @param propertyPath The path of a (possibly nested) property to add/update.
75
- * @param value The new value to set the property to.
76
- * @param position The desired position for the added/updated property.
77
- */
78
- addChange(propertyPath: string[], value: JsonValue, positioning?: PackageJsonPropertyPositioning): this;
79
- /**
80
- * Write the recorded changes to the associated `package.json` file (and optionally a
81
- * pre-existing, in-memory representation of it).
82
- *
83
- * @param packageJsonPath The path to the `package.json` file that needs to be updated.
84
- * @param parsedJson A pre-existing, in-memory representation of the `package.json` file that
85
- * needs to be updated as well.
86
- */
87
- writeChanges(packageJsonPath: AbsoluteFsPath, parsedJson?: JsonObject): void;
88
- private ensureNotApplied;
89
- private ensureNotSynthesized;
90
- }
91
- /** A `PackageJsonUpdater` that writes directly to the file-system. */
92
- export declare class DirectPackageJsonUpdater implements PackageJsonUpdater {
93
- private fs;
94
- constructor(fs: FileSystem);
95
- createUpdate(): PackageJsonUpdate;
96
- writeChanges(changes: PackageJsonChange[], packageJsonPath: AbsoluteFsPath, preExistingParsedJson?: JsonObject): void;
97
- }
98
- export declare function applyChange(ctx: JsonObject, propPath: string[], value: JsonValue, positioning: PackageJsonPropertyPositioning): void;
@@ -1,24 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import ts from 'typescript';
9
- import { AbsoluteFsPath } from '../../file_system';
10
- import { ImportRewriter } from '../../imports';
11
- import { FactoryInfo, FactoryTracker, ModuleInfo, PerFileShimGenerator } from '../api';
12
- /**
13
- * Generates ts.SourceFiles which contain variable declarations for NgFactories for every exported
14
- * class of an input ts.SourceFile.
15
- */
16
- export declare class FactoryGenerator implements PerFileShimGenerator, FactoryTracker {
17
- readonly sourceInfo: Map<string, FactoryInfo>;
18
- private sourceToFactorySymbols;
19
- readonly shouldEmit = true;
20
- readonly extensionPrefix = "ngfactory";
21
- generateShimForFile(sf: ts.SourceFile, genFilePath: AbsoluteFsPath): ts.SourceFile;
22
- track(sf: ts.SourceFile, moduleInfo: ModuleInfo): void;
23
- }
24
- export declare function generatedFactoryTransform(factoryMap: Map<string, FactoryInfo>, importRewriter: ImportRewriter): ts.TransformerFactory<ts.SourceFile>;
@@ -1,15 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import ts from 'typescript';
9
- import { AbsoluteFsPath } from '../../file_system';
10
- import { PerFileShimGenerator } from '../api';
11
- export declare class SummaryGenerator implements PerFileShimGenerator {
12
- readonly shouldEmit = true;
13
- readonly extensionPrefix = "ngsummary";
14
- generateShimForFile(sf: ts.SourceFile, genFilePath: AbsoluteFsPath): ts.SourceFile;
15
- }