conventional-commits

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Conventional Commits

约定式提交(Conventional Commits)

This project follows the Conventional Commits specification for commit messages.
本项目遵循 Conventional Commits 规范编写提交信息。

Commit Format

提交格式

type(scope): description

[optional body]

[optional footer]
type(scope): description

[optional body]

[optional footer]

Commit Types

提交类型

Use one of these types:
  • feat
    - A new feature
  • fix
    - A bug fix
  • docs
    - Documentation only changes
  • chore
    - Maintenance tasks, dependency updates, config changes
  • refactor
    - Code restructuring without changing behavior
  • test
    - Adding or updating tests
  • style
    - Formatting, whitespace, missing semicolons (no code change)
  • perf
    - Performance improvements
  • ci
    - CI/CD configuration changes
  • build
    - Build system or external dependencies changes
请使用以下类型之一:
  • feat
    - 新增功能
  • fix
    - 漏洞修复
  • docs
    - 仅文档变更
  • chore
    - 维护任务、依赖更新、配置变更
  • refactor
    - 不改变代码行为的重构
  • test
    - 新增或更新测试
  • style
    - 格式调整、空格处理、补全缺失分号(无代码逻辑变更)
  • perf
    - 性能优化
  • ci
    - CI/CD 配置变更
  • build
    - 构建系统或外部依赖变更

Scope

作用域

Scope is optional but recommended for monorepo projects. Use workspace/app names:
  • cms
    - CMS/Payload changes
  • clients
    - Clients app changes
  • lawyers
    - Lawyers app changes
  • website
    - Website app changes
  • packages
    - Shared package changes
Examples:
  • feat(cms): add new collection
  • fix(clients): resolve form validation issue
  • docs(website): update API documentation
作用域为可选项,但在 monorepo 项目中推荐使用。可使用工作区/应用名称:
  • cms
    - CMS/Payload 相关变更
  • clients
    - 客户端应用相关变更
  • lawyers
    - 律师端应用相关变更
  • website
    - 官网应用相关变更
  • packages
    - 共享包相关变更
示例:
  • feat(cms): add new collection
  • fix(clients): resolve form validation issue
  • docs(website): update API documentation

Description

描述要求

  • Use imperative mood ("add" not "added" or "adds")
  • Lowercase first letter (unless starting with proper noun)
  • No period at the end
  • Keep it concise (50-72 characters recommended)
  • 使用祈使语气(用 "add" 而非 "added" 或 "adds")
  • 首字母小写(以专有名词开头的情况除外)
  • 末尾不加句号
  • 保持简洁(推荐长度为 50-72 个字符)

Examples

示例

Good:
feat: introduce editors field for enhanced content management
docs: add AI Elements skill for manual component installation
fix: add CollectionCards to import map for UI components
refactor: simplify AI chat components and enhance conversation handling
chore: update dependencies and configurations for CMS packages
feat(cms): add new blog post collection
fix(clients): resolve authentication token expiration
Bad:
Added new feature
fix bug
Update README.md
feat: Added new feature for users
fix(clients): Fixed the bug that was causing issues
正确示例:
feat: introduce editors field for enhanced content management
docs: add AI Elements skill for manual component installation
fix: add CollectionCards to import map for UI components
refactor: simplify AI chat components and enhance conversation handling
chore: update dependencies and configurations for CMS packages
feat(cms): add new blog post collection
fix(clients): resolve authentication token expiration
错误示例:
Added new feature
fix bug
Update README.md
feat: Added new feature for users
fix(clients): Fixed the bug that was causing issues

When to Use Each Type

各类型使用场景

feat - New functionality that users will notice fix - Bug fixes that resolve incorrect behavior docs - README, comments, documentation files chore - Package.json updates, lock files, config tweaks refactor - Restructuring code without changing what it does test - Test files only style - Code style changes (formatting, whitespace) perf - Performance optimizations ci - GitHub Actions, CI config files build - Build tools, bundlers, transpilers
feat - 用户可感知的新增功能 fix - 修复错误行为的漏洞补丁 docs - README、代码注释、文档文件相关变更 chore - Package.json 更新、锁文件变更、配置调整 refactor - 不改变代码原有功能的结构调整 test - 仅测试文件相关变更 style - 代码风格变更(格式化、空格调整等) perf - 性能优化 ci - GitHub Actions、CI 配置文件相关变更 build - 构建工具、打包器、转译器相关变更

Multi-line Commits

多行提交

For complex changes, use body:
feat(cms): add draft/publish workflow

- Add draft status field to collections
- Implement publish endpoint
- Add validation for draft content
针对复杂变更,可添加正文:
feat(cms): add draft/publish workflow

- Add draft status field to collections
- Implement publish endpoint
- Add validation for draft content