Thank you for your interest in contributing to DeepLX! This document provides guidelines and information for contributors.
This repository and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository on GitHub
- Clone your fork locally
- Set up the development environment
- Create a branch for your changes
- Make your changes
- Test your changes
- Submit a pull request
- Node.js >= 18.0.0
- npm or yarn
- Cloudflare Wrangler CLI
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/DeepLX.git cd DeepLX -
Install dependencies:
npm install
-
Set up your development environment:
npm run test:setup
-
Start the development server:
npm run dev
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoringtest/description- Test improvements
Use conventional commits format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featuretest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools
Example:
feat(api): add new translation feature
Implement new endpoint that accepts multiple text inputs
for translation to improve performance for bulk operations.
Closes #123
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test types
npm run test:unit
npm run test:integration
npm run test:performance
# Run tests in watch mode
npm run test:watch- Write unit tests for all new functions and classes
- Add integration tests for API endpoints
- Include performance tests for critical paths
- Ensure tests are deterministic and isolated
- Use descriptive test names and organize with
describeblocks
- All tests must pass
- Code coverage should not decrease
- Integration tests should verify real-world scenarios
- Performance tests should validate response times
- Ensure all tests pass:
npm test - Check code style:
npm run lint - Update documentation if needed
- Add tests for new functionality
- Update CHANGELOG.md if applicable
- Create a pull request from your feature branch
- Fill out the PR template completely
- Ensure the PR passes all CI checks
- Request review from maintainers
- Address any feedback promptly
- Keep the PR updated with the main branch
- Clear description of changes
- Reference related issues
- Include screenshots for UI changes
- Add performance impact notes if applicable
- Update documentation as needed
- Use strict TypeScript configuration
- Define explicit types for function parameters and returns
- Avoid
anytype unless absolutely necessary - Use meaningful variable and function names
- Follow consistent naming conventions
- Use 2 spaces for indentation
- Use single quotes for strings
- Add trailing commas in multiline structures
- Keep lines under 100 characters
- Use meaningful comments for complex logic
- Keep files focused on a single responsibility
- Use consistent file naming (kebab-case)
- Export types and interfaces from dedicated files
- Group related functionality in modules
- Optimize for Cloudflare Workers environment
- Minimize memory allocations
- Use efficient algorithms and data structures
- Cache frequently accessed data
- Monitor and test performance impact
- Never commit sensitive information
- Use environment variables for configuration
- Validate all user inputs
- Implement proper error handling
- Follow security best practices for APIs
If you discover a security vulnerability, please follow our Security Policy instead of creating a public issue.
- Add JSDoc comments for public APIs
- Document complex algorithms and business logic
- Include usage examples in documentation
- Keep documentation up to date with code changes
- Update feature lists for new functionality
- Add new configuration options
- Update API documentation
- Include new examples and use cases
We follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Update CHANGELOG.md for all user-facing changes
- Group changes by type (Added, Changed, Fixed, Removed)
- Include migration notes for breaking changes
- Reference related issues and PRs
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions and general discussion
- Pull Request comments: Code review and implementation discussion
Contributors will be recognized in:
- CHANGELOG.md for significant contributions
- README.md contributors section
- GitHub contributors page
Thank you for contributing to DeepLX! 🚀