docs: add contributing guides + link docs from README

This commit is contained in:
youzini
2026-05-31 17:11:19 +00:00
parent efbf5e3505
commit e80ca7ed9a
4 changed files with 166 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
# 本地开发
## 安装依赖
```bash
npm install
```
## 常用命令
| 命令 | 作用 |
| --- | --- |
| `npm run check` | 语法检查(`typescript-language-server` 不可用时作为 LSP 诊断替代) |
| `npm run test:stable` | 稳定测试集(自动扫描 `tests/*.mjs` |
| `npm run test:p0` | P0 主回归 |
| `npm run test:persistence-matrix` | 持久化矩阵p0 + runtime-history + graph-persistence + indexeddb |
| `npm run test:index-slicing-ratchet` | 防止测试切片 `index.js` 的防线 |
| `npm run test:runtime-deps` | 依赖注入完整性守卫 |
| `npm run build:native:wasm` | 构建 Native WASM |
| `npm run version:bump-manifest` | 更新 manifest 版本 |
控制面/数据格式专项测试见 [`testing.md`](testing.md)。
## 提交前
至少运行:
```bash
npm run check
npm run test:stable
```
涉及具体子系统时,额外跑对应专项测试。
## 分支工作流
- 功能开发推到 `dev` 分支,不直接推 `main`
- 合并带 `manifest.json` 版本冲突的分支时,保留更高的版本号。
- 远端 `dev` 常有自动版本 bumpmerge 时按上面规则处理,不要 force push。
## 环境提示
- `typescript-language-server` 在当前环境未安装,用 `npm run check` 作为 LSP 诊断替代。
- git 身份缺失时,按命令注入 `GIT_AUTHOR_*` / `GIT_COMMITTER_*` 环境变量,不要改 git config。