- Node.js v22 or later
- pnpm package manager
- Docker (optional, for containerized development)
- Git
-
Fork the repository
-
Clone your fork:
git clone <your-fork-url> cd rpc-worker-pool
-
Install dependencies:
pnpm install
-
Build the project:
pnpm run build
main- Stable release branchdevelop- Development branch- Feature branches:
feature/<feature-name> - Bug fixes:
fix/<bug-description> - Hotfixes:
hotfix/<description>
-
Type Safety
- Enable strict TypeScript configuration
- Avoid using
anytype - Use interface declarations for object shapes
-
Naming Conventions
- PascalCase for interfaces, types, and classes
- camelCase for methods and variables
- UPPER_CASE for constants
-
File Organization
- One class per file
- Clear module boundaries
- Consistent import ordering
-
Documentation
- JSDoc comments for public APIs
- Clear inline comments for complex logic
- Updated README for new features
The project uses ESLint and Prettier for code formatting:
# Format code
pnpm run prettier
# Run linter
pnpm run lint
# Fix linting issues
pnpm run lint:fix# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run specific test file
pnpm test <path-to-test-file>-
Unit Tests
- Test individual components
- Mock dependencies
- Focus on behavior, not implementation
-
Integration Tests
- Test component interactions
- Verify system workflows
- Test error scenarios
-
Test Coverage
- Aim for high coverage
- Cover edge cases
- Include error scenarios
-
Code Documentation
- Clear and concise comments
- Updated JSDoc
- TypeScript declarations
-
Project Documentation
- README.md updates
- ARCHITECTURE.md for design changes
- API documentation updates
-
Before Creating a PR
- Update documentation
- Add/update tests
- Run linter and tests
- Rebase on latest main
-
PR Guidelines
- Clear description of changes
- Reference related issues
- Include test results
- Add screenshots if applicable
-
Review Process
- Address review comments
- Keep PR focused
- Maintain clean commit history
Follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style updates
- refactor: Code refactoring
- test: Test updates
- chore: Maintenance tasks
Example:
feat(worker-pool): add dynamic scaling capability
- Implement automatic worker pool scaling
- Add configuration options
- Update documentation
Closes #123
- Local Development
pnpm run debug- Docker Development
# Build development image
pnpm run docker:build
# Run with development configuration
pnpm run docker:live:server-
Worker Thread Issues
- Check resource limits
- Verify message serialization
- Monitor memory usage
-
Performance Problems
- Profile worker execution
- Check task queue size
- Monitor system resources
-
Type Errors
- Verify interface implementations
- Check generic type constraints
- Review type declarations
- Check existing issues
- Review documentation
- Join development discussions
- Ask questions in pull requests
By contributing, you agree that your contributions will be licensed under the project's MIT License.