Skip to content

Commit 63c41b2

Browse files
authored
Angular v18 (#1)
* feat: update angular to v18 Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * fix(ci): fix pnpm install on ci Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * chore(deps): use npm instead of pnpm Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * feat: use prettier code formatter Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * feat: add ListRepoScoreType Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * chore(deps): update date-fns Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * chore(deps): update typescript Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * chore(docs): update README Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> * chore(docs): update angular version in README Signed-off-by: Mohamed Elkholy <mkh117@gmail.com> --------- Signed-off-by: Mohamed Elkholy <mkh117@gmail.com>
1 parent 56f00a2 commit 63c41b2

File tree

163 files changed

+15792
-10672
lines changed

Some content is hidden

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

163 files changed

+15792
-10672
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 & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,62 @@ 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: Project Node Version
22+
run: |
23+
echo "Node version: $(which node):$(node -v)"
24+
echo "NPM version: $(which npm):$(npm -v)"
25+
1026
Build:
27+
needs: [Setup]
1128
if: "!contains(github.event.head_commit.message, '[skip ci]')"
12-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-latest
1330
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
31+
- uses: actions/checkout@v4
32+
- uses: volta-cli/action@v4
1633
with:
17-
node-version: 12
18-
- uses: actions/cache@v2
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
- uses: actions/cache@v4
1936
with:
20-
path: ~/.pnpm-store
21-
key: pnpm-install-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
37+
path: ~/.npm
38+
key: npm-install-v3-${{ hashFiles('**/package-lock.json') }}
2239
restore-keys: |
23-
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
40+
npm-install-v3-
41+
- name: Install Dependencies
42+
run: npm ci
43+
- name: Type Check
44+
run: npm run typecheck
45+
- name: Lint
46+
run: npm run lint
2947
- name: Build
30-
run: |
31-
pnpm build:debug
32-
pnpm build
33-
pnpm postbuild
48+
run: npm run build
3449
- if: github.event_name == 'push'
35-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v4
3651
with:
3752
name: build-art
3853
path: dist
3954
Deploy:
55+
needs: [Build]
4056
if: github.event_name == 'push'
41-
needs: Build
42-
runs-on: ubuntu-20.04
57+
runs-on: ubuntu-latest
4358
steps:
44-
- uses: actions/checkout@v2
59+
- uses: actions/checkout@v4
4560
with:
4661
repository: awesomehub/awesomehub.github.io
4762
token: ${{ secrets.PAT }}
4863
path: deploy
4964
- run: rm -r deploy/dist/*
50-
- uses: actions/download-artifact@v2
65+
- uses: actions/download-artifact@v4
5166
id: download
5267
with:
5368
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

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
shamefully-hoist=true
1+
prefer-dedupe
2+
legacy-peer-deps

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"jsxSingleQuote": true,
4+
"trailingComma": "all",
5+
"semi": false,
6+
"printWidth": 120
7+
}

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repository contains the sources for AwesomeHub Angular application.
88
99
## About
1010
The App was originaly built for educational purposes and to experiment with [Angular 2](https://v2.angular.io/), [NgRx](https://ngrx.io/) and [RxJS](https://www.learnrxjs.io/), but
11-
I have recently managed to update the codebase to [Angular 12](https://v12.angular.io/).
11+
I have recently managed to update the codebase to [Angular 12](https://v12.angular.io/), then to [Angular 18](https://angular.dev/).
1212

1313
The App UI is built on top of the good old [Material Design Lite](https://getmdl.io/) library, It's much lighter than [Angular Material](https://material.angular.io/)
1414
but I originally used it because Angular Material was still in alpha at the time I built this app.
@@ -17,38 +17,40 @@ but I originally used it because Angular Material was still in alpha at the time
1717

1818
### Prerequisites
1919

20-
- Node >= 12.14.1
21-
- PNPM >= 6.0
20+
- Node >= 18.0
21+
- NPM >= 10.0
2222

2323
```bash
2424
# Clone the repo
2525
$ git clone https://github.com/awesomehub/app.git awesomehub-app
2626
$ cd awesomehub-app
2727

2828
# Install dependencies
29-
$ pnpm install
29+
$ npm install
3030

3131
# Start dev server
32-
$ pnpm start
32+
$ npm start
3333
```
3434

3535
## Main Commands
3636

37-
|Command|Description|
38-
|---|---|
39-
|`pnpm start`|Start dev server @ `localhost:4200`|
40-
|`pnpm build`|Build production bundles to `./dist` directory|
41-
|`pnpm build:debug`|Build unoptimized production bundles for debugging purposes to `./dist` directory|
42-
|`pnpm serve`|Start web server @ `localhost:5000` to serve build artifacts from `./dist` directory|
43-
|`pnpm lint`|Lint TypeScript source with ESLint |
44-
|`pnpm ng` or `ng`|Run Angular CLI commands (eg. `ng generate module`)|
37+
| Command | Description |
38+
|-----------------------|--------------------------------------------------------------------------------------|
39+
| `npm start` | Start dev server @ `localhost:4200` |
40+
| `npm run build` | Build production bundles to `./dist` directory |
41+
| `npm run build:debug` | Build unoptimized production bundles for debugging purposes to `./dist` directory |
42+
| `npm run serve` | Start web server @ `localhost:5000` to serve build artifacts from `./dist` directory |
43+
| `npm run typechek` | Check TypeScript source code |
44+
| `npm run lint` | Lint source code with ESLint |
45+
| `npm run format` | Format source code with Prettier |
46+
| `npm run ng` or `ng` | Run Angular CLI commands (eg. `ng generate module`) |
4547

4648

4749
[ci-url]: https://github.com/awesomehub/app/actions/workflows/main.yml
4850
[ci-img]: https://img.shields.io/github/actions/workflow/status/awesomehub/app/main.yml?branch=master
4951
[netlify-url]: https://app.netlify.com/sites/awesomehub/deploys
5052
[netlify-img]: https://img.shields.io/netlify/968920d6-f8ff-4967-93d7-9e55861c1174?logo=netlify&logoColor=white
51-
[angular-url]: https://github.com/angular/angular/releases/tag/12.0.0
52-
[angular-img]: https://img.shields.io/badge/angular-v12-dd0131.svg?logo=angular
53+
[angular-url]: https://github.com/angular/angular/releases/tag/18.0.0
54+
[angular-img]: https://img.shields.io/badge/angular-v18-dd0131.svg?logo=angular
5355
[website-url]: https://awesomehub.js.org
5456
[website-img]: https://img.shields.io/website?logo=statuspal&url=https%3A%2F%2Fawesomehub.js.org

angular.json

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": 1,
44
"cli": {
55
"packageManager": "pnpm",
6-
"defaultCollection": "@angular-eslint/schematics"
6+
"schematicCollections": ["@angular-eslint/schematics", "@ngrx/schematics"]
77
},
88
"newProjectRoot": "projects",
99
"projects": {
@@ -28,6 +28,12 @@
2828
},
2929
"@schematics/angular:service": {
3030
"skipTests": true
31+
},
32+
"@angular-eslint/schematics:application": {
33+
"setParserOptionsProject": true
34+
},
35+
"@angular-eslint/schematics:library": {
36+
"setParserOptionsProject": true
3137
}
3238
},
3339
"root": "",
@@ -45,14 +51,8 @@
4551
"tsConfig": "tsconfig.app.json",
4652
"aot": false,
4753
"sourceMap": true,
48-
"assets": [
49-
"src/assets/data",
50-
"src/assets/images",
51-
"src/manifest.json"
52-
],
53-
"styles": [
54-
"src/styles.css"
55-
],
54+
"assets": ["src/assets/data", "src/assets/images", "src/manifest.json"],
55+
"styles": ["src/styles.css"],
5656
"scripts": []
5757
},
5858
"configurations": {
@@ -101,32 +101,28 @@
101101
},
102102
"configurations": {
103103
"production": {
104-
"browserTarget": "awesomehub:build:production"
104+
"buildTarget": "awesomehub:build:production"
105105
},
106106
"development": {
107-
"browserTarget": "awesomehub:build:development"
107+
"buildTarget": "awesomehub:build:development"
108108
}
109109
},
110110
"defaultConfiguration": "development"
111111
},
112112
"extract-i18n": {
113113
"builder": "@angular-devkit/build-angular:extract-i18n",
114114
"options": {
115-
"browserTarget": "awesomehub:build"
115+
"buildTarget": "awesomehub:build"
116116
}
117117
},
118118
"lint": {
119119
"builder": "@angular-eslint/builder:lint",
120120
"options": {
121-
"lintFilePatterns": [
122-
"src/**/*.ts",
123-
"src/**/*.html"
124-
],
121+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"],
125122
"fix": true
126123
}
127124
}
128125
}
129126
}
130-
},
131-
"defaultProject": "awesomehub"
127+
}
132128
}

0 commit comments

Comments
 (0)