Skip to content

Commit 2eced8b

Browse files
Merge pull request #275 from jeremy-eychenne/migrate-to-angular-14
Migrate to angular 14
2 parents 8b2058c + 4908b85 commit 2eced8b

File tree

105 files changed

+4525
-5632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4525
-5632
lines changed

.eslintrc.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [
4+
"projects/**/*"
5+
],
6+
"overrides": [
7+
{
8+
"files": [
9+
"*.ts"
10+
],
11+
"parserOptions": {
12+
"project": [
13+
"tsconfig.json",
14+
"e2e/tsconfig.json"
15+
],
16+
"createDefaultProgram": true
17+
},
18+
"extends": [
19+
"plugin:@angular-eslint/ng-cli-compat",
20+
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
21+
"plugin:@angular-eslint/template/process-inline-templates"
22+
],
23+
"rules": {
24+
"@angular-eslint/component-selector": [
25+
"error",
26+
{
27+
"type": "element",
28+
"prefix": "app",
29+
"style": "kebab-case"
30+
}
31+
],
32+
"@angular-eslint/directive-selector": [
33+
"error",
34+
{
35+
"type": "attribute",
36+
"prefix": "app",
37+
"style": "camelCase"
38+
}
39+
],
40+
"@typescript-eslint/explicit-member-accessibility": [
41+
"off",
42+
{
43+
"accessibility": "explicit"
44+
}
45+
],
46+
"arrow-parens": [
47+
"off",
48+
"always"
49+
],
50+
"import/order": "off"
51+
}
52+
},
53+
{
54+
"files": [
55+
"*.html"
56+
],
57+
"extends": [
58+
"plugin:@angular-eslint/template/recommended"
59+
],
60+
"rules": {}
61+
}
62+
]
63+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ speed-measure-plugin*.json
3232
.history/*
3333

3434
# misc
35+
/.angular/cache
3536
/.sass-cache
3637
/connect.lock
3738
/coverage

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
src
22
example
33
tsconfig.json
4-
tslint.json
54
*.tgz
65
node_modules/*
76
npm-debug.log

angular.json

Lines changed: 25 additions & 31 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": {
@@ -70,13 +72,13 @@
7072
"optimization": true,
7173
"outputHashing": "all",
7274
"sourceMap": false,
73-
"extractCss": true,
7475
"namedChunks": false,
7576
"extractLicenses": true,
7677
"vendorChunk": false,
7778
"buildOptimizer": true
7879
}
79-
}
80+
},
81+
"defaultConfiguration": "production"
8082
},
8183
"serve": {
8284
"builder": "@angular-devkit/build-angular:dev-server",
@@ -113,19 +115,12 @@
113115
}
114116
},
115117
"lint": {
116-
"builder": "@angular-devkit/build-angular:tslint",
118+
"builder": "@angular-eslint/builder:lint",
117119
"options": {
118-
"tsConfig": [
119-
"tsconfig.app.json",
120-
"tsconfig.spec.json",
121-
"e2e/tsconfig.json",
122-
],
123-
"exclude": [
124-
"**/node_modules/**",
125-
"**/projects/**"
126-
],
127-
"tslintConfig": "tslint-prettier.json",
128-
"typeCheck": true
120+
"lintFilePatterns": [
121+
"src/**/*.ts",
122+
"src/**/*.html"
123+
]
129124
}
130125
},
131126
"e2e": {
@@ -144,7 +139,7 @@
144139
"prefix": "lib",
145140
"architect": {
146141
"build": {
147-
"builder": "@angular-devkit/build-ng-packagr:build",
142+
"builder": "@angular-devkit/build-angular:ng-packagr",
148143
"options": {
149144
"tsConfig": "projects/ngx-openlayers/tsconfig.lib.json",
150145
"project": "projects/ngx-openlayers/ng-package.json"
@@ -164,21 +159,20 @@
164159
}
165160
},
166161
"lint": {
167-
"builder": "@angular-devkit/build-angular:tslint",
162+
"builder": "@angular-eslint/builder:lint",
168163
"options": {
169-
"tsConfig": [
170-
"projects/ngx-openlayers/tsconfig.lib.json",
171-
"projects/ngx-openlayers/tsconfig.spec.json"
172-
],
173-
"exclude": [
174-
"**/node_modules/**"
175-
],
176-
"tslintConfig": "projects/ngx-openlayers/tslint-prettier.json",
177-
"typeCheck": true
164+
"lintFilePatterns": [
165+
"projects/ngx-openlayers/**/*.ts",
166+
"projects/ngx-openlayers/**/*.html"
167+
]
178168
}
179169
}
180170
}
181171
}
182172
},
183-
"defaultProject": "demo-ngx-openlayers"
173+
"cli": {
174+
"schematicCollections": [
175+
"@angular-eslint/schematics"
176+
]
177+
}
184178
}

e2e/src/app.e2e-spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ describe('workspace-project App', () => {
77
page = new AppPage();
88
});
99

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

e2e/src/app.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { browser, by, element } from 'protractor';
22

33
export class AppPage {
4-
navigateTo() {
4+
async navigateTo(): Promise<unknown> {
55
return browser.get('/');
66
}
77

8-
getParagraphText() {
8+
async getParagraphText(): Promise<string> {
99
return element(by.css('app-root h1')).getText();
1010
}
1111
}

e2e/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"target": "es2018",
77
"types": [
88
"jasmine",
9-
"jasminewd2",
109
"node"
1110
]
1211
}

karma.conf.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,28 @@ module.exports = function (config) {
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
12-
require('karma-coverage-istanbul-reporter'),
12+
require('karma-coverage'),
1313
require('@angular-devkit/build-angular/plugins/karma')
1414
],
1515
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
1622
clearContext: false // leave Jasmine Spec Runner output visible in browser
1723
},
18-
coverageIstanbulReporter: {
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
1928
dir: require('path').join(__dirname, './coverage'),
20-
reports: ['html', 'lcovonly'],
21-
fixWebpackSourcePaths: true
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'lcovonly' }
33+
]
2234
},
2335
reporters: ['progress', 'kjhtml'],
2436
port: 9876,

package.json

Lines changed: 34 additions & 29 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,45 +15,50 @@
1515
},
1616
"private": true,
1717
"dependencies": {
18-
"@angular/animations": "~10.2.5",
19-
"@angular/common": "~10.2.5",
20-
"@angular/compiler": "~10.2.5",
21-
"@angular/core": "~10.2.5",
22-
"@angular/forms": "~10.2.5",
23-
"@angular/platform-browser": "~10.2.5",
24-
"@angular/platform-browser-dynamic": "~10.2.5",
25-
"@angular/router": "~10.2.5",
18+
"@angular/animations": "^14.3.0",
19+
"@angular/common": "^14.3.0",
20+
"@angular/compiler": "^14.3.0",
21+
"@angular/core": "^14.3.0",
22+
"@angular/forms": "^14.3.0",
23+
"@angular/platform-browser": "^14.3.0",
24+
"@angular/platform-browser-dynamic": "^14.3.0",
25+
"@angular/router": "^14.3.0",
2626
"hammerjs": "^2.0.8",
2727
"ol": "~6.3.1",
28-
"rxjs": "~6.6.0",
28+
"rxjs": "~7.5.0",
2929
"tslib": "^2.5.0",
30-
"zone.js": "~0.10.2"
30+
"zone.js": "~0.11.4"
3131
},
3232
"devDependencies": {
33-
"@angular-devkit/build-angular": "~0.1002.4",
34-
"@angular-devkit/build-ng-packagr": "~0.1002.4",
35-
"@angular/cli": "~10.2.4",
36-
"@angular/compiler-cli": "~10.2.5",
37-
"@angular/language-service": "~10.2.5",
38-
"@types/jasmine": "~3.5.0",
39-
"@types/jasminewd2": "~2.0.3",
33+
"@angular-devkit/build-angular": "^14.2.11",
34+
"@angular-eslint/builder": "14.4.0",
35+
"@angular-eslint/eslint-plugin": "14.4.0",
36+
"@angular-eslint/eslint-plugin-template": "14.4.0",
37+
"@angular-eslint/schematics": "14.4.0",
38+
"@angular-eslint/template-parser": "14.4.0",
39+
"@angular/cli": "^14.2.11",
40+
"@angular/compiler-cli": "^14.3.0",
41+
"@angular/language-service": "^14.3.0",
42+
"@types/jasmine": "~4.3.1",
4043
"@types/node": "^12.11.1",
41-
"codelyzer": "^6.0.0",
42-
"jasmine-core": "~3.8.0",
44+
"@typescript-eslint/eslint-plugin": "^5.36.2",
45+
"@typescript-eslint/parser": "^5.36.2",
46+
"eslint": "^8.23.0",
47+
"eslint-plugin-import": "latest",
48+
"eslint-plugin-jsdoc": "latest",
49+
"eslint-plugin-prefer-arrow": "latest",
50+
"jasmine-core": "~4.3.0",
4351
"jasmine-spec-reporter": "~5.0.0",
44-
"karma": "~5.0.0",
52+
"karma": "~6.4.1",
4553
"karma-chrome-launcher": "~3.1.0",
46-
"karma-coverage-istanbul-reporter": "~3.0.2",
47-
"karma-jasmine": "~4.0.0",
48-
"karma-jasmine-html-reporter": "^1.5.0",
49-
"ng-packagr": "^10.1.2",
54+
"karma-coverage": "~2.2.0",
55+
"karma-jasmine": "~5.1.0",
56+
"karma-jasmine-html-reporter": "~2.0.0",
57+
"ng-packagr": "^14.2.2",
5058
"prettier": "^2.0.3",
5159
"protractor": "~7.0.0",
5260
"standard-version": "^7.1.0",
5361
"ts-node": "~8.3.0",
54-
"tslint": "~6.1.0",
55-
"tslint-config-prettier": "^1.13.0",
56-
"tslint-plugin-prettier": "^2.3.0",
57-
"typescript": "~4.0.8"
62+
"typescript": "~4.7.2"
5863
}
5964
}

0 commit comments

Comments
 (0)