Skip to content

Commit

Permalink
[add] GitHub action for updating Repository Meta
Browse files Browse the repository at this point in the history
[add] Prettier CSS plugins
[optimize] upgrade to Node.js 20, KoAJAX 3 & other latest Upstream packages/actions
  • Loading branch information
TechQuery committed Nov 8, 2024
1 parent 582959a commit dcf74cd
Show file tree
Hide file tree
Showing 7 changed files with 1,677 additions and 1,761 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
node-version: 18
node-version: 20
cache: pnpm
- name: Install Dependencies
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
Expand All @@ -30,7 +30,7 @@ jobs:
run: pnpm build

- name: Deploy Production
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
publish_dir: ./dist
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/replace-repository-name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ TargetName=$4

sed -i "s/$SourceOwner\/$SourceName/$TargetOwner\/$TargetName/ig" \
$(grep -i $SourceOwner/$SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
sed -i "s/$SourceOwner/$TargetOwner/ig" \
$(grep -i $SourceOwner -rl . --exclude-dir=.git --exclude-dir=node_modules)
sed -i "s/$SourceName/$TargetName/ig" \
$(grep -i $SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
36 changes: 36 additions & 0 deletions .github/workflows/update-meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update Meta
on:
push:
branches:
- master
paths:
- package.json
jobs:
Update-Meta:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Set NPM metadata
env:
# "Administration" repository permissions (write),
# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#replace-all-repository-topics
GH_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
DESCRIPTION=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).description || ''")
HOME_PAGE=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).homepage || ''")
TOPICS=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).keywords?.join().toLowerCase() || ''")
[[ "$DESCRIPTION" ]] && gh repo edit "$REPOSITORY" --description "$DESCRIPTION"
[[ "$HOME_PAGE" ]] && gh repo edit "$REPOSITORY" --homepage "$HOME_PAGE"
[[ "$TOPICS" ]] && {
gh api --method PUT "repos/$REPOSITORY/topics" -f "names[]"
gh repo edit "$REPOSITORY" --add-topic "$TOPICS"
} || true
37 changes: 22 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "webcell-mobile",
"version": "0.4.0",
"description": "Mobile App scaffold of WebCell v3",
"description": "Mobile App scaffold of WebCell v3, which is a PWA scaffold based on Material Design Web components, with Anti-996 sample data.",
"author": "[email protected]",
"homepage": "https://web-cell.dev/WebCell-mobile/",
"homepage": "https://web-cell-mobile.vercel.app/",
"repository": {
"type": "git",
"url": "git+https://github.com/EasyWebApp/WebCell-mobile.git"
Expand All @@ -14,31 +14,38 @@
"dependencies": {
"browser-unhandled-rejection": "^1.0.2",
"cell-router": "^3.0.0-rc.8",
"dom-renderer": "^2.1.8",
"koajax": "^1.1.2",
"mdui": "^2.1.1",
"mobx": "^6.12.4",
"web-cell": "^3.0.0-rc.16",
"web-utility": "^4.4.0"
"dom-renderer": "^2.4.2",
"koajax": "^3.0.3",
"mdui": "^2.1.3",
"mobx": "^6.13.5",
"web-cell": "^3.0.0",
"web-utility": "^4.4.2"
},
"devDependencies": {
"@parcel/config-default": "~2.12.0",
"@parcel/packager-raw-url": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-webmanifest": "~2.12.0",
"@types/node": "^18.19.39",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"@softonus/prettier-plugin-duplicate-remover": "^1.0.1",
"@types/node": "^20.17.6",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"parcel": "~2.12.0",
"prettier": "^3.3.2",
"typescript": "~5.5.2",
"workbox-cli": "^7.1.0"
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-css-order": "^2.1.2",
"typescript": "~5.6.3",
"workbox-cli": "^7.3.0"
},
"prettier": {
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid",
"tabWidth": 4
"tabWidth": 4,
"plugins": [
"prettier-plugin-css-order",
"@softonus/prettier-plugin-duplicate-remover"
]
},
"lint-staged": {
"*.{html,md,css,less,json,yml,js,ts,tsx}": "prettier --write"
Expand Down
Loading

1 comment on commit dcf74cd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for web-cell-mobile ready!

✅ Preview
https://web-cell-mobile-mk1zclyp2-techquerys-projects.vercel.app

Built with commit dcf74cd.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.