Contributing to Logpilot
Thank you for your interest in contributing to Logpilot. This guide covers how to report bugs, propose new features, and submit pull requests.
Code of conductโ
All contributors are expected to follow our Code of Conduct. We're committed to maintaining a welcoming and inclusive community.
Ways to contributeโ
- ๐ Report a bug โ open a GitHub issue
- ๐ก Propose a feature โ start a GitHub Discussion
- ๐ Improve documentation โ edit any
.mdfile and open a pull request - ๐งช Add tests โ increase coverage for edge cases
- ๐ง Fix a bug or implement a feature โ see the workflow below
Reporting bugsโ
Before opening an issue, please search existing issues to avoid duplicates.
When reporting a bug, include:
- Logpilot version (
npm list logpilot) - Node.js version (
node --version) - Operating system
- Minimal reproduction โ the smallest possible code that reproduces the issue
- Expected vs actual behaviour
Use the bug report template to get started.
Development setupโ
Prerequisitesโ
- Node.js 18 or higher
- npm 9 or higher
- Git
Fork and cloneโ
# 1. Fork the repo on GitHub, then clone your fork
git clone https://github.com/YOUR-USERNAME/logpilot.git
cd logpilot
# 2. Add the upstream remote
git remote add upstream https://github.com/logpilot/logpilot.git
# 3. Install dependencies
npm install
Run testsโ
# Run the full test suite
npm test
# Run tests in watch mode during development
npm run test:watch
# Check coverage report
npm run coverage
All pull requests must maintain โฅ95% code coverage.
Project structureโ
logpilot/
โโโ src/
โ โโโ index.js # Public API entry point
โ โโโ logger.js # Core logger class
โ โโโ transports/ # Built-in transport implementations
โ โ โโโ stdout.js
โ โ โโโ file.js
โ โ โโโ http.js
โ โโโ formatters/ # Log formatting utilities
โโโ test/
โ โโโ logger.test.js
โ โโโ transports/
โโโ docs/ # This documentation
โโโ CHANGELOG.md
โโโ package.json
Pull request workflowโ
- Sync your fork with the latest upstream changes:
git fetch upstream
git checkout main
git merge upstream/main
- Create a branch for your change:
git checkout -b fix/null-metadata-crash
# or
git checkout -b feat/syslog-transport
-
Make your changes and write or update tests.
-
Lint and test before committing:
npm run lint
npm test
- Commit using Conventional Commits format:
git commit -m "fix: handle null values in metadata object"
git commit -m "feat: add syslog transport"
git commit -m "docs: add transport configuration examples"
- Push your branch and open a pull request against
main.
Pull request checklistโ
Before submitting, confirm your PR:
- Passes all existing tests (
npm test) - Includes tests for any new behaviour
- Maintains โฅ95% code coverage
- Follows the existing code style (
npm run lintpasses) - Updates documentation if behaviour has changed
- Has a clear title following the Conventional Commits format
- References any related issues (for example,
Fixes #42)
Review processโ
A maintainer will review your pull request within 3โ5 business days. We may request changes โ please don't take this personally. Once approved, a maintainer will merge your PR and credit you in the changelog.