Skip to content

Commit a86064a

Browse files
authored
build: ensure build uses typescript 3.9 (#19336)
We recently updated TS 3.9 in the `package.json` with #19286, but the build did not pick up the new version. This is because peer dependency ranges did not accept TS 3.9, so yarn hoisted sufficient TS versions.
1 parent 948dfa9 commit a86064a

File tree

27 files changed

+209
-220
lines changed

27 files changed

+209
-220
lines changed

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,32 @@
4848
},
4949
"version": "10.0.0-next.0",
5050
"dependencies": {
51-
"@angular/animations": "^10.0.0-next.6",
52-
"@angular/common": "^10.0.0-next.6",
53-
"@angular/compiler": "^10.0.0-next.6",
54-
"@angular/core": "^10.0.0-next.6",
55-
"@angular/elements": "^10.0.0-next.6",
56-
"@angular/forms": "^10.0.0-next.6",
57-
"@angular/platform-browser": "^10.0.0-next.6",
51+
"@angular/animations": "^10.0.0-next.8",
52+
"@angular/common": "^10.0.0-next.8",
53+
"@angular/compiler": "^10.0.0-next.8",
54+
"@angular/core": "^10.0.0-next.8",
55+
"@angular/elements": "^10.0.0-next.8",
56+
"@angular/forms": "^10.0.0-next.8",
57+
"@angular/platform-browser": "^10.0.0-next.8",
5858
"@types/googlemaps": "^3.39.3",
5959
"@types/youtube": "^0.0.38",
6060
"@webcomponents/custom-elements": "^1.1.0",
6161
"core-js": "^2.6.9",
6262
"material-components-web": "7.0.0-canary.058cfd23c.0",
6363
"rxjs": "^6.5.3",
6464
"systemjs": "0.19.43",
65-
"tslib": "^1.10.0",
65+
"tslib": "^1.12.0",
6666
"zone.js": "~0.10.2"
6767
},
6868
"devDependencies": {
69-
"@angular-devkit/core": "^10.0.0-next.3",
70-
"@angular-devkit/schematics": "^10.0.0-next.3",
71-
"@angular/bazel": "^10.0.0-next.6",
72-
"@angular/compiler-cli": "^10.0.0-next.6",
69+
"@angular-devkit/core": "^10.0.0-next.5",
70+
"@angular-devkit/schematics": "^10.0.0-next.5",
71+
"@angular/bazel": "^10.0.0-next.8",
72+
"@angular/compiler-cli": "^10.0.0-next.8",
7373
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#414d7dd979092cb52d60b58596927abbc26d40b9",
74-
"@angular/platform-browser-dynamic": "^10.0.0-next.6",
75-
"@angular/platform-server": "^10.0.0-next.6",
76-
"@angular/router": "^10.0.0-next.6",
74+
"@angular/platform-browser-dynamic": "^10.0.0-next.8",
75+
"@angular/platform-server": "^10.0.0-next.8",
76+
"@angular/router": "^10.0.0-next.8",
7777
"@bazel/bazelisk": "^1.4.0",
7878
"@bazel/buildifier": "^2.2.1",
7979
"@bazel/ibazel": "^0.13.0",
@@ -83,7 +83,7 @@
8383
"@bazel/typescript": "^1.6.0",
8484
"@firebase/app-types": "^0.3.2",
8585
"@octokit/rest": "16.28.7",
86-
"@schematics/angular": "^10.0.0-next.3",
86+
"@schematics/angular": "^10.0.0-next.5",
8787
"@types/autoprefixer": "^9.7.2",
8888
"@types/browser-sync": "^2.26.1",
8989
"@types/fs-extra": "^4.0.3",
@@ -161,7 +161,7 @@
161161
"tsickle": "0.38.1",
162162
"tslint": "^6.1.0",
163163
"tsutils": "^3.17.1",
164-
"typescript": "3.9.1-rc",
164+
"typescript": "3.9.2",
165165
"typescript-3.6": "npm:typescript@~3.6.4",
166166
"typescript-3.7": "npm:typescript@~3.7.0",
167167
"typescript-3.8": "npm:typescript@~3.8.0",
@@ -170,7 +170,7 @@
170170
"yargs": "15.3.0"
171171
},
172172
"resolutions": {
173-
"dgeni-packages/typescript": "3.8.3",
173+
"dgeni-packages/typescript": "3.9.2",
174174
"**/graceful-fs": "4.2.2"
175175
}
176176
}

src/bazel-tsconfig-test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"extends": "./bazel-tsconfig-build.json",
66
"compilerOptions": {
7-
"importHelpers": false,
7+
"importHelpers": true,
88
"types": ["jasmine"]
99
},
1010
"bazelOptions": {

src/cdk/schematics/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ ts_library(
2323
"testing/**/*.ts",
2424
],
2525
),
26+
# Schematics do not need to run in browsers and can use `commonjs`
27+
# as format instead the default `umd` format.
28+
devmode_module = "commonjs",
2629
module_name = "@angular/cdk/schematics",
30+
prodmode_module = "commonjs",
2731
tsconfig = ":tsconfig.json",
2832
deps = [
2933
"//src/cdk/schematics/update-tool",

src/cdk/schematics/testing/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ package(default_visibility = ["//visibility:public"])
55
ts_library(
66
name = "testing",
77
srcs = glob(["**/*.ts"]),
8+
# Schematics do not need to run in browsers and can use `commonjs`
9+
# as format instead the default `umd` format.
10+
devmode_module = "commonjs",
811
module_name = "@angular/cdk/schematics/testing",
12+
prodmode_module = "commonjs",
913
tsconfig = "tsconfig.json",
1014
deps = [
1115
"@npm//@angular-devkit/core",

src/cdk/schematics/testing/test-case-setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export function _patchTypeScriptDefaultLib(tree: Tree) {
232232
if (filePath.match(/node_modules[/\\]typescript/)) {
233233
return readFileSync(getSystemPath(filePath));
234234
} else {
235-
return _originalRead.apply(this, arguments);
235+
return _originalRead.call(this, filePath);
236236
}
237237
};
238238
}

src/cdk/schematics/testing/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"strict": true,
34
"lib": ["es2015"],
45
"types": ["node", "jasmine", "glob"]
56
}

src/cdk/schematics/update-tool/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ package(default_visibility = ["//visibility:public"])
55
ts_library(
66
name = "update-tool",
77
srcs = glob(["**/*.ts"]),
8+
# Schematics do not need to run in browsers and can use `commonjs`
9+
# as format instead the default `umd` format.
10+
devmode_module = "commonjs",
811
module_name = "@angular/cdk/schematics/update-tool",
12+
prodmode_module = "commonjs",
913
tsconfig = ":tsconfig.json",
1014
deps = [
1115
"@npm//@types/node",

src/google-maps/google-map/google-map.spec.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,8 @@ import {async, TestBed} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44

55
import {GoogleMapsModule} from '../google-maps-module';
6-
import {
7-
createMapConstructorSpy,
8-
createMapSpy,
9-
TestingWindow
10-
} from '../testing/fake-google-map-utils';
11-
import {
12-
DEFAULT_HEIGHT,
13-
DEFAULT_OPTIONS,
14-
DEFAULT_WIDTH,
15-
GoogleMap,
16-
} from './google-map';
6+
import {createMapConstructorSpy, createMapSpy} from '../testing/fake-google-map-utils';
7+
import {DEFAULT_HEIGHT, DEFAULT_OPTIONS, DEFAULT_WIDTH, GoogleMap} from './google-map';
178

189
/** Represents boundaries of a map to be used in tests. */
1910
const testBounds: google.maps.LatLngBoundsLiteral = {
@@ -47,8 +38,7 @@ describe('GoogleMap', () => {
4738
});
4839

4940
afterEach(() => {
50-
const testingWindow: TestingWindow = window;
51-
delete testingWindow.google;
41+
delete window.google;
5242
});
5343

5444
it('throws an error is the Google Maps JavaScript API was not loaded', () => {

src/google-maps/map-circle/map-circle.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
createCircleSpy,
1010
createMapConstructorSpy,
1111
createMapSpy,
12-
TestingWindow,
1312
} from '../testing/fake-google-map-utils';
1413

1514
import {MapCircle} from './map-circle';
@@ -43,8 +42,7 @@ describe('MapCircle', () => {
4342
});
4443

4544
afterEach(() => {
46-
const testingWindow: TestingWindow = window;
47-
delete testingWindow.google;
45+
delete window.google;
4846
});
4947

5048
it('initializes a Google Map Circle', () => {

src/google-maps/map-ground-overlay/map-ground-overlay.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
createGroundOverlaySpy,
1010
createMapConstructorSpy,
1111
createMapSpy,
12-
TestingWindow,
1312
} from '../testing/fake-google-map-utils';
1413

1514
import {MapGroundOverlay} from './map-ground-overlay';
@@ -37,8 +36,7 @@ describe('MapGroundOverlay', () => {
3736
});
3837

3938
afterEach(() => {
40-
const testingWindow: TestingWindow = window;
41-
delete testingWindow.google;
39+
delete window.google;
4240
});
4341

4442
it('initializes a Google Map Ground Overlay', () => {

src/google-maps/map-info-window/map-info-window.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ import {async, TestBed} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44

55
import {DEFAULT_OPTIONS} from '../google-map/google-map';
6+
7+
import {GoogleMapsModule} from '../google-maps-module';
68
import {MapMarker} from '../map-marker/map-marker';
79
import {
810
createInfoWindowConstructorSpy,
911
createInfoWindowSpy,
1012
createMapConstructorSpy,
11-
createMapSpy,
12-
TestingWindow
13+
createMapSpy
1314
} from '../testing/fake-google-map-utils';
14-
15-
import {GoogleMapsModule} from '../google-maps-module';
1615
import {MapInfoWindow} from './map-info-window';
1716

1817
describe('MapInfoWindow', () => {
@@ -33,8 +32,7 @@ describe('MapInfoWindow', () => {
3332
});
3433

3534
afterEach(() => {
36-
const testingWindow: TestingWindow = window;
37-
delete testingWindow.google;
35+
delete window.google;
3836
});
3937

4038
it('initializes a Google Map Info Window', () => {

src/google-maps/map-marker/map-marker.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import {async, TestBed} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44

55
import {DEFAULT_OPTIONS} from '../google-map/google-map';
6+
7+
import {GoogleMapsModule} from '../google-maps-module';
68
import {
79
createMapConstructorSpy,
810
createMapSpy,
911
createMarkerConstructorSpy,
10-
createMarkerSpy,
11-
TestingWindow
12+
createMarkerSpy
1213
} from '../testing/fake-google-map-utils';
13-
14-
import {GoogleMapsModule} from '../google-maps-module';
1514
import {DEFAULT_MARKER_OPTIONS, MapMarker} from './map-marker';
1615

1716
describe('MapMarker', () => {
@@ -32,8 +31,7 @@ describe('MapMarker', () => {
3231
});
3332

3433
afterEach(() => {
35-
const testingWindow: TestingWindow = window;
36-
delete testingWindow.google;
34+
delete window.google;
3735
});
3836

3937
it('initializes a Google Map marker', () => {

src/google-maps/map-polygon/map-polygon.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
createMapSpy,
1010
createPolygonConstructorSpy,
1111
createPolygonSpy,
12-
TestingWindow,
1312
} from '../testing/fake-google-map-utils';
1413

1514
import {MapPolygon} from './map-polygon';
@@ -36,8 +35,7 @@ describe('MapPolygon', () => {
3635
});
3736

3837
afterEach(() => {
39-
const testingWindow: TestingWindow = window;
40-
delete testingWindow.google;
38+
delete window.google;
4139
});
4240

4341
it('initializes a Google Map Polygon', () => {

src/google-maps/map-polyline/map-polyline.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
createMapSpy,
1010
createPolylineConstructorSpy,
1111
createPolylineSpy,
12-
TestingWindow,
1312
} from '../testing/fake-google-map-utils';
1413

1514
import {MapPolyline} from './map-polyline';
@@ -40,8 +39,7 @@ describe('MapPolyline', () => {
4039
});
4140

4241
afterEach(() => {
43-
const testingWindow: TestingWindow = window;
44-
delete testingWindow.google;
42+
delete window.google;
4543
});
4644

4745
it('initializes a Google Map Polyline', () => {

src/google-maps/map-rectangle/map-rectangle.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
createMapSpy,
1010
createRectangleConstructorSpy,
1111
createRectangleSpy,
12-
TestingWindow,
1312
} from '../testing/fake-google-map-utils';
1413

1514
import {MapRectangle} from './map-rectangle';
@@ -36,8 +35,7 @@ describe('MapRectangle', () => {
3635
});
3736

3837
afterEach(() => {
39-
const testingWindow: TestingWindow = window;
40-
delete testingWindow.google;
38+
delete window.google;
4139
});
4240

4341
it('initializes a Google Map Rectangle', () => {

src/google-maps/testing/fake-google-map-utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
// The global `window` variable is typed as an intersection of `Window` and `globalThis`.
10+
// We re-declare `window` here and omit `globalThis` as it is typed with the actual Google
11+
// Maps types which we intend to override with jasmine spies for testing. Keeping `globalThis`
12+
// would mean that `window` is not assignable to our testing window.
13+
declare var window: Window;
14+
915
/** Window interface for testing */
1016
export interface TestingWindow extends Window {
1117
google?: {

src/material/button-toggle/button-toggle.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('button-toggle', () => {
55
beforeEach(async () => await browser.get('/button-toggle'));
66

77
it('should show a button-toggle', async () => {
8-
expect(await element(by.tagName('mat-button-toggle'))).toBeDefined();
8+
expect(await element(by.tagName('mat-button-toggle')).isPresent()).toBe(true);
99
});
1010

1111
});

src/material/card/card.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('mat-card', () => {
55
beforeEach(async () => await browser.get('/cards'));
66

77
it('should show a card', async () => {
8-
expect(await element(by.tagName('mat-card'))).toBeDefined();
8+
expect(await element(by.tagName('mat-card')).isPresent()).toBe(true);
99
});
1010

1111
});

src/material/expansion/expansion.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('expansion', () => {
44
beforeEach(async () => await browser.get('/expansion'));
55

66
it('should show an accordion', async () => {
7-
expect(await element(by.css('.mat-accordion'))).toBeDefined();
7+
expect(await element(by.css('.mat-accordion')).isPresent()).toBe(true);
88
});
99

1010
it('should show two panels', async () => {

src/material/schematics/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ ts_library(
2222
"ng-generate/*/files/**/*.ts",
2323
],
2424
),
25+
# Schematics do not need to run in browsers and can use `commonjs`
26+
# as format instead the default `umd` format.
27+
devmode_module = "commonjs",
2528
module_name = "@angular/material/schematics",
29+
prodmode_module = "commonjs",
2630
tsconfig = ":tsconfig.json",
2731
deps = [
2832
"//src/cdk/schematics",

src/material/toolbar/toolbar.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('mat-toolbar', () => {
55
beforeEach(async () => await browser.get('/toolbar'));
66

77
it('should show a toolbar', async () => {
8-
expect(await element(by.tagName('mat-toolbar'))).toBeDefined();
8+
expect(await element(by.tagName('mat-toolbar')).isPresent()).toBe(true);
99
});
1010

1111
});

0 commit comments

Comments
 (0)