Skip to content

Commit b345b27

Browse files
committed
Merge branch 'main' into w2p-93963-Add_support_for_line_breaks_markdown_and_mathjax_in_metadata
# Conflicts: # package.json # src/app/shared/shared.module.ts # src/app/shared/truncatable/truncatable-part/truncatable-part.component.html # src/config/app-config.interface.ts # src/config/default-app-config.ts # src/environments/environment.test.ts # src/styles/_global-styles.scss # yarn.lock
2 parents 2f71dc3 + 001d6dc commit b345b27

1,399 files changed

Lines changed: 81762 additions & 35990 deletions

File tree

Some content is hidden

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

.browserslistrc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
# For additional information regarding the format and rule options, please see:
33
# https://github.com/browserslist/browserslist#queries
44

5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
58
# You can see what browsers were selected by your queries by running:
69
# npx browserslist
710

8-
> 0.5%
9-
last 2 versions
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
1016
Firefox ESR
11-
not IE 9-11 # For IE 9-11 support, remove 'not'.
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

.eslintrc.json

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
{
2+
"root": true,
3+
"plugins": [
4+
"@typescript-eslint",
5+
"@angular-eslint/eslint-plugin",
6+
"eslint-plugin-import",
7+
"eslint-plugin-jsdoc",
8+
"eslint-plugin-deprecation",
9+
"eslint-plugin-unused-imports"
10+
],
11+
"overrides": [
12+
{
13+
"files": [
14+
"*.ts"
15+
],
16+
"parserOptions": {
17+
"project": [
18+
"./tsconfig.json",
19+
"./cypress/tsconfig.json"
20+
],
21+
"createDefaultProgram": true
22+
},
23+
"extends": [
24+
"eslint:recommended",
25+
"plugin:@typescript-eslint/recommended",
26+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
27+
"plugin:@angular-eslint/recommended",
28+
"plugin:@angular-eslint/template/process-inline-templates"
29+
],
30+
"rules": {
31+
"max-classes-per-file": [
32+
"error",
33+
1
34+
],
35+
"comma-dangle": [
36+
"off",
37+
"always-multiline"
38+
],
39+
"eol-last": [
40+
"error",
41+
"always"
42+
],
43+
"no-console": [
44+
"error",
45+
{
46+
"allow": [
47+
"log",
48+
"warn",
49+
"dir",
50+
"timeLog",
51+
"assert",
52+
"clear",
53+
"count",
54+
"countReset",
55+
"group",
56+
"groupEnd",
57+
"table",
58+
"debug",
59+
"info",
60+
"dirxml",
61+
"error",
62+
"groupCollapsed",
63+
"Console",
64+
"profile",
65+
"profileEnd",
66+
"timeStamp",
67+
"context"
68+
]
69+
}
70+
],
71+
"curly": "error",
72+
"brace-style": [
73+
"error",
74+
"1tbs",
75+
{
76+
"allowSingleLine": true
77+
}
78+
],
79+
"eqeqeq": [
80+
"error",
81+
"always",
82+
{
83+
"null": "ignore"
84+
}
85+
],
86+
"radix": "error",
87+
"guard-for-in": "error",
88+
"no-bitwise": "error",
89+
"no-restricted-imports": "error",
90+
"no-caller": "error",
91+
"no-debugger": "error",
92+
"no-redeclare": "error",
93+
"no-eval": "error",
94+
"no-fallthrough": "error",
95+
"no-trailing-spaces": "error",
96+
"space-infix-ops": "error",
97+
"keyword-spacing": "error",
98+
"no-var": "error",
99+
"no-unused-expressions": [
100+
"error",
101+
{
102+
"allowTernary": true
103+
}
104+
],
105+
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
106+
"prefer-spread": "off",
107+
"no-underscore-dangle": "off",
108+
109+
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
110+
"no-prototype-builtins": "off",
111+
"no-useless-escape": "off",
112+
"no-case-declarations": "off",
113+
"no-extra-boolean-cast": "off",
114+
115+
"@angular-eslint/directive-selector": [
116+
"error",
117+
{
118+
"type": "attribute",
119+
"prefix": "ds",
120+
"style": "camelCase"
121+
}
122+
],
123+
"@angular-eslint/component-selector": [
124+
"error",
125+
{
126+
"type": "element",
127+
"prefix": "ds",
128+
"style": "kebab-case"
129+
}
130+
],
131+
"@angular-eslint/pipe-prefix": [
132+
"error",
133+
{
134+
"prefixes": [
135+
"ds"
136+
]
137+
}
138+
],
139+
"@angular-eslint/no-attribute-decorator": "error",
140+
"@angular-eslint/no-forward-ref": "error",
141+
"@angular-eslint/no-output-native": "warn",
142+
"@angular-eslint/no-output-on-prefix": "warn",
143+
"@angular-eslint/no-conflicting-lifecycle": "warn",
144+
145+
"@typescript-eslint/no-inferrable-types":[
146+
"error",
147+
{
148+
"ignoreParameters": true
149+
}
150+
],
151+
"@typescript-eslint/quotes": [
152+
"error",
153+
"single",
154+
{
155+
"avoidEscape": true,
156+
"allowTemplateLiterals": true
157+
}
158+
],
159+
"@typescript-eslint/semi": "error",
160+
"@typescript-eslint/no-shadow": "error",
161+
"@typescript-eslint/dot-notation": "error",
162+
"@typescript-eslint/consistent-type-definitions": "error",
163+
"@typescript-eslint/prefer-function-type": "error",
164+
"@typescript-eslint/naming-convention": [
165+
"error",
166+
{
167+
"selector": "property",
168+
"format": null
169+
}
170+
],
171+
"@typescript-eslint/member-ordering": [
172+
"error",
173+
{
174+
"default": [
175+
"static-field",
176+
"instance-field",
177+
"static-method",
178+
"instance-method"
179+
]
180+
}
181+
],
182+
"@typescript-eslint/type-annotation-spacing": "error",
183+
"@typescript-eslint/unified-signatures": "error",
184+
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
185+
"@typescript-eslint/no-floating-promises": "warn",
186+
"@typescript-eslint/no-misused-promises": "warn",
187+
"@typescript-eslint/restrict-plus-operands": "warn",
188+
"@typescript-eslint/unbound-method": "off",
189+
"@typescript-eslint/ban-ts-comment": "off",
190+
"@typescript-eslint/no-var-requires": "off",
191+
"@typescript-eslint/no-unused-vars": "off",
192+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
193+
"@typescript-eslint/no-explicit-any": "off",
194+
"@typescript-eslint/no-unsafe-assignment": "off",
195+
"@typescript-eslint/no-unsafe-member-access": "off",
196+
"@typescript-eslint/no-unsafe-call": "off",
197+
"@typescript-eslint/no-unsafe-argument": "off",
198+
"@typescript-eslint/no-unsafe-return": "off",
199+
"@typescript-eslint/restrict-template-expressions": "off",
200+
"@typescript-eslint/require-await": "off",
201+
202+
"deprecation/deprecation": "warn",
203+
204+
"import/order": "off",
205+
"import/no-deprecated": "warn"
206+
}
207+
},
208+
{
209+
"files": [
210+
"*.html"
211+
],
212+
"extends": [
213+
"plugin:@angular-eslint/template/recommended"
214+
],
215+
"rules": {
216+
// todo: re-enable & fix errors
217+
"@angular-eslint/template/no-negated-async": "off",
218+
"@angular-eslint/template/eqeqeq": "off"
219+
}
220+
}
221+
]
222+
}

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# By default, auto detect text files and perform LF normalization
2+
# This ensures code is always checked in with LF line endings
3+
* text=auto
4+
5+
# JS and TS files must always use LF for Angular tools to work
6+
# Some Angular tools expect LF line endings, even on Windows.
7+
# This ensures Windows always checks out these files with LF line endings
8+
# We've copied many of these rules from https://github.com/angular/angular-cli/
9+
*.js eol=lf
10+
*.ts eol=lf
11+
*.json eol=lf
12+
*.json5 eol=lf
13+
*.css eol=lf
14+
*.scss eol=lf
15+
*.html eol=lf
16+
*.svg eol=lf

.github/workflows/build.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
# Create a matrix of Node versions to test against (in parallel)
2424
matrix:
25-
node-version: [12.x, 14.x]
25+
node-version: [14.x, 16.x]
2626
# Do NOT exit immediately if one matrix job fails
2727
fail-fast: false
2828
# These are the actual CI steps to perform per job
@@ -70,7 +70,10 @@ jobs:
7070
run: yarn install --frozen-lockfile
7171

7272
- name: Run lint
73-
run: yarn run lint
73+
run: yarn run lint --quiet
74+
75+
- name: Check for circular dependencies
76+
run: yarn run check-circ-deps
7477

7578
- name: Run build
7679
run: yarn run build:prod
@@ -79,11 +82,11 @@ jobs:
7982
run: yarn run test:headless
8083

8184
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
82-
# Upload coverage reports to Codecov (for Node v12 only)
85+
# Upload coverage reports to Codecov (for one version of Node only)
8386
# https://github.com/codecov/codecov-action
8487
- name: Upload coverage to Codecov.io
8588
uses: codecov/codecov-action@v2
86-
if: matrix.node-version == '12.x'
89+
if: matrix.node-version == '16.x'
8790

8891
# Using docker-compose start backend using CI configuration
8992
# and load assetstore from a cached copy
@@ -128,6 +131,14 @@ jobs:
128131
name: e2e-test-screenshots
129132
path: cypress/screenshots
130133

134+
- name: Stop app (in case it stays up after e2e tests)
135+
run: |
136+
app_pid=$(lsof -t -i:4000)
137+
if [[ ! -z $app_pid ]]; then
138+
echo "App was still up! (PID: $app_pid)"
139+
kill -9 $app_pid
140+
fi
141+
131142
# Start up the app with SSR enabled (run in background)
132143
- name: Start app in SSR (server-side rendering) mode
133144
run: |

.github/workflows/docker.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
# We turn off 'latest' tag by default.
3232
TAGS_FLAVOR: |
3333
latest=false
34+
# Architectures / Platforms for which we will build Docker images
35+
# If this is a PR, we ONLY build for AMD64. For PRs we only do a sanity check test to ensure Docker builds work.
36+
# If this is NOT a PR (e.g. a tag or merge commit), also build for ARM64.
37+
PLATFORMS: linux/amd64${{ github.event_name != 'pull_request' && ', linux/arm64' || '' }}
3438

3539
steps:
3640
# https://github.com/actions/checkout
@@ -41,6 +45,10 @@ jobs:
4145
- name: Setup Docker Buildx
4246
uses: docker/setup-buildx-action@v1
4347

48+
# https://github.com/docker/setup-qemu-action
49+
- name: Set up QEMU emulation to build for multiple architectures
50+
uses: docker/setup-qemu-action@v2
51+
4452
# https://github.com/docker/login-action
4553
- name: Login to DockerHub
4654
# Only login if not a PR, as PRs only trigger a Docker build and not a push
@@ -70,6 +78,7 @@ jobs:
7078
with:
7179
context: .
7280
file: ./Dockerfile
81+
platforms: ${{ env.PLATFORMS }}
7382
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
7483
# but we ONLY do an image push to DockerHub if it's NOT a PR
7584
push: ${{ github.event_name != 'pull_request' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.angular/cache
12
/__build__
23
/__server_build__
34
/node_modules
@@ -36,3 +37,5 @@ package-lock.json
3637

3738
.env
3839
/nbproject/
40+
41+
junit.xml

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ EXPOSE 4000
99
# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
1010
# See, for example https://github.com/yarnpkg/yarn/issues/5540
1111
RUN yarn install --network-timeout 300000
12-
CMD yarn run start:dev
12+
13+
# On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc).
14+
# Listen / accept connections from all IP addresses.
15+
# NOTE: At this time it is only possible to run Docker container in Production mode
16+
# if you have a public IP. See https://github.com/DSpace/dspace-angular/issues/1485
17+
CMD yarn serve --host 0.0.0.0

0 commit comments

Comments
 (0)