Ziya/.github/COMMIT_CONVENTION.md

2.1 KiB

Commit Convention Guide

This project uses Conventional Commits with changelogen for automatic changelog generation.

Commit Message Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types

Type Emoji Description Version Bump
feat 🚀 New features minor
fix 🐛 Bug fixes patch
docs 📖 Documentation changes patch
style 💄 Code style changes patch
refactor ♻️ Code refactoring patch
perf Performance improvements patch
test Adding tests patch
build 🏗️ Build system changes patch
ci 🤖 CI/CD changes patch
chore 🧹 Maintenance tasks patch
revert Reverting changes patch

Examples

Feature

git commit -m "feat: add user authentication system"

Bug Fix

git commit -m "fix: resolve login validation error"

Breaking Change

git commit -m "feat: redesign API structure

BREAKING CHANGE: API endpoints have changed from /api/v1 to /api/v2"

With Scope

git commit -m "feat(theme): add dark mode support"

Changelog Scripts

Generate Changelog

pnpm run changelog

Release with Changelog

pnpm run changelog:release

Full Release Workflow

pnpm run release

Best Practices

  1. Use present tense: "add feature" not "added feature"
  2. Use imperative mood: "fix bug" not "fixes bug"
  3. Keep first line under 72 characters
  4. Reference issues: "fix: resolve login issue (#123)"
  5. Include breaking changes: Always document breaking changes in footer
  6. Be descriptive: Explain what and why, not how

Scopes (Optional)

Common scopes for this project:

  • theme - Theme system changes
  • eslint - ESLint configuration
  • ui - User interface components
  • auth - Authentication system
  • electron - Electron-specific changes
  • build - Build system changes