docs: add harness coding documentation
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
# 技术栈
|
||||
|
||||
## 后端
|
||||
|
||||
- Go:`1.23.0`
|
||||
- 桌面框架:`github.com/wailsapp/wails/v3 v3.0.0-alpha.9`
|
||||
- 本地数据库:`modernc.org/sqlite v1.38.2`
|
||||
- 系统热键:`golang.design/x/hotkey v0.4.1`
|
||||
|
||||
Wails CLI 安装命令:
|
||||
|
||||
```powershell
|
||||
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.9
|
||||
```
|
||||
|
||||
不要直接安装 `wails3@latest`,避免 CLI、Go SDK 和前端 runtime 版本不匹配。
|
||||
|
||||
## 前端
|
||||
|
||||
- Vue:`^3.2.45`
|
||||
- TypeScript:`^4.9.3`
|
||||
- Vite:`^8.1.3`
|
||||
- Wails runtime:`@wailsio/runtime 3.0.0-alpha.66`
|
||||
- UI:Ant Design Vue `^4.2.6`
|
||||
- 样式:Tailwind CSS `^3.4.1`
|
||||
- 国际化:Vue I18n `^11.1.5`
|
||||
|
||||
## 目录职责
|
||||
|
||||
```text
|
||||
.
|
||||
├── main.go # Wails 应用入口、服务注册、资源嵌入
|
||||
├── internal/
|
||||
│ ├── models/ # 数据模型
|
||||
│ └── services/ # Wails 服务、配置、数据库、热键、OCR
|
||||
├── platform/ # Windows / macOS 平台差异实现
|
||||
├── frontend/
|
||||
│ ├── src/ # Vue 源码
|
||||
│ ├── bindings/ # Wails 生成的前端绑定
|
||||
│ └── dist/ # 前端构建产物,git 忽略
|
||||
├── build/ # Wails 打包配置
|
||||
└── docs/ # Harness Coding 文档
|
||||
```
|
||||
|
||||
## 常用命令
|
||||
|
||||
安装前端依赖:
|
||||
|
||||
```powershell
|
||||
cd frontend
|
||||
npm install
|
||||
```
|
||||
|
||||
后端测试:
|
||||
|
||||
```powershell
|
||||
go test ./...
|
||||
```
|
||||
|
||||
前端构建:
|
||||
|
||||
```powershell
|
||||
cd frontend
|
||||
npm run build
|
||||
```
|
||||
|
||||
后端编译:
|
||||
|
||||
```powershell
|
||||
go build -o bin\cmbone.exe .
|
||||
```
|
||||
|
||||
统一验证入口:
|
||||
|
||||
```powershell
|
||||
.\init.ps1
|
||||
```
|
||||
|
||||
开发启动:
|
||||
|
||||
```powershell
|
||||
wails3 dev
|
||||
```
|
||||
|
||||
打包:
|
||||
|
||||
```powershell
|
||||
wails3 package
|
||||
```
|
||||
|
||||
## 版本升级规则
|
||||
|
||||
- 升级 Go 前,先确认 Wails v3 alpha、SQLite 和热键库的兼容性。
|
||||
- 升级 Wails 后,同时检查 `@wailsio/runtime` 和 `frontend/bindings`。
|
||||
- 升级 Vite / TypeScript 后,必须跑 `npm run build`。
|
||||
- 依赖升级必须单独提交,不和业务功能混在一起。
|
||||
Reference in New Issue
Block a user