Files
proxycast/docs/content/06.development/2.contributing.md
T
coso 267bbf75e3 feat: add documentation system with Docus framework
- Add complete documentation structure with 25+ markdown files
- Add introduction, user guide, provider configs, API reference
- Add troubleshooting and development guides
- Add disclaimer for legal use
- Add GitHub Actions workflow for auto-deploying docs to GitHub Pages
- Bump version to v0.11.0
2025-12-17 13:10:58 +08:00

201 lines
3.0 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.
---
title: 贡献指南
description: 如何为 ProxyCast 做贡献
navigation:
icon: i-heroicons-heart
---
# 贡献指南
感谢你对 ProxyCast 的关注!本指南帮助你开始贡献。
## 开发环境设置
### 前置要求
| 工具 | 版本 |
|------|------|
| Node.js | >= 18 |
| pnpm | >= 8 |
| Rust | >= 1.70 |
| Tauri CLI | >= 2.0 |
### 安装依赖
```bash
# 克隆仓库
git clone https://github.com/aiclientproxy/proxycast.git
cd proxycast
# 安装前端依赖
pnpm install
# 安装 Tauri CLI
cargo install tauri-cli
```
### 开发模式
```bash
# 启动开发服务器
pnpm tauri dev
```
### 构建
```bash
# 构建发布版本
pnpm tauri build
```
## 代码规范
### TypeScript/React
- 使用 ESLint 和 Prettier
- 遵循 React Hooks 规范
- 组件使用函数式写法
```bash
# 检查代码
pnpm lint
# 格式化代码
pnpm format
```
### Rust
- 使用 rustfmt 格式化
- 使用 clippy 检查
- 遵循 Rust API Guidelines
```bash
# 格式化
cargo fmt
# 检查
cargo clippy
```
### 提交规范
使用 Conventional Commits:
```
feat: 添加新功能
fix: 修复 bug
docs: 更新文档
style: 代码格式调整
refactor: 代码重构
test: 添加测试
chore: 构建/工具变更
```
示例:
```
feat(credential): 添加 Qwen 凭证支持
fix(router): 修复路由规则匹配问题
docs: 更新安装指南
```
## PR 流程
### 1. Fork 仓库
在 GitHub 上 Fork 项目到你的账户。
### 2. 创建分支
```bash
git checkout -b feature/your-feature
```
### 3. 开发和测试
- 编写代码
- 添加测试
- 确保所有测试通过
### 4. 提交代码
```bash
git add .
git commit -m "feat: your feature description"
git push origin feature/your-feature
```
### 5. 创建 PR
1. 在 GitHub 上创建 Pull Request
2. 填写 PR 描述
3. 等待 Review
### PR 检查清单
- [ ] 代码通过 lint 检查
- [ ] 添加了必要的测试
- [ ] 更新了相关文档
- [ ] 提交信息符合规范
## 项目结构
```
proxycast/
├── src/ # 前端源码
│ ├── components/ # React 组件
│ ├── pages/ # 页面组件
│ ├── hooks/ # 自定义 Hooks
│ ├── lib/ # 工具函数
│ └── styles/ # 样式文件
├── src-tauri/ # Rust 后端
│ ├── src/ # 源码
│ ├── Cargo.toml # 依赖配置
│ └── tauri.conf.json # Tauri 配置
├── docs/ # 文档
└── public/ # 静态资源
```
## 测试
### 前端测试
```bash
# 运行测试
pnpm test
# 运行测试并生成覆盖率
pnpm test:coverage
```
### 后端测试
```bash
cd src-tauri
cargo test
```
## 问题反馈
### 报告 Bug
1. 搜索是否已有相同问题
2. 创建新 Issue
3. 提供详细信息:
- 操作系统和版本
- ProxyCast 版本
- 复现步骤
- 错误日志
### 功能建议
1. 创建 Feature Request Issue
2. 描述功能需求
3. 说明使用场景
## 社区
- GitHub Issues: 问题反馈
- GitHub Discussions: 讨论交流