Skip to content

Commit 582959a

Browse files
authored
[refactor] replace Material Web 1 with MDUI 2 to simplify components (#2)
1 parent 05baec7 commit 582959a

File tree

16 files changed

+5102
-4201
lines changed

16 files changed

+5102
-4201
lines changed

.github/pr-badge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- icon: visualstudio
2+
label: 'GitHub.dev'
3+
message: 'PR-$prNumber'
4+
color: 'blue'
5+
url: 'https://github.dev/$owner/$repo/pull/$prNumber'
6+
7+
- icon: github
8+
label: 'GitHub codespaces'
9+
message: 'PR-$prNumber'
10+
color: 'black'
11+
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber'
12+
13+
- icon: git
14+
label: 'GitPod.io'
15+
message: 'PR-$prNumber'
16+
color: 'orange'
17+
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Template Repository initialization
2+
on:
3+
push:
4+
branches:
5+
- master
6+
env:
7+
TEMPLATE_OWNER: EasyWebApp
8+
TEMPLATE_NAME: WebCell-mobile
9+
10+
jobs:
11+
replace-repository-name:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- if: github.repository != format('{0}/{1}', env.TEMPLATE_OWNER, env.TEMPLATE_NAME)
17+
run: |
18+
sh .github/workflows/replace-repository-name.sh \
19+
${{ env.TEMPLATE_OWNER }} ${{ env.TEMPLATE_NAME }} \
20+
${{ github.repository_owner }} ${{ github.event.repository.name }}
21+
rm -f .github/workflows/init-template.yml
22+
23+
- uses: stefanzweifel/git-auto-commit-action@v5
24+
with:
25+
commit_message: '[fix] replace Repository Name'

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- uses: pnpm/action-setup@v2
1717
with:
18-
version: 8
18+
version: 9
1919
- uses: actions/setup-node@v3
2020
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
2121
with:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /usr/bin/env bash
2+
3+
SourceOwner=$1
4+
SourceName=$2
5+
TargetOwner=$3
6+
TargetName=$4
7+
8+
sed -i "s/$SourceOwner\/$SourceName/$TargetOwner\/$TargetName/ig" \
9+
$(grep -i $SourceOwner/$SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
10+
sed -i "s/$SourceName/$TargetName/ig" \
11+
$(grep -i $SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ package-lock.json
33
yarn.lock
44
.parcel-cache/
55
dist/
6-
.vscode/settings.json
76
.vercel/

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"html.customData": ["./node_modules/mdui/html-data.en.json"],
3+
"css.customData": ["./node_modules/mdui/css-data.en.json"],
4+
"typescript.tsdk": "./node_modules/typescript/lib"
5+
}

ReadMe.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
![](https://git-pager.vercel.app/src/image/WebCell-0.png)
1+
![](https://github.com/EasyWebApp.png)
22

3-
# WebCell mobile scaffold
3+
# WebCell-mobile
44

55
Mobile App scaffold of [WebCell v3][1]
66

7-
https://web-cell.dev/mobile/
7+
https://web-cell.dev/WebCell-mobile/
88

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

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

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

3737
## Best practice
3838

39-
1. Install **[Settings][11] GitHub app** in your account or organization
40-
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
41-
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
42-
4. Set [Vercel variables][13] as [Repository secrets][14], then every commit will get an independent **Preview URL**
43-
5. Recommend to add a [Notification step in GitHub actions][15] for your Team IM app
44-
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
45-
7. Collect all these issues into [Project kanbans][17], then create **Pull requests** & add `closes #issue_number` into its description for automation
39+
1. Install GitHub apps in your organization or account:
40+
41+
1. [Probot settings][11]: set up Issue labels & Pull Request rules
42+
2. [PR badge][12]: set up Online [VS Code][13] editor entries in Pull Request description
43+
44+
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
45+
46+
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
47+
48+
4. Set [Vercel variables][15] as [Repository secrets][16], then every commit will get an independent **Preview URL**
49+
50+
5. Recommend to add a [Notification step in GitHub actions][17] for your Team IM app
51+
52+
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
53+
54+
7. Collect all these issues into [Project kanbans][19], then create **Pull requests** & add `closes #issue_number` into its description for automation
4655

4756
[1]: https://web-cell.dev/
48-
[2]: https://github.com/EasyWebApp/mobile/actions/workflows/main.yml
49-
[3]: https://codespaces.new/EasyWebApp/mobile
50-
[4]: https://gitpod.io/?autostart=true#https://github.com/EasyWebApp/mobile
57+
[2]: https://github.com/EasyWebApp/WebCell-mobile/actions/workflows/main.yml
58+
[3]: https://codespaces.new/EasyWebApp/WebCell-mobile
59+
[4]: https://gitpod.io/?autostart=true#https://github.com/EasyWebApp/WebCell-mobile
5160
[5]: https://typescriptlang.org/
52-
[6]: https://material-web.dev/
61+
[6]: https://www.mdui.org/
5362
[7]: https://developers.google.com/web/tools/workbox
5463
[8]: https://parceljs.org/
5564
[9]: https://github.com/features/actions
5665
[10]: https://pages.github.com/
5766
[11]: https://github.com/apps/settings
58-
[12]: https://github.com/new?template_name=mobile&template_owner=EasyWebApp
59-
[13]: https://github.com/idea2app/Next-Bootstrap-ts/blob/80967ed49045af9dbcf4d3695a2c39d53a6f71f1/.github/workflows/pull-request.yml#L9-L12
60-
[14]: https://github.com/EasyWebApp/mobile/settings/secrets/actions
61-
[15]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
62-
[16]: https://github.com/EasyWebApp/mobile/issues/new/choose
63-
[17]: https://github.com/EasyWebApp/mobile/projects
67+
[12]: https://pullrequestbadge.com/
68+
[13]: https://code.visualstudio.com/
69+
[14]: https://github.com/new?template_name=WebCell-mobile&template_owner=EasyWebApp
70+
[15]: https://github.com/EasyWebApp/mobile/blob/05baec7446a8cb84a3cdc6dd184cc7314c63b468/.github/workflows/main.yml#L10-L12
71+
[16]: https://github.com/EasyWebApp/WebCell-mobile/settings/secrets/actions
72+
[17]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
73+
[18]: https://github.com/EasyWebApp/WebCell-mobile/issues/new/choose
74+
[19]: https://github.com/EasyWebApp/WebCell-mobile/projects

package.json

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
{
2-
"name": "@web-cell/mobile",
3-
"version": "0.3.0",
4-
"description": "Mobile App scaffold of WebCell v2",
2+
"name": "webcell-mobile",
3+
"version": "0.4.0",
4+
"description": "Mobile App scaffold of WebCell v3",
55
"author": "[email protected]",
6-
"homepage": "https://web-cell.dev/mobile/",
6+
"homepage": "https://web-cell.dev/WebCell-mobile/",
77
"repository": {
88
"type": "git",
9-
"url": "git+https://github.com/EasyWebApp/mobile.git"
9+
"url": "git+https://github.com/EasyWebApp/WebCell-mobile.git"
1010
},
1111
"bugs": {
12-
"url": "https://github.com/EasyWebApp/mobile/issues"
12+
"url": "https://github.com/EasyWebApp/WebCell-mobile/issues"
1313
},
1414
"dependencies": {
15-
"@material/web": "^1.2.0",
16-
"boot-cell": "^2.0.0-beta.18",
1715
"browser-unhandled-rejection": "^1.0.2",
18-
"cell-router": "^3.0.0-rc.5",
19-
"dom-renderer": "^2.1.3",
20-
"koajax": "^0.9.6",
21-
"mobx": "^6.12.0",
22-
"web-cell": "^3.0.0-rc.15",
23-
"web-utility": "^4.1.3"
16+
"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"
2423
},
2524
"devDependencies": {
26-
"@parcel/config-default": "~2.11.0",
27-
"@parcel/packager-raw-url": "2.11.0",
28-
"@parcel/transformer-typescript-tsc": "~2.11.0",
29-
"@parcel/transformer-webmanifest": "~2.11.0",
30-
"@types/node": "^18.19.15",
31-
"husky": "^9.0.10",
32-
"lint-staged": "^15.2.2",
33-
"parcel": "~2.11.0",
34-
"prettier": "^3.2.5",
35-
"typescript": "~5.3.3",
36-
"workbox-cli": "^7.0.0"
25+
"@parcel/config-default": "~2.12.0",
26+
"@parcel/packager-raw-url": "~2.12.0",
27+
"@parcel/transformer-typescript-tsc": "~2.12.0",
28+
"@parcel/transformer-webmanifest": "~2.12.0",
29+
"@types/node": "^18.19.39",
30+
"husky": "^9.0.11",
31+
"lint-staged": "^15.2.7",
32+
"parcel": "~2.12.0",
33+
"prettier": "^3.3.2",
34+
"typescript": "~5.5.2",
35+
"workbox-cli": "^7.1.0"
3736
},
3837
"prettier": {
3938
"singleQuote": true,
@@ -48,7 +47,7 @@
4847
"prepare": "husky",
4948
"test": "lint-staged",
5049
"clean": "rm -rf .parcel-cache/ dist/",
51-
"start": "npm run clean && parcel src/index.html --open",
50+
"start": "npm run clean && parcel src/index.html",
5251
"pack": "parcel build src/index.html --public-url .",
5352
"build": "npm run clean && npm run pack && workbox generateSW"
5453
}

0 commit comments

Comments
 (0)