Skip to content

Commit ce87117

Browse files
build: update to Angular 20
BREAKING CHANGE: Angular 18 is no more supported BREAKING CHANGE: ol peer dependency is now ~10.7.0 Closes #333
1 parent b8d5358 commit ce87117

File tree

88 files changed

+1767
-4018
lines changed

Some content is hidden

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

88 files changed

+1767
-4018
lines changed

.github/workflows/angular.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on:
22
workflow_call:
33

44
env:
5-
NODE_JS_VERSION: 18
5+
NODE_JS_VERSION: 20
66

77
jobs:
88
install-and-scan-deps:

README.MD

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ https://quentin-ol.github.io/ngx-openlayers/
77

88
ngx-openlayers works with the following versions which must be installed as peer dependencies:
99

10-
| ngx-openlayers | Angular | Openlayers |
11-
|----------------|----------------|----------------|
12-
| 19.x | ^19.0.0 | ~10.5.0 |
13-
| 18.x | ^18.0.0 | ~10.5.0 |
14-
| 17.x | ^17.0.0 | ~9.2.4 |
15-
| 16.x | ^16.0.0 | ~8.2.0 |
16-
| 15.x | ^15.0.0 | ~7.5.2 |
17-
| 14.x | ^14.0.0 | ~6.15.1 |
10+
| ngx-openlayers | Angular | Openlayers |
11+
|----------------|---------|------------|
12+
| 20.x | ^20.0.0 | ~10.7.0 |
13+
| 19.x | ^19.0.0 | ~10.5.0 |
14+
| 18.x | ^18.0.0 | ~10.5.0 |
15+
| 17.x | ^17.0.0 | ~9.2.4 |
16+
| 16.x | ^16.0.0 | ~8.2.0 |
17+
| 15.x | ^15.0.0 | ~7.5.2 |
18+
| 14.x | ^14.0.0 | ~6.15.1 |
1819

1920
## Installation
2021

angular.json

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"prefix": "app",
3333
"architect": {
3434
"build": {
35-
"builder": "@angular-devkit/build-angular:application",
35+
"builder": "@angular/build:application",
3636
"options": {
3737
"outputPath": {
3838
"base": "dist/demo-ngx-openlayers"
@@ -82,7 +82,7 @@
8282
"defaultConfiguration": "production"
8383
},
8484
"serve": {
85-
"builder": "@angular-devkit/build-angular:dev-server",
85+
"builder": "@angular/build:dev-server",
8686
"options": {
8787
"buildTarget": "demo-ngx-openlayers:build"
8888
},
@@ -93,13 +93,13 @@
9393
}
9494
},
9595
"extract-i18n": {
96-
"builder": "@angular-devkit/build-angular:extract-i18n",
96+
"builder": "@angular/build:extract-i18n",
9797
"options": {
9898
"buildTarget": "demo-ngx-openlayers:build"
9999
}
100100
},
101101
"test": {
102-
"builder": "@angular-devkit/build-angular:karma",
102+
"builder": "@angular/build:karma",
103103
"options": {
104104
"main": "src/test.ts",
105105
"polyfills": "src/polyfills.ts",
@@ -133,7 +133,7 @@
133133
"prefix": "lib",
134134
"architect": {
135135
"build": {
136-
"builder": "@angular-devkit/build-angular:ng-packagr",
136+
"builder": "@angular/build:ng-packagr",
137137
"options": {
138138
"tsConfig": "projects/ngx-openlayers/tsconfig.lib.json",
139139
"project": "projects/ngx-openlayers/ng-package.json"
@@ -145,7 +145,7 @@
145145
}
146146
},
147147
"test": {
148-
"builder": "@angular-devkit/build-angular:karma",
148+
"builder": "@angular/build:karma",
149149
"options": {
150150
"main": "projects/ngx-openlayers/src/test.ts",
151151
"tsConfig": "projects/ngx-openlayers/tsconfig.spec.json",
@@ -176,6 +176,30 @@
176176
},
177177
"@angular-eslint/schematics:library": {
178178
"setParserOptionsProject": true
179+
},
180+
"@schematics/angular:component": {
181+
"type": "component"
182+
},
183+
"@schematics/angular:directive": {
184+
"type": "directive"
185+
},
186+
"@schematics/angular:service": {
187+
"type": "service"
188+
},
189+
"@schematics/angular:guard": {
190+
"typeSeparator": "."
191+
},
192+
"@schematics/angular:interceptor": {
193+
"typeSeparator": "."
194+
},
195+
"@schematics/angular:module": {
196+
"typeSeparator": "."
197+
},
198+
"@schematics/angular:pipe": {
199+
"typeSeparator": "."
200+
},
201+
"@schematics/angular:resolver": {
202+
"typeSeparator": "."
179203
}
180204
}
181205
}

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma')
13+
1414
],
1515
client: {
1616
jasmine: {

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/animations": "^19.2.16",
18-
"@angular/cdk": "^19.2.19",
19-
"@angular/common": "^19.2.16",
20-
"@angular/compiler": "^19.2.17",
21-
"@angular/core": "^19.2.16",
22-
"@angular/forms": "^19.2.16",
23-
"@angular/material": "^19.2.19",
24-
"@angular/platform-browser": "^19.2.16",
25-
"@angular/platform-browser-dynamic": "^19.2.16",
26-
"@angular/router": "^19.2.16",
17+
"@angular/animations": "^20.3.15",
18+
"@angular/cdk": "^20.2.14",
19+
"@angular/common": "^20.3.15",
20+
"@angular/compiler": "^20.3.15",
21+
"@angular/core": "^20.3.15",
22+
"@angular/forms": "^20.3.15",
23+
"@angular/material": "^20.2.14",
24+
"@angular/platform-browser": "^20.3.15",
25+
"@angular/platform-browser-dynamic": "^20.3.15",
26+
"@angular/router": "^20.3.15",
2727
"hammerjs": "^2.0.8",
28-
"ol": "~10.5.0",
28+
"ol": "~10.7.0",
2929
"rxjs": "~7.5.0",
3030
"tslib": "^2.5.0",
3131
"zone.js": "~0.15.1"
3232
},
3333
"devDependencies": {
34-
"@angular-devkit/build-angular": "^19.2.19",
35-
"@angular-eslint/builder": "19.8.1",
36-
"@angular-eslint/eslint-plugin": "19.8.1",
37-
"@angular-eslint/eslint-plugin-template": "19.8.1",
38-
"@angular-eslint/schematics": "19.8.1",
39-
"@angular-eslint/template-parser": "19.8.1",
40-
"@angular/cli": "^19.2.19",
41-
"@angular/compiler-cli": "^19.2.16",
42-
"@angular/language-service": "^19.2.16",
34+
"@angular-eslint/builder": "20.7.0",
35+
"@angular-eslint/eslint-plugin": "20.7.0",
36+
"@angular-eslint/eslint-plugin-template": "20.7.0",
37+
"@angular-eslint/schematics": "20.7.0",
38+
"@angular-eslint/template-parser": "20.7.0",
39+
"@angular/build": "^20.3.13",
40+
"@angular/cli": "^20.3.13",
41+
"@angular/compiler-cli": "^20.3.15",
42+
"@angular/language-service": "^20.3.15",
4343
"@types/arcgis-rest-api": "^10.4.5",
4444
"@types/hammerjs": "^2.0.41",
4545
"@types/jasmine": "~5.1.5",
@@ -60,12 +60,12 @@
6060
"karma-coverage": "~2.2.0",
6161
"karma-jasmine": "~5.1.0",
6262
"karma-jasmine-html-reporter": "~2.1.0",
63-
"ng-packagr": "~19.2.2",
63+
"ng-packagr": "~20.3.2",
6464
"prettier": "^3.4.2",
6565
"ts-node": "~8.3.0",
6666
"typescript": "~5.8.3"
6767
},
6868
"volta": {
69-
"node": "18.20.5"
69+
"node": "20.19.6"
7070
}
7171
}

projects/ngx-openlayers/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma')
13+
1414
],
1515
client: {
1616
jasmine: {

projects/ngx-openlayers/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"release": "commit-and-tag-version -m \"chore(release): version %s\" -t \"\""
1111
},
1212
"peerDependencies": {
13-
"@angular/common": ">=18.0.0 <=19.x.x",
14-
"@angular/core": ">=18.0.0 <=19.x.x",
15-
"ol": "~10.5.0"
13+
"@angular/common": ">=19.0.0 <=20.x.x",
14+
"@angular/core": ">=19.0.0 <=20.x.x",
15+
"ol": "~10.7.0"
1616
}
1717
}

projects/ngx-openlayers/src/lib/attribution.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ElementRef, OnInit } from '@angular/core';
1+
import { Component, ElementRef, OnInit, inject } from '@angular/core';
22
import { Attribution } from 'ol/control';
33

44
@Component({
@@ -7,11 +7,11 @@ import { Attribution } from 'ol/control';
77
standalone: true,
88
})
99
export class AttributionComponent implements OnInit {
10+
private elementRef = inject(ElementRef);
11+
1012
instance: Attribution;
1113
html: string;
1214

13-
constructor(private elementRef: ElementRef) {}
14-
1515
ngOnInit(): void {
1616
this.html = this.elementRef.nativeElement.innerHTML;
1717
this.instance = new Attribution();

projects/ngx-openlayers/src/lib/attributions.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AfterViewInit, Component, ContentChildren, Host, QueryList } from '@angular/core';
1+
import { AfterViewInit, Component, ContentChildren, QueryList, inject } from '@angular/core';
22
import { AttributionComponent } from './attribution.component';
33
import { SourceComponent } from './sources/source.component';
44

@@ -8,13 +8,13 @@ import { SourceComponent } from './sources/source.component';
88
standalone: true,
99
})
1010
export class AttributionsComponent implements AfterViewInit {
11+
private source = inject(SourceComponent, { host: true });
12+
1113
@ContentChildren(AttributionComponent)
1214
attributions: QueryList<AttributionComponent>;
1315

1416
instance: Array<string>;
1517

16-
constructor(@Host() private source: SourceComponent) {}
17-
1818
/* we can do this at the very end */
1919
ngAfterViewInit(): void {
2020
if (this.attributions.length) {

projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnChanges, OnInit, Optional } from '@angular/core';
1+
import { Component, Input, OnChanges, OnInit, inject } from '@angular/core';
22
import { Coordinate } from 'ol/coordinate';
33
import { transform } from 'ol/proj';
44
import { GeometryLinestringComponent } from './geom/geometrylinestring.component';
@@ -14,6 +14,8 @@ import { MapComponent } from './map.component';
1414
standalone: true,
1515
})
1616
export class CollectionCoordinatesComponent implements OnChanges, OnInit {
17+
private map = inject(MapComponent);
18+
1719
@Input()
1820
coordinates: Coordinate[] | Coordinate[][] | Coordinate[][][];
1921
@Input()
@@ -27,14 +29,13 @@ export class CollectionCoordinatesComponent implements OnChanges, OnInit {
2729
| GeometryMultiPolygonComponent;
2830
private mapSrid = 'EPSG:3857';
2931

30-
constructor(
31-
private map: MapComponent,
32-
@Optional() geometryLinestring: GeometryLinestringComponent,
33-
@Optional() geometryPolygon: GeometryPolygonComponent,
34-
@Optional() geometryMultipoint: GeometryMultiPointComponent,
35-
@Optional() geometryMultilinestring: GeometryMultiLinestringComponent,
36-
@Optional() geometryMultipolygon: GeometryMultiPolygonComponent
37-
) {
32+
constructor() {
33+
const geometryLinestring = inject(GeometryLinestringComponent, { optional: true });
34+
const geometryPolygon = inject(GeometryPolygonComponent, { optional: true });
35+
const geometryMultipoint = inject(GeometryMultiPointComponent, { optional: true });
36+
const geometryMultilinestring = inject(GeometryMultiLinestringComponent, { optional: true });
37+
const geometryMultipolygon = inject(GeometryMultiPolygonComponent, { optional: true });
38+
3839
const geometryComponent =
3940
geometryLinestring ??
4041
geometryPolygon ??

0 commit comments

Comments
 (0)