@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.
- package/bundles/{chunk-PKSKJEUS.js → chunk-2DMH5JXJ.js} +9 -18
- package/bundles/{chunk-PKSKJEUS.js.map → chunk-2DMH5JXJ.js.map} +1 -1
- package/bundles/{chunk-P6SWFK2U.js → chunk-4TCRZYAK.js} +2 -2
- package/bundles/{chunk-NJMZRTB6.js → chunk-54RHUHYB.js} +1 -2
- package/bundles/{chunk-2PLRZDNU.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-2OF2AI57.js → chunk-IS6KZYEA.js} +377 -609
- package/bundles/chunk-IS6KZYEA.js.map +6 -0
- package/bundles/{chunk-J3L7WZP3.js → chunk-JHMH3CX2.js} +3 -3
- package/bundles/{chunk-ZCBRXUPO.js → chunk-K2A5WD7L.js} +1 -6
- package/bundles/chunk-K2A5WD7L.js.map +6 -0
- package/bundles/{chunk-QRHWLC7U.js → chunk-PSGRCFPQ.js} +2 -2
- package/bundles/index.js +13 -13
- package/bundles/linker/babel/index.js +8 -8
- package/bundles/linker/index.js +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +1 -1
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +7 -7
- package/bundles/src/bin/ngc.js +7 -7
- 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/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-2OF2AI57.js.map +0 -6
- package/bundles/chunk-7DUI3BSX.js +0 -29
- package/bundles/chunk-7DUI3BSX.js.map +0 -6
- package/bundles/chunk-MLCT4AWL.js +0 -2187
- package/bundles/chunk-MLCT4AWL.js.map +0 -6
- package/bundles/chunk-NXCQCU6C.js +0 -5265
- package/bundles/chunk-NXCQCU6C.js.map +0 -6
- package/bundles/chunk-O4JLZZWJ.js.map +0 -6
- package/bundles/chunk-YRDMG3GM.js +0 -115
- package/bundles/chunk-YRDMG3GM.js.map +0 -6
- package/bundles/chunk-ZCBRXUPO.js.map +0 -6
- package/bundles/ngcc/index.js +0 -52
- package/bundles/ngcc/index.js.map +0 -6
- package/bundles/ngcc/main-ngcc.js +0 -49
- package/bundles/ngcc/main-ngcc.js.map +0 -6
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -114
- 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/bundles/{chunk-P6SWFK2U.js.map → chunk-4TCRZYAK.js.map} +0 -0
- /package/bundles/{chunk-NJMZRTB6.js.map → chunk-54RHUHYB.js.map} +0 -0
- /package/bundles/{chunk-2PLRZDNU.js.map → chunk-6CARGXRJ.js.map} +0 -0
- /package/bundles/{chunk-6ZJFIQBG.js.map → chunk-GYHDNUIK.js.map} +0 -0
- /package/bundles/{chunk-J3L7WZP3.js.map → chunk-JHMH3CX2.js.map} +0 -0
- /package/bundles/{chunk-QRHWLC7U.js.map → chunk-PSGRCFPQ.js.map} +0 -0
|
@@ -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
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
9
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
10
|
-
import { ParsedConfiguration } from '../../../src/perform_compile';
|
|
11
|
-
import { EntryPointWithDependencies } from '../dependencies/dependency_host';
|
|
12
|
-
import { DependencyResolver } from '../dependencies/dependency_resolver';
|
|
13
|
-
import { NgccConfiguration } from '../packages/configuration';
|
|
14
|
-
import { EntryPointManifest } from '../packages/entry_point_manifest';
|
|
15
|
-
import { EntryPointCollector } from './entry_point_collector';
|
|
16
|
-
import { TracingEntryPointFinder } from './tracing_entry_point_finder';
|
|
17
|
-
/**
|
|
18
|
-
* An EntryPointFinder that starts from the files in the program defined by the given tsconfig.json
|
|
19
|
-
* and only returns entry-points that are dependencies of these files.
|
|
20
|
-
*
|
|
21
|
-
* This is faster than searching the entire file-system for all the entry-points,
|
|
22
|
-
* and is used primarily by the CLI integration.
|
|
23
|
-
*/
|
|
24
|
-
export declare class ProgramBasedEntryPointFinder extends TracingEntryPointFinder {
|
|
25
|
-
private entryPointCollector;
|
|
26
|
-
private entryPointManifest;
|
|
27
|
-
private tsConfig;
|
|
28
|
-
private entryPointsWithDependencies;
|
|
29
|
-
constructor(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, resolver: DependencyResolver, entryPointCollector: EntryPointCollector, entryPointManifest: EntryPointManifest, basePath: AbsoluteFsPath, tsConfig: ParsedConfiguration, projectPath: AbsoluteFsPath);
|
|
30
|
-
/**
|
|
31
|
-
* Return an array containing the external import paths that were extracted from the source-files
|
|
32
|
-
* of the program defined by the tsconfig.json.
|
|
33
|
-
*/
|
|
34
|
-
protected getInitialEntryPointPaths(): AbsoluteFsPath[];
|
|
35
|
-
/**
|
|
36
|
-
* For the given `entryPointPath`, compute, or retrieve, the entry-point information, including
|
|
37
|
-
* paths to other entry-points that this entry-point depends upon.
|
|
38
|
-
*
|
|
39
|
-
* In this entry-point finder, we use the `EntryPointManifest` to avoid computing each
|
|
40
|
-
* entry-point's dependencies in the case that this had been done previously.
|
|
41
|
-
*
|
|
42
|
-
* @param entryPointPath the path to the entry-point whose information and dependencies are to be
|
|
43
|
-
* retrieved or computed.
|
|
44
|
-
*
|
|
45
|
-
* @returns the entry-point and its dependencies or `null` if the entry-point is not compiled by
|
|
46
|
-
* Angular or cannot be determined.
|
|
47
|
-
*/
|
|
48
|
-
protected getEntryPointWithDeps(entryPointPath: AbsoluteFsPath): EntryPointWithDependencies | null;
|
|
49
|
-
/**
|
|
50
|
-
* Walk the base paths looking for entry-points or load this information from an entry-point
|
|
51
|
-
* manifest, if available.
|
|
52
|
-
*/
|
|
53
|
-
private findOrLoadEntryPoints;
|
|
54
|
-
/**
|
|
55
|
-
* Search the `basePath` for possible Angular packages and entry-points.
|
|
56
|
-
*
|
|
57
|
-
* @param basePath The path at which to start the search.
|
|
58
|
-
* @returns an array of `EntryPoint`s that were found within `basePath`.
|
|
59
|
-
*/
|
|
60
|
-
walkBasePathForPackages(basePath: AbsoluteFsPath): EntryPointWithDependencies[];
|
|
61
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
9
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
10
|
-
import { EntryPointWithDependencies } from '../dependencies/dependency_host';
|
|
11
|
-
import { DependencyResolver, SortedEntryPointsInfo } from '../dependencies/dependency_resolver';
|
|
12
|
-
import { NgccConfiguration } from '../packages/configuration';
|
|
13
|
-
import { EntryPointJsonProperty } from '../packages/entry_point';
|
|
14
|
-
import { PathMappings } from '../path_mappings';
|
|
15
|
-
import { TracingEntryPointFinder } from './tracing_entry_point_finder';
|
|
16
|
-
/**
|
|
17
|
-
* An EntryPointFinder that starts from a target entry-point and only finds
|
|
18
|
-
* entry-points that are dependencies of the target.
|
|
19
|
-
*
|
|
20
|
-
* This is faster than searching the entire file-system for all the entry-points,
|
|
21
|
-
* and is used primarily by the CLI integration.
|
|
22
|
-
*/
|
|
23
|
-
export declare class TargetedEntryPointFinder extends TracingEntryPointFinder {
|
|
24
|
-
private targetPath;
|
|
25
|
-
constructor(fs: ReadonlyFileSystem, config: NgccConfiguration, logger: Logger, resolver: DependencyResolver, basePath: AbsoluteFsPath, pathMappings: PathMappings | undefined, targetPath: AbsoluteFsPath);
|
|
26
|
-
/**
|
|
27
|
-
* Search for Angular entry-points that can be reached from the entry-point specified by the given
|
|
28
|
-
* `targetPath`.
|
|
29
|
-
*/
|
|
30
|
-
findEntryPoints(): SortedEntryPointsInfo;
|
|
31
|
-
/**
|
|
32
|
-
* Determine whether the entry-point at the given `targetPath` needs to be processed.
|
|
33
|
-
*
|
|
34
|
-
* @param propertiesToConsider the package.json properties that should be considered for
|
|
35
|
-
* processing.
|
|
36
|
-
* @param compileAllFormats true if all formats need to be processed, or false if it is enough for
|
|
37
|
-
* one of the formats covered by the `propertiesToConsider` is processed.
|
|
38
|
-
*/
|
|
39
|
-
targetNeedsProcessingOrCleaning(propertiesToConsider: EntryPointJsonProperty[], compileAllFormats: boolean): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Return an array containing the `targetPath` from which to start the trace.
|
|
42
|
-
*/
|
|
43
|
-
protected getInitialEntryPointPaths(): AbsoluteFsPath[];
|
|
44
|
-
/**
|
|
45
|
-
* For the given `entryPointPath`, compute, or retrieve, the entry-point information, including
|
|
46
|
-
* paths to other entry-points that this entry-point depends upon.
|
|
47
|
-
*
|
|
48
|
-
* @param entryPointPath the path to the entry-point whose information and dependencies are to be
|
|
49
|
-
* retrieved or computed.
|
|
50
|
-
*
|
|
51
|
-
* @returns the entry-point and its dependencies or `null` if the entry-point is not compiled by
|
|
52
|
-
* Angular or cannot be determined.
|
|
53
|
-
*/
|
|
54
|
-
protected getEntryPointWithDeps(entryPointPath: AbsoluteFsPath): EntryPointWithDependencies | null;
|
|
55
|
-
/**
|
|
56
|
-
* Compute the path to the package that contains the given entry-point.
|
|
57
|
-
*
|
|
58
|
-
* In this entry-point finder it is not trivial to find the containing package, since it is
|
|
59
|
-
* possible that this entry-point is not directly below the directory containing the package.
|
|
60
|
-
* Moreover, the import path could be affected by path-mapping.
|
|
61
|
-
*
|
|
62
|
-
* @param entryPointPath the path to the entry-point, whose package path we want to compute.
|
|
63
|
-
*/
|
|
64
|
-
private computePackagePath;
|
|
65
|
-
/**
|
|
66
|
-
* Compute whether the `test` path is contained within the `base` path.
|
|
67
|
-
*
|
|
68
|
-
* Note that this doesn't use a simple `startsWith()` since that would result in a false positive
|
|
69
|
-
* for `test` paths such as `a/b/c-x` when the `base` path is `a/b/c`.
|
|
70
|
-
*
|
|
71
|
-
* Since `fs.relative()` can be quite expensive we check the fast possibilities first.
|
|
72
|
-
*/
|
|
73
|
-
private isPathContainedBy;
|
|
74
|
-
/**
|
|
75
|
-
* Search down to the `entryPointPath` from the `containingPath` for the first `package.json` that
|
|
76
|
-
* we come to. This is the path to the entry-point's containing package. For example if
|
|
77
|
-
* `containingPath` is `/a/b/c` and `entryPointPath` is `/a/b/c/d/e` and there exists
|
|
78
|
-
* `/a/b/c/d/package.json` and `/a/b/c/d/e/package.json`, then we will return `/a/b/c/d`.
|
|
79
|
-
*
|
|
80
|
-
* To account for nested `node_modules` we actually start the search at the last `node_modules` in
|
|
81
|
-
* the `entryPointPath` that is below the `containingPath`. E.g. if `containingPath` is `/a/b/c`
|
|
82
|
-
* and `entryPointPath` is `/a/b/c/d/node_modules/x/y/z`, we start the search at
|
|
83
|
-
* `/a/b/c/d/node_modules`.
|
|
84
|
-
*/
|
|
85
|
-
private computePackagePathFromContainingPath;
|
|
86
|
-
/**
|
|
87
|
-
* Search up the directory tree from the `entryPointPath` looking for a `node_modules` directory
|
|
88
|
-
* that we can use as a potential starting point for computing the package path.
|
|
89
|
-
*/
|
|
90
|
-
private computePackagePathFromNearestNodeModules;
|
|
91
|
-
/**
|
|
92
|
-
* Split the given `path` into path segments using an FS independent algorithm.
|
|
93
|
-
*/
|
|
94
|
-
private splitPath;
|
|
95
|
-
}
|