Skip to content

Commit 1344edf

Browse files
Updated to Angular 13 (cryptic-game#314)
- migrated to eslint (still todos) - improved typing (still todos) - "forked" ngx-contextmenu - changed particles lib - improved actions Co-authored-by: Tristan <[email protected]>
1 parent 7ebf16a commit 1344edf

File tree

262 files changed

+23877
-14409
lines changed

Some content is hidden

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

262 files changed

+23877
-14409
lines changed

.browserslistrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
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
16+
Firefox ESR

.dockerignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Editor configuration, see http://editorconfig.org
1+
# Editor configuration, see https://editorconfig.org
22
root = true
33

44
[*]
@@ -8,9 +8,9 @@ indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11+
[*.ts]
12+
quote_type = single
13+
1114
[*.md]
1215
max_line_length = off
1316
trim_trailing_whitespace = false
14-
15-
[*.conf]
16-
indent_size = 4

.eslintrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [
4+
"projects/**/*"
5+
],
6+
"overrides": [
7+
{
8+
"files": [
9+
"*.ts"
10+
],
11+
"parserOptions": {
12+
"project": [
13+
"tsconfig.json"
14+
],
15+
"createDefaultProgram": true
16+
},
17+
"extends": [
18+
"plugin:@angular-eslint/recommended",
19+
"plugin:@angular-eslint/template/process-inline-templates"
20+
],
21+
"rules": {
22+
"@angular-eslint/directive-selector": [
23+
"error",
24+
{
25+
"type": "attribute",
26+
"prefix": "app",
27+
"style": "camelCase"
28+
}
29+
],
30+
"@angular-eslint/component-selector": [
31+
"error",
32+
{
33+
"type": "element",
34+
"prefix": "app",
35+
"style": "kebab-case"
36+
}
37+
],
38+
"object-curly-spacing": "off"
39+
}
40+
},
41+
{
42+
"files": [
43+
"*.html"
44+
],
45+
"extends": [
46+
"plugin:@angular-eslint/template/recommended"
47+
],
48+
"rules": {}
49+
}
50+
]
51+
}

.github/workflows/ci.yaml

Lines changed: 35 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
IMAGE_NAME: crypticcp/frontend
10+
GHCR_SLUG: ghcr.io/cryptic-game/frontend
1111
DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
1212

1313
jobs:
@@ -18,40 +18,30 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020

21-
- uses: actions/setup-node@v2
21+
- uses: actions/setup-node@v3
2222
with:
23-
node-version: 14
23+
node-version-file: '.nvmrc'
24+
cache: 'npm'
2425

25-
- uses: actions/cache@v2
26-
with:
27-
path: ~/.npm
28-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
29-
restore-keys: |
30-
${{ runner.os }}-node-
31-
32-
- run: npm ci
33-
34-
- run: npm run lint
26+
- run: npm install --no-audit
27+
- run: npm run lint:ci
3528

3629
test:
3730
runs-on: ubuntu-latest
3831

32+
strategy:
33+
matrix:
34+
node: [ 16, 17 ]
35+
3936
steps:
4037
- uses: actions/checkout@v2
4138

42-
- uses: actions/setup-node@v2
43-
with:
44-
node-version: 14
45-
46-
- uses: actions/cache@v2
39+
- uses: actions/setup-node@v3
4740
with:
48-
path: ~/.npm
49-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
50-
restore-keys: |
51-
${{ runner.os }}-node-
52-
53-
- run: npm ci
41+
node-version: ${{ matrix.node }}
42+
cache: 'npm'
5443

44+
- run: npm install --no-audit
5545
- run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadless
5646

5747
build:
@@ -61,26 +51,19 @@ jobs:
6151
steps:
6252
- uses: actions/checkout@v2
6353

64-
- uses: actions/setup-node@v2
65-
with:
66-
node-version: 14
67-
68-
- uses: actions/cache@v2
54+
- uses: actions/setup-node@v3
6955
with:
70-
path: ~/.npm
71-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
72-
restore-keys: |
73-
${{ runner.os }}-node-
74-
75-
- run: npm ci
56+
node-version-file: '.nvmrc'
57+
cache: 'npm'
7658

59+
- run: npm install --no-audit
7760
- run: npm run build:ci -- --output-path=./dist
7861

7962
- uses: actions/upload-artifact@v2
8063
with:
8164
name: frontend
8265
path: dist
83-
66+
8467
docker:
8568
needs: build
8669
runs-on: ubuntu-latest
@@ -89,15 +72,17 @@ jobs:
8972
- uses: actions/checkout@v2
9073

9174
- name: Docker meta
92-
id: docker_meta
93-
uses: crazy-max/ghaction-docker-meta@v1
75+
id: meta
76+
uses: docker/metadata-action@v3
9477
with:
95-
tag-edge: true
9678
images: |
97-
${{ env.IMAGE_NAME }}
98-
tag-semver: |
99-
{{version}}
100-
{{major}}.{{minor}}
79+
${{ env.GHCR_SLUG }}
80+
tags: |
81+
type=semver,pattern={{version}}
82+
type=semver,pattern={{major}}.{{minor}}
83+
type=semver,pattern={{major}}
84+
type=ref,event=pr
85+
type=edge
10186
10287
- uses: docker/setup-qemu-action@v1
10388
- uses: docker/setup-buildx-action@v1
@@ -110,12 +95,13 @@ jobs:
11095
restore-keys: |
11196
${{ runner.os }}-buildx-
11297
113-
- name: Login to Docker Hub
98+
- name: Login to GitHub Container Registry
11499
uses: docker/login-action@v1
115-
if: ${{ github.event_name != 'pull_request' }}
100+
if: github.event_name != 'pull_request'
116101
with:
117-
username: ${{ secrets.DOCKERHUB_USERNAME }}
118-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
102+
registry: ghcr.io
103+
username: ${{ github.repository_owner }}
104+
password: ${{ github.token }}
119105

120106
- uses: actions/download-artifact@v2
121107
with:
@@ -129,17 +115,12 @@ jobs:
129115
file: ./Dockerfile.github-actions
130116
platforms: ${{ env.DOCKER_PLATFORMS }}
131117
push: ${{ github.event_name != 'pull_request' }}
132-
tags: ${{ steps.docker_meta.outputs.tags }}
133-
labels: ${{ steps.docker_meta.outputs.labels }}
118+
tags: ${{ steps.meta.outputs.tags }}
119+
labels: ${{ steps.meta.outputs.labels }}
134120
cache-from: type=local,src=/tmp/.buildx-cache
135121
cache-to: type=local,dest=/tmp/.buildx-cache-new
136122

137123
- name: Move cache
138124
run: |
139125
rm -rf /tmp/.buildx-cache
140126
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
141-
142-
- name: Check manifest
143-
if: ${{ github.event_name != 'pull_request' }}
144-
run: |
145-
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.version }}

.github/workflows/codeql-analysis.yml

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
71
name: "CodeQL"
82

93
on:
@@ -20,43 +14,40 @@ jobs:
2014
name: Analyze
2115
runs-on: ubuntu-latest
2216

23-
#strategy:
24-
# fail-fast: false
25-
# matrix:
26-
# language: [ 'javascript' ]
27-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
28-
# Learn more:
29-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
3021

3122
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v2
34-
35-
# Initializes the CodeQL tools for scanning.
36-
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v1
38-
with:
39-
languages: javascript #${{ matrix.language }}
40-
# If you wish to specify custom queries, you can do so here or in a config file.
41-
# By default, queries listed here will override any specified in a config file.
42-
# Prefix the list here with "+" to use these queries and those in the config file.
43-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44-
45-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
46-
# If this step fails, then you should remove it and run the build manually (see below)
47-
#- name: Autobuild
48-
# uses: github/codeql-action/autobuild@v1
49-
50-
# ℹ️ Command-line programs to run using the OS shell.
51-
# 📚 https://git.io/JvXDl
52-
53-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
54-
# and modify them (or add more) to build your code if your project
55-
# uses a compiled language
56-
57-
#- run: |
58-
# make bootstrap
59-
# make release
60-
61-
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v1
23+
- name: Checkout repository
24+
uses: actions/checkout@v2
25+
26+
# Initializes the CodeQL tools for scanning.
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v1
29+
with:
30+
languages: javascript
31+
# If you wish to specify custom queries, you can do so here or in a config file.
32+
# By default, queries listed here will override any specified in a config file.
33+
# Prefix the list here with "+" to use these queries and those in the config file.
34+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
35+
36+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
37+
# If this step fails, then you should remove it and run the build manually (see below)
38+
- name: Autobuild
39+
uses: github/codeql-action/autobuild@v1
40+
41+
# ℹ️ Command-line programs to run using the OS shell.
42+
# 📚 https://git.io/JvXDl
43+
44+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
45+
# and modify them (or add more) to build your code if your project
46+
# uses a compiled language
47+
48+
#- run: |
49+
# make bootstrap
50+
# make release
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)