fix(compiler): various squashed fixes for the new ngc
introduce the option `allowEmptyCodegenFiles` to generate all generated files, even if they are empty. - also provides the original source files from which the file was generated in the write file callback - needed e.g. for G3 when copying over pinto mod names from the original component to all generated files use `importAs` from flat modules when writing summaries - i.e. prevents incorrect entries like @angular/common/common in the .ngsummary.json files. change interaction between ng and ts to prevent race conditions - before Angular would rely on TS to first read the file for which we generate files, and then the generated files. However, this can break easily when we reuse an old program. don’t generate files for sources that are outside of `rootDir` (see #19337)
This commit is contained in:

committed by
Victor Berchet

parent
13613d4acb
commit
a8a9660112
@ -92,6 +92,12 @@ export interface TsEmitArguments {
|
||||
|
||||
export interface TsEmitCallback { (args: TsEmitArguments): ts.EmitResult; }
|
||||
|
||||
export interface LibrarySummary {
|
||||
fileName: string;
|
||||
text: string;
|
||||
sourceFile?: ts.SourceFile;
|
||||
}
|
||||
|
||||
export interface Program {
|
||||
getTsProgram(): ts.Program;
|
||||
getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken): ts.Diagnostic[];
|
||||
@ -110,7 +116,7 @@ export interface Program {
|
||||
customTransformers?: CustomTransformers,
|
||||
emitCallback?: TsEmitCallback
|
||||
}): ts.EmitResult;
|
||||
getLibrarySummaries(): {fileName: string, content: string}[];
|
||||
getLibrarySummaries(): LibrarySummary[];
|
||||
}
|
||||
|
||||
// Wrapper for createProgram.
|
||||
|
Reference in New Issue
Block a user