Files
im-system/CONTRIBUTING.md
T

51 lines
1.6 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.
# 贡献指南
欢迎为 im-system 贡献代码。请遵循以下约定,让协作更顺畅。
## 分支命名
- `main`:稳定分支,只接受已 review 的合并。
- 功能分支:`feat/描述``fix/描述``refactor/描述`(例:`feat/login-flow``fix/kafka-reconnect`)。
## 提交信息
使用 [Conventional Commits](https://www.conventionalcommits.org/zh-hans/)
```
<type>(<scope>): <subject>
```
- `type``feat` / `fix` / `docs` / `style` / `refactor` / `perf` / `test` / `build` / `chore`
- `scope`(可选):`backend``gateway``im-service``log-service``frontend``admin``app`
示例:
```
feat(im-service): 发送心跳日志到 Kafka
fix(gateway): 修正 /api/im 路由谓词
```
## 代码风格
- **后端(Kotlin**:遵循 [Kotlin 官方风格](https://kotlinlang.org/docs/coding-conventions.html);类名大驼峰、函数/变量小驼峰;Spring Bean 用构造注入;公开 API 写简短 KDoc。
- **前端(Vue 3 + TS**`<script setup lang="ts">`;组件/文件用 PascalCase 命名,目录 kebab-case;类型尽量显式,禁用 `any`;样式用 scoped。
- 提交前保证 `pnpm type-check``./gradlew build` 通过。
## 测试
- 后端:`./gradlew test`
- 前端:`pnpm -r test`(当前骨架未含测试框架,补充后生效)
## 提交流程
1.`main` 拉取最新并切功能分支。
2. 小步提交,信息符合规范。
3. 本地跑通构建与相关测试。
4. 发起 Pull Request 到 `main`,描述改动动机与验证方式。
5. Review 通过后由维护者合入。
## 环境准备
见 [DEVELOPMENT.md](DEVELOPMENT.md)。