Commit Guidelines
This project uses Conventional Commits for consistent commit messages.
Making Commits
Section titled “Making Commits”Use the interactive commit tool:
pnpm commitThis will guide you through creating a properly formatted commit message.
Commit Message Format
Section titled “Commit Message Format”<type>(<scope>): <subject>
[optional body]
[optional footer]The type must be one of the following:
| Type | Description | Example |
|---|---|---|
feat | ✨ A new feature | feat(api): add user search endpoint |
fix | 🐛 A bug fix | fix(auth): resolve JWT validation error |
docs | 📝 Documentation changes | docs: update installation guide |
style | 💄 Code style changes | style(api): format with prettier |
refactor | ♻️ Code refactoring | refactor(db): simplify query logic |
perf | ⚡ Performance improvements | perf(stream): optimize video buffering |
test | ✅ Adding or updating tests | test(api): add auth integration tests |
build | 📦 Build system changes | build: update dependencies |
ci | 👷 CI/CD changes | ci: add automated release workflow |
chore | 🔧 Other changes | chore: update gitignore |
revert | ⏪ Revert a commit | revert: revert "feat: add feature" |
The scope is optional and represents the area of the codebase affected:
Available scopes:
api- Backend APIdatabase- Database changeswebsocket- WebSocket functionalitystream- Streaming featureslibrary- Library managementmovies- Movie-related featurestvshows- TV show featuresscan- Media scanningsettings- Settings functionalityauth- Authenticationmiddleware- Middlewareconfig- Configurationdeps- Dependenciesdocker- Docker configurationci- CI/CDdocs- Documentationrelease- Release management
You can also use custom scopes when needed.
Subject
Section titled “Subject”The subject contains a succinct description of the change:
- Use the imperative, present tense: “change” not “changed” nor “changes”
- Don’t capitalize the first letter
- No period (.) at the end
- Keep it under 100 characters
Good examples:
add user authenticationfix memory leak in stream handlerupdate API documentationBad examples:
Added user authentication (past tense)Fix Memory Leak (capitalized)updated API documentation. (period at end)The body is optional and should include:
- Motivation for the change
- Contrast with previous behavior
- Implementation details (if complex)
Use | to break lines in the interactive commit tool.
Footer
Section titled “Footer”The footer is optional and should include:
- Breaking changes (prefixed with
BREAKING CHANGE:) - Issue references (e.g.,
Closes #123)
Breaking Changes
Section titled “Breaking Changes”Breaking changes must be indicated in two ways:
-
Add
!after the type/scope:feat(api)!: redesign authentication API -
Add
BREAKING CHANGE:in the footer:feat(api)!: redesign authentication APIReplace REST authentication with OAuth2 flowBREAKING CHANGE: The /auth/login endpoint has been removed.Use OAuth2 flow instead. See migration guide for details.
Examples
Section titled “Examples”Feature Addition
Section titled “Feature Addition”feat(api): add user search endpoint
Implement search functionality for users with filters:- Search by username- Search by email- Pagination support
Closes #42Bug Fix
Section titled “Bug Fix”fix(auth): resolve JWT validation error
Fix issue where expired tokens were not properly rejected,causing 401 errors on valid requests.
Fixes #123Breaking Change
Section titled “Breaking Change”feat(api)!: redesign authentication API
Replace REST authentication endpoints with OAuth2 flowfor improved security and standards compliance.
BREAKING CHANGE: The following endpoints have been removed:- POST /auth/login- POST /auth/register
Use the new OAuth2 flow instead. See docs/migration.md formigration guide.
Closes #56Documentation Update
Section titled “Documentation Update”docs: update versioning guide
Add examples for breaking changes and clarifywhen to create changesets.Performance Improvement
Section titled “Performance Improvement”perf(stream): optimize video buffering
Reduce initial buffering time by 50% through:- Implement adaptive bitrate streaming- Optimize chunk size- Add memory caching layerRefactoring
Section titled “Refactoring”refactor(database): simplify query logic
Extract common query patterns into reusable functionsto reduce code duplication and improve maintainability.Multiple Changes
Section titled “Multiple Changes”If you have multiple logical changes, make separate commits:
# Commit 1git add src/auth/pnpm commit# feat(auth): add OAuth2 support
# Commit 2git add src/api/pnpm commit# docs(api): update authentication examplesCommit Message Validation
Section titled “Commit Message Validation”Commits are automatically validated using commitlint. If your commit message doesn’t follow the convention, you’ll see an error:
⧗ input: Added new feature✖ subject may not be empty [subject-empty]✖ type may not be empty [type-empty]Best Practices
Section titled “Best Practices”- Atomic commits - One logical change per commit
- Clear subjects - Describe what changed, not how
- Add context - Use the body for complex changes
- Reference issues - Link to relevant issues
- Break changes properly - Always document breaking changes
- Test before committing - Ensure tests pass
- Use the interactive tool -
pnpm commithelps you follow the format