Skip to content

Commit 917366b

Browse files
authored
[refactor] upgrade to WebCell v3, CellRouter v3 & BootCell v2 (#1)
1 parent 7bb0d5e commit 917366b

24 files changed

+6603
-468
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI & CD
2+
on:
3+
push:
4+
branches:
5+
- source
6+
jobs:
7+
Build-and-Deploy:
8+
env:
9+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: pnpm/action-setup@v2
17+
with:
18+
version: 8
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
cache: pnpm
23+
- name: Install & Build
24+
run: |
25+
pnpm i --frozen-lockfile
26+
pnpm build
27+
28+
- name: Deploy to GitHub pages
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
publish_dir: ./dist
32+
personal_token: ${{ secrets.GITHUB_TOKEN }}
33+
force_orphan: true
34+
35+
- name: Deploy to Vercel
36+
uses: amondnet/vercel-action@v25
37+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
38+
with:
39+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
42+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
43+
working-directory: ./dist
44+
vercel-args: --prod

.github/workflows/push.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Commit preview
2+
on:
3+
push:
4+
branches-ignore:
5+
- source
6+
jobs:
7+
Build-and-Deploy:
8+
env:
9+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: pnpm/action-setup@v2
17+
with:
18+
version: 8
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
cache: pnpm
23+
- name: Install & Build
24+
run: |
25+
pnpm i --frozen-lockfile
26+
pnpm build
27+
28+
- uses: amondnet/vercel-action@v25
29+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
30+
with:
31+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
34+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
35+
working-directory: ./dist

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
node_modules/
22
package-lock.json
3+
yarn.lock
34
dist/
4-
.cache/
5+
.parcel-cache/
6+
.husky/
57
.vscode/

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm test

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run build

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = false

.parcelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"transformers": {
4+
"*.{ts,tsx}": [
5+
"@parcel/transformer-typescript-tsc"
6+
]
7+
}
8+
}

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

ReadMe.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# WebCell official website
22

3-
Design of https://web-cell.dev/ is based on [Product][1] & [Carousel][2] templates of BootStrap 4.
3+
Design of https://web-cell.dev/ is based on [Product][1] & [Carousel][2] templates of BootStrap 5.
44

5-
[![NPM Dependency](https://david-dm.org/EasyWebApp/EasyWebApp.github.io.svg)][3]
6-
[![Build Status](https://travis-ci.com/EasyWebApp/EasyWebApp.github.io.svg?branch=source)][4]
5+
[![CI & CD](https://github.com/EasyWebApp/EasyWebApp.github.io/actions/workflows/main.yml/badge.svg)][3]
76

87
[1]: https://getbootstrap.com/docs/4.5/examples/product/
98
[2]: https://getbootstrap.com/docs/4.5/examples/carousel/
10-
[3]: https://david-dm.org/EasyWebApp/EasyWebApp.github.io
11-
[4]: https://travis-ci.com/EasyWebApp/EasyWebApp.github.io
9+
[3]: https://github.com/EasyWebApp/EasyWebApp.github.io/actions/workflows/main.yml

package.json

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web-cell/home",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Official site of WebCell",
55
"keywords": [
66
"WebCell",
@@ -20,28 +20,32 @@
2020
"url": "https://github.com/EasyWebApp/EasyWebApp.github.io/issues"
2121
},
2222
"dependencies": {
23-
"boot-cell": "^1.9.4",
24-
"cell-router": "^2.0.4",
25-
"classnames": "^2.2.6",
26-
"github-web-widget": "^3.0.0-beta.9",
27-
"koajax": "^0.6.4",
28-
"marked": "^1.2.7",
29-
"prismjs": "^1.23.0",
30-
"web-cell": "^2.3.0-rc.1",
31-
"web-utility": "^2.4.3"
23+
"boot-cell": "^2.0.0-beta.7",
24+
"cell-router": "^3.0.0-rc.5",
25+
"classnames": "^2.5.1",
26+
"dom-renderer": "^2.0.6",
27+
"github-web-widget": "^4.0.0-rc.1",
28+
"koajax": "^0.9.6",
29+
"marked": "^11.1.1",
30+
"mobx": "^6.12.0",
31+
"prismjs": "^1.29.0",
32+
"web-cell": "^3.0.0-rc.7",
33+
"web-utility": "^4.1.3"
3234
},
3335
"devDependencies": {
34-
"@babel/core": "^7.12.10",
35-
"@types/classnames": "^2.2.11",
36-
"autoprefixer": "^9.8.6",
37-
"husky": "^4.3.7",
38-
"less": "^4.1.0",
39-
"lint-staged": "^10.5.3",
40-
"parcel-bundler": "^1.12.4",
41-
"postcss-modules": "^3.2.2",
42-
"prettier": "^2.2.1",
43-
"typescript": "^4.1.3",
44-
"workbox-cli": "^6.0.2"
36+
"@parcel/config-default": "~2.11.0",
37+
"@parcel/packager-raw-url": "~2.11.0",
38+
"@parcel/transformer-less": "~2.11.0",
39+
"@parcel/transformer-typescript-tsc": "~2.11.0",
40+
"@parcel/transformer-webmanifest": "~2.11.0",
41+
"@types/classnames": "^2.3.1",
42+
"@types/node": "^18.19.8",
43+
"husky": "^8.0.3",
44+
"lint-staged": "^15.2.0",
45+
"parcel": "~2.11.0",
46+
"prettier": "^3.2.4",
47+
"typescript": "~5.3.3",
48+
"workbox-cli": "^7.0.0"
4549
},
4650
"prettier": {
4751
"tabWidth": 4,
@@ -52,25 +56,12 @@
5256
"lint-staged": {
5357
"*.{html,md,less,json,yml,js,ts,tsx}": "prettier --write"
5458
},
55-
"postcss": {
56-
"modules": true,
57-
"plugins": {
58-
"autoprefixer": {
59-
"grid": true
60-
}
61-
}
62-
},
6359
"scripts": {
60+
"prepare": "husky install",
6461
"test": "lint-staged",
6562
"start": "parcel source/index.html --open",
6663
"pack-dist": "parcel build source/index.html --public-url .",
6764
"pack-sw": "rm -f dist/sw.js.map && workbox generateSW",
6865
"build": "rm -rf dist/ && npm run pack-dist && npm run pack-sw"
69-
},
70-
"husky": {
71-
"hooks": {
72-
"pre-commit": "npm test",
73-
"pre-push": "npm run build"
74-
}
7566
}
7667
}

0 commit comments

Comments
 (0)