Skip to content

Commit dcf74cd

Browse files
committed
[add] GitHub action for updating Repository Meta
[add] Prettier CSS plugins [optimize] upgrade to Node.js 20, KoAJAX 3 & other latest Upstream packages/actions
1 parent 582959a commit dcf74cd

File tree

7 files changed

+1677
-1761
lines changed

7 files changed

+1677
-1761
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1212
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

16-
- uses: pnpm/action-setup@v2
16+
- uses: pnpm/action-setup@v4
1717
with:
1818
version: 9
19-
- uses: actions/setup-node@v3
19+
- uses: actions/setup-node@v4
2020
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
2121
with:
22-
node-version: 18
22+
node-version: 20
2323
cache: pnpm
2424
- name: Install Dependencies
2525
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
@@ -30,7 +30,7 @@ jobs:
3030
run: pnpm build
3131

3232
- name: Deploy Production
33-
uses: peaceiris/actions-gh-pages@v3
33+
uses: peaceiris/actions-gh-pages@v4
3434
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
3535
with:
3636
publish_dir: ./dist

.github/workflows/replace-repository-name.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ TargetName=$4
77

88
sed -i "s/$SourceOwner\/$SourceName/$TargetOwner\/$TargetName/ig" \
99
$(grep -i $SourceOwner/$SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
10+
sed -i "s/$SourceOwner/$TargetOwner/ig" \
11+
$(grep -i $SourceOwner -rl . --exclude-dir=.git --exclude-dir=node_modules)
1012
sed -i "s/$SourceName/$TargetName/ig" \
1113
$(grep -i $SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)

.github/workflows/update-meta.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update Meta
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- package.json
8+
jobs:
9+
Update-Meta:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Set NPM metadata
21+
env:
22+
# "Administration" repository permissions (write),
23+
# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#replace-all-repository-topics
24+
GH_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
25+
REPOSITORY: ${{ github.repository }}
26+
run: |
27+
DESCRIPTION=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).description || ''")
28+
HOME_PAGE=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).homepage || ''")
29+
TOPICS=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).keywords?.join().toLowerCase() || ''")
30+
31+
[[ "$DESCRIPTION" ]] && gh repo edit "$REPOSITORY" --description "$DESCRIPTION"
32+
[[ "$HOME_PAGE" ]] && gh repo edit "$REPOSITORY" --homepage "$HOME_PAGE"
33+
[[ "$TOPICS" ]] && {
34+
gh api --method PUT "repos/$REPOSITORY/topics" -f "names[]"
35+
gh repo edit "$REPOSITORY" --add-topic "$TOPICS"
36+
} || true

package.json

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "webcell-mobile",
33
"version": "0.4.0",
4-
"description": "Mobile App scaffold of WebCell v3",
4+
"description": "Mobile App scaffold of WebCell v3, which is a PWA scaffold based on Material Design Web components, with Anti-996 sample data.",
55
"author": "[email protected]",
6-
"homepage": "https://web-cell.dev/WebCell-mobile/",
6+
"homepage": "https://web-cell-mobile.vercel.app/",
77
"repository": {
88
"type": "git",
99
"url": "git+https://github.com/EasyWebApp/WebCell-mobile.git"
@@ -14,31 +14,38 @@
1414
"dependencies": {
1515
"browser-unhandled-rejection": "^1.0.2",
1616
"cell-router": "^3.0.0-rc.8",
17-
"dom-renderer": "^2.1.8",
18-
"koajax": "^1.1.2",
19-
"mdui": "^2.1.1",
20-
"mobx": "^6.12.4",
21-
"web-cell": "^3.0.0-rc.16",
22-
"web-utility": "^4.4.0"
17+
"dom-renderer": "^2.4.2",
18+
"koajax": "^3.0.3",
19+
"mdui": "^2.1.3",
20+
"mobx": "^6.13.5",
21+
"web-cell": "^3.0.0",
22+
"web-utility": "^4.4.2"
2323
},
2424
"devDependencies": {
2525
"@parcel/config-default": "~2.12.0",
2626
"@parcel/packager-raw-url": "~2.12.0",
2727
"@parcel/transformer-typescript-tsc": "~2.12.0",
2828
"@parcel/transformer-webmanifest": "~2.12.0",
29-
"@types/node": "^18.19.39",
30-
"husky": "^9.0.11",
31-
"lint-staged": "^15.2.7",
29+
"@softonus/prettier-plugin-duplicate-remover": "^1.0.1",
30+
"@types/node": "^20.17.6",
31+
"husky": "^9.1.6",
32+
"lint-staged": "^15.2.10",
3233
"parcel": "~2.12.0",
33-
"prettier": "^3.3.2",
34-
"typescript": "~5.5.2",
35-
"workbox-cli": "^7.1.0"
34+
"postcss": "^8.4.47",
35+
"prettier": "^3.3.3",
36+
"prettier-plugin-css-order": "^2.1.2",
37+
"typescript": "~5.6.3",
38+
"workbox-cli": "^7.3.0"
3639
},
3740
"prettier": {
3841
"singleQuote": true,
3942
"trailingComma": "none",
4043
"arrowParens": "avoid",
41-
"tabWidth": 4
44+
"tabWidth": 4,
45+
"plugins": [
46+
"prettier-plugin-css-order",
47+
"@softonus/prettier-plugin-duplicate-remover"
48+
]
4249
},
4350
"lint-staged": {
4451
"*.{html,md,css,less,json,yml,js,ts,tsx}": "prettier --write"

0 commit comments

Comments
 (0)