Contributing to Loggily
Development Setup
bash
git clone https://github.com/beorn/loggily.git
cd loggily
bun install
bun run test # Run tests
bun run typecheck # Type checkCode Style
- TypeScript strict mode
- ESM imports only (
import/export, neverrequire) - Factory functions over classes
- Zero external dependencies
Testing
All changes should include tests. Run the test suite before submitting:
bash
bun run testTests must be silent on success. Use vi.spyOn(console, 'log').mockImplementation(() => {}) to suppress output in tests.
Pull Requests
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Ensure
bun run testandbun run typecheckpass - Commit with conventional commit messages
- Push and open a pull request
Commit Messages
feat:-- New featuresfix:-- Bug fixesdocs:-- Documentation onlytest:-- Test additionsrefactor:-- Code changes that neither fix bugs nor add featureschore:-- Maintenance tasks
Design Principles
- Logger-first -- Spans are loggers with timing, not separate concepts
- Minimal surface -- Few, well-designed functions
- Type safe -- TypeScript enforces correct usage (e.g.,
?.for disabled levels) - Zero-cost -- Optional chaining skips argument evaluation when disabled
- Structured -- JSON in production, readable console in development
Questions?
Open an issue for discussion before starting large changes.