Content-Length: 332793 | pFad | https://github.com/angular/angular/commit/08f7d21d5c93240917801ce1f1a18ebdf72b6684

09 refactor(migrations): ensure tsurge configures file system properly (… · angular/angular@08f7d21 · GitHub
Skip to content

Commit 08f7d21

Browse files
devversionthePunderWoman
authored andcommitted
refactor(migrations): ensure tsurge configures file system properly (#61553)
Currently in 1P, without this commit, the tsconfig parsing picks up the default file system (InvalidFS) and results in runtime errors. PR Close #61553
1 parent 7adbb9c commit 08f7d21

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

packages/core/schematics/utils/tsurge/base_migration.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {absoluteFrom, FileSystem} from '@angular/compiler-cli/src/ngtsc/file_system';
109
import {NgCompilerOptions} from '@angular/compiler-cli/src/ngtsc/core/api';
11-
import {getRootDirs} from '@angular/compiler-cli/src/ngtsc/util/src/typescript';
12-
import {isShim} from '@angular/compiler-cli/src/ngtsc/shims';
13-
import {ProgramInfo} from './program_info';
14-
import {Serializable} from './helpers/serializable';
10+
import {FileSystem} from '@angular/compiler-cli/src/ngtsc/file_system';
1511
import {createBaseProgramInfo, getProgramInfoFromBaseInfo} from './helpers/create_program';
12+
import {Serializable} from './helpers/serializable';
13+
import {ProgramInfo} from './program_info';
1614

1715
/** Type helper extracting the stats type of a migration. */
1816
export type MigrationStats<T> =

packages/core/schematics/utils/tsurge/helpers/create_program.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ import {createPlainTsProgram} from './ts_program';
2525
/** Creates the base program info for the given tsconfig path. */
2626
export function createBaseProgramInfo(
2727
absoluteTsconfigPath: string,
28-
fs?: FileSystem,
28+
fs: FileSystem,
2929
optionOverrides: NgCompilerOptions = {},
3030
): BaseProgramInfo {
31-
if (fs === undefined) {
32-
fs = new NodeJSFileSystem();
33-
setFileSystem(fs);
34-
}
31+
// Make sure the FS becomes globally available. Some code paths
32+
// of the Angular compiler, or tsconfig parsing aren't leveraging
33+
// the specified file system.
34+
setFileSystem(fs);
3535

3636
const tsconfig = parseTsconfigOrDie(absoluteTsconfigPath, fs);
3737
const tsHost = new NgtscCompilerHost(fs, tsconfig.options);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/angular/angular/commit/08f7d21d5c93240917801ce1f1a18ebdf72b6684

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy