Skip to content

Commit e0e70f1

Browse files
Update Angular to Angular 18 (#675)
1 parent cce23b7 commit e0e70f1

31 files changed

+19138
-38918
lines changed

.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"createDefaultProgram": true
1010
},
1111
"extends": [
12-
"plugin:@angular-eslint/ng-cli-compat",
13-
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
12+
"plugin:@angular-eslint/recommended",
1413
"plugin:@angular-eslint/template/process-inline-templates"
1514
],
1615
"rules": {

.github/actions/build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
node:
66
description: The Node version to use
77
required: false
8-
default: 18
8+
default: 22
99

1010
runs:
1111
using: composite

.github/workflows/browserstack.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ concurrency:
1919
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2020

2121
env:
22-
NODE_VERSION: 18
22+
NODE_VERSION: 22
2323
CACHE_KEY: '${{ github.event.pull_request.head.sha || github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}'
2424

2525
jobs:
26-
2726
browserstack:
28-
2927
name: BrowserStack Tests
3028
runs-on: ubuntu-latest
3129

.github/workflows/publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permissions:
2222
id-token: write # For publishing to NPM with provenance. Allows developers to run `npm audit signatures` and verify release signature of SDK. @see https://github.blog/2023-04-19-introducing-npm-package-provenance/
2323

2424
env:
25-
NODE_VERSION: 18
25+
NODE_VERSION: 22
2626
NODE_ENV: development
2727

2828
jobs:
@@ -52,8 +52,7 @@ jobs:
5252
# Build the tag string from package.json version and release suffix. Produces something like `1.0.0-beta.1` for a beta, or `1.0.0` for a stable release.
5353
- name: Build tag
5454
id: vtag
55-
env:
56-
PACKAGE_VERSION="${{ github.event.inputs.version }}"
55+
env: PACKAGE_VERSION="${{ github.event.inputs.version }}"
5756
run: |
5857
echo "vtag=${PACKAGE_VERSION}" >> $GITHUB_ENV
5958
echo "vtag=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
rl-scanner:
1919
uses: ./.github/workflows/rl-secure.yml
2020
with:
21-
node-version: 18 ## depends if build requires node else we can remove this.
22-
artifact-name: 'auth0-angular.tgz' ## Will change respective to Repository
21+
node-version: 22 ## depends if build requires node else we can remove this.
22+
artifact-name: 'auth0-angular.tgz' ## Will change respective to Repository
2323
secrets:
2424
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
2525
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
@@ -32,7 +32,7 @@ jobs:
3232
uses: ./.github/workflows/npm-release.yml
3333
needs: rl-scanner ## this is important as this will not let release job to run until rl-scanner is done
3434
with:
35-
node-version: 18
35+
node-version: 22
3636
require-build: true
3737
release-directory: './dist/auth0-angular'
3838
secrets:

.github/workflows/test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1919

2020
env:
21-
NODE_VERSION: 18
21+
NODE_VERSION: 22
2222
CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}'
2323

2424
jobs:
@@ -42,26 +42,27 @@ jobs:
4242
key: ${{ env.CACHE_KEY }}
4343

4444
unit:
45-
needs: build # Require build to complete before running tests
46-
4745
name: Unit Tests
4846
runs-on: ubuntu-latest
4947

48+
strategy:
49+
matrix:
50+
NODE_VERSION: [20, 22]
51+
5052
steps:
5153
- name: Checkout code
5254
uses: actions/checkout@v4
5355

5456
- name: Setup Node
5557
uses: actions/setup-node@v4
5658
with:
57-
node-version: ${{ env.NODE_VERSION }}
59+
node-version: ${{ matrix.NODE_VERSION }}
5860
cache: npm
5961

60-
- name: Restore build artifacts
61-
uses: actions/cache/restore@v4
62+
- name: Build package
63+
uses: ./.github/actions/build
6264
with:
63-
path: .
64-
key: ${{ env.CACHE_KEY }}
65+
node: ${{ matrix.NODE_VERSION }}
6566

6667
- name: Run tests
6768
run: npm run test:ci

angular.json

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"test": {
2525
"builder": "@angular-devkit/build-angular:karma",
2626
"options": {
27-
"main": "projects/auth0-angular/src/test.ts",
2827
"tsConfig": "projects/auth0-angular/tsconfig.spec.json",
2928
"karmaConfig": "projects/auth0-angular/karma.conf.js"
3029
}
@@ -48,12 +47,13 @@
4847
"prefix": "app",
4948
"architect": {
5049
"build": {
51-
"builder": "@angular-devkit/build-angular:browser",
50+
"builder": "@angular-devkit/build-angular:application",
5251
"options": {
53-
"outputPath": "dist/playground",
52+
"outputPath": {
53+
"base": "dist/playground"
54+
},
5455
"index": "projects/playground/src/index.html",
55-
"main": "projects/playground/src/main.ts",
56-
"polyfills": "projects/playground/src/polyfills.ts",
56+
"polyfills": ["projects/playground/src/polyfills.ts"],
5757
"tsConfig": "projects/playground/tsconfig.app.json",
5858
"assets": [
5959
"projects/playground/src/favicon.ico",
@@ -66,12 +66,11 @@
6666
],
6767
"styles": ["projects/playground/src/styles.css"],
6868
"scripts": [],
69-
"vendorChunk": true,
7069
"extractLicenses": false,
71-
"buildOptimizer": false,
7270
"sourceMap": true,
7371
"optimization": false,
74-
"namedChunks": true
72+
"namedChunks": true,
73+
"browser": "projects/playground/src/main.ts"
7574
},
7675
"configurations": {
7776
"local": {
@@ -97,8 +96,6 @@
9796
"sourceMap": false,
9897
"namedChunks": false,
9998
"extractLicenses": true,
100-
"vendorChunk": false,
101-
"buildOptimizer": true,
10299
"budgets": [
103100
{
104101
"type": "initial",
@@ -117,29 +114,28 @@
117114
"serve": {
118115
"builder": "@angular-devkit/build-angular:dev-server",
119116
"options": {
120-
"browserTarget": "playground:build",
121-
"host": "0.0.0.0"
117+
"host": "0.0.0.0",
118+
"buildTarget": "playground:build"
122119
},
123120
"configurations": {
124121
"production": {
125-
"browserTarget": "playground:build"
122+
"buildTarget": "playground:build"
126123
},
127124
"local": {
128-
"browserTarget": "playground:build:local",
129-
"proxyConfig": "projects/playground/src/proxy.conf.json"
125+
"proxyConfig": "projects/playground/src/proxy.conf.json",
126+
"buildTarget": "playground:build:local"
130127
}
131128
}
132129
},
133130
"extract-i18n": {
134131
"builder": "@angular-devkit/build-angular:extract-i18n",
135132
"options": {
136-
"browserTarget": "playground:build"
133+
"buildTarget": "playground:build"
137134
}
138135
},
139136
"test": {
140137
"builder": "@angular-devkit/build-angular:karma",
141138
"options": {
142-
"main": "projects/playground/src/test.ts",
143139
"polyfills": "projects/playground/src/polyfills.ts",
144140
"tsConfig": "projects/playground/tsconfig.spec.json",
145141
"karmaConfig": "projects/playground/karma.conf.js",
@@ -200,8 +196,7 @@
200196
}
201197
}
202198
},
203-
"defaultProject": "auth0-angular",
204199
"cli": {
205-
"defaultCollection": "@angular-eslint/schematics"
200+
"schematicCollections": ["angular-eslint"]
206201
}
207202
}

0 commit comments

Comments
 (0)