Skip to content

Commit c9f5304

Browse files
alan-agius4filipesilva
authored andcommitted
fix(@schematics/angular): migrate tsconfig.base.json module and target options
Closes #18073
1 parent 68ed9ab commit c9f5304

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/schematics/angular/migrations/migration-collection.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@
9595
"factory": "./update-10/solution-style-tsconfig",
9696
"description": "Add \"Solution Style\" TypeScript configuration file support. This improves developer experience using editors powered by TypeScript’s language server. Read more about this here: https://v10.angular.io/guide/migration-solution-style-tsconfig"
9797
},
98-
"update-module-and-target-compiler-options": {
99-
"version": "10.0.0-rc.1",
100-
"factory": "./update-10/update-module-and-target-compiler-options",
101-
"description": "Update 'module' and 'target' TypeScript compiler options. Read more about this here: https://v10.angular.io/guide/migration-update-module-and-target-compiler-options"
102-
},
10398
"update-workspace-dependencies": {
10499
"version": "10.0.0-rc.2",
105100
"factory": "./update-10/update-dependencies",
106101
"description": "Update workspace dependencies to match a new v10 project."
102+
},
103+
"update-module-and-target-compiler-options": {
104+
"version": "10.0.1",
105+
"factory": "./update-10/update-module-and-target-compiler-options",
106+
"description": "Update 'module' and 'target' TypeScript compiler options. Read more about this here: https://v10.angular.io/guide/migration-update-module-and-target-compiler-options"
107107
}
108108
}
109109
}

packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface ModuleAndTargetReplamenent {
2323
export default function (): Rule {
2424
return async host => {
2525
// Workspace level tsconfig
26-
updateModuleAndTarget(host, 'tsconfig.json', {
26+
updateModuleAndTarget(host, 'tsconfig.base.json', {
2727
oldModule: 'esnext',
2828
newModule: 'es2020',
2929
});

packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options_spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('Migration to update target and module compiler options', () => {
9191
const compilerOptions = { target: 'es2015', module: 'esnext' };
9292

9393
// Workspace
94-
createJsonFile(tree, 'tsconfig.json', { compilerOptions });
94+
createJsonFile(tree, 'tsconfig.base.json', { compilerOptions });
9595

9696
// Application
9797
createJsonFile(tree, 'src/tsconfig.app.json', { compilerOptions });
@@ -106,19 +106,19 @@ describe('Migration to update target and module compiler options', () => {
106106
createJsonFile(tree, 'src/tsconfig.server.json', { compilerOptions: { module: 'commonjs' } });
107107
});
108108

109-
it(`should update module and target in workspace 'tsconfig.json'`, async () => {
109+
it(`should update module and target in workspace 'tsconfig.base.json'`, async () => {
110110
const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise();
111-
const { module } = readJsonFile(newTree, 'tsconfig.json').compilerOptions;
111+
const { module } = readJsonFile(newTree, 'tsconfig.base.json').compilerOptions;
112112
expect(module).toBe('es2020');
113113
});
114114

115-
it(`should update module and target in 'tsconfig.json' which is referenced in option`, async () => {
115+
it(`should update module and target in 'tsconfig.base.json' which is referenced in option`, async () => {
116116
const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise();
117117
const { module } = readJsonFile(newTree, 'src/tsconfig.spec.json').compilerOptions;
118118
expect(module).toBe('es2020');
119119
});
120120

121-
it(`should update module and target in 'tsconfig.json' which is referenced in a configuration`, async () => {
121+
it(`should update module and target in 'tsconfig.base.json' which is referenced in a configuration`, async () => {
122122
const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise();
123123
const { module } = readJsonFile(newTree, 'src/tsconfig.app.prod.json').compilerOptions;
124124
expect(module).toBe('es2020');

0 commit comments

Comments
 (0)