Skip to content

Commit 2e994c0

Browse files
committed
feat: update angular to v18
Signed-off-by: Mohamed Elkholy <mkh117@gmail.com>
1 parent 56f00a2 commit 2e994c0

File tree

62 files changed

+8127
-7298
lines changed

Some content is hidden

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

62 files changed

+8127
-7298
lines changed

.browserslistrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
# You can see what browsers were selected by your queries by running:
99
# npx browserslist
1010

11-
last 2 Chrome version
12-
last 2 Firefox version
11+
last 2 Chrome versions
12+
last 2 Firefox versions
1313
last 2 Edge major versions
1414
last 2 Safari major versions
1515
last 2 iOS major versions
1616
Firefox ESR
17-
not IE 11
17+
not IE 11

.eslintrc.json

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

.github/workflows/main.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,65 @@ on:
77
branches: [ master ]
88

99
jobs:
10+
Setup:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Bundled Node Version
15+
run: |
16+
echo "Node version: $(which node):$(node -v)"
17+
echo "NPM version: $(which npm):$(npm -v)"
18+
- uses: volta-cli/action@v4
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Install PNPM
22+
run: volta install pnpm
23+
- name: Project Node Version
24+
run: |
25+
echo "Node version: $(which node):$(node -v)"
26+
echo "NPM version: $(which npm):$(npm -v)"
27+
echo "PNPM version: $(which pnpm):$(pnpm -v)"
28+
1029
Build:
30+
needs: [Setup]
1131
if: "!contains(github.event.head_commit.message, '[skip ci]')"
12-
runs-on: ubuntu-20.04
32+
runs-on: ubuntu-latest
1333
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
34+
- uses: actions/checkout@v4
35+
- uses: volta-cli/action@v4
1636
with:
17-
node-version: 12
18-
- uses: actions/cache@v2
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
- uses: actions/cache@v4
1939
with:
2040
path: ~/.pnpm-store
2141
key: pnpm-install-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
2242
restore-keys: |
2343
pnpm-install-v3-
24-
- uses: pnpm/action-setup@v2.0.1
25-
with:
26-
version: 6
27-
run_install: true
28-
# The initial build after pnpm install fails for some reason so for now we will build twice
44+
- name: Install PNPM
45+
run: volta install pnpm
46+
- name: Install Dependencies
47+
run: pnpm install
48+
- name: Lint
49+
run: pnpm lint
2950
- name: Build
30-
run: |
31-
pnpm build:debug
32-
pnpm build
33-
pnpm postbuild
51+
run: pnpm build
3452
- if: github.event_name == 'push'
35-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
3654
with:
3755
name: build-art
3856
path: dist
3957
Deploy:
58+
needs: [Build]
4059
if: github.event_name == 'push'
41-
needs: Build
42-
runs-on: ubuntu-20.04
60+
runs-on: ubuntu-latest
4361
steps:
44-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v4
4563
with:
4664
repository: awesomehub/awesomehub.github.io
4765
token: ${{ secrets.PAT }}
4866
path: deploy
4967
- run: rm -r deploy/dist/*
50-
- uses: actions/download-artifact@v2
68+
- uses: actions/download-artifact@v4
5169
id: download
5270
with:
5371
name: build-art

.gitignore

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,43 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
22

3-
# compiled output
3+
# Compiled output
44
/dist
5-
/src/assets/data/
5+
/src/assets/data
66
/tmp
77
/out-tsc
8-
# Only exists if Bazel was run
98
/bazel-out
109

11-
# dependencies
10+
# Node
1211
/node_modules
13-
14-
# profiling files
15-
chrome-profiler-events*.json
12+
npm-debug.log
13+
yarn-error.log
1614

1715
# IDEs and editors
18-
/.idea
16+
.idea/
1917
.project
2018
.classpath
2119
.c9/
2220
*.launch
2321
.settings/
2422
*.sublime-workspace
2523

26-
# IDE - VSCode
24+
# Visual Studio Code
2725
.vscode/*
2826
!.vscode/settings.json
2927
!.vscode/tasks.json
3028
!.vscode/launch.json
3129
!.vscode/extensions.json
3230
.history/*
3331

34-
# misc
35-
/.sass-cache
32+
# Miscellaneous
33+
/.angular/cache
34+
.sass-cache/
3635
/connect.lock
3736
/coverage
3837
/libpeerconnection.log
39-
npm-debug.log
40-
yarn-error.log
4138
testem.log
4239
/typings
4340

44-
# System Files
41+
# System files
4542
.DS_Store
46-
Thumbs.
43+
Thumbs.db

angular.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"version": 1,
44
"cli": {
55
"packageManager": "pnpm",
6-
"defaultCollection": "@angular-eslint/schematics"
6+
"schematicCollections": [
7+
"@angular-eslint/schematics",
8+
"@ngrx/schematics"
9+
]
710
},
811
"newProjectRoot": "projects",
912
"projects": {
@@ -28,6 +31,12 @@
2831
},
2932
"@schematics/angular:service": {
3033
"skipTests": true
34+
},
35+
"@angular-eslint/schematics:application": {
36+
"setParserOptionsProject": true
37+
},
38+
"@angular-eslint/schematics:library": {
39+
"setParserOptionsProject": true
3140
}
3241
},
3342
"root": "",
@@ -101,18 +110,18 @@
101110
},
102111
"configurations": {
103112
"production": {
104-
"browserTarget": "awesomehub:build:production"
113+
"buildTarget": "awesomehub:build:production"
105114
},
106115
"development": {
107-
"browserTarget": "awesomehub:build:development"
116+
"buildTarget": "awesomehub:build:development"
108117
}
109118
},
110119
"defaultConfiguration": "development"
111120
},
112121
"extract-i18n": {
113122
"builder": "@angular-devkit/build-angular:extract-i18n",
114123
"options": {
115-
"browserTarget": "awesomehub:build"
124+
"buildTarget": "awesomehub:build"
116125
}
117126
},
118127
"lint": {
@@ -127,6 +136,5 @@
127136
}
128137
}
129138
}
130-
},
131-
"defaultProject": "awesomehub"
139+
}
132140
}

eslint.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// @ts-check
2+
const eslint = require("@eslint/js");
3+
const tseslint = require("typescript-eslint");
4+
const angular = require("angular-eslint");
5+
const ngrx = require("@ngrx/eslint-plugin/v9");
6+
7+
// @todo uncomment the recommended configs
8+
module.exports = tseslint.config(
9+
{
10+
files: ["**/*.ts"],
11+
extends: [
12+
// eslint.configs.recommended,
13+
// ...tseslint.configs.recommended,
14+
...tseslint.configs.stylistic,
15+
...angular.configs.tsRecommended,
16+
...ngrx.configs.all,
17+
],
18+
processor: angular.processInlineTemplates,
19+
rules: {
20+
"@angular-eslint/directive-selector": [
21+
"error",
22+
{
23+
type: "attribute",
24+
prefix: "ah",
25+
style: "camelCase",
26+
},
27+
],
28+
"@angular-eslint/component-selector": [
29+
"error",
30+
{
31+
type: "element",
32+
prefix: "ah",
33+
style: "kebab-case",
34+
},
35+
],
36+
"@ngrx/use-consistent-global-store-name": ["warn", "store$"]
37+
},
38+
},
39+
{
40+
files: ["**/*.html"],
41+
extends: [
42+
...angular.configs.templateRecommended,
43+
// ...angular.configs.templateAccessibility,
44+
],
45+
rules: {},
46+
}
47+
);

0 commit comments

Comments
 (0)