Files
FootPrint/CONTRIBUTING.md
T

38 lines
1.4 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.
# 贡献指南
欢迎 Issue 与 PR!开始之前:
## 环境要求
- Node.js ≥ 22.5(推荐 24,`node:sqlite` 依赖)
- 前端构建:npm 或 pnpm
- 桌面端构建(可选):Rust stable + MSVC Build Tools(Windows)
## 开发流程
1. Fork / 建分支:`git checkout -b feat/your-feature`
2. 提交信息用约定式前缀:`feat: / fix: / docs: / chore: / ci: / refactor:`
3. 本地跑绿再推:
```bash
git config core.hooksPath .githooks # 每个克隆只需一次
node scripts/check.mjs
node scripts/test-integration.mjs
```
启用钩子后,push 会自动跑同一套检查;工作区有未提交变更或测试失败时 push 会被拒绝。
## 约定
- 服务端保持**零 npm 依赖**(只用 Node 内置模块);确需引入依赖请先开 Issue 讨论
- 改动 `app/server/db.mjs`(命令层)时注意:Web / 桌面 / 播种三处共用它,测试必须全绿
- 涉及 schema 变更:保证老库能平滑迁移(参考 `preMigrateColumns` 的加列模式),并在
`scripts/test-integration.mjs` 补断言
- 涉及 Service Worker:接口类请求(/api /auth /admin /sync)永远不得缓存
- UI 改动请同时适配亮/暗两套主题(令牌见 `app/src/styles/theme.css`)
## Issue
- Bug 报告请附:复现步骤、期望/实际行为、服务端日志(`docker logs footprints-sync`)
- 功能建议请说明使用场景,最好附上你期望的记录/检索形态