Skip to content

Commit

Permalink
Merge pull request #275 from jeremy-eychenne/migrate-to-angular-14
Browse files Browse the repository at this point in the history
Migrate to angular 14
  • Loading branch information
jeremy-eychenne committed Oct 6, 2023
2 parents 8b2058c + 4908b85 commit 2eced8b
Show file tree
Hide file tree
Showing 105 changed files with 4,525 additions and 5,632 deletions.
63 changes: 63 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"arrow-parens": [
"off",
"always"
],
"import/order": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ speed-measure-plugin*.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
src
example
tsconfig.json
tslint.json
*.tgz
node_modules/*
npm-debug.log
Expand Down
56 changes: 25 additions & 31 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
Expand All @@ -42,7 +39,6 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
Expand All @@ -51,7 +47,13 @@
"src/styles.css",
"node_modules/ol/ol.css"
],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -70,13 +72,13 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -113,19 +115,12 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json",
],
"exclude": [
"**/node_modules/**",
"**/projects/**"
],
"tslintConfig": "tslint-prettier.json",
"typeCheck": true
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"e2e": {
Expand All @@ -144,7 +139,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/ngx-openlayers/tsconfig.lib.json",
"project": "projects/ngx-openlayers/ng-package.json"
Expand All @@ -164,21 +159,20 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"projects/ngx-openlayers/tsconfig.lib.json",
"projects/ngx-openlayers/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
],
"tslintConfig": "projects/ngx-openlayers/tslint-prettier.json",
"typeCheck": true
"lintFilePatterns": [
"projects/ngx-openlayers/**/*.ts",
"projects/ngx-openlayers/**/*.html"
]
}
}
}
}
},
"defaultProject": "demo-ngx-openlayers"
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
6 changes: 3 additions & 3 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ describe('workspace-project App', () => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
it('should display welcome message', async () => {
await page.navigateTo();
expect(await page.getParagraphText()).toEqual('ngx-openlayer demo');
});
});
4 changes: 2 additions & 2 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
async navigateTo(): Promise<unknown> {
return browser.get('/');
}

getParagraphText() {
async getParagraphText(): Promise<string> {
return element(by.css('app-root h1')).getText();
}
}
1 change: 0 additions & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"target": "es2018",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
Expand Down
20 changes: 16 additions & 4 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'lcovonly' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
Expand Down
63 changes: 34 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"ng": "ng",
"start": "yarn build:lib && ng serve",
"build:lib": "ng build ngx-openlayers --prod",
"build:lib": "ng build ngx-openlayers --configuration production",
"build:demo": "ng build demo-ngx-openlayers",
"build": "yarn build:lib && yarn build:demo",
"test": "yarn build:lib && ng test",
Expand All @@ -15,45 +15,50 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.2.5",
"@angular/common": "~10.2.5",
"@angular/compiler": "~10.2.5",
"@angular/core": "~10.2.5",
"@angular/forms": "~10.2.5",
"@angular/platform-browser": "~10.2.5",
"@angular/platform-browser-dynamic": "~10.2.5",
"@angular/router": "~10.2.5",
"@angular/animations": "^14.3.0",
"@angular/common": "^14.3.0",
"@angular/compiler": "^14.3.0",
"@angular/core": "^14.3.0",
"@angular/forms": "^14.3.0",
"@angular/platform-browser": "^14.3.0",
"@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^14.3.0",
"hammerjs": "^2.0.8",
"ol": "~6.3.1",
"rxjs": "~6.6.0",
"rxjs": "~7.5.0",
"tslib": "^2.5.0",
"zone.js": "~0.10.2"
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1002.4",
"@angular-devkit/build-ng-packagr": "~0.1002.4",
"@angular/cli": "~10.2.4",
"@angular/compiler-cli": "~10.2.5",
"@angular/language-service": "~10.2.5",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@angular-devkit/build-angular": "^14.2.11",
"@angular-eslint/builder": "14.4.0",
"@angular-eslint/eslint-plugin": "14.4.0",
"@angular-eslint/eslint-plugin-template": "14.4.0",
"@angular-eslint/schematics": "14.4.0",
"@angular-eslint/template-parser": "14.4.0",
"@angular/cli": "^14.2.11",
"@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^14.3.0",
"@types/jasmine": "~4.3.1",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.8.0",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"@typescript-eslint/parser": "^5.36.2",
"eslint": "^8.23.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prefer-arrow": "latest",
"jasmine-core": "~4.3.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^10.1.2",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"ng-packagr": "^14.2.2",
"prettier": "^2.0.3",
"protractor": "~7.0.0",
"standard-version": "^7.1.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"tslint-config-prettier": "^1.13.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "~4.0.8"
"typescript": "~4.7.2"
}
}
Loading

0 comments on commit 2eced8b

Please sign in to comment.