Thank you for your interest in contributing to BlobKit! This document provides guidelines and information for contributors.
By participating in this project, you agree to abide by our Code of Conduct. Please report any unacceptable behavior to Zak Cole at zcole@linux.com.
- Node.js 16.0.0 or higher
- npm or yarn package manager
- Git
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/blobkit.git cd blobkit -
Install dependencies:
npm install
-
Create a
.envfile for testing:cp .env.example .env # Edit .env with your test configuration -
Run tests to ensure everything works:
npm test
-
Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name
-
Ensure all tests pass:
npm test -
Check code quality:
npm run lint npm run typecheck
-
Follow TypeScript best practices
- Use strict typing
- Add JSDoc comments for public APIs
- Follow existing code patterns
-
Write tests for new functionality
- Unit tests for all new functions
- Integration tests for API changes
- Maintain or improve test coverage
-
Follow security practices
- Validate all inputs
- Use structured error handling
- Never hardcode sensitive information
- Use TypeScript strict mode
- Follow existing naming conventions
- Use meaningful variable and function names
- Add comprehensive error handling
- Document complex algorithms or cryptographic operations
Use conventional commit messages:
type(scope): description
feat(kzg): add new KZG proof verification
fix(blob): resolve encoding issue with large data
docs(readme): update installation instructions
test(utils): add edge cases for blob validation
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changestest: Test additions or fixesrefactor: Code refactoringperf: Performance improvementschore: Maintenance tasks
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm test -- blob.test.ts- Place tests in the
test/directory - Mirror the source structure in test organization
- Test both success and failure cases
- Include edge cases and boundary conditions
- Mock external dependencies appropriately
- Unit Tests: Test individual functions and classes
- Integration Tests: Test component interactions
- Edge Case Tests: Test boundary conditions and error cases
- Performance Tests: Verify performance characteristics (disabled by default)
- Add JSDoc comments to all public APIs
- Include parameter descriptions and examples
- Document error conditions and return types
- Explain complex algorithms or cryptographic operations
- Update feature lists for new functionality
- Add new configuration options
- Include new usage examples
- Update API reference sections
Do not open public issues for security vulnerabilities. Instead:
- Email security concerns to the maintainers
- Include detailed reproduction steps
- Provide potential fix suggestions if available
- Validate all user inputs
- Use parameterized queries and safe APIs
- Never log sensitive information
- Follow cryptographic best practices
- Use audited libraries for cryptographic operations
- Optimize for memory efficiency
- Use zero-copy operations where possible
- Pre-allocate buffers for known sizes
- Avoid unnecessary object creation in hot paths
- Profile performance-critical code paths
- Add benchmarks for new performance-critical features
- Ensure changes don't regress existing performance
- Document performance characteristics
- Ensure all tests pass
- Run the full lint and type check suite
- Update documentation if needed
- Add changelog entries for significant changes
-
Clear Description
- Explain what the PR does
- Reference related issues
- Include screenshots for UI changes
-
Code Quality
- All tests pass
- No linting errors
- Type checking passes
- Good test coverage
-
Documentation
- Update relevant documentation
- Add JSDoc for new public APIs
- Update changelog if appropriate
- Maintainers will review your PR
- Address feedback and requested changes
- Ensure CI checks pass
- PR will be merged after approval
- Update version in package.json
- Update CHANGELOG.md
- Create release notes
- Tag the release
- Publish to npm
- Open an issue for bugs or feature requests
- Join discussions for questions about implementation
- Contact Zak Cole at zcole@linux.com for security concerns or direct support
Contributors will be recognized in:
- Release notes for significant contributions
- Project documentation
- Special thanks for major features or fixes
Thank you for contributing to BlobKit!