1
0

chore: streamline workspace make workflows

Clarify product-level server and desktop commands while moving backend-only maintenance tasks into backend/Makefile. This keeps root automation focused on core flows and aligns the main OpenSpec specs with the new command boundaries.
This commit is contained in:
2026-04-28 17:44:23 +08:00
parent a9972360c2
commit 2c401f7ae6
8 changed files with 411 additions and 266 deletions

View File

@@ -437,24 +437,37 @@ docker run -d -e NEX_SERVER_PORT=9000 -e NEX_LOG_LEVEL=info nex-server
## 测试
```bash
# 运行所有测试
# 运行 backend 默认测试
make test
# 分类测试
make test-unit
make test-integration
# 生成覆盖率报告
make test-coverage
# MySQL 专项测试
make mysql-up
make mysql-down
make mysql-test
make mysql-test-quick
```
## 数据库迁移
```bash
# 使用 Makefile
make migrate-up DB_PATH=~/.nex/config.db
make migrate-down DB_PATH=~/.nex/config.db
make migrate-status DB_PATH=~/.nex/config.db
make migrate-up DB_DSN=~/.nex/config.db
make migrate-down DB_DSN=~/.nex/config.db
make migrate-status DB_DSN=~/.nex/config.db
# 创建新迁移
make migrate-create
# MySQL 迁移
make migrate-up DB_DRIVER=mysql DB_DSN='user:pass@tcp(localhost:3306)/nex'
# 或直接使用 goose
goose -dir migrations sqlite3 ~/.nex/config.db up
```
@@ -571,9 +584,12 @@ GET /anthropic/v1/models
## 开发
```bash
make build # 构建
make lint # 代码检查
make deps # 整理依赖
make build # 构建 backend/bin/server
make run # 运行后端服务
make lint # 代码检查
make clean # 清理 backend 构建产物
go mod tidy # 整理依赖
go generate ./... # 刷新 mock 等生成代码
```
环境要求Go 1.26 或更高版本