Skip to content

Commit

Permalink
chore: update angular and openayer
Browse files Browse the repository at this point in the history
- angular 8 and openlayer 6
- update all config files (according to angular-cli-diff)
- fix OL breaking change: postrender and prerender
- fix all examples height style
- fix lint errors
- fix `Don't use 'Object' as a type.` according to @type/ol
- remove `on` prefix for all output
- update node in travis CI

BREAKING CHANGES:
- precompose, postcompose become prerender, postrender
- remove `on` prefix for all output, exception for native events :
  - `click` -> `olClick`
  - `select` -> `olFeature`
  - `change` -> `olChange`
  • Loading branch information
Michael PARRY authored and Yakoust committed Nov 13, 2019
1 parent f41daf9 commit 187a3b0
Show file tree
Hide file tree
Showing 67 changed files with 3,378 additions and 2,406 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
node_modules
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
Expand All @@ -23,6 +29,7 @@ node_modules
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
sudo: false
node_js:
- '8'
- '10'
install:
- yarn
cache:
Expand Down
53 changes: 20 additions & 33 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
"newProjectRoot": "projects",
"projects": {
"demo-ngx-openlayers": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
Expand All @@ -33,6 +30,9 @@
"spec": false
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
Expand All @@ -41,7 +41,8 @@
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
Expand All @@ -65,7 +66,6 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
Expand Down Expand Up @@ -94,60 +94,47 @@
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
]
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json",
],
"exclude": [
"**/node_modules/**"
"**/node_modules/**",
"**/projects/**"
],
"tslintConfig": "tslint-prettier.json",
"typeCheck": true
}
}
}
},
"demo-ngx-openlayers-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "demo-ngx-openlayers:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ngx-openlayers": {
"projectType": "library",
"root": "projects/ngx-openlayers",
"sourceRoot": "projects/ngx-openlayers/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
Expand Down Expand Up @@ -180,7 +167,7 @@
"exclude": [
"**/node_modules/**"
],
"tslintConfig": "tslint-prettier.json",
"tslintConfig": "projects/ngx-openlayers/tslint-prettier.json",
"typeCheck": true
}
}
Expand Down
12 changes: 12 additions & 0 deletions browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
10 changes: 7 additions & 3 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand All @@ -21,8 +25,8 @@ exports.config = {
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
};
4 changes: 2 additions & 2 deletions e2e/tsconfig.e2e.json → e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
Expand All @@ -10,4 +10,4 @@
"node"
]
}
}
}
4 changes: 2 additions & 2 deletions src/karma.conf.js → karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
dir: require('path').join(__dirname, './coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
Expand All @@ -28,4 +28,4 @@ module.exports = function (config) {
browsers: ['Chrome'],
singleRun: false
});
};
};
56 changes: 27 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,48 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.12",
"@angular/common": "^7.2.12",
"@angular/compiler": "^7.2.12",
"@angular/core": "^7.2.12",
"@angular/forms": "^7.2.12",
"@angular/http": "^7.2.12",
"@angular/platform-browser": "^7.2.12",
"@angular/platform-browser-dynamic": "^7.2.12",
"@angular/router": "^7.2.12",
"core-js": "^2.5.4",
"@angular/animations": "^8.2.11",
"@angular/common": "^8.2.11",
"@angular/compiler": "^8.2.11",
"@angular/core": "^8.2.11",
"@angular/forms": "^8.2.11",
"@angular/platform-browser": "^8.2.11",
"@angular/platform-browser-dynamic": "^8.2.11",
"@angular/router": "^8.2.11",
"geojson": "^0.5.0",
"hammer-timejs": "^1.1.0",
"hammerjs": "^2.0.8",
"ol": "^5.3.1",
"rxjs": "6.3.3",
"zone.js": "^0.8.26"
"ol": "^6.0.1",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.8",
"@angular-devkit/build-ng-packagr": "~0.13.8",
"@angular/cli": "~7.3.8",
"@angular/compiler-cli": "^7.2.12",
"@angular/language-service": "^7.2.12",
"@types/jasmine": "~2.8.6",
"@angular-devkit/build-angular": "~0.803.13",
"@angular-devkit/build-ng-packagr": "~0.803.13",
"@angular/cli": "^8.3.13",
"@angular/compiler-cli": "^8.2.11",
"@angular/language-service": "^8.2.11",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^4.2.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"ng-packagr": "^5.4.0",
"prettier": "^1.13.4",
"protractor": "~5.3.0",
"standard-version": "^4.4.0",
"ts-node": "~5.0.1",
"tsickle": ">=0.25.5",
"tslib": "^1.7.1",
"tslint": "~5.9.1",
"tsickle": "^0.37.0",
"tslint": "~5.15.0",
"tslint-config-prettier": "^1.13.0",
"tslint-plugin-prettier": "^1.3.0",
"typescript": "~3.1.1"
"typescript": "~3.5.3"
}
}
7 changes: 4 additions & 3 deletions projects/ngx-openlayers/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage'),
reports: ['html', 'lcovonly'],
dir: require('path').join(__dirname, '../../coverage/ngx-openlayers'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
Expand All @@ -26,6 +26,7 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
singleRun: false,
restartOnFileChange: true
});
};
10 changes: 10 additions & 0 deletions projects/ngx-openlayers/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions projects/ngx-openlayers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"postchangelog": "cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md"
},
"peerDependencies": {
"@angular/common": "^6.0.0-rc.0 || ^6.0.0 || ^7.0.0",
"@angular/core": "^6.0.0-rc.0 || ^6.0.0 || ^7.0.0",
"ol": "^5.3.1"
},
"dependencies": {}
"@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0",
"@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0",
"ol": "^6.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ export class CollectionCoordinatesComponent implements OnChanges, OnInit {
switch (this.host.componentType) {
case 'geometry-linestring':
case 'geometry-multipoint':
transformedCoordinates = (<Coordinate[]>this.coordinates).map(c => transform(c, this.srid, this.mapSrid));
transformedCoordinates = (this.coordinates as Coordinate[]).map(c => transform(c, this.srid, this.mapSrid));
break;
case 'geometry-polygon':
case 'geometry-multilinestring':
transformedCoordinates = (<Coordinate[][]>this.coordinates).map(cc =>
transformedCoordinates = (this.coordinates as Coordinate[][]).map(cc =>
cc.map(c => transform(c, this.srid, this.mapSrid))
);
break;
case 'geometry-multipolygon':
transformedCoordinates = (<Coordinate[][][]>this.coordinates).map(ccc =>
transformedCoordinates = (this.coordinates as Coordinate[][][]).map(ccc =>
ccc.map(cc => cc.map(c => transform(c, this.srid, this.mapSrid)))
);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, ContentChild, OnDestroy, OnInit } from '@angular/core';
import { Control } from 'ol/control';
import { MapComponent } from '../map.component';
import { ContentComponent } from '../content.component';
import { TileGridComponent } from '../tilegrid.component';

@Component({
selector: 'aol-control',
Expand All @@ -13,7 +14,7 @@ export class ControlComponent implements OnInit, OnDestroy {
public componentType = 'control';
instance: Control;
element: Element;
@ContentChild(ContentComponent)
@ContentChild(ContentComponent, { static: true })
content: ContentComponent;

constructor(private map: MapComponent) {}
Expand Down
Loading

0 comments on commit 187a3b0

Please sign in to comment.