mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-06-28 16:35:55 +08:00
1.3 KiB
1.3 KiB
贡献指南
本地开发环境
- Node.js 22+
- Rust 1.95+ (stable-x86_64-pc-windows-gnu)
- MinGW-w64 (GCC 15.x 需
-lmcfgthread链接标志) - Windows 10+ (自带 WebView2)
开发流程
- Fork 本仓库
git clone <你的 fork>git checkout -b feature/xxx- 开发 + 测试
git commit(遵循约定式提交格式)git push- 提交 Pull Request
运行测试
# 前端单元测试
npm test
# Rust 测试
cargo test
# TypeScript 类型检查
npx tsc -b
# Clippy 检查
cargo clippy -- -D warnings
代码规范
TypeScript
strict: true,零编译错误- 核心逻辑在
src/core/,纯函数,零框架依赖 - 不可变操作优先
Rust
- 所有
pub fn必须有///文档注释 - 所有
unsafe块必须有// SAFETY:注释 cargo clippy -- -D warnings零警告cargo fmt统一格式
提交格式
<类型>: <描述>
类型:feat, fix, refactor, docs, test, chore, perf, ci
项目结构
core/ # Rust 游戏核心库(零 Tauri 依赖)
gui/ # Tauri 桌面应用
src/ # React 前端 + 内联 vitest 测试
开始贡献前
- 大改动建议先开 Issue 讨论
- 新功能需要对应的测试
- 不要引入新的 clippy 警告