Contributing
Thank you for your interest in contributing to TypeORM Pino Logger! This guide will help you get started.
Development Setup
- Fork and clone the repository
- Install dependencies:
bun install
- Build the project:
bun run build
- Run tests:
bun test
- Type checking:
bun run check-types
- Linting:
bun run lint
Commit Convention
This project follows the Conventional Commits specification. This leads to more readable messages and allows us to automatically generate changelogs.
Commit Message Format
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types
feat
: A new featurefix
: A bug fixdocs
: Documentation only changesstyle
: Changes that do not affect the meaning of the code (white-space, formatting, etc)refactor
: A code change that neither fixes a bug nor adds a featureperf
: A code change that improves performancetest
: Adding missing tests or correcting existing testschore
: Changes to the build process or auxiliary tools and libraries
Examples
feat(logger): add support for custom log levels
fix(query): handle undefined parameters correctly
docs(readme): update usage examples
test(logger): add tests for slow query detection
Pull Request Process
- Create a feature branch from
main
- Make your changes following the coding standards
- Add or update tests as needed
- Update documentation if required
- Ensure all tests pass:
bun test
- Ensure the build succeeds:
bun run build
- Ensure linting passes:
bun run lint
- Ensure type checking passes:
bun run check-types
- Create a pull request with a clear description
Release Process
Releases are automated using release-it
with conventional commits. Only maintainers can create releases:
Manual Release (for maintainers)
# Standard release (version determined by conventional commits)
bun run release
# Dry run (preview changes without releasing)
bun run release --dry-run
The release process automatically:
- Determines the version bump based on conventional commits
- Generates CHANGELOG.md
- Creates a git tag
- Publishes to npm
- Creates a GitHub release
Code Style
- Use TypeScript with strict mode enabled
- Follow the existing code style and formatting (enforced by Biome)
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Use
unknown
instead ofany
for better type safety - Avoid using
any
type unless absolutely necessary
Testing
- Write tests for new features and bug fixes using Bun's test runner
- Tests are located in the
tests/
directory - Ensure test coverage remains high
- Use descriptive test names
- Group related tests using
describe
blocks - Use Bun's
mock()
function for mocking dependencies - Run tests with
bun test
orbun run test:watch
for watch mode
Documentation
- Update README.md for new features or breaking changes
- Add JSDoc comments for new public methods
- CHANGELOG.md is automatically generated by release-it from conventional commits
Development Tools
This project uses:
- Bun - JavaScript runtime and package manager
- TypeScript - Type checking and compilation
- tsup - Build tool for generating ESM and CJS bundles
- Biome - Linting and formatting
- release-it - Automated releases with conventional changelog
- lefthook - Git hooks for quality checks
Questions?
If you have questions about contributing, please open an issue or start a discussion in the repository.