Skip to content

Commit b29ae2f

Browse files
alan-agius4clydin
authored andcommitted
fix(@schematics/angular): add @angular/localize as type when localize package is installed
The `@angular/localize` entrypoint now exposes the global `$localize` method type. See: angular/angular#47763
1 parent 708011e commit b29ae2f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

packages/angular_devkit/build_angular/test/hello-world-app/src/tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
5-
"types": ["@angular/localize/init"]
5+
"types": ["@angular/localize"]
66
},
77
"files": [
88
"main.ts",

packages/angular_devkit/build_angular/test/hello-world-app/src/tsconfig.server.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "../dist-server",
55
"target": "es2016",
66
"baseUrl": "./",
7-
"types": ["@angular/localize/init"]
7+
"types": ["@angular/localize"]
88
},
99
"files": [
1010
"main.server.ts"

packages/angular_devkit/build_angular/test/hello-world-app/src/tsconfig.spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "../out-tsc/spec",
55
"types": [
66
"jasmine",
7-
"@angular/localize/init"
7+
"@angular/localize"
88
]
99
},
1010
"files": [

packages/schematics/angular/universal/files/root/tsconfig.server.json.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"target": "es2019",
77
"types": [
88
"node"<% if (hasLocalizePackage) { %>,
9-
"@angular/localize/init"<% } %>
9+
"@angular/localize"<% } %>
1010
]
1111
},
1212
"files": [

packages/schematics/angular/universal/index_spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ describe('Universal Schematic', () => {
233233
const { compilerOptions } = tree.readJson('/projects/bar/tsconfig.server.json') as {
234234
compilerOptions: CompilerOptions;
235235
};
236-
expect(compilerOptions.types).not.toContain('@angular/localize/init');
236+
expect(compilerOptions.types).not.toContain('@angular/localize');
237237
});
238238

239239
it(`should add import to '@angular/localize' as type in 'tsconfig.server.json' when it's a dependency`, async () => {
@@ -249,6 +249,6 @@ describe('Universal Schematic', () => {
249249
const { compilerOptions } = tree.readJson('/projects/bar/tsconfig.server.json') as {
250250
compilerOptions: CompilerOptions;
251251
};
252-
expect(compilerOptions.types).toContain('@angular/localize/init');
252+
expect(compilerOptions.types).toContain('@angular/localize');
253253
});
254254
});

0 commit comments

Comments
 (0)