@angular/compiler-cli 15.2.0-rc.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.
- package/bundles/{chunk-JYL7IHZC.js → chunk-2DMH5JXJ.js} +16 -23
- package/bundles/chunk-2DMH5JXJ.js.map +6 -0
- package/bundles/{chunk-ZB4CDKOH.js → chunk-4TCRZYAK.js} +2 -2
- package/bundles/{chunk-NJMZRTB6.js → chunk-54RHUHYB.js} +1 -2
- package/bundles/{chunk-64X67E3N.js → chunk-6CARGXRJ.js} +5 -5
- package/bundles/{chunk-O4JLZZWJ.js → chunk-EDWIBG7R.js} +1 -10
- package/bundles/chunk-EDWIBG7R.js.map +6 -0
- package/bundles/{chunk-6ZJFIQBG.js → chunk-GYHDNUIK.js} +1 -2
- package/bundles/{chunk-HYFCMILZ.js → chunk-IS6KZYEA.js} +384 -614
- package/bundles/chunk-IS6KZYEA.js.map +6 -0
- package/bundles/{chunk-Q6W3UCXI.js → chunk-JHMH3CX2.js} +92 -125
- package/bundles/chunk-JHMH3CX2.js.map +6 -0
- package/bundles/chunk-K2A5WD7L.js +872 -0
- package/bundles/chunk-K2A5WD7L.js.map +6 -0
- package/bundles/chunk-PSGRCFPQ.js +714 -0
- package/bundles/chunk-PSGRCFPQ.js.map +6 -0
- package/bundles/index.js +13 -12
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +8 -7
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +4 -3
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +1 -1
- package/bundles/private/migrations.js +5 -4
- package/bundles/private/tooling.js +4 -2
- package/bundles/src/bin/ng_xi18n.js +7 -6
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +7 -6
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/package.json +2 -15
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -3
- package/src/ngtsc/core/api/src/adapter.d.ts +0 -7
- package/src/ngtsc/core/api/src/options.d.ts +2 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +0 -25
- package/src/ngtsc/core/src/host.d.ts +3 -5
- package/src/ngtsc/imports/index.d.ts +1 -0
- package/src/ngtsc/imports/src/default.d.ts +6 -10
- package/src/ngtsc/imports/src/patch_alias_reference_resolution.d.ts +61 -0
- package/src/ngtsc/shims/api.d.ts +0 -19
- package/src/ngtsc/shims/index.d.ts +0 -2
- package/src/transformers/api.d.ts +0 -5
- package/bundles/chunk-7DUI3BSX.js +0 -29
- package/bundles/chunk-7DUI3BSX.js.map +0 -6
- package/bundles/chunk-BEXFRTBC.js +0 -2187
- package/bundles/chunk-BEXFRTBC.js.map +0 -6
- package/bundles/chunk-HYFCMILZ.js.map +0 -6
- package/bundles/chunk-JYL7IHZC.js.map +0 -6
- package/bundles/chunk-O4JLZZWJ.js.map +0 -6
- package/bundles/chunk-OAZD7RII.js +0 -5263
- package/bundles/chunk-OAZD7RII.js.map +0 -6
- package/bundles/chunk-Q6W3UCXI.js.map +0 -6
- package/bundles/chunk-YRDMG3GM.js +0 -115
- package/bundles/chunk-YRDMG3GM.js.map +0 -6
- package/bundles/chunk-Z534TW2O.js +0 -1540
- package/bundles/chunk-Z534TW2O.js.map +0 -6
- package/bundles/ngcc/index.js +0 -51
- package/bundles/ngcc/index.js.map +0 -6
- package/bundles/ngcc/main-ngcc.js +0 -48
- package/bundles/ngcc/main-ngcc.js.map +0 -6
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -113
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +0 -6
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +0 -34
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +0 -6
- package/ngcc/index.d.ts +0 -19
- package/ngcc/main-ngcc.d.ts +0 -2
- package/ngcc/src/analysis/decoration_analyzer.d.ts +0 -80
- package/ngcc/src/analysis/migration_host.d.ts +0 -22
- package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +0 -61
- package/ngcc/src/analysis/ngcc_references_registry.d.ts +0 -34
- package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +0 -42
- package/ngcc/src/analysis/private_declarations_analyzer.d.ts +0 -29
- package/ngcc/src/analysis/types.d.ts +0 -29
- package/ngcc/src/analysis/util.d.ts +0 -11
- package/ngcc/src/command_line_options.d.ts +0 -3
- package/ngcc/src/constants.d.ts +0 -9
- package/ngcc/src/dependencies/commonjs_dependency_host.d.ts +0 -20
- package/ngcc/src/dependencies/dependency_host.d.ts +0 -77
- package/ngcc/src/dependencies/dependency_resolver.d.ts +0 -102
- package/ngcc/src/dependencies/dts_dependency_host.d.ts +0 -20
- package/ngcc/src/dependencies/esm_dependency_host.d.ts +0 -93
- package/ngcc/src/dependencies/module_resolver.d.ts +0 -134
- package/ngcc/src/dependencies/umd_dependency_host.d.ts +0 -9
- package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.d.ts +0 -41
- package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +0 -41
- package/ngcc/src/entry_point_finder/interface.d.ts +0 -14
- package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +0 -61
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +0 -95
- package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +0 -67
- package/ngcc/src/entry_point_finder/utils.d.ts +0 -38
- package/ngcc/src/execution/analyze_entry_points.d.ts +0 -9
- package/ngcc/src/execution/api.d.ts +0 -27
- package/ngcc/src/execution/cluster/api.d.ts +0 -51
- package/ngcc/src/execution/cluster/executor.d.ts +0 -29
- package/ngcc/src/execution/cluster/master.d.ts +0 -57
- package/ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts +0 -8
- package/ngcc/src/execution/cluster/package_json_updater.d.ts +0 -22
- package/ngcc/src/execution/cluster/utils.d.ts +0 -44
- package/ngcc/src/execution/cluster/worker.d.ts +0 -10
- package/ngcc/src/execution/create_compile_function.d.ts +0 -10
- package/ngcc/src/execution/single_process_executor.d.ts +0 -34
- package/ngcc/src/execution/tasks/api.d.ts +0 -141
- package/ngcc/src/execution/tasks/completion.d.ts +0 -41
- package/ngcc/src/execution/tasks/queues/base_task_queue.d.ts +0 -38
- package/ngcc/src/execution/tasks/queues/parallel_task_queue.d.ts +0 -27
- package/ngcc/src/execution/tasks/queues/serial_task_queue.d.ts +0 -16
- package/ngcc/src/execution/tasks/utils.d.ts +0 -57
- package/ngcc/src/host/commonjs_host.d.ts +0 -69
- package/ngcc/src/host/commonjs_umd_utils.d.ts +0 -146
- package/ngcc/src/host/delegating_host.d.ts +0 -43
- package/ngcc/src/host/esm2015_host.d.ts +0 -935
- package/ngcc/src/host/esm5_host.d.ts +0 -299
- package/ngcc/src/host/ngcc_host.d.ts +0 -87
- package/ngcc/src/host/umd_host.d.ts +0 -85
- package/ngcc/src/host/utils.d.ts +0 -9
- package/ngcc/src/locking/async_locker.d.ts +0 -34
- package/ngcc/src/locking/lock_file.d.ts +0 -31
- package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +0 -44
- package/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.d.ts +0 -1
- package/ngcc/src/locking/lock_file_with_child_process/util.d.ts +0 -16
- package/ngcc/src/locking/sync_locker.d.ts +0 -35
- package/ngcc/src/main.d.ts +0 -17
- package/ngcc/src/migrations/migration.d.ts +0 -59
- package/ngcc/src/migrations/missing_injectable_migration.d.ts +0 -35
- package/ngcc/src/migrations/undecorated_child_migration.d.ts +0 -15
- package/ngcc/src/migrations/undecorated_parent_migration.d.ts +0 -51
- package/ngcc/src/migrations/utils.d.ts +0 -41
- package/ngcc/src/ngcc_options.d.ts +0 -155
- package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +0 -16
- package/ngcc/src/packages/build_marker.d.ts +0 -44
- package/ngcc/src/packages/bundle_program.d.ts +0 -35
- package/ngcc/src/packages/configuration.d.ts +0 -222
- package/ngcc/src/packages/entry_point.d.ts +0 -109
- package/ngcc/src/packages/entry_point_bundle.d.ts +0 -46
- package/ngcc/src/packages/entry_point_manifest.d.ts +0 -79
- package/ngcc/src/packages/ngcc_compiler_host.d.ts +0 -36
- package/ngcc/src/packages/patch_ts_expando_initializer.d.ts +0 -41
- package/ngcc/src/packages/source_file_cache.d.ts +0 -97
- package/ngcc/src/packages/transformer.d.ts +0 -70
- package/ngcc/src/path_mappings.d.ts +0 -19
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +0 -34
- package/ngcc/src/rendering/dts_renderer.d.ts +0 -51
- package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +0 -35
- package/ngcc/src/rendering/esm_rendering_formatter.d.ts +0 -84
- package/ngcc/src/rendering/ngcc_import_rewriter.d.ts +0 -13
- package/ngcc/src/rendering/renderer.d.ts +0 -72
- package/ngcc/src/rendering/rendering_formatter.d.ts +0 -37
- package/ngcc/src/rendering/source_maps.d.ts +0 -23
- package/ngcc/src/rendering/umd_rendering_formatter.d.ts +0 -54
- package/ngcc/src/rendering/utils.d.ts +0 -24
- package/ngcc/src/utils.d.ts +0 -112
- package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +0 -44
- package/ngcc/src/writing/cleaning/package_cleaner.d.ts +0 -38
- package/ngcc/src/writing/cleaning/utils.d.ts +0 -15
- package/ngcc/src/writing/file_writer.d.ts +0 -28
- package/ngcc/src/writing/in_place_file_writer.d.ts +0 -28
- package/ngcc/src/writing/new_entry_point_file_writer.d.ts +0 -48
- package/ngcc/src/writing/package_json_updater.d.ts +0 -98
- package/src/ngtsc/shims/src/factory_generator.d.ts +0 -24
- package/src/ngtsc/shims/src/summary_generator.d.ts +0 -15
- package/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.d.ts +0 -14
- /package/bundles/{chunk-ZB4CDKOH.js.map → chunk-4TCRZYAK.js.map} +0 -0
- /package/bundles/{chunk-NJMZRTB6.js.map → chunk-54RHUHYB.js.map} +0 -0
- /package/bundles/{chunk-64X67E3N.js.map → chunk-6CARGXRJ.js.map} +0 -0
- /package/bundles/{chunk-6ZJFIQBG.js.map → chunk-GYHDNUIK.js.map} +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
|
|
10
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
11
|
-
import { NgccReferencesRegistry } from './ngcc_references_registry';
|
|
12
|
-
export interface ExportInfo {
|
|
13
|
-
identifier: string;
|
|
14
|
-
from: AbsoluteFsPath;
|
|
15
|
-
dtsFrom?: AbsoluteFsPath | null;
|
|
16
|
-
}
|
|
17
|
-
export type PrivateDeclarationsAnalyses = ExportInfo[];
|
|
18
|
-
/**
|
|
19
|
-
* This class will analyze a program to find all the declared classes
|
|
20
|
-
* (i.e. on an NgModule) that are not publicly exported via an entry-point.
|
|
21
|
-
*/
|
|
22
|
-
export declare class PrivateDeclarationsAnalyzer {
|
|
23
|
-
private host;
|
|
24
|
-
private referencesRegistry;
|
|
25
|
-
constructor(host: NgccReflectionHost, referencesRegistry: NgccReferencesRegistry);
|
|
26
|
-
analyzeProgram(program: ts.Program): PrivateDeclarationsAnalyses;
|
|
27
|
-
private getRootFiles;
|
|
28
|
-
private getPrivateDeclarations;
|
|
29
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ConstantPool } from '@angular/compiler';
|
|
9
|
-
import ts from 'typescript';
|
|
10
|
-
import { Reexport } from '../../../src/ngtsc/imports';
|
|
11
|
-
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
|
|
12
|
-
import { CompileResult } from '../../../src/ngtsc/transform';
|
|
13
|
-
export interface CompiledClass {
|
|
14
|
-
name: string;
|
|
15
|
-
decorators: Decorator[] | null;
|
|
16
|
-
declaration: ClassDeclaration;
|
|
17
|
-
compilation: CompileResult[];
|
|
18
|
-
}
|
|
19
|
-
export interface CompiledFile {
|
|
20
|
-
compiledClasses: CompiledClass[];
|
|
21
|
-
sourceFile: ts.SourceFile;
|
|
22
|
-
constantPool: ConstantPool;
|
|
23
|
-
/**
|
|
24
|
-
* Any re-exports which should be added next to this class, both in .js and (if possible) .d.ts.
|
|
25
|
-
*/
|
|
26
|
-
reexports: Reexport[];
|
|
27
|
-
}
|
|
28
|
-
export type DecorationAnalyses = Map<ts.SourceFile, CompiledFile>;
|
|
29
|
-
export declare const DecorationAnalyses: MapConstructor;
|
|
@@ -1,11 +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 { DependencyTracker } from '../../../src/ngtsc/incremental/api';
|
|
10
|
-
export declare function isWithinPackage(packagePath: AbsoluteFsPath, filePath: AbsoluteFsPath): boolean;
|
|
11
|
-
export declare const NOOP_DEPENDENCY_TRACKER: DependencyTracker;
|
package/ngcc/src/constants.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
export declare const IMPORT_PREFIX = "\u0275ngcc";
|
|
9
|
-
export declare const NGCC_TIMED_OUT_EXIT_CODE = 177;
|
|
@@ -1,20 +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 CommonJsDependencyHost extends DependencyHostBase {
|
|
7
|
-
protected canSkipFile(fileContents: string): boolean;
|
|
8
|
-
protected extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Check whether a source file needs to be parsed for imports.
|
|
12
|
-
* This is a performance short-circuit, which saves us from creating
|
|
13
|
-
* a TypeScript AST unnecessarily.
|
|
14
|
-
*
|
|
15
|
-
* @param source The content of the source file to check.
|
|
16
|
-
*
|
|
17
|
-
* @returns false if there are definitely no require calls
|
|
18
|
-
* in this file, true otherwise.
|
|
19
|
-
*/
|
|
20
|
-
export declare function hasRequireCalls(source: string): boolean;
|
|
@@ -1,77 +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, PathSegment, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
9
|
-
import { EntryPoint } from '../packages/entry_point';
|
|
10
|
-
import { ModuleResolver } from './module_resolver';
|
|
11
|
-
export interface DependencyHost {
|
|
12
|
-
collectDependencies(entryPointPath: AbsoluteFsPath, { dependencies, missing, deepImports }: DependencyInfo): void;
|
|
13
|
-
}
|
|
14
|
-
export interface DependencyInfo {
|
|
15
|
-
dependencies: Set<AbsoluteFsPath>;
|
|
16
|
-
missing: Set<AbsoluteFsPath | PathSegment>;
|
|
17
|
-
deepImports: Set<AbsoluteFsPath>;
|
|
18
|
-
}
|
|
19
|
-
export interface EntryPointWithDependencies {
|
|
20
|
-
entryPoint: EntryPoint;
|
|
21
|
-
depInfo: DependencyInfo;
|
|
22
|
-
}
|
|
23
|
-
export declare function createDependencyInfo(): DependencyInfo;
|
|
24
|
-
export declare abstract class DependencyHostBase implements DependencyHost {
|
|
25
|
-
protected fs: ReadonlyFileSystem;
|
|
26
|
-
protected moduleResolver: ModuleResolver;
|
|
27
|
-
constructor(fs: ReadonlyFileSystem, moduleResolver: ModuleResolver);
|
|
28
|
-
/**
|
|
29
|
-
* Find all the dependencies for the entry-point at the given path.
|
|
30
|
-
*
|
|
31
|
-
* @param entryPointPath The absolute path to the JavaScript file that represents an entry-point.
|
|
32
|
-
* @param dependencyInfo An object containing information about the dependencies of the
|
|
33
|
-
* entry-point, including those that were missing or deep imports into other entry-points. The
|
|
34
|
-
* sets in this object will be updated with new information about the entry-point's dependencies.
|
|
35
|
-
*/
|
|
36
|
-
collectDependencies(entryPointPath: AbsoluteFsPath, { dependencies, missing, deepImports }: DependencyInfo): void;
|
|
37
|
-
/**
|
|
38
|
-
* Find all the dependencies for the provided paths.
|
|
39
|
-
*
|
|
40
|
-
* @param files The list of absolute paths of JavaScript files to scan for dependencies.
|
|
41
|
-
* @param dependencyInfo An object containing information about the dependencies of the
|
|
42
|
-
* entry-point, including those that were missing or deep imports into other entry-points. The
|
|
43
|
-
* sets in this object will be updated with new information about the entry-point's dependencies.
|
|
44
|
-
*/
|
|
45
|
-
collectDependenciesInFiles(files: AbsoluteFsPath[], { dependencies, missing, deepImports }: DependencyInfo): void;
|
|
46
|
-
/**
|
|
47
|
-
* Compute the dependencies of the given file.
|
|
48
|
-
*
|
|
49
|
-
* @param file An absolute path to the file whose dependencies we want to get.
|
|
50
|
-
* @param dependencies A set that will have the absolute paths of resolved entry points added to
|
|
51
|
-
* it.
|
|
52
|
-
* @param missing A set that will have the dependencies that could not be found added to it.
|
|
53
|
-
* @param deepImports A set that will have the import paths that exist but cannot be mapped to
|
|
54
|
-
* entry-points, i.e. deep-imports.
|
|
55
|
-
* @param alreadySeen A set that is used to track internal dependencies to prevent getting stuck
|
|
56
|
-
* in a circular dependency loop.
|
|
57
|
-
*/
|
|
58
|
-
protected recursivelyCollectDependencies(file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): void;
|
|
59
|
-
protected abstract canSkipFile(fileContents: string): boolean;
|
|
60
|
-
protected abstract extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Resolve the given `importPath` from `file` and add it to the appropriate set.
|
|
63
|
-
*
|
|
64
|
-
* If the import is local to this package then follow it by calling
|
|
65
|
-
* `recursivelyCollectDependencies()`.
|
|
66
|
-
*
|
|
67
|
-
* @returns `true` if the import was resolved (to an entry-point, a local import, or a
|
|
68
|
-
* deep-import), `false` otherwise.
|
|
69
|
-
*/
|
|
70
|
-
protected processImport(importPath: string, file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Processes the file if it has not already been seen. This will also recursively process
|
|
73
|
-
* all files that are imported from the file, while taking the set of already seen files
|
|
74
|
-
* into account.
|
|
75
|
-
*/
|
|
76
|
-
protected processFile(file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): void;
|
|
77
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { DepGraph } from 'dependency-graph';
|
|
9
|
-
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
10
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
11
|
-
import { NgccConfiguration } from '../packages/configuration';
|
|
12
|
-
import { EntryPoint, EntryPointFormat } from '../packages/entry_point';
|
|
13
|
-
import { PartiallyOrderedList } from '../utils';
|
|
14
|
-
import { DependencyHost, EntryPointWithDependencies } from './dependency_host';
|
|
15
|
-
/**
|
|
16
|
-
* Holds information about entry points that are removed because
|
|
17
|
-
* they have dependencies that are missing (directly or transitively).
|
|
18
|
-
*
|
|
19
|
-
* This might not be an error, because such an entry point might not actually be used
|
|
20
|
-
* in the application. If it is used then the `ngc` application compilation would
|
|
21
|
-
* fail also, so we don't need ngcc to catch this.
|
|
22
|
-
*
|
|
23
|
-
* For example, consider an application that uses the `@angular/router` package.
|
|
24
|
-
* This package includes an entry-point called `@angular/router/upgrade`, which has a dependency
|
|
25
|
-
* on the `@angular/upgrade` package.
|
|
26
|
-
* If the application never uses code from `@angular/router/upgrade` then there is no need for
|
|
27
|
-
* `@angular/upgrade` to be installed.
|
|
28
|
-
* In this case the ngcc tool should just ignore the `@angular/router/upgrade` end-point.
|
|
29
|
-
*/
|
|
30
|
-
export interface InvalidEntryPoint {
|
|
31
|
-
entryPoint: EntryPoint;
|
|
32
|
-
missingDependencies: string[];
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Holds information about dependencies of an entry-point that do not need to be processed
|
|
36
|
-
* by the ngcc tool.
|
|
37
|
-
*
|
|
38
|
-
* For example, the `rxjs` package does not contain any Angular decorators that need to be
|
|
39
|
-
* compiled and so this can be safely ignored by ngcc.
|
|
40
|
-
*/
|
|
41
|
-
export interface IgnoredDependency {
|
|
42
|
-
entryPoint: EntryPoint;
|
|
43
|
-
dependencyPath: string;
|
|
44
|
-
}
|
|
45
|
-
export interface DependencyDiagnostics {
|
|
46
|
-
invalidEntryPoints: InvalidEntryPoint[];
|
|
47
|
-
ignoredDependencies: IgnoredDependency[];
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Represents a partially ordered list of entry-points.
|
|
51
|
-
*
|
|
52
|
-
* The entry-points' order/precedence is such that dependent entry-points always come later than
|
|
53
|
-
* their dependencies in the list.
|
|
54
|
-
*
|
|
55
|
-
* See `DependencyResolver#sortEntryPointsByDependency()`.
|
|
56
|
-
*/
|
|
57
|
-
export type PartiallyOrderedEntryPoints = PartiallyOrderedList<EntryPoint>;
|
|
58
|
-
/**
|
|
59
|
-
* A list of entry-points, sorted by their dependencies, and the dependency graph.
|
|
60
|
-
*
|
|
61
|
-
* The `entryPoints` array will be ordered so that no entry point depends upon an entry point that
|
|
62
|
-
* appears later in the array.
|
|
63
|
-
*
|
|
64
|
-
* Some entry points or their dependencies may have been ignored. These are captured for
|
|
65
|
-
* diagnostic purposes in `invalidEntryPoints` and `ignoredDependencies` respectively.
|
|
66
|
-
*/
|
|
67
|
-
export interface SortedEntryPointsInfo extends DependencyDiagnostics {
|
|
68
|
-
entryPoints: PartiallyOrderedEntryPoints;
|
|
69
|
-
graph: DepGraph<EntryPoint>;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A class that resolves dependencies between entry-points.
|
|
73
|
-
*/
|
|
74
|
-
export declare class DependencyResolver {
|
|
75
|
-
private fs;
|
|
76
|
-
private logger;
|
|
77
|
-
private config;
|
|
78
|
-
private hosts;
|
|
79
|
-
private typingsHost;
|
|
80
|
-
constructor(fs: ReadonlyFileSystem, logger: Logger, config: NgccConfiguration, hosts: Partial<Record<EntryPointFormat, DependencyHost>>, typingsHost: DependencyHost);
|
|
81
|
-
/**
|
|
82
|
-
* Sort the array of entry points so that the dependant entry points always come later than
|
|
83
|
-
* their dependencies in the array.
|
|
84
|
-
* @param entryPoints An array entry points to sort.
|
|
85
|
-
* @param target If provided, only return entry-points depended on by this entry-point.
|
|
86
|
-
* @returns the result of sorting the entry points by dependency.
|
|
87
|
-
*/
|
|
88
|
-
sortEntryPointsByDependency(entryPoints: EntryPointWithDependencies[], target?: EntryPoint): SortedEntryPointsInfo;
|
|
89
|
-
getEntryPointWithDependencies(entryPoint: EntryPoint): EntryPointWithDependencies;
|
|
90
|
-
/**
|
|
91
|
-
* Computes a dependency graph of the given entry-points.
|
|
92
|
-
*
|
|
93
|
-
* The graph only holds entry-points that ngcc cares about and whose dependencies
|
|
94
|
-
* (direct and transitive) all exist.
|
|
95
|
-
*/
|
|
96
|
-
private computeDependencyGraph;
|
|
97
|
-
private getEntryPointFormatInfo;
|
|
98
|
-
/**
|
|
99
|
-
* Filter out the deepImports that can be ignored, according to this entryPoint's config.
|
|
100
|
-
*/
|
|
101
|
-
private filterIgnorableDeepImports;
|
|
102
|
-
}
|
|
@@ -1,20 +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
|
-
import { EsmDependencyHost } from './esm_dependency_host';
|
|
11
|
-
/**
|
|
12
|
-
* Helper functions for computing dependencies via typings files.
|
|
13
|
-
*/
|
|
14
|
-
export declare class DtsDependencyHost extends EsmDependencyHost {
|
|
15
|
-
constructor(fs: ReadonlyFileSystem, pathMappings?: PathMappings);
|
|
16
|
-
/**
|
|
17
|
-
* Attempts to process the `importPath` directly and also inside `@types/...`.
|
|
18
|
-
*/
|
|
19
|
-
protected processImport(importPath: string, file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>, deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): boolean;
|
|
20
|
-
}
|
|
@@ -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
|
-
}
|