Files
Local-Cursor/docs/build-environment.md

31 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

# 构建与发布环境
工具路径以当前会话为准,不依赖旧的 fnm 会话目录:
```powershell
Get-Command git, go, node, yarn, wails3, task, 7z
go version
go env GOROOT
```
- Go 使用项目固定的 1.26.10 工具链;Node.js 需满足 Vite 的引擎要求(本次验证为 Node 24)。
- 前端依赖通过 yarn.lock 和 security resolutions 固定,使用 `yarn --cwd frontend install --frozen-lockfile`。
- 修改 build/config.yml 版本后执行 `go run ./scripts/release sync-metadata`,仅同步版本字段,保留定制构建任务。
- `task release:prepare` 会构建平台资源;本次 Gitea 发布只上传压缩后的 Windows x64 便携 ZIP,避免同时保存 EXE、安装包和重复 ZIP。
- `bin/`、生成的 bindings/proto、node_modules 和运行数据不提交到 Git。
验证命令:
```powershell
go test ./...
go vet ./...
go test -race ./internal/backend/... ./internal/client/... ./internal/certs/... ./internal/skills/...
govulncheck ./...
yarn --cwd frontend test
yarn --cwd frontend audit --summary
yarn --cwd frontend build
```
Tab 服务是独立 Go 模块,需在 cursor-tab-server 下单独运行测试和扫描。
实际数据修改、证书迁移测试使用临时用户目录和模拟信任存储。Windows UI 诊断可使用 `Local-Cursor.exe --no-auto-start`;该选项不自动启用代理、安装根证书或注册快捷方式。