mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(compiler-cli): expose code needed by Angular CLI (#43431)
Exposes code needed by the Angular CLI. Previously the CLI used deep imports for most of these things, but now with bundling the CLI, we no longer support deep imports. We will expose the necessary dependencies for the linker as part of the primary entry-point (I think that is more maintable than re-exporting them as part of the linker). We also expose the ngcc entry-point for the CLI with a new constant that will point to the ngcc command line entry-point (which the CLI relies on). PR Close #43431
This commit is contained in:
committed by
Dylan Hunn
parent
7d886ce91c
commit
f7cd8a0e45
@@ -21,12 +21,19 @@ export * from './src/perform_compile';
|
||||
export {CompilerOptions as AngularCompilerOptions} from './src/transformers/api';
|
||||
|
||||
export {ngToTsDiagnostic} from './src/transformers/util';
|
||||
export {NgTscPlugin} from './src/ngtsc/tsc_plugin';
|
||||
export {NgtscProgram} from './src/ngtsc/program';
|
||||
|
||||
// Internal exports needed for packages relying on the compiler-cli.
|
||||
// TODO: Consider moving into `@angular/compiler-cli/private`. This would
|
||||
// help with a consistent pattern for cross package imports for Angular.
|
||||
export * from './src/tooling';
|
||||
|
||||
// Exposed as they are needed for relying on the `linker`.
|
||||
export * from './src/ngtsc/logging';
|
||||
export * from './src/ngtsc/file_system';
|
||||
|
||||
// Exports for dealing with the `ngtsc` program.
|
||||
export {NgTscPlugin} from './src/ngtsc/tsc_plugin';
|
||||
export {NgtscProgram} from './src/ngtsc/program';
|
||||
export {OptimizeFor} from './src/ngtsc/typecheck/api';
|
||||
|
||||
setFileSystem(new NodeJSFileSystem());
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {join} from 'path';
|
||||
import {NodeJSFileSystem, setFileSystem} from '../src/ngtsc/file_system';
|
||||
|
||||
import {mainNgcc} from './src/main';
|
||||
@@ -20,3 +22,11 @@ export function process(options: AsyncNgccOptions|SyncNgccOptions): void|Promise
|
||||
setFileSystem(new NodeJSFileSystem());
|
||||
return mainNgcc(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Absolute file path that points to the `ngcc` entry-point.
|
||||
*
|
||||
* This can be used by the Angular CLI to spawn a process running ngcc using
|
||||
* command line options.
|
||||
*/
|
||||
export const ngccMainFilePath = join(__dirname, './main-ngcc.js');
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
"./package.json": {
|
||||
"default": "./package.json"
|
||||
},
|
||||
"./ngcc": {
|
||||
"types": "./ngcc/index.d.ts",
|
||||
"default": "./bundles/ngcc/index.js"
|
||||
},
|
||||
"./linker": {
|
||||
"types": "./linker/index.d.ts",
|
||||
"default": "./bundles/linker/index.js"
|
||||
|
||||
Reference in New Issue
Block a user