Skip to content

Commit

Permalink
[refactor] replace Material Web 1 with MDUI 2 to simplify components
Browse files Browse the repository at this point in the history
[add] Rename script & action of GitHub repository
[add] VS Code settings & PR badges
[optimize] upgrade to PNPM 9 & other latest Upstream packages
  • Loading branch information
TechQuery committed Jun 26, 2024
1 parent 05baec7 commit c8e237e
Show file tree
Hide file tree
Showing 16 changed files with 5,098 additions and 4,200 deletions.
17 changes: 17 additions & 0 deletions .github/pr-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- icon: visualstudio
label: 'GitHub.dev'
message: 'PR-$prNumber'
color: 'blue'
url: 'https://github.dev/$owner/$repo/pull/$prNumber'

- icon: github
label: 'GitHub codespaces'
message: 'PR-$prNumber'
color: 'black'
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber'

- icon: git
label: 'GitPod.io'
message: 'PR-$prNumber'
color: 'orange'
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber'
25 changes: 25 additions & 0 deletions .github/workflows/init-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Template Repository initialization
on:
push:
branches:
- master
env:
TEMPLATE_OWNER: EasyWebApp
TEMPLATE_NAME: WebCell-mobile

jobs:
replace-repository-name:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- if: github.repository != format('{0}/{1}', env.TEMPLATE_OWNER, env.TEMPLATE_NAME)
run: |
sh .github/workflows/replace-repository-name.sh \
${{ env.TEMPLATE_OWNER }} ${{ env.TEMPLATE_NAME }} \
${{ github.repository_owner }} ${{ github.event.repository.name }}
rm -f .github/workflows/init-template.yml
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[fix] replace Repository Name'
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- uses: actions/setup-node@v3
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/replace-repository-name.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /usr/bin/env bash

SourceOwner=$1
SourceName=$2
TargetOwner=$3
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/$SourceName/$TargetName/ig" \
$(grep -i $SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package-lock.json
yarn.lock
.parcel-cache/
dist/
.vscode/settings.json
.vercel/
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"html.customData": ["./node_modules/mdui/html-data.en.json"],
"css.customData": ["./node_modules/mdui/css-data.en.json"],
"typescript.tsdk": "./node_modules/typescript/lib"
}
55 changes: 33 additions & 22 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
![](https://git-pager.vercel.app/src/image/WebCell-0.png)
![](https://github.com/EasyWebApp.png)

# WebCell mobile scaffold
# WebCell-mobile

Mobile App scaffold of [WebCell v3][1]

https://web-cell.dev/mobile/
https://web-cell.dev/WebCell-mobile/

[![CI & CD](https://github.com/EasyWebApp/mobile/actions/workflows/main.yml/badge.svg)][2]
[![CI & CD](https://github.com/EasyWebApp/WebCell-mobile/actions/workflows/main.yml/badge.svg)][2]

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)][3]
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][4]
Expand All @@ -15,7 +15,7 @@ https://web-cell.dev/mobile/

- Language: [TypeScript v5][5]
- Component engine: [WebCell v3][1]
- Component suite: [Material Web v1][6]
- Component suite: [MDUI v2][6]
- PWA framework: [Workbox v7][7]
- Package bundler: [Parcel v2][8]
- CI / CD: GitHub [Actions][9] + [Pages][10]
Expand All @@ -36,28 +36,39 @@ pnpm build

## Best practice

1. Install **[Settings][11] GitHub app** in your account or organization
2. Click the **[Use this template][12] button** on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above
3. Click the **[Open in GitHub codespaces][4] button** on the top of ReadMe file, then an **online VS Code development environment** will be started immediately
4. Set [Vercel variables][13] as [Repository secrets][14], then every commit will get an independent **Preview URL**
5. Recommend to add a [Notification step in GitHub actions][15] for your Team IM app
6. Remind the PMs & users of your product to submit **Feature/Enhancement** requests or **Bug** reports with [Issue forms][16] instead of IM messages or Mobile Phone calls
7. Collect all these issues into [Project kanbans][17], then create **Pull requests** & add `closes #issue_number` into its description for automation
1. Install GitHub apps in your organization or account:

1. [Probot settings][11]: set up Issue labels & Pull Request rules
2. [PR badge][12]: set up Online [VS Code][13] editor entries in Pull Request description

2. Click the **[<kbd>Use this template</kbd>][14] button** on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above

3. Click the **[<kbd>Open in GitHub codespaces</kbd>][3] button** on the top of ReadMe file, then an **online VS Code development environment** will be started immediately

4. Set [Vercel variables][15] as [Repository secrets][16], then every commit will get an independent **Preview URL**

5. Recommend to add a [Notification step in GitHub actions][17] for your Team IM app

6. Remind the PMs & users of your product to submit **Feature/Enhancement** requests or **Bug** reports with [Issue forms][18] instead of IM messages or Mobile Phone calls

7. Collect all these issues into [Project kanbans][19], then create **Pull requests** & add `closes #issue_number` into its description for automation

[1]: https://web-cell.dev/
[2]: https://github.com/EasyWebApp/mobile/actions/workflows/main.yml
[3]: https://codespaces.new/EasyWebApp/mobile
[4]: https://gitpod.io/?autostart=true#https://github.com/EasyWebApp/mobile
[2]: https://github.com/EasyWebApp/WebCell-mobile/actions/workflows/main.yml
[3]: https://codespaces.new/EasyWebApp/WebCell-mobile
[4]: https://gitpod.io/?autostart=true#https://github.com/EasyWebApp/WebCell-mobile
[5]: https://typescriptlang.org/
[6]: https://material-web.dev/
[6]: https://www.mdui.org/
[7]: https://developers.google.com/web/tools/workbox
[8]: https://parceljs.org/
[9]: https://github.com/features/actions
[10]: https://pages.github.com/
[11]: https://github.com/apps/settings
[12]: https://github.com/new?template_name=mobile&template_owner=EasyWebApp
[13]: https://github.com/idea2app/Next-Bootstrap-ts/blob/80967ed49045af9dbcf4d3695a2c39d53a6f71f1/.github/workflows/pull-request.yml#L9-L12
[14]: https://github.com/EasyWebApp/mobile/settings/secrets/actions
[15]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
[16]: https://github.com/EasyWebApp/mobile/issues/new/choose
[17]: https://github.com/EasyWebApp/mobile/projects
[12]: https://pullrequestbadge.com/
[13]: https://code.visualstudio.com/
[14]: https://github.com/new?template_name=WebCell-mobile&template_owner=EasyWebApp
[15]: https://github.com/EasyWebApp/mobile/blob/05baec7446a8cb84a3cdc6dd184cc7314c63b468/.github/workflows/main.yml#L10-L12
[16]: https://github.com/EasyWebApp/WebCell-mobile/settings/secrets/actions
[17]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
[18]: https://github.com/EasyWebApp/WebCell-mobile/issues/new/choose
[19]: https://github.com/EasyWebApp/WebCell-mobile/projects
51 changes: 25 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
{
"name": "@web-cell/mobile",
"version": "0.3.0",
"description": "Mobile App scaffold of WebCell v2",
"name": "webcell-mobile",
"version": "0.4.0",
"description": "Mobile App scaffold of WebCell v3",
"author": "[email protected]",
"homepage": "https://web-cell.dev/mobile/",
"homepage": "https://web-cell.dev/WebCell-mobile/",
"repository": {
"type": "git",
"url": "git+https://github.com/EasyWebApp/mobile.git"
"url": "git+https://github.com/EasyWebApp/WebCell-mobile.git"
},
"bugs": {
"url": "https://github.com/EasyWebApp/mobile/issues"
"url": "https://github.com/EasyWebApp/WebCell-mobile/issues"
},
"dependencies": {
"@material/web": "^1.2.0",
"boot-cell": "^2.0.0-beta.18",
"browser-unhandled-rejection": "^1.0.2",
"cell-router": "^3.0.0-rc.5",
"dom-renderer": "^2.1.3",
"koajax": "^0.9.6",
"mobx": "^6.12.0",
"web-cell": "^3.0.0-rc.15",
"web-utility": "^4.1.3"
"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"
},
"devDependencies": {
"@parcel/config-default": "~2.11.0",
"@parcel/packager-raw-url": "2.11.0",
"@parcel/transformer-typescript-tsc": "~2.11.0",
"@parcel/transformer-webmanifest": "~2.11.0",
"@types/node": "^18.19.15",
"husky": "^9.0.10",
"lint-staged": "^15.2.2",
"parcel": "~2.11.0",
"prettier": "^3.2.5",
"typescript": "~5.3.3",
"workbox-cli": "^7.0.0"
"@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",
"parcel": "~2.12.0",
"prettier": "^3.3.2",
"typescript": "~5.5.2",
"workbox-cli": "^7.1.0"
},
"prettier": {
"singleQuote": true,
Expand All @@ -48,7 +47,7 @@
"prepare": "husky",
"test": "lint-staged",
"clean": "rm -rf .parcel-cache/ dist/",
"start": "npm run clean && parcel src/index.html --open",
"start": "npm run clean && parcel src/index.html",
"pack": "parcel build src/index.html --public-url .",
"build": "npm run clean && npm run pack && workbox generateSW"
}
Expand Down
Loading

1 comment on commit c8e237e

@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-irnxg3m2r-techquerys-projects.vercel.app

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

Please sign in to comment.