Skip to content

Commit 8d7dffe

Browse files
chore: migrate to angular 12
1 parent 7e82125 commit 8d7dffe

File tree

11 files changed

+1830
-2878
lines changed

11 files changed

+1830
-2878
lines changed

angular.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
"@schematics/angular:guard": {
2121
"skipTests": true
2222
},
23-
"@schematics/angular:module": {
24-
"skipTests": true
25-
},
2623
"@schematics/angular:pipe": {
2724
"skipTests": true
2825
},
@@ -42,7 +39,6 @@
4239
"main": "src/main.ts",
4340
"polyfills": "src/polyfills.ts",
4441
"tsConfig": "tsconfig.app.json",
45-
"aot": true,
4642
"assets": [
4743
"src/favicon.ico",
4844
"src/assets"
@@ -51,7 +47,13 @@
5147
"src/styles.css",
5248
"node_modules/ol/ol.css"
5349
],
54-
"scripts": []
50+
"scripts": [],
51+
"vendorChunk": true,
52+
"extractLicenses": false,
53+
"buildOptimizer": false,
54+
"sourceMap": true,
55+
"optimization": false,
56+
"namedChunks": true
5557
},
5658
"configurations": {
5759
"production": {
@@ -75,7 +77,8 @@
7577
"vendorChunk": false,
7678
"buildOptimizer": true
7779
}
78-
}
80+
},
81+
"defaultConfiguration": "production"
7982
},
8083
"serve": {
8184
"builder": "@angular-devkit/build-angular:dev-server",
@@ -117,7 +120,7 @@
117120
"tsConfig": [
118121
"tsconfig.app.json",
119122
"tsconfig.spec.json",
120-
"e2e/tsconfig.json",
123+
"e2e/tsconfig.json"
121124
],
122125
"exclude": [
123126
"**/node_modules/**",

e2e/src/app.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ describe('workspace-project App', () => {
99

1010
it('should display welcome message', async () => {
1111
await page.navigateTo();
12-
expect(await page.getParagraphText()).toEqual('Welcome to app!');
12+
expect(await page.getParagraphText()).toEqual('ngx-openlayer demo');
1313
});
1414
});

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "yarn build:lib && ng serve",
7-
"build:lib": "ng build ngx-openlayers --prod",
7+
"build:lib": "ng build ngx-openlayers --configuration production",
88
"build:demo": "ng build demo-ngx-openlayers",
99
"build": "yarn build:lib && yarn build:demo",
1010
"test": "yarn build:lib && ng test",
@@ -15,25 +15,25 @@
1515
},
1616
"private": true,
1717
"dependencies": {
18-
"@angular/animations": "~11.2.14",
19-
"@angular/common": "~11.2.14",
20-
"@angular/compiler": "~11.2.14",
21-
"@angular/core": "~11.2.14",
22-
"@angular/forms": "~11.2.14",
23-
"@angular/platform-browser": "~11.2.14",
24-
"@angular/platform-browser-dynamic": "~11.2.14",
25-
"@angular/router": "~11.2.14",
18+
"@angular/animations": "~12.2.17",
19+
"@angular/common": "~12.2.17",
20+
"@angular/compiler": "~12.2.17",
21+
"@angular/core": "~12.2.17",
22+
"@angular/forms": "~12.2.17",
23+
"@angular/platform-browser": "~12.2.17",
24+
"@angular/platform-browser-dynamic": "~12.2.17",
25+
"@angular/router": "~12.2.17",
2626
"hammerjs": "^2.0.8",
2727
"ol": "~6.3.1",
2828
"rxjs": "~6.6.0",
2929
"tslib": "^2.5.0",
30-
"zone.js": "~0.11.3"
30+
"zone.js": "~0.11.4"
3131
},
3232
"devDependencies": {
33-
"@angular-devkit/build-angular": "~0.1102.19",
34-
"@angular/cli": "~11.2.19",
35-
"@angular/compiler-cli": "~11.2.14",
36-
"@angular/language-service": "~11.2.14",
33+
"@angular-devkit/build-angular": "~12.2.18",
34+
"@angular/cli": "~12.2.18",
35+
"@angular/compiler-cli": "~12.2.17",
36+
"@angular/language-service": "~12.2.17",
3737
"@types/jasmine": "~3.8.0",
3838
"@types/node": "^12.11.1",
3939
"codelyzer": "^6.0.0",
@@ -43,15 +43,15 @@
4343
"karma-chrome-launcher": "~3.1.0",
4444
"karma-coverage": "~2.0.3",
4545
"karma-jasmine": "~4.0.0",
46-
"karma-jasmine-html-reporter": "^1.5.0",
47-
"ng-packagr": "^11.2.4",
46+
"karma-jasmine-html-reporter": "~1.7.0",
47+
"ng-packagr": "^12.2.7",
4848
"prettier": "^2.0.3",
4949
"protractor": "~7.0.0",
5050
"standard-version": "^7.1.0",
5151
"ts-node": "~8.3.0",
5252
"tslint": "~6.1.0",
5353
"tslint-config-prettier": "^1.13.0",
5454
"tslint-plugin-prettier": "^2.3.0",
55-
"typescript": "~4.0.8"
55+
"typescript": "~4.3.5"
5656
}
57-
}
57+
}

projects/ngx-openlayers/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"postchangelog": "cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md"
99
},
1010
"peerDependencies": {
11-
"@angular/common": ">=6.0.0 <=11.x.x",
12-
"@angular/core": ">=6.0.0 <=11.x.x",
11+
"@angular/common": ">=6.0.0 <=12.x.x",
12+
"@angular/core": ">=6.0.0 <=12.x.x",
1313
"ol": "^6.0.0"
1414
}
1515
}

projects/ngx-openlayers/src/test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

3-
import 'core-js/es7/reflect';
4-
import 'zone.js/dist/zone';
5-
import 'zone.js/dist/zone-testing';
3+
import 'zone.js';
4+
import 'zone.js/testing';
65
import { getTestBed } from '@angular/core/testing';
76
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
87

98
declare const require: any;
109

1110
// First, initialize the Angular testing environment.
12-
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
11+
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
12+
teardown: { destroyAfterEach: true },
13+
});
1314
// Then we find all the tests.
1415
const context = require.context('./', true, /\.spec\.ts$/);
1516
// And load the modules.

src/app/utfgrid/utfgrid.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class UTFGridComponent {
4343
@ViewChild('view', { static: true }) view: ViewComponent;
4444

4545
info: any;
46-
coords: Coordinates;
46+
coords: [number, number];
4747
key = 'pk.eyJ1IjoieWFrb3VzdCIsImEiOiJjanVkc3Y0b2cwNWppM3lwaXd5M3JidHRzIn0.rJmuWPJnuKA9MJ9z5RPKZw';
4848

4949
displayInfo(c) {

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export const environment = {
1212
* import the following file, but please comment it out in production mode
1313
* because it will have performance impact when throw error
1414
*/
15-
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
15+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

src/polyfills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/***************************************************************************************************
5656
* Zone JS is required by default for Angular itself.
5757
*/
58-
import 'zone.js/dist/zone'; // Included with Angular CLI.
58+
import 'zone.js'; // Included with Angular CLI.
5959

6060
/***************************************************************************************************
6161
* APPLICATION IMPORTS

src/test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

3-
import 'zone.js/dist/zone-testing';
3+
import 'zone.js/testing';
44
import { getTestBed } from '@angular/core/testing';
55
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
66

@@ -16,7 +16,9 @@ declare const require: {
1616
};
1717

1818
// First, initialize the Angular testing environment.
19-
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
19+
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
20+
teardown: { destroyAfterEach: true },
21+
});
2022
// Then we find all the tests.
2123
const context = require.context('./', true, /\.spec\.ts$/);
2224
// And load the modules.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"module": "es2020",
1414
"moduleResolution": "node",
1515
"importHelpers": true,
16-
"target": "es2015",
16+
"target": "es2017",
1717
"typeRoots": [
1818
"node_modules/@types"
1919
],

0 commit comments

Comments
 (0)