First off, thanks for taking the time to contribute! 🎉
We love your input! We want to make contributing to Bytekit as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Code Style Guidelines
- Testing Guidelines
- Documentation Guidelines
- Community
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 sebamar88@gmail.com.
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 snippets, screenshots)
- Describe the behavior you observed and what you expected
- Include environment details (Node.js version, OS, browser)
Use our Bug Report Template
Feature suggestions are tracked as GitHub issues. When creating a feature request:
- Use a clear and descriptive title
- Provide a detailed description of the proposed feature
- Explain why this feature would be useful to most users
- Include code examples showing how the feature would be used
Use our Feature Request Template
Unsure where to begin? You can start by looking through good-first-issue and help-wanted issues:
- Good first issues - issues which should only require a few lines of code
- Help wanted issues - issues which should be a bit more involved
- Fork the repository and create your branch from
main - Install dependencies:
pnpm install - Make your changes following our code style guidelines
- Add tests for your changes
- Ensure all tests pass:
pnpm run test:coverage - Lint your code:
pnpm run lint - Format your code:
pnpm run format - Update documentation if needed
- Submit your PR using our template
- Node.js >= 18
- pnpm >= 9
# Clone your fork
git clone https://github.com/YOUR_USERNAME/bytekit.git
cd bytekit
# Install dependencies
pnpm install
# Build the project
pnpm run build# Run tests in watch mode
pnpm run test:watch
# Run tests with coverage
pnpm run test:coverage
# View coverage UI
pnpm run test:ui
# Lint code
pnpm run lint
# Fix linting issues
pnpm run lint:fix
# Format code
pnpm run format
# Type check
pnpm run typecheck
# Build
pnpm run build- Update the README.md with details of changes to the interface (if applicable)
- Update the CHANGELOG.md following Keep a Changelog format
- Ensure all tests pass and coverage remains above 90%
- Update documentation for any new features or changes
- Follow the commit message convention (see below)
- Request review from maintainers
- Address review feedback promptly
- Squash commits before merging (if requested)
We follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasksci: CI/CD changes
Examples:
feat(api-client): add retry mechanism with exponential backoff
fix(date-utils): handle timezone edge cases correctly
docs(readme): update installation instructions
test(array-utils): add edge case tests for chunk function
- Use TypeScript strict mode
- Prefer interfaces over types for object shapes
- Use explicit return types for public functions
- Avoid
any- useunknownif type is truly unknown - Use optional chaining (
?.) and nullish coalescing (??)
- Files: kebab-case (
array-utils.ts) - Classes: PascalCase (
ApiClient) - Functions: camelCase (
formatDate) - Constants: UPPER_SNAKE_CASE (
MAX_RETRIES) - Interfaces: PascalCase with 'I' prefix optional (
IRequestOptionsorRequestOptions)
// 1. Imports (external first, then internal)
// Native fetch is available globally in Node.js 18+ and browsers
import { Logger } from "./logger";
// 2. Types and Interfaces
interface Options {
timeout: number;
}
// 3. Constants
const DEFAULT_TIMEOUT = 5000;
// 4. Main implementation
export class MyClass {
// ...
}
// 5. Helper functions (unexported)
function helperFunction() {
// ...
}- DRY (Don't Repeat Yourself): Extract common logic into utilities
- SOLID Principles: Follow single responsibility, open/closed, etc.
- Error Handling: Always handle errors gracefully with descriptive messages
- Documentation: Add JSDoc comments for all public APIs
- Performance: Consider performance implications, especially for utilities
- Type Safety: Leverage TypeScript's type system fully
- Overall coverage: >= 90%
- Branch coverage: >= 85%
- Function coverage: >= 90%
- Line coverage: >= 90%
import { describe, it, expect } from "vitest";
import { myFunction } from "./my-function";
describe("myFunction", () => {
it("should handle normal input", () => {
expect(myFunction("test")).toBe("expected");
});
it("should handle edge cases", () => {
expect(myFunction("")).toBe("");
expect(myFunction(null)).toThrow();
});
it("should handle errors gracefully", () => {
expect(() => myFunction(undefined)).toThrow("Invalid input");
});
});- Arrange: Set up test data and conditions
- Act: Execute the function/method being tested
- Assert: Verify the results
- ✅ Happy path scenarios
- ✅ Edge cases (empty arrays, null/undefined, boundary values)
- ✅ Error conditions
- ✅ Type safety (if using TypeScript)
- ✅ Performance (for critical utilities)
- ✅ Integration between modules
Add JSDoc comments for all public APIs:
/**
* Formats a date according to the specified format string.
*
* @param date - The date to format
* @param format - The format string (e.g., 'YYYY-MM-DD')
* @param options - Additional formatting options
* @returns The formatted date string
* @throws {Error} If the date is invalid
*
* @example
* ```typescript
* formatDate(new Date(), 'YYYY-MM-DD')
* // => '2024-03-15'
* ```
*/
export function formatDate(
date: Date,
format: string,
options?: FormatOptions
): string {
// ...
}When adding new features:
- Add to the feature list
- Include usage examples
- Update the API reference
- Add to the table of contents if needed
For major features:
- Create a dedicated wiki page
- Include detailed examples
- Add troubleshooting section
- Link from main documentation
- 💬 GitHub Discussions - Ask questions and share ideas
- 🐛 GitHub Issues - Report bugs and request features
- 📧 Email: sebamar88@gmail.com
Contributors will be:
- Listed in our README
- Mentioned in release notes
- Credited in the CHANGELOG
By contributing, you agree that your contributions will be licensed under the MIT License.
Your contributions make Bytekit better for everyone. Thank you for being part of our community!