Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check existing issues. When creating a bug report, include as many details as possible using the bug report template.
Enhancement suggestions are tracked as GitHub issues. Use the feature request template and provide:
- Clear use case
- Expected behavior
- Example code
- Fork the repository and create your branch from
main - Make your changes with clear, descriptive commits
- Add tests for new functionality
- Update documentation if needed
- Ensure tests pass:
npm test - Ensure build works:
npm run build - Submit PR with description of changes
# Clone your fork
git clone https://github.com/YOUR-USERNAME/redactkit.git
cd redactkit
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Run in development mode
npm run devredactkit/
├── src/ # Source code
│ ├── preprocess/ # Preprocessing modules
│ ├── utils/ # Utilities
│ └── index.js # Main export
├── tests/ # Test files
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── helpers/ # Test utilities
├── examples/ # Example usage
└── docs/ # Documentation
- Use ES6+ features
- 2 spaces for indentation
- Semicolons required
- Single quotes for strings
- Descriptive variable names
- Add JSDoc for all exported functions
- Include
@paramand@returnstags - Explain complex logic
/**
* Clean text by removing noise
* @param {string} text - Input text
* @param {Object} options - Cleaning options
* @returns {Promise<string>} Cleaned text
*/
export async function clean(text, options = {}) {
// Implementation
}- Test pure functions in isolation
- Mock external dependencies
- One assertion per test minimum
- Clear test descriptions
- Test complete workflows
- Test error paths
- Test edge cases
describe('Feature', () => {
it('should do something specific', () => {
// Arrange
const input = 'test';
// Act
const result = doSomething(input);
// Assert
expect(result).toBe('expected');
});
});Use clear, descriptive commit messages:
feat: add email validation to extract function
fix: resolve memory leak in logger circular buffer
docs: update README with new examples
test: add integration tests for pipeline
refactor: simplify validation logic
feat:- New featurefix:- Bug fixdocs:- Documentationtest:- Testsrefactor:- Code refactoringperf:- Performance improvementschore:- Maintenance tasks
- Update README.md for user-facing changes
- Update docs/ for technical details
- Add examples for new features
- Keep docs concise and clear
Feel free to open an issue with your question or reach out to maintainers.
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0.