First off, thank you for considering contributing to commit-emoji! It's people like you that make commit-emoji such a great tool.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples (code samples, screenshots, etc.)
- Describe the behavior you observed and what you expected
- Include your environment details (OS, Node.js version, npm version)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- Include code examples if applicable
One of the easiest ways to contribute! If you have ideas for new emoji rules:
- Edit
src/rules.ts - Add your rule following this format:
{
emoji: '🎯',
keywords: ['target', 'goal', 'objective'],
filePatterns: ['*.target.ts'], // Optional
description: 'Your description here'
}- Submit a pull request with examples of when this emoji would be useful
- Fork the repo and create your branch from
main - If you've added code that should be tested, add tests
- Ensure the test suite passes
- Make sure your code lints
- Issue that pull request!
# Clone your fork
git clone https://github.com/yourusername/commit-emoji.git
cd commit-emoji
# Install dependencies
npm install
# Build the project
npm run build
# Link for local testing
npm link-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Build and test:
npm run build npm test npm run lint -
Test your changes manually:
commit-emoji suggest commit-emoji list
- Use TypeScript
- Follow the existing code style
- Write clear, descriptive variable and function names
- Add comments for complex logic
- Keep functions small and focused
- Use meaningful commit messages (with emojis, of course!)
# Run tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run linter
npm run lint
# Format code
npm run formatSince this is commit-emoji, we expect great commit messages! Use the tool itself:
# Stage your changes
git add .
# Get emoji suggestion
commit-emoji suggest
# Commit with emoji
git commit -m "✨ add new emoji rule for API endpoints"Commit message format:
- Use an appropriate emoji (use the tool to help!)
- Start with a verb in present tense (add, fix, update, remove)
- Keep the first line under 72 characters
- Add detailed description if needed
Examples:
✨ add Docker-related emoji rules
🐛 fix analyzer crash on empty diffs
📝 update installation instructions
⚡ improve pattern matching performance
♻️ refactor rule scoring algorithm
commit-emoji/
├── src/
│ ├── analyzer.ts # Core analysis logic
│ ├── cli.ts # CLI interface
│ ├── git.ts # Git operations
│ ├── index.ts # Main exports
│ ├── rules.ts # Emoji rules definition
│ └── types.ts # TypeScript types
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── README.md
- Edit
src/rules.ts - Add your rule to the
defaultRulesarray - Update the emoji table in
README.md - Test with relevant files
- Edit
src/analyzer.ts - Add tests for your improvements
- Document the algorithm changes
- Edit
src/cli.ts - Follow the commander.js pattern
- Update README with new command usage
(For maintainers)
- Update version in
package.json - Update CHANGELOG.md
- Create a git tag
- Push to npm:
npm publish
Feel free to open an issue with the question label. We're here to help!
Contributors will be recognized in:
- README.md contributors section
- Release notes
- GitHub contributors page
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to commit-emoji! 🎉