Skip to content

贡献指南

欢迎贡献代码、报告问题或提出建议!

开发环境设置

克隆仓库

bash
git clone https://github.com/ExploringTheCodeWorld/relationship-ts.git
cd relationship-ts

安装依赖

bash
pnpm install

开发命令

bash
# 开发模式(监听文件变化)
pnpm run dev

# 类型检查
pnpm run type-check

# 构建
pnpm run build

# 构建文档
pnpm run docs:dev

项目结构

relationship-ts/
├── src/
│   ├── core/           # 核心模块
│   │   ├── cache.ts    # 缓存系统(Map优化)
│   │   ├── id.ts       # 关系链转中文
│   │   ├── lru.ts      # LRU缓存实现
│   │   ├── mode.ts     # 模式管理
│   │   └── selector.ts # 中文转关系链
│   ├── data/           # 数据文件
│   ├── rules/          # 规则文件
│   ├── utils/          # 工具函数
│   ├── locale/         # 方言数据
│   ├── types.ts        # 类型定义
│   └── index.ts        # 主入口
├── docs/               # 文档
├── dist/               # 构建产物
├── rollup.config.mjs   # Rollup配置
├── gulpfile.mjs        # Gulp配置 (繁体转换)
└── tsconfig.json       # TypeScript配置

提交代码

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启 Pull Request

代码规范

  • 使用 TypeScript 编写所有代码
  • 遵循现有的代码风格
  • 为新功能添加类型定义
  • 确保所有测试通过
  • 更新相关文档

报告问题

如果你发现了 bug 或有功能建议,请在 GitHub Issues 中提出。

报告问题时,请提供:

  • 问题描述
  • 复现步骤
  • 预期行为
  • 实际行为
  • 环境信息(Node.js 版本、浏览器等)

许可证

通过贡献代码,你同意你的代码将基于 MIT License 发布。

基于 MIT 许可发布