@angular/compiler-cli 9.0.0-rc.9 → 9.0.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/ngcc/src/analysis/decoration_analyzer.d.ts +9 -23
- package/ngcc/src/analysis/decoration_analyzer.js +82 -144
- package/ngcc/src/analysis/migration_host.d.ts +5 -16
- package/ngcc/src/analysis/migration_host.js +20 -91
- package/ngcc/src/analysis/module_with_providers_analyzer.js +2 -2
- package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +42 -0
- package/ngcc/src/analysis/ngcc_trait_compiler.js +107 -0
- package/ngcc/src/analysis/types.d.ts +6 -20
- package/ngcc/src/analysis/types.js +1 -1
- package/ngcc/src/analysis/util.d.ts +0 -5
- package/ngcc/src/analysis/util.js +2 -116
- package/ngcc/src/dependencies/dts_dependency_host.d.ts +5 -1
- package/ngcc/src/dependencies/dts_dependency_host.js +9 -2
- package/ngcc/src/dependencies/esm_dependency_host.d.ts +7 -0
- package/ngcc/src/dependencies/esm_dependency_host.js +29 -21
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +2 -0
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.js +49 -9
- package/ngcc/src/execution/cluster/executor.d.ts +3 -1
- package/ngcc/src/execution/cluster/executor.js +11 -6
- package/ngcc/src/execution/cluster/package_json_updater.js +3 -2
- package/ngcc/src/execution/lock_file.d.ts +43 -0
- package/ngcc/src/execution/lock_file.js +129 -0
- package/ngcc/src/execution/single_process_executor.d.ts +3 -1
- package/ngcc/src/execution/single_process_executor.js +18 -15
- package/ngcc/src/host/commonjs_host.js +5 -4
- package/ngcc/src/host/esm2015_host.d.ts +3 -1
- package/ngcc/src/host/esm2015_host.js +40 -9
- package/ngcc/src/host/esm5_host.js +3 -1
- package/ngcc/src/host/umd_host.js +5 -4
- package/ngcc/src/main.js +62 -122
- package/ngcc/src/migrations/migration.d.ts +1 -0
- package/ngcc/src/migrations/migration.js +1 -1
- package/ngcc/src/packages/build_marker.d.ts +17 -8
- package/ngcc/src/packages/build_marker.js +61 -32
- package/ngcc/src/packages/entry_point_bundle.js +2 -2
- package/ngcc/src/rendering/dts_renderer.js +7 -4
- package/ngcc/src/rendering/renderer.js +4 -4
- package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +45 -0
- package/ngcc/src/writing/cleaning/cleaning_strategies.js +77 -0
- package/ngcc/src/writing/cleaning/package_cleaner.d.ts +39 -0
- package/ngcc/src/writing/cleaning/package_cleaner.js +125 -0
- package/ngcc/src/writing/cleaning/utils.d.ts +16 -0
- package/ngcc/src/writing/cleaning/utils.js +29 -0
- package/ngcc/src/writing/in_place_file_writer.d.ts +1 -0
- package/ngcc/src/writing/in_place_file_writer.js +3 -2
- package/ngcc/src/writing/new_entry_point_file_writer.d.ts +2 -0
- package/ngcc/src/writing/new_entry_point_file_writer.js +5 -4
- package/ngcc/src/writing/package_json_updater.d.ts +24 -10
- package/ngcc/src/writing/package_json_updater.js +53 -10
- package/package.json +5 -4
- package/src/ngtsc/annotations/src/component.d.ts +1 -1
- package/src/ngtsc/annotations/src/component.js +4 -3
- package/src/ngtsc/annotations/src/directive.js +4 -3
- package/src/ngtsc/annotations/src/injectable.js +2 -1
- package/src/ngtsc/annotations/src/ng_module.js +2 -1
- package/src/ngtsc/annotations/src/pipe.js +2 -1
- package/src/ngtsc/annotations/src/util.js +3 -3
- package/src/ngtsc/core/api.d.ts +368 -0
- package/src/ngtsc/core/api.js +20 -0
- package/src/ngtsc/core/index.d.ts +10 -0
- package/src/ngtsc/core/index.js +24 -0
- package/src/ngtsc/core/src/compiler.d.ts +120 -0
- package/src/ngtsc/core/src/compiler.js +769 -0
- package/src/ngtsc/core/src/host.d.ts +85 -0
- package/src/ngtsc/core/src/host.js +208 -0
- package/src/ngtsc/diagnostics/index.d.ts +1 -1
- package/src/ngtsc/diagnostics/index.js +5 -5
- package/src/ngtsc/diagnostics/src/error.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/error.js +1 -1
- package/src/ngtsc/diagnostics/src/{code.d.ts → error_code.d.ts} +4 -6
- package/src/ngtsc/diagnostics/src/error_code.js +128 -0
- package/src/ngtsc/file_system/src/cached_file_system.d.ts +3 -1
- package/src/ngtsc/file_system/src/cached_file_system.js +48 -4
- package/src/ngtsc/file_system/src/invalid_file_system.d.ts +3 -1
- package/src/ngtsc/file_system/src/invalid_file_system.js +4 -2
- package/src/ngtsc/file_system/src/node_js_file_system.d.ts +3 -1
- package/src/ngtsc/file_system/src/node_js_file_system.js +8 -4
- package/src/ngtsc/file_system/src/types.d.ts +3 -1
- package/src/ngtsc/file_system/src/types.js +1 -1
- package/src/ngtsc/imports/index.d.ts +3 -3
- package/src/ngtsc/imports/index.js +4 -4
- package/src/ngtsc/imports/src/alias.d.ts +12 -11
- package/src/ngtsc/imports/src/alias.js +21 -16
- package/src/ngtsc/imports/src/emitter.d.ts +37 -16
- package/src/ngtsc/imports/src/emitter.js +51 -18
- package/src/ngtsc/imports/src/references.d.ts +0 -4
- package/src/ngtsc/imports/src/references.js +1 -6
- package/src/ngtsc/incremental/api.d.ts +2 -1
- package/src/ngtsc/incremental/api.js +1 -1
- package/src/ngtsc/incremental/src/dependency_tracking.d.ts +4 -3
- package/src/ngtsc/incremental/src/dependency_tracking.js +2 -2
- package/src/ngtsc/incremental/src/state.js +33 -13
- package/src/ngtsc/indexer/index.d.ts +1 -0
- package/src/ngtsc/indexer/index.js +4 -2
- package/src/ngtsc/modulewithproviders/src/scanner.js +2 -2
- package/src/ngtsc/partial_evaluator/src/builtin.d.ts +7 -6
- package/src/ngtsc/partial_evaluator/src/builtin.js +54 -9
- package/src/ngtsc/partial_evaluator/src/interpreter.js +9 -5
- package/src/ngtsc/partial_evaluator/src/known_declaration.d.ts +19 -0
- package/src/ngtsc/partial_evaluator/src/known_declaration.js +38 -0
- package/src/ngtsc/partial_evaluator/src/result.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/result.js +1 -1
- package/src/ngtsc/partial_evaluator/src/ts_helpers.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/ts_helpers.js +13 -3
- package/src/ngtsc/program.d.ts +46 -64
- package/src/ngtsc/program.js +76 -724
- package/src/ngtsc/reflection/src/host.d.ts +19 -2
- package/src/ngtsc/reflection/src/host.js +17 -3
- package/src/ngtsc/reflection/src/typescript.js +4 -4
- package/src/ngtsc/resource/index.d.ts +9 -0
- package/src/ngtsc/resource/index.js +22 -0
- package/src/ngtsc/{resource_loader.d.ts → resource/src/loader.d.ts} +4 -4
- package/src/ngtsc/resource/src/loader.js +193 -0
- package/src/ngtsc/shims/index.d.ts +1 -1
- package/src/ngtsc/shims/index.js +2 -5
- package/src/ngtsc/shims/src/api.d.ts +25 -0
- package/src/ngtsc/shims/src/api.js +13 -0
- package/src/ngtsc/shims/src/factory_generator.d.ts +1 -1
- package/src/ngtsc/shims/src/factory_generator.js +1 -1
- package/src/ngtsc/shims/src/summary_generator.d.ts +1 -1
- package/src/ngtsc/shims/src/summary_generator.js +1 -1
- package/src/ngtsc/shims/src/typecheck_shim.d.ts +1 -1
- package/src/ngtsc/shims/src/typecheck_shim.js +1 -1
- package/src/ngtsc/transform/index.d.ts +2 -0
- package/src/ngtsc/transform/index.js +7 -2
- package/src/ngtsc/transform/src/alias.d.ts +1 -1
- package/src/ngtsc/transform/src/alias.js +1 -1
- package/src/ngtsc/transform/src/api.d.ts +16 -0
- package/src/ngtsc/transform/src/api.js +1 -1
- package/src/ngtsc/transform/src/compilation.d.ts +8 -6
- package/src/ngtsc/transform/src/compilation.js +47 -20
- package/src/ngtsc/transform/src/declaration.d.ts +1 -1
- package/src/ngtsc/transform/src/declaration.js +1 -1
- package/src/ngtsc/typecheck/index.d.ts +1 -0
- package/src/ngtsc/typecheck/index.js +4 -2
- package/src/ngtsc/typecheck/src/api.d.ts +8 -0
- package/src/ngtsc/typecheck/src/api.js +1 -1
- package/src/ngtsc/typecheck/src/diagnostics.d.ts +13 -3
- package/src/ngtsc/typecheck/src/diagnostics.js +14 -5
- package/src/ngtsc/typecheck/src/dom.js +3 -3
- package/src/ngtsc/typecheck/src/environment.js +7 -3
- package/src/ngtsc/typecheck/src/host.d.ts +1 -0
- package/src/ngtsc/typecheck/src/host.js +4 -1
- package/src/ngtsc/typecheck/src/oob.js +4 -4
- package/src/ngtsc/typecheck/src/ts_util.js +36 -1
- package/src/ngtsc/typecheck/src/type_check_block.js +31 -18
- package/src/ngtsc/util/src/typescript.d.ts +2 -0
- package/src/ngtsc/util/src/typescript.js +12 -4
- package/src/perform_watch.js +6 -5
- package/src/transformers/api.d.ts +3 -206
- package/src/transformers/api.js +1 -1
- package/src/transformers/compiler_host.js +2 -2
- package/src/transformers/program.js +1 -1
- package/src/version.js +1 -1
- package/src/ngtsc/diagnostics/src/code.js +0 -126
- package/src/ngtsc/resource_loader.js +0 -193
- package/src/ngtsc/shims/src/host.d.ts +0 -46
- package/src/ngtsc/shims/src/host.js +0 -82
package/src/ngtsc/program.d.ts
CHANGED
|
@@ -9,82 +9,64 @@
|
|
|
9
9
|
import { GeneratedFile } from '@angular/compiler';
|
|
10
10
|
import * as ts from 'typescript';
|
|
11
11
|
import * as api from '../transformers/api';
|
|
12
|
-
import {
|
|
13
|
-
import { ReferenceGraph } from './entry_point';
|
|
14
|
-
import { Reference } from './imports';
|
|
12
|
+
import { NgCompilerOptions } from './core/api';
|
|
15
13
|
import { IndexedComponent } from './indexer';
|
|
14
|
+
/**
|
|
15
|
+
* Entrypoint to the Angular Compiler (Ivy+) which sits behind the `api.Program` interface, allowing
|
|
16
|
+
* it to be a drop-in replacement for the legacy View Engine compiler to tooling such as the
|
|
17
|
+
* command-line main() function or the Angular CLI.
|
|
18
|
+
*/
|
|
16
19
|
export declare class NgtscProgram implements api.Program {
|
|
17
20
|
private options;
|
|
18
|
-
private
|
|
21
|
+
private compiler;
|
|
22
|
+
/**
|
|
23
|
+
* The primary TypeScript program, which is used for analysis and emit.
|
|
24
|
+
*/
|
|
19
25
|
private tsProgram;
|
|
26
|
+
/**
|
|
27
|
+
* The TypeScript program to use for the next incremental compilation.
|
|
28
|
+
*
|
|
29
|
+
* Once a TS program is used to create another (an incremental compilation operation), it can no
|
|
30
|
+
* longer be used to do so again.
|
|
31
|
+
*
|
|
32
|
+
* Since template type-checking uses the primary program to create a type-checking program, after
|
|
33
|
+
* this happens the primary program is no longer suitable for starting a subsequent compilation,
|
|
34
|
+
* and the template type-checking program should be used instead.
|
|
35
|
+
*
|
|
36
|
+
* Thus, the program which should be used for the next incremental compilation is tracked in
|
|
37
|
+
* `reuseTsProgram`, separately from the "primary" program which is always used for emit.
|
|
38
|
+
*/
|
|
20
39
|
private reuseTsProgram;
|
|
21
|
-
private resourceManager;
|
|
22
|
-
private compilation;
|
|
23
|
-
private _coreImportsFrom;
|
|
24
|
-
private _importRewriter;
|
|
25
|
-
private _reflector;
|
|
26
|
-
private _isCore;
|
|
27
|
-
private rootDirs;
|
|
28
40
|
private closureCompilerEnabled;
|
|
29
|
-
private
|
|
30
|
-
private exportReferenceGraph;
|
|
31
|
-
private flatIndexGenerator;
|
|
32
|
-
private routeAnalyzer;
|
|
33
|
-
private scopeRegistry;
|
|
34
|
-
private constructionDiagnostics;
|
|
35
|
-
private moduleResolver;
|
|
36
|
-
private cycleAnalyzer;
|
|
37
|
-
private metaReader;
|
|
38
|
-
private aliasingHost;
|
|
39
|
-
private refEmitter;
|
|
40
|
-
private fileToModuleHost;
|
|
41
|
-
private defaultImportTracker;
|
|
41
|
+
private host;
|
|
42
42
|
private perfRecorder;
|
|
43
43
|
private perfTracker;
|
|
44
|
-
|
|
45
|
-
private typeCheckFilePath;
|
|
46
|
-
private factoryTracker;
|
|
47
|
-
private modifiedResourceFiles;
|
|
48
|
-
private dtsTransforms;
|
|
49
|
-
private mwpScanner;
|
|
50
|
-
constructor(rootNames: ReadonlyArray<string>, options: api.CompilerOptions, host: api.CompilerHost, oldProgram?: NgtscProgram);
|
|
44
|
+
constructor(rootNames: ReadonlyArray<string>, options: NgCompilerOptions, delegateHost: api.CompilerHost, oldProgram?: NgtscProgram);
|
|
51
45
|
getTsProgram(): ts.Program;
|
|
52
|
-
getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken | undefined):
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
getNgSemanticDiagnostics(fileName?: string | undefined, cancellationToken?: ts.CancellationToken | undefined):
|
|
46
|
+
getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
|
|
47
|
+
getTsSyntacticDiagnostics(sourceFile?: ts.SourceFile | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
|
|
48
|
+
getTsSemanticDiagnostics(sourceFile?: ts.SourceFile | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
|
|
49
|
+
getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly (ts.Diagnostic | api.Diagnostic)[];
|
|
50
|
+
getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly api.Diagnostic[];
|
|
51
|
+
getNgSemanticDiagnostics(fileName?: string | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly (ts.Diagnostic | api.Diagnostic)[];
|
|
52
|
+
/**
|
|
53
|
+
* Ensure that the `NgCompiler` has properly analyzed the program, and allow for the asynchronous
|
|
54
|
+
* loading of any resources during the process.
|
|
55
|
+
*
|
|
56
|
+
* This is used by the Angular CLI to allow for spawning (async) child compilations for things
|
|
57
|
+
* like SASS files used in `styleUrls`.
|
|
58
|
+
*/
|
|
58
59
|
loadNgStructureAsync(): Promise<void>;
|
|
59
60
|
listLazyRoutes(entryRoute?: string | undefined): api.LazyRoute[];
|
|
61
|
+
emit(opts?: {
|
|
62
|
+
emitFlags?: api.EmitFlags | undefined;
|
|
63
|
+
cancellationToken?: ts.CancellationToken | undefined;
|
|
64
|
+
customTransformers?: api.CustomTransformers | undefined;
|
|
65
|
+
emitCallback?: api.TsEmitCallback | undefined;
|
|
66
|
+
mergeEmitResultsCallback?: api.TsMergeEmitResultsCallback | undefined;
|
|
67
|
+
} | undefined): ts.EmitResult;
|
|
68
|
+
getIndexedComponents(): Map<ts.Declaration, IndexedComponent>;
|
|
60
69
|
getLibrarySummaries(): Map<string, api.LibrarySummary>;
|
|
61
70
|
getEmittedGeneratedFiles(): Map<string, GeneratedFile>;
|
|
62
71
|
getEmittedSourceFiles(): Map<string, ts.SourceFile>;
|
|
63
|
-
private scanForMwp;
|
|
64
|
-
private ensureAnalyzed;
|
|
65
|
-
private resolveCompilation;
|
|
66
|
-
emit(opts?: {
|
|
67
|
-
emitFlags?: api.EmitFlags;
|
|
68
|
-
cancellationToken?: ts.CancellationToken;
|
|
69
|
-
customTransformers?: api.CustomTransformers;
|
|
70
|
-
emitCallback?: api.TsEmitCallback;
|
|
71
|
-
mergeEmitResultsCallback?: api.TsMergeEmitResultsCallback;
|
|
72
|
-
}): ts.EmitResult;
|
|
73
|
-
private getTemplateDiagnostics;
|
|
74
|
-
getIndexedComponents(): Map<ts.Declaration, IndexedComponent>;
|
|
75
|
-
private makeCompilation;
|
|
76
|
-
/**
|
|
77
|
-
* Reifies the inter-dependencies of NgModules and the components within their compilation scopes
|
|
78
|
-
* into the `IncrementalDriver`'s dependency graph.
|
|
79
|
-
*/
|
|
80
|
-
private recordNgModuleScopeDependencies;
|
|
81
|
-
private get reflector();
|
|
82
|
-
private get coreImportsFrom();
|
|
83
|
-
private get isCore();
|
|
84
|
-
private get importRewriter();
|
|
85
|
-
}
|
|
86
|
-
export declare class ReferenceGraphAdapter implements ReferencesRegistry {
|
|
87
|
-
private graph;
|
|
88
|
-
constructor(graph: ReferenceGraph);
|
|
89
|
-
add(source: ts.Declaration, ...references: Reference<ts.Declaration>[]): void;
|
|
90
72
|
}
|