Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] upgrade to WebCell v3, CellRouter v3 & BootCell v2 #46

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@
"jsx": true
}
},
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-unused-vars": "warn"
"prefer-const": "warn",
"no-unused-vars": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-ts-comment": "warn"
}
}
37 changes: 28 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,41 @@ on:
- master
jobs:
Build-and-Deploy:
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
node-version: '14'
- name: Install & build
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install & Build
run: |
npm install
npm run build
- name: Deploy
pnpm i --frozen-lockfile
pnpm build

- name: Deploy to GitHub pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./dist
cname: web-conf.dev
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./dist
vercel-args: --prod
35 changes: 35 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Commit preview
on:
push:
branches-ignore:
- master
jobs:
Build-and-Deploy:
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install & Build
run: |
pnpm i --frozen-lockfile
pnpm build

- uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./dist
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
node_modules/
package-lock.json
yarn.lock
dist/
.cache/
.husky/_/
.parcel-cache/
.husky/
.idea/
.vscode/
.DS_Store
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
registry=https://registry.npm.taobao.org
auto-install-peers = false
8 changes: 8 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.{ts,tsx}": [
"@parcel/transformer-typescript-tsc"
]
}
}
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# 成都 Web 开发者大会

[![NPM Dependency](https://david-dm.org/FreeCodeCamp-Chengdu/Web-Conf.svg)][1]
[![CI & CD](https://github.com/FreeCodeCamp-Chengdu/Web-Conf/workflows/CI%20&%20CD/badge.svg)][2]
[![CI & CD](https://github.com/FreeCodeCamp-Chengdu/Web-Conf/actions/workflows/main.yml/badge.svg)][2]
[![TechConf](https://img.shields.io/badge/TechConf-Chinese-red)][3]

## 官网地址
Expand All @@ -14,21 +13,22 @@ https://github.com/FreeCodeCamp-Chengdu/Web-Conf/graphs/contributors

## 技术栈

- 逻辑语言: [TypeScript v4][4]
- 组件引擎: [WebCell v2][5]
- 组件库: [BootCell v1][6]
- 状态管理: [MobX v5][7]
- 打包工具: [Parcel v1][8]
- 逻辑语言: [TypeScript v5][4]
- 组件引擎: [WebCell v3][5]
- 组件库: [BootCell v2][6]
- 状态管理: [MobX v6][7]
- 打包工具: [Parcel v2][8]

## 本地开发

### 安装工程

```shell
git clone https://github.com/FreeCodeCamp-Chengdu/Web-Conf.git
cd Web-Conf

npm install

npm i pnpm -g
pnpm i
npm start
```

Expand All @@ -42,9 +42,8 @@ npm start
node toolkit/import-assets path/to/media/folder
```

[1]: https://david-dm.org/FreeCodeCamp-Chengdu/Web-Conf
[2]: https://github.com/FreeCodeCamp-Chengdu/Web-Conf/actions
[3]: https://github.com/hax/chinese-tech-conf-schedule
[2]: https://github.com/FreeCodeCamp-Chengdu/Web-Conf/actions/workflows/main.yml
[3]: https://github.com/b-conf/chinese-tech-conf-schedule
[4]: https://typescriptlang.org
[5]: https://web-cell.dev/
[6]: https://bootstrap.web-cell.dev/
Expand Down
83 changes: 35 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-conf",
"version": "3.1.0",
"version": "3.2.0",
"description": "Web Developer Conference in Chengdu, China",
"keywords": [
"Web",
Expand All @@ -22,67 +22,54 @@
"scripts": {
"prepare": "husky install",
"test": "lint-staged",
"start": "parcel source/index.html --open",
"clean": "rm -rf dist/ .parcel-cache/",
"start": "npm run clean && parcel source/index.html --open",
"pack-sw": "rm -f dist/sw.js.map && workbox generateSW",
"build": "rm -rf dist/ .cache/ && parcel build source/index.html --public-url . && npm run pack-sw"
"build": "npm run clean && parcel build source/index.html --public-url . && npm run pack-sw"
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"eslint --fix"
],
"*.{ts,tsx}": "eslint --fix",
"*.{html,md,css,less,js,ts,tsx,json}": "prettier --write"
},
"dependencies": {
"boot-cell": "^1.9.5",
"boot-cell": "^2.0.0-beta.9",
"browser-unhandled-rejection": "^1.0.2",
"cell-router": "^2.0.4",
"classnames": "^2.3.1",
"html-to-image": "^1.6.2",
"koajax": "^0.6.5",
"cell-router": "^3.0.0-rc.5",
"classnames": "^2.5.1",
"dom-renderer": "^2.0.6",
"html-to-image": "^1.11.11",
"koajax": "^0.9.6",
"lodash.groupby": "^4.6.0",
"marked": "^2.1.3",
"mobx": "^5.15.7",
"mobx-web-cell": "^0.3.4",
"web-cell": "^2.3.0",
"web-utility": "^2.4.4"
"marked": "^11.1.1",
"mobx": "^6.12.0",
"mobx-i18n": "^0.5.0",
"web-cell": "^3.0.0-rc.8",
"web-utility": "^4.1.3"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@types/classnames": "^2.3.1",
"@types/lodash.groupby": "^4.6.6",
"@types/marked": "^2.0.3",
"@typescript-eslint/parser": "^4.28.0",
"autoprefixer": "^9.8.6",
"eslint": "^7.29.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"less": "^4.1.1",
"lint-staged": "^11.0.0",
"parcel-bundler": "^1.12.5",
"parcel-plugin-text": "^0.9.7",
"postcss-modules": "^3.2.2",
"prettier": "^2.3.2",
"typescript": "^4.3.4",
"workbox-cli": "^6.1.5"
"@parcel/config-default": "~2.11.0",
"@parcel/packager-raw-url": "~2.11.0",
"@parcel/transformer-less": "~2.11.0",
"@parcel/transformer-typescript-tsc": "~2.11.0",
"@parcel/transformer-webmanifest": "~2.11.0",
"@types/lodash.groupby": "^4.6.9",
"@types/node": "^18.19.8",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"parcel": "~2.11.0",
"postcss": "^8.4.33",
"postcss-modules": "^4.3.1",
"prettier": "^3.2.4",
"typescript": "~5.3.3",
"workbox-cli": "^7.0.0"
},
"prettier": {
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid"
},
"postcss": {
"modules": true,
"plugins": {
"autoprefixer": {
"grid": true
}
}
},
"parcel-plugin-text": {
"extensions": [
"csv"
]
}
}
Loading