Skip to content

Commit ad274f0

Browse files
authored
[refactor] upgrade to WebCell v3, CellRouter v3 & BootCell v2 (#5)
1 parent f40a554 commit ad274f0

33 files changed

+8676
-9163
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,39 @@ name: CI & CD
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
jobs:
77
Build-and-Deploy:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v2
12-
- name: Use Node.js
13-
uses: actions/setup-node@v2
10+
- uses: actions/checkout@v3
11+
12+
- uses: pnpm/action-setup@v2
1413
with:
15-
node-version: 14
16-
cache: yarn
17-
- name: Install & build
18-
run: yarn && yarn build
19-
- name: Deploy
14+
version: 8
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
cache: pnpm
19+
- name: Install & Build
20+
run: |
21+
pnpm i --frozen-lockfile
22+
pnpm build
23+
24+
- name: Deploy to GitHub pages
2025
uses: peaceiris/actions-gh-pages@v3
2126
with:
2227
publish_dir: ./dist
2328
cname: bootstrap.web-cell.dev
2429
personal_token: ${{ secrets.GITHUB_TOKEN }}
2530
force_orphan: true
31+
32+
- name: Deploy to Vercel
33+
uses: amondnet/vercel-action@v25
34+
with:
35+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
38+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
39+
working-directory: ./dist
40+
vercel-args: --prod

.github/workflows/push.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Commit preview
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
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 Vercel
29+
uses: amondnet/vercel-action@v25
30+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
31+
with:
32+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
35+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
36+
working-directory: ./dist

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package-lock.json
2+
yarn.lock
23
node_modules/
34
dist/
4-
.cache/
5-
.vscode/
5+
.parcel-cache/
6+
.vscode/settings.json

.husky/pre-commit

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

.husky/pre-push

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
#!/bin/sh
2-
3-
. "$(dirname "$0")/_/husky.sh"
4-
51
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"transformers": {
4+
"*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"],
5+
"*.{md,mdx}": ["parcel-transformer-mdx"]
6+
}
7+
}

ReadMe.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# BootCell document
22

33
Re-implemented Official **Document site** of [BootStrap][1] & [FontAwesome][2]
4-
based on [WebCell][3], [BootCell][4] & [MarkCell][5]
4+
based on [WebCell][3], [BootCell][4] & [MDX][5]
55

6-
[![NPM Dependency](https://david-dm.org/EasyWebApp/BootCell-document.svg)][6]
7-
[![CI & CD](https://github.com/EasyWebApp/BootCell-document/workflows/CI%20&%20CD/badge.svg)][7]
6+
[![CI & CD](https://github.com/EasyWebApp/WebCell/actions/workflows/main.yml/badge.svg)][6]
87

98
[1]: https://getbootstrap.com/
109
[2]: https://fontawesome.com/
1110
[3]: https://web-cell.dev/
1211
[4]: https://web-cell.dev/BootCell/
13-
[5]: https://github.com/EasyWebApp/MarkCell
14-
[6]: https://david-dm.org/EasyWebApp/BootCell-document
15-
[7]: https://github.com/EasyWebApp/BootCell-document/actions
12+
[5]: https://mdxjs.com/
13+
[6]: https://github.com/EasyWebApp/BootCell-document/actions/workflows/main.yml

package.json

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,44 @@
33
"version": "1.0.0",
44
"description": "Re-implemented Official Document site of BootStrap & FontAwesome based on WebCell, BootCell & MarkCell",
55
"dependencies": {
6-
"@nuintun/qrcode": "^3.1.1",
7-
"boot-cell": "^1.9.5",
8-
"cell-router": "~2.0.4",
9-
"classnames": "^2.3.1",
10-
"github-web-widget": "^3.0.0-beta.9",
11-
"iterable-observer": "1.0.0-rc.0",
12-
"koajax": "^0.7.1",
6+
"@nuintun/qrcode": "^3.4.0",
7+
"boot-cell": "^2.0.0-beta.9",
8+
"cell-router": "^3.0.0-rc.5",
9+
"classnames": "^2.5.1",
10+
"dom-renderer": "^2.0.6",
11+
"github-web-widget": "^4.0.0-rc.1",
12+
"iterable-observer": "^1.0.1",
13+
"koajax": "^0.9.6",
1314
"lodash.groupby": "^4.6.0",
1415
"markdown-ime": "^1.0.3",
15-
"marked": "^4.0.12",
16-
"mobx": "^5.15.7",
17-
"mobx-web-cell": "^0.3.5",
16+
"marked": "^11.1.1",
17+
"mobx": "^6.12.0",
1818
"quill": "^1.3.7",
19-
"quill-image-uploader": "^1.2.2",
20-
"turndown": "^7.1.1",
19+
"quill-image-uploader": "^1.3.0",
20+
"turndown": "^7.1.2",
2121
"turndown-plugin-gfm": "^1.0.2",
22-
"web-cell": "~2.3.0",
23-
"web-utility": "^3.0.0"
22+
"web-cell": "^3.0.0-rc.8",
23+
"web-utility": "^4.1.3"
2424
},
2525
"devDependencies": {
26-
"@octokit/openapi-types": "^11.2.0",
27-
"@types/classnames": "^2.3.1",
28-
"@types/lodash.groupby": "^4.6.6",
29-
"autoprefixer": "^9.8.8",
30-
"husky": "^7.0.4",
31-
"less": "^4.1.2",
32-
"lint-staged": "^12.3.3",
33-
"mark-cell": "^0.4.9",
34-
"parcel-bundler": "^1.12.5",
35-
"postcss-modules": "^3.2.2",
36-
"prettier": "^2.5.1",
37-
"typescript": "~4.3.5",
38-
"workbox-cli": "^6.4.2"
26+
"@octokit/openapi-types": "^19.1.0",
27+
"@parcel/config-default": "~2.11.0",
28+
"@parcel/packager-raw-url": "~2.11.0",
29+
"@parcel/transformer-less": "~2.11.0",
30+
"@parcel/transformer-typescript-tsc": "~2.11.0",
31+
"@parcel/transformer-webmanifest": "~2.11.0",
32+
"@types/lodash.groupby": "^4.6.9",
33+
"@types/mdx": "^2.0.10",
34+
"@types/node": "^18.19.9",
35+
"husky": "^9.0.5",
36+
"lint-staged": "^15.2.0",
37+
"parcel": "~2.11.0",
38+
"parcel-transformer-mdx": "^0.3.1",
39+
"postcss": "^8.4.33",
40+
"postcss-modules": "^4.3.1",
41+
"prettier": "^3.2.4",
42+
"typescript": "~5.3.3",
43+
"workbox-cli": "^7.0.0"
3944
},
4045
"prettier": {
4146
"singleQuote": true,
@@ -46,19 +51,12 @@
4651
"lint-staged": {
4752
"*.{html,md,mdx,less,json,yml,ts,tsx}": "prettier --write"
4853
},
49-
"postcss": {
50-
"modules": true,
51-
"plugins": {
52-
"autoprefixer": {
53-
"grid": true
54-
}
55-
}
56-
},
5754
"scripts": {
55+
"prepare": "husky",
5856
"test": "lint-staged",
59-
"pack-mdx": "mark-cell document/source -p web-cell -f createCell",
57+
"clean": "rm -rf .parcel-cache/ dist/",
6058
"pack-tsx": "parcel build source/index.html --public-url .",
61-
"build": "rm -rf dist/ document/dist/ && npm run pack-mdx && npm run pack-tsx && workbox generateSW",
62-
"start": "npm run pack-mdx && parcel source/index.html --open"
59+
"build": "npm run clean && npm run pack-tsx && workbox generateSW",
60+
"start": "npm run clean && parcel source/index.html --open"
6361
}
6462
}

0 commit comments

Comments
 (0)