Skip to content

Commit cb07c27

Browse files
authored
chore: update angular to 20 (#3293)
* remove postinstall * disable husky * perform base migration to angular 20 * update and enable husky * update @schematics/angular * revert postinstall * remove usage of ComponentFactory and ComponentFactoryResolver * remove usage of PortalInjector * remove usage of _COALESCED_STYLE_SCHEDULER and _CoalescedStyleScheduler * fix eslint usage * fix pre-commit * update moment import * update peerDependencies * ng update for packages-smoke * update angular-eslint * dedupe * update @types/node, bump angular and nebular for packages-smoke * fix main.server.ts * fix server.ts * update @schematics/angular for packages-smoke * various fixes * bump actions/download-artifact * bump actions/download-artifact * update nodejs * fix security hotspots * update package-lock
1 parent 192a0de commit cb07c27

Some content is hidden

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

46 files changed

+20380
-13194
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-node@v3
1515
with:
16-
node-version: 18.19.1
16+
node-version: 20.19.5
1717
cache: 'npm'
1818
- run: npm ci
1919
- run: npm run docs:gh-pages

.github/workflows/pr-check.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 18.19.1
14+
node-version: 20.19.5
1515
cache: 'npm'
1616
- run: npm ci
1717
- run: npm run build:packages
18-
- uses: actions/upload-artifact@v2
18+
- uses: actions/upload-artifact@v4
1919
with:
2020
name: built-packages
2121
path: 'dist/'
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@v3
2828
- uses: actions/setup-node@v3
2929
with:
30-
node-version: 18.19.1
30+
node-version: 20.19.5
3131
cache: 'npm'
3232
- run: |
3333
npm ci
@@ -40,7 +40,7 @@ jobs:
4040
- uses: actions/checkout@v3
4141
- uses: actions/setup-node@v3
4242
with:
43-
node-version: 18.19.1
43+
node-version: 20.19.5
4444
- run: npm ci
4545
- run: npm run docs:build
4646
build-playground:
@@ -50,9 +50,9 @@ jobs:
5050
- uses: actions/checkout@v3
5151
- uses: actions/setup-node@v3
5252
with:
53-
node-version: 18.19.1
53+
node-version: 20.19.5
5454
- run: npm ci
55-
- uses: actions/download-artifact@v2
55+
- uses: actions/download-artifact@v4
5656
with:
5757
name: built-packages
5858
path: dist
@@ -104,40 +104,40 @@ jobs:
104104
- uses: actions/checkout@v3
105105
- uses: actions/setup-node@v3
106106
with:
107-
node-version: 18.19.1
107+
node-version: 20.19.5
108108
- run: npm ci
109-
- uses: actions/download-artifact@v2
109+
- uses: actions/download-artifact@v4
110110
with:
111111
name: built-packages
112112
path: dist
113113
- name: BrowserStack Setup
114-
uses: 'browserstack/github-actions@master'
114+
uses: 'browserstack/github-actions@93aebce225b754566349151c0676b26b005e591b'
115115
with:
116116
username: ${{ env.BSU }}
117117
access-key: ${{ env.BSK }}
118118
- name: Start BrowserStackLocal Tunnel
119-
uses: browserstack/github-actions/setup-local@master
119+
uses: browserstack/github-actions/setup-local@93aebce225b754566349151c0676b26b005e591b
120120
with:
121121
local-testing: start
122122
- name: Test packages
123123
run: npm run test playground -- -c=production-wp --watch=false
124124
- name: Test schematics
125125
run: npm run test:schematics
126126
- name: Stop BrowserStackLocal Tunnel
127-
uses: browserstack/github-actions/setup-local@master
127+
uses: browserstack/github-actions/setup-local@93aebce225b754566349151c0676b26b005e591b
128128
with:
129129
local-testing: stop
130130
- name: Upload coverage to codecov
131-
uses: codecov/codecov-action@v2
131+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
132132
packages-smoke:
133133
needs: build-packages
134134
runs-on: ubuntu-latest
135135
steps:
136136
- uses: actions/checkout@v3
137137
- uses: actions/setup-node@v3
138138
with:
139-
node-version: 18.19.1
140-
- uses: actions/download-artifact@v2
139+
node-version: 20.19.5
140+
- uses: actions/download-artifact@v4
141141
with:
142142
name: built-packages
143143
path: packages-smoke/.lib/

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

100755100644
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx lint-staged
1+
npm run lint:fix

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.19.1
1+
20.19.5

angular.json

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@
2020
"prefix": "npg",
2121
"architect": {
2222
"build": {
23-
"builder": "@angular-devkit/build-angular:browser",
23+
"builder": "@angular-devkit/build-angular:application",
2424
"options": {
25-
"outputPath": "dist/playground",
25+
"outputPath": {
26+
"base": "dist/playground"
27+
},
2628
"index": "src/index.html",
27-
"main": "src/main.ts",
28-
"polyfills": "src/polyfills.ts",
29+
"polyfills": ["src/polyfills.ts"],
2930
"tsConfig": "src/tsconfig.app.json",
3031
"inlineStyleLanguage": "scss",
3132
"assets": [
3233
"src/favicon.ico",
3334
"src/assets"
3435
],
3536
"styles": [],
36-
"scripts": []
37+
"scripts": [],
38+
"browser": "src/main.ts"
3739
},
3840
"configurations": {
3941
"production": {
@@ -76,9 +78,7 @@
7678
"outputHashing": "all"
7779
},
7880
"development": {
79-
"buildOptimizer": false,
8081
"optimization": false,
81-
"vendorChunk": true,
8282
"extractLicenses": false,
8383
"sourceMap": true,
8484
"namedChunks": true
@@ -127,15 +127,6 @@
127127
"tsConfig": "src/tsconfig.spec-wp.json"
128128
}
129129
}
130-
},
131-
"lint": {
132-
"builder": "@angular-eslint/builder:lint",
133-
"options": {
134-
"lintFilePatterns": [
135-
"src/**/*.ts",
136-
"src/**/*.html"
137-
]
138-
}
139130
}
140131
}
141132
},
@@ -184,12 +175,13 @@
184175
"prefix": "ngd",
185176
"architect": {
186177
"build": {
187-
"builder": "@angular-devkit/build-angular:browser",
178+
"builder": "@angular-devkit/build-angular:application",
188179
"options": {
189-
"outputPath": "dist/docs",
180+
"outputPath": {
181+
"base": "dist/docs"
182+
},
190183
"index": "docs/index.html",
191-
"main": "docs/main.ts",
192-
"polyfills": "docs/polyfills.ts",
184+
"polyfills": ["docs/polyfills.ts"],
193185
"tsConfig": "docs/tsconfig.app.json",
194186
"inlineStyleLanguage": "scss",
195187
"assets": [
@@ -222,7 +214,8 @@
222214
],
223215
"allowedCommonJsDependencies": [
224216
"highlight.js"
225-
]
217+
],
218+
"browser": "docs/main.ts"
226219
},
227220
"configurations": {
228221
"production": {
@@ -245,9 +238,7 @@
245238
"outputHashing": "all"
246239
},
247240
"development": {
248-
"buildOptimizer": false,
249241
"optimization": false,
250-
"vendorChunk": true,
251242
"extractLicenses": false,
252243
"sourceMap": true,
253244
"namedChunks": true
@@ -609,7 +600,8 @@
609600
"schematics": {
610601
"@schematics/angular:component": {
611602
"style": "scss",
612-
"changeDetection": "OnPush"
603+
"changeDetection": "OnPush",
604+
"type": "component"
613605
},
614606
"@schematics/angular:application": {
615607
"strict": true
@@ -619,6 +611,27 @@
619611
},
620612
"@angular-eslint/schematics:library": {
621613
"setParserOptionsProject": true
614+
},
615+
"@schematics/angular:directive": {
616+
"type": "directive"
617+
},
618+
"@schematics/angular:service": {
619+
"type": "service"
620+
},
621+
"@schematics/angular:guard": {
622+
"typeSeparator": "."
623+
},
624+
"@schematics/angular:interceptor": {
625+
"typeSeparator": "."
626+
},
627+
"@schematics/angular:module": {
628+
"typeSeparator": "."
629+
},
630+
"@schematics/angular:pipe": {
631+
"typeSeparator": "."
632+
},
633+
"@schematics/angular:resolver": {
634+
"typeSeparator": "."
622635
}
623636
},
624637
"cli": {

eslint.config.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import rxjs from "eslint-plugin-rxjs";
1+
import rxjs from "eslint-plugin-rxjs-x";
22
import globals from "globals";
33
import path from "node:path";
44
import { fileURLToPath } from "node:url";
55
import js from "@eslint/js";
66
import { FlatCompat } from "@eslint/eslintrc";
7+
import tseslint from "@typescript-eslint/eslint-plugin";
78

89
const __filename = fileURLToPath(import.meta.url);
910
const __dirname = path.dirname(__filename);
@@ -16,9 +17,6 @@ const compat = new FlatCompat({
1617
export default [{
1718
ignores: [
1819
"src/framework/**/*",
19-
"docs/**/*",
20-
"packages-smoke/**/*",
21-
"tools/dev-schematics/*/files",
2220
],
2321
}, ...compat.extends(
2422
"plugin:@angular-eslint/recommended",
@@ -32,6 +30,7 @@ export default [{
3230

3331
plugins: {
3432
rxjs,
33+
"@typescript-eslint": tseslint,
3534
},
3635

3736
languageOptions: {
@@ -53,6 +52,8 @@ export default [{
5352
"@typescript-eslint/no-shadow": "error",
5453
"no-underscore-dangle": "off",
5554
"@typescript-eslint/consistent-type-definitions": "error",
55+
"@angular-eslint/prefer-standalone": "off",
56+
"@angular-eslint/prefer-inject": "off",
5657

5758
"rxjs/no-unsafe-takeuntil": ["error", {
5859
allow: [
@@ -97,4 +98,4 @@ export default [{
9798
ecmaVersion: 11,
9899
sourceType: "commonjs",
99100
},
100-
}];
101+
}];

0 commit comments

Comments
 (0)