Skip to content

Commit 7522fb5

Browse files
committed
chore: add quality gates
1 parent c496e17 commit 7522fb5

5 files changed

Lines changed: 3455 additions & 4980 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,30 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v3
15-
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: '18'
14+
uses: actions/checkout@v4
2015

2116
- name: Setup pnpm
2217
uses: pnpm/action-setup@v4
2318
with:
2419
version: 9
2520

21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '18'
25+
cache: pnpm
26+
2627
- name: Install dependencies
27-
run: pnpm install
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Type check
31+
run: pnpm run typecheck
32+
33+
- name: Test
34+
run: pnpm test
35+
36+
- name: Lint
37+
run: pnpm run lint
2838

2939
- name: Build
3040
env:

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
## 简介
1010

11-
`umi-react-admin` 是一个基于 `react``umi max` 的模版系统, 一款开源免费且开箱即用的系统模版, 使用了最新的 `Umi4.x`, `React18.x` , `antd5.x` , `Tailwindcss` , `CSS in JS` , `TypeScript` , `ProComponents` 等主流技术开发。目前已包括, `Formily(低代码设计器)`, `日历`, `富文本(tinymce)`, `拖放界面`, `地图(Cesium, 高德, OpenLayers)`, `音频/视频播放器`, `签名`, `音频可视化`, `多语言`等模块功能。
11+
`umi-react-admin` 是一个基于 `react``umi max` 的模板系统, 一款开源免费且开箱即用的系统模板, 使用了最新的 `Umi4.x`, `React18.x` , `antd5.x` , `Tailwindcss` , `CSS in JS` , `TypeScript` , `ProComponents` 等主流技术开发。目前已包括, `Formily(低代码设计器)`, `日历`, `富文本(tinymce)`, `拖放界面`, `地图(Cesium, 高德, OpenLayers)`, `音频/视频播放器`, `签名`, `音频可视化`, `多语言`等模块功能。
1212

1313
## 安装使用
1414

15-
首先得有 node,并确保 node 版本是 14 或以上。(推荐用 nvm 来管理 node 版本,windows 下推荐用 nvm-windows)
15+
首先得有 Node.js,并确保 Node.js 版本是 18 或以上。(推荐用 nvm 来管理 Node.js 版本,Windows 下推荐用 nvm-windows)
1616

1717
- 获取项目代码
1818

@@ -34,6 +34,16 @@ pnpm install
3434
pnpm start
3535
```
3636

37+
## 常用脚本
38+
39+
```bash
40+
pnpm lint # 运行 Umi Max lint
41+
pnpm typecheck # TypeScript 类型检查
42+
pnpm test # 运行项目测试
43+
pnpm check # 依次运行类型检查、lint 和测试
44+
pnpm build # 生产构建
45+
```
46+
3747
## Contributors ✨
3848

3949
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
"scripts": {
55
"build": "max build",
66
"build:github": "cross-env UMI_ENV=github max build",
7+
"check": "pnpm typecheck && pnpm lint && pnpm test",
78
"format": "prettier --cache --write .",
89
"postinstall": "max setup",
10+
"lint": "max lint",
911
"prepare": "husky install",
1012
"preview": "pnpm build && pnpm max preview --port 8001",
1113
"setup": "max setup",
1214
"start": "cross-env max dev",
13-
"start:github": "cross-env UMI_ENV=github max dev"
15+
"start:github": "cross-env UMI_ENV=github max dev",
16+
"test": "node --test scripts/*.test.mjs",
17+
"typecheck": "tsc --noEmit"
1418
},
1519
"lint-staged": {
1620
"*.{js,jsx,ts,tsx,css,less}": [

0 commit comments

Comments
 (0)