Files
cmbone/README.md
T

81 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# cmbone
基于 SuiDemo 迁移而来的 Wails v3 桌面项目,已从模板仓库整理为可直接维护和构建的普通工程。
## 技术栈
- 后端:Go 1.23.0、Wails v3.0.0-alpha.9、SQLite
- 前端:Vue 3、TypeScript、Vite、Tailwind CSS、Ant Design Vue
- 功能:多语言、主题切换、本地配置、快捷键、OCR 示例
## 环境准备
当前项目按本机 Go 1.23.0 锁定依赖,不要直接安装 `wails3@latest`。
```powershell
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.9
```
如果安装后 PowerShell 找不到 `wails3`,把 Go bin 目录加入当前终端 PATH:
```powershell
$env:Path += ";$(go env GOPATH)\bin"
wails3 doctor
```
## 目录结构
```text
.
├── main.go # Wails 应用入口
├── internal/
│ ├── models/ # 后端数据模型
│ └── services/ # 后端服务和数据库逻辑
├── platform/ # Windows/macOS 平台差异代码
├── frontend/
│ ├── src/ # Vue 前端源码
│ ├── bindings/ # Wails 前端绑定
│ └── dist/ # 前端构建产物,供 Go embed 使用
└── build/ # Wails 构建配置
```
## 常用命令
```bash
go test ./...
cd frontend
npm install
npm run build
```
安装 `wails3` 后可以使用:
```bash
wails3 dev
wails3 package
```
## 维护约定
- Go 模块名统一为 `cmbone`。
- 当前依赖按系统 Go 1.23.0 锁定,升级 Go 前不要随意升级 Wails、SQLite 或热键库。
- 修改后端服务后,优先使用 `wails3 generate bindings` 重新生成 `frontend/bindings`;如果本机没有 CLI,只做小范围手动绑定。
- 提交前至少运行 `go test ./...` 和 `npm run build`。
## Harness Coding 文档
本项目已接入 Harness Coding 文档,用于让后续维护者和 AI coding agent 快速恢复上下文、领取任务并验证改动。
- [`AGENTS.md`](AGENTS.md):仓库级 agent 入口。
- [`docs/00-ai-start-here.md`](docs/00-ai-start-here.md):固定开工流程。
- [`docs/current-state.md`](docs/current-state.md):当前真实状态和命令。
- [`docs/06-tasks.md`](docs/06-tasks.md):任务看板。
- [`progress.md`](progress.md):执行流水和验证证据。
统一验证入口:
```powershell
.\init.ps1
```