Skip to content

Commit b67801f

Browse files
authored
Merge branch 'main' into patch-14
2 parents a238a28 + 8b1f46c commit b67801f

File tree

3,300 files changed

+125429
-59922
lines changed

Some content is hidden

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

3,300 files changed

+125429
-59922
lines changed

.eslintrc.json

Lines changed: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88
"eslint-plugin-deprecation",
99
"unused-imports",
1010
"eslint-plugin-lodash",
11-
"eslint-plugin-jsonc"
11+
"eslint-plugin-jsonc",
12+
"eslint-plugin-rxjs",
13+
"eslint-plugin-simple-import-sort",
14+
"eslint-plugin-import-newlines",
15+
"eslint-plugin-jsonc",
16+
"dspace-angular-ts",
17+
"dspace-angular-html"
18+
],
19+
"ignorePatterns": [
20+
"lint/test/fixture"
1221
],
1322
"overrides": [
1423
{
@@ -18,7 +27,8 @@
1827
"parserOptions": {
1928
"project": [
2029
"./tsconfig.json",
21-
"./cypress/tsconfig.json"
30+
"./cypress/tsconfig.json",
31+
"./lint/tsconfig.json"
2232
],
2333
"createDefaultProgram": true
2434
},
@@ -27,17 +37,32 @@
2737
"plugin:@typescript-eslint/recommended",
2838
"plugin:@typescript-eslint/recommended-requiring-type-checking",
2939
"plugin:@angular-eslint/recommended",
30-
"plugin:@angular-eslint/template/process-inline-templates"
40+
"plugin:@angular-eslint/template/process-inline-templates",
41+
"plugin:rxjs/recommended"
3142
],
3243
"rules": {
44+
"indent": [
45+
"error",
46+
2,
47+
{
48+
"SwitchCase": 1,
49+
"ignoredNodes": [
50+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
51+
]
52+
}
53+
],
3354
"max-classes-per-file": [
3455
"error",
3556
1
3657
],
3758
"comma-dangle": [
38-
"off",
59+
"error",
3960
"always-multiline"
4061
],
62+
"object-curly-spacing": [
63+
"error",
64+
"always"
65+
],
4166
"eol-last": [
4267
"error",
4368
"always"
@@ -104,15 +129,13 @@
104129
"allowTernary": true
105130
}
106131
],
107-
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
132+
"prefer-const": "error",
133+
"no-case-declarations": "error",
134+
"no-extra-boolean-cast": "error",
108135
"prefer-spread": "off",
109136
"no-underscore-dangle": "off",
110-
111-
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
112137
"no-prototype-builtins": "off",
113138
"no-useless-escape": "off",
114-
"no-case-declarations": "off",
115-
"no-extra-boolean-cast": "off",
116139

117140
"@angular-eslint/directive-selector": [
118141
"error",
@@ -139,7 +162,6 @@
139162
}
140163
],
141164
"@angular-eslint/no-attribute-decorator": "error",
142-
"@angular-eslint/no-forward-ref": "error",
143165
"@angular-eslint/no-output-native": "warn",
144166
"@angular-eslint/no-output-on-prefix": "warn",
145167
"@angular-eslint/no-conflicting-lifecycle": "warn",
@@ -183,7 +205,7 @@
183205
],
184206
"@typescript-eslint/type-annotation-spacing": "error",
185207
"@typescript-eslint/unified-signatures": "error",
186-
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
208+
"@typescript-eslint/ban-types": "error",
187209
"@typescript-eslint/no-floating-promises": "warn",
188210
"@typescript-eslint/no-misused-promises": "warn",
189211
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -200,17 +222,65 @@
200222
"@typescript-eslint/no-unsafe-return": "off",
201223
"@typescript-eslint/restrict-template-expressions": "off",
202224
"@typescript-eslint/require-await": "off",
225+
"@typescript-eslint/no-base-to-string": [
226+
"error",
227+
{
228+
"ignoredTypeNames": [
229+
"ResourceType",
230+
"Error"
231+
]
232+
}
233+
],
203234

204235
"deprecation/deprecation": "warn",
205236

237+
"simple-import-sort/imports": "error",
238+
"simple-import-sort/exports": "error",
206239
"import/order": "off",
240+
"import/first": "error",
241+
"import/newline-after-import": "error",
242+
"import/no-duplicates": "error",
207243
"import/no-deprecated": "warn",
208244
"import/no-namespace": "error",
245+
"import-newlines/enforce": [
246+
"error",
247+
{
248+
"items": 1,
249+
"semi": true,
250+
"forceSingleLine": true
251+
}
252+
],
253+
209254
"unused-imports/no-unused-imports": "error",
210255
"lodash/import-scope": [
211256
"error",
212257
"method"
213-
]
258+
],
259+
260+
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
261+
262+
// Custom DSpace Angular rules
263+
"dspace-angular-ts/themed-component-classes": "error",
264+
"dspace-angular-ts/themed-component-selectors": "error",
265+
"dspace-angular-ts/themed-component-usages": "error"
266+
}
267+
},
268+
{
269+
"files": [
270+
"*.spec.ts"
271+
],
272+
"parserOptions": {
273+
"project": [
274+
"./tsconfig.json",
275+
"./cypress/tsconfig.json"
276+
],
277+
"createDefaultProgram": true
278+
},
279+
"rules": {
280+
"prefer-const": "off",
281+
282+
// Custom DSpace Angular rules
283+
"dspace-angular-ts/themed-component-usages": "error"
214284
}
215285
},
216286
{
@@ -221,9 +291,8 @@
221291
"plugin:@angular-eslint/template/recommended"
222292
],
223293
"rules": {
224-
// todo: re-enable & fix errors
225-
"@angular-eslint/template/no-negated-async": "off",
226-
"@angular-eslint/template/eqeqeq": "off"
294+
// Custom DSpace Angular rules
295+
"dspace-angular-html/themed-component-usages": "error"
227296
}
228297
},
229298
{

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
*.css eol=lf
1414
*.scss eol=lf
1515
*.html eol=lf
16-
*.svg eol=lf
16+
*.svg eol=lf
17+
18+
# Generated documentation should have LF line endings to reduce git noise
19+
docs/lint/**/*.md eol=lf

.github/workflows/build.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ jobs:
3333
#CHROME_VERSION: "90.0.4430.212-1"
3434
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3535
NODE_OPTIONS: '--max-old-space-size=4096'
36+
# Project name to use when running "docker compose" prior to e2e tests
37+
COMPOSE_PROJECT_NAME: 'ci'
3638
strategy:
3739
# Create a matrix of Node versions to test against (in parallel)
3840
matrix:
39-
node-version: [16.x, 18.x]
41+
node-version: [18.x, 20.x]
4042
# Do NOT exit immediately if one matrix job fails
4143
fail-fast: false
4244
# These are the actual CI steps to perform per job
@@ -72,7 +74,7 @@ jobs:
7274
id: yarn-cache-dir-path
7375
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
7476
- name: Cache Yarn dependencies
75-
uses: actions/cache@v3
77+
uses: actions/cache@v4
7678
with:
7779
# Cache entire Yarn cache directory (see previous step)
7880
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -83,8 +85,14 @@ jobs:
8385
- name: Install Yarn dependencies
8486
run: yarn install --frozen-lockfile
8587

88+
- name: Build lint plugins
89+
run: yarn run build:lint
90+
91+
- name: Run lint plugin tests
92+
run: yarn run test:lint:nobuild
93+
8694
- name: Run lint
87-
run: yarn run lint --quiet
95+
run: yarn run lint:nobuild --quiet
8896

8997
- name: Check for circular dependencies
9098
run: yarn run check-circ-deps
@@ -99,19 +107,19 @@ jobs:
99107
# so that it can be shared with the 'codecov' job (see below)
100108
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
101109
- name: Upload code coverage report to Artifact
102-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
103111
if: matrix.node-version == '18.x'
104112
with:
105-
name: dspace-angular coverage report
113+
name: coverage-report-${{ matrix.node-version }}
106114
path: 'coverage/dspace-angular/lcov.info'
107115
retention-days: 14
108116

109-
# Using docker-compose start backend using CI configuration
117+
# Using "docker compose" start backend using CI configuration
110118
# and load assetstore from a cached copy
111119
- name: Start DSpace REST Backend via Docker (for e2e tests)
112120
run: |
113-
docker-compose -f ./docker/docker-compose-ci.yml up -d
114-
docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
121+
docker compose -f ./docker/docker-compose-ci.yml up -d
122+
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
115123
docker container ls
116124
117125
# Run integration tests via Cypress.io
@@ -133,19 +141,19 @@ jobs:
133141
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
134142
# Save those in an Artifact
135143
- name: Upload e2e test videos to Artifacts
136-
uses: actions/upload-artifact@v3
144+
uses: actions/upload-artifact@v4
137145
if: always()
138146
with:
139-
name: e2e-test-videos
147+
name: e2e-test-videos-${{ matrix.node-version }}
140148
path: cypress/videos
141149

142150
# If e2e tests fail, Cypress creates a screenshot of what happened
143151
# Save those in an Artifact
144152
- name: Upload e2e test failure screenshots to Artifacts
145-
uses: actions/upload-artifact@v3
153+
uses: actions/upload-artifact@v4
146154
if: failure()
147155
with:
148-
name: e2e-test-screenshots
156+
name: e2e-test-screenshots-${{ matrix.node-version }}
149157
path: cypress/screenshots
150158

151159
- name: Stop app (in case it stays up after e2e tests)
@@ -180,7 +188,7 @@ jobs:
180188
run: kill -9 $(lsof -t -i:4000)
181189

182190
- name: Shutdown Docker containers
183-
run: docker-compose -f ./docker/docker-compose-ci.yml down
191+
run: docker compose -f ./docker/docker-compose-ci.yml down
184192

185193
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
186194
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
@@ -195,7 +203,7 @@ jobs:
195203

196204
# Download artifacts from previous 'tests' job
197205
- name: Download coverage artifacts
198-
uses: actions/download-artifact@v3
206+
uses: actions/download-artifact@v4
199207

200208
# Now attempt upload to Codecov using its action.
201209
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
@@ -205,11 +213,12 @@ jobs:
205213
- name: Upload coverage to Codecov.io
206214
uses: Wandalen/[email protected]
207215
with:
208-
action: codecov/codecov-action@v3
216+
action: codecov/codecov-action@v4
209217
# Ensure codecov-action throws an error when it fails to upload
210218
# This allows us to auto-restart the action if an error is thrown
211219
with: |
212220
fail_ci_if_error: true
221+
token: ${{ secrets.CODECOV_TOKEN }}
213222
# Try re-running action 5 times max
214223
attempt_limit: 5
215224
# Run again in 30 seconds

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
2929
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@main
3030
with:
31-
build_id: dspace-angular
31+
build_id: dspace-angular-dev
3232
image_name: dspace/dspace-angular
3333
dockerfile_path: ./Dockerfile
3434
secrets:

.github/workflows/issue_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Only add to project board if issue is flagged as "needs triage" or has no labels
1717
# NOTE: By default we flag new issues as "needs triage" in our issue template
1818
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
19-
uses: actions/add-to-project@v0.5.0
19+
uses: actions/add-to-project@v1.0.0
2020
# Note, the authentication token below is an ORG level Secret.
2121
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2222
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token

.github/workflows/pull_request_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
2222
# See https://github.com/toshimaru/auto-author-assign
2323
- name: Assign PR to creator
24-
uses: toshimaru/auto-author-assign@v2.0.1
24+
uses: toshimaru/auto-author-assign@v2.1.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.angular/cache
2+
/.nx
23
/__build__
34
/__server_build__
45
/node_modules

0 commit comments

Comments
 (0)