fix(core): migrations not always migrating all files (#30269)
In an Angular CLI project scenario where projects only reference top-level source-files through the `tsconfig` `files` option, we currently do not migrate referenced source-files. This can be fixed checking all referenced source-files which aren't coming from an external library. This is similar to how `tslint` determines project source-files. PR Close #30269
This commit is contained in:

committed by
Alex Rickabaugh

parent
6357d4a0d3
commit
349935a434
@ -53,10 +53,11 @@ function runInjectablePipeMigration(tree: Tree, tsconfigPath: string, basePath:
|
||||
const program = ts.createProgram(parsed.fileNames, parsed.options, host);
|
||||
const typeChecker = program.getTypeChecker();
|
||||
const visitor = new InjectablePipeVisitor(typeChecker);
|
||||
const rootSourceFiles = program.getRootFileNames().map(f => program.getSourceFile(f) !);
|
||||
const sourceFiles = program.getSourceFiles().filter(
|
||||
f => !f.isDeclarationFile && !program.isSourceFileFromExternalLibrary(f));
|
||||
const printer = ts.createPrinter();
|
||||
|
||||
rootSourceFiles.forEach(sourceFile => visitor.visitNode(sourceFile));
|
||||
sourceFiles.forEach(sourceFile => visitor.visitNode(sourceFile));
|
||||
|
||||
visitor.missingInjectablePipes.forEach(data => {
|
||||
const {classDeclaration, importDeclarationMissingImport} = data;
|
||||
|
Reference in New Issue
Block a user