Skip to content

Commit e7e8c2d

Browse files
authored
Merge pull request #4870 from alexandrevryghem/angular-20-upgrade_backport-9_x
[Port dspace-9_x] Angular 20 upgrade
2 parents 0b1f0a2 + ad408ee commit e7e8c2d

File tree

1,102 files changed

+8706
-7997
lines changed

Some content is hidden

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

1,102 files changed

+8706
-7997
lines changed

.eslintrc.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"eslint-plugin-rxjs",
1313
"eslint-plugin-simple-import-sort",
1414
"eslint-plugin-import-newlines",
15+
"@stylistic",
1516
"dspace-angular-ts",
1617
"dspace-angular-html"
1718
],
@@ -175,15 +176,16 @@
175176
"ignoreParameters": true
176177
}
177178
],
178-
"@typescript-eslint/quotes": [
179+
"@angular-eslint/prefer-inject": "off",
180+
"@stylistic/quotes": [
179181
"error",
180182
"single",
181183
{
182184
"avoidEscape": true,
183185
"allowTemplateLiterals": true
184186
}
185187
],
186-
"@typescript-eslint/semi": "error",
188+
"@stylistic/semi": "error",
187189
"@typescript-eslint/no-shadow": "error",
188190
"@typescript-eslint/dot-notation": "error",
189191
"@typescript-eslint/consistent-type-definitions": "error",
@@ -206,9 +208,9 @@
206208
]
207209
}
208210
],
209-
"@typescript-eslint/type-annotation-spacing": "error",
211+
"@stylistic/type-annotation-spacing": "error",
210212
"@typescript-eslint/unified-signatures": "error",
211-
"@typescript-eslint/ban-types": "error",
213+
"@typescript-eslint/no-restricted-types": "error",
212214
"@typescript-eslint/no-floating-promises": "warn",
213215
"@typescript-eslint/no-misused-promises": "warn",
214216
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -279,7 +281,7 @@
279281
]
280282
}
281283
],
282-
"dspace-angular-ts/themed-component-classes": "error",
284+
"dspace-angular-ts/no-default-standalone-value": "error",
283285
"dspace-angular-ts/themed-component-selectors": "error",
284286
"dspace-angular-ts/themed-component-usages": "error",
285287
"dspace-angular-ts/themed-decorators": [

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
DSPACE_REST_PORT: 8080
2222
DSPACE_REST_NAMESPACE: '/server'
2323
DSPACE_REST_SSL: false
24-
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
24+
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 20+
2525
DSPACE_UI_HOST: 127.0.0.1
2626
DSPACE_UI_PORT: 4000
2727
# Ensure all SSR caching is disabled in test environment
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
# Create a matrix of Node versions to test against (in parallel)
4646
matrix:
47-
node-version: [18.x, 20.x]
47+
node-version: [20.x, 22.x]
4848
# Do NOT exit immediately if one matrix job fails
4949
fail-fast: false
5050
# These are the actual CI steps to perform per job
@@ -114,7 +114,7 @@ jobs:
114114
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
115115
- name: Upload code coverage report to Artifact
116116
uses: actions/upload-artifact@v4
117-
if: matrix.node-version == '18.x'
117+
if: matrix.node-version == '20.x'
118118
with:
119119
name: coverage-report-${{ matrix.node-version }}
120120
path: 'coverage/dspace-angular/lcov.info'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This image will be published as dspace/dspace-angular
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

4-
FROM docker.io/node:18-alpine
4+
FROM docker.io/node:20-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64

Dockerfile.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Test build:
55
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
66

7-
FROM docker.io/node:18-alpine AS build
7+
FROM docker.io/node:20-alpine AS build
88

99
# Ensure Python and other build tools are available
1010
# These are needed to install some node modules, especially on linux/arm64
@@ -17,7 +17,7 @@ RUN npm install
1717
ADD . /app/
1818
RUN npm run build:prod
1919

20-
FROM node:18-alpine
20+
FROM node:20-alpine
2121
RUN npm install --global pm2
2222

2323
COPY --chown=node:node --from=build /app/dist /app/dist

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ https://wiki.lyrasis.org/display/DSDOC9x/Installing+DSpace
3535
Quick start
3636
-----------
3737

38-
**Ensure you're running [Node](https://nodejs.org) `v18.x` or `v20.x`, [npm](https://www.npmjs.com/) >= `v10.x`**
38+
**Ensure you're running [Node](https://nodejs.org) `v20.x` or `v22.x`, [npm](https://www.npmjs.com/) >= `v10.x`**
3939

4040
```bash
4141
# clone the repo
@@ -90,7 +90,7 @@ Requirements
9090
------------
9191

9292
- [Node.js](https://nodejs.org)
93-
- Ensure you're running node `v18.x` or `v20.x`
93+
- Ensure you're running node `v20.x` or `v22.x`
9494

9595
If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.
9696

angular.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,30 @@
290290
},
291291
"@angular-eslint/schematics:library": {
292292
"setParserOptionsProject": true
293+
},
294+
"@schematics/angular:component": {
295+
"type": "component"
296+
},
297+
"@schematics/angular:directive": {
298+
"type": "directive"
299+
},
300+
"@schematics/angular:service": {
301+
"type": "service"
302+
},
303+
"@schematics/angular:guard": {
304+
"typeSeparator": "."
305+
},
306+
"@schematics/angular:interceptor": {
307+
"typeSeparator": "."
308+
},
309+
"@schematics/angular:module": {
310+
"typeSeparator": "."
311+
},
312+
"@schematics/angular:pipe": {
313+
"typeSeparator": "."
314+
},
315+
"@schematics/angular:resolver": {
316+
"typeSeparator": "."
293317
}
294318
}
295319
}

config/config.example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ submission:
235235
style: text-muted
236236
icon: fa-circle-xmark
237237

238-
# Default Language in which the UI will be rendered if the user's browser language is not an active language
239-
defaultLanguage: en
238+
# Fallback language in which the UI will be rendered if the user's browser language is not an active language
239+
fallbackLanguage: en
240240

241241
# Languages. DSpace Angular holds a message catalog for each of the following languages.
242242
# When set to active, users will be able to switch to the use of this language in the user interface.

cypress/plugins/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fs = require('node:fs');
1+
import fs from 'node:fs';
22

33
// These two global variables are used to store information about the REST API used
44
// by these e2e tests. They are filled out prior to running any tests in the before()

docs/lint/html/rules/themed-component-usages.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ _______
3030
##### use no-prefix selectors in TypeScript templates
3131
3232
```html
33-
@Component({
34-
template: '<ds-test-themeable></ds-test-themeable>'
35-
})
36-
class Test {
37-
}
33+
<ds-test-themeable></ds-test-themeable>
3834
```
3935
4036

@@ -43,11 +39,7 @@ class Test {
4339
Filename: `lint/test/fixture/src/test.spec.ts`
4440

4541
```html
46-
@Component({
47-
template: '<ds-test-themeable></ds-test-themeable>'
48-
})
49-
class Test {
50-
}
42+
<ds-test-themeable></ds-test-themeable>
5143
```
5244
5345

@@ -56,11 +48,7 @@ class Test {
5648
Filename: `lint/test/fixture/src/test.spec.ts`
5749

5850
```html
59-
@Component({
60-
template: '<ds-base-test-themeable></ds-base-test-themeable>'
61-
})
62-
class Test {
63-
}
51+
<ds-base-test-themeable></ds-base-test-themeable>
6452
```
6553
6654

docs/lint/ts/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
_______
33

44
- [`dspace-angular-ts/alias-imports`](./rules/alias-imports.md): Unclear imports should be aliased for clarity
5+
- [`dspace-angular-ts/no-default-standalone-value`](./rules/no-default-standalone-value.md): Removes unnecessary explicit standalone declarations of the @Component decorators. Starting from Angular 19 this is now the default value.
56
- [`dspace-angular-ts/sort-standalone-imports`](./rules/sort-standalone-imports.md): Sorts the standalone `@Component` imports alphabetically
6-
- [`dspace-angular-ts/themed-component-classes`](./rules/themed-component-classes.md): Formatting rules for themeable component classes
77
- [`dspace-angular-ts/themed-component-selectors`](./rules/themed-component-selectors.md): Themeable component selectors should follow the DSpace convention
88
- [`dspace-angular-ts/themed-component-usages`](./rules/themed-component-usages.md): Themeable components should be used via their `ThemedComponent` wrapper class
99
- [`dspace-angular-ts/themed-decorators`](./rules/themed-decorators.md): Entry components with theme support should declare the correct theme

0 commit comments

Comments
 (0)