Skip to content

Commit

Permalink
fix(@schematics/angular): add @angular/localize as type when locali…
Browse files Browse the repository at this point in the history
…ze package is installed

The `@angular/localize` entrypoint now exposes the global `$localize` method type.

See: angular/angular#47763
(cherry picked from commit b29ae2f)
  • Loading branch information
alan-agius4 authored and clydin committed Oct 21, 2022
1 parent f48d3a6 commit 4e69e80
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": ["@angular/localize/init"]
"types": ["@angular/localize"]
},
"files": [
"main.ts",
Expand Down
Expand Up @@ -4,7 +4,7 @@
"outDir": "../dist-server",
"target": "es2016",
"baseUrl": "./",
"types": ["@angular/localize/init"]
"types": ["@angular/localize"]
},
"files": [
"main.server.ts"
Expand Down
Expand Up @@ -4,7 +4,7 @@
"outDir": "../out-tsc/spec",
"types": [
"jasmine",
"@angular/localize/init"
"@angular/localize"
]
},
"files": [
Expand Down
Expand Up @@ -6,7 +6,7 @@
"target": "es2019",
"types": [
"node"<% if (hasLocalizePackage) { %>,
"@angular/localize/init"<% } %>
"@angular/localize"<% } %>
]
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/schematics/angular/universal/index_spec.ts
Expand Up @@ -233,7 +233,7 @@ describe('Universal Schematic', () => {
const { compilerOptions } = tree.readJson('/projects/bar/tsconfig.server.json') as {
compilerOptions: CompilerOptions;
};
expect(compilerOptions.types).not.toContain('@angular/localize/init');
expect(compilerOptions.types).not.toContain('@angular/localize');
});

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

0 comments on commit 4e69e80

Please sign in to comment.