Thank you for considering contributing to rollout-bucket! 🎉
- Node.js >= 18.0.0
- npm (comes with Node.js)
- Git
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/rollout-bucket.git cd rollout-bucket -
Install dependencies:
npm install
-
Verify setup:
npm test # All tests should pass npm run lint # No linting errors npm run build # Build should succeed
-
Create a branch:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes:
- Write code in
src/ - Add/update tests in
test/ - Update README if adding features
- Update docs/CHANGELOG.md
- Write code in
-
Test your changes:
npm test # Run tests npm run test:coverage # Check coverage (aim for >95%) npm run lint # Check code style npm run build # Verify build works
-
Commit your changes:
git add . git commit -m "feat: add amazing feature"
Pre-commit hooks will automatically run linting and formatting.
We follow Conventional Commits. Use prefixes: feat:, fix:, docs:, test:, chore:, or refactor:.
-
Push your branch:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
-
Ensure CI passes:
- All tests pass
- Linting passes
- Build succeeds
- No security vulnerabilities
-
Wait for review:
- Address any feedback
- Make requested changes
- Push updates to the same branch
- Location:
test/rollout-bucket.test.ts - Framework: Vitest
- Coverage: Aim for >95% coverage
Example test:
it('should return deterministic buckets', () => {
const rollout = new RolloutBucket();
const bucket1 = rollout.getBucket('feature', 'user-123');
const bucket2 = rollout.getBucket('feature', 'user-123');
expect(bucket1).toBe(bucket2);
});npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # With coverage report
npm run test:ui # Visual UI (Vitest UI)We use ESLint and Prettier for code formatting:
npm run lint # Check for issues
npm run format # Auto-fix formattingPre-commit hooks automatically enforce code style.
rollout-bucket/
├── src/
│ └── index.ts # Main source code
├── test/
│ └── rollout-bucket.test.ts # Test suite
├── dist/ # Build output (git-ignored)
│ ├── esm/ # ES Module build
│ └── cjs/ # CommonJS build
├── .github/
│ └── workflows/ # CI/CD workflows
├── package.json
├── tsconfig.json # TypeScript config
├── vitest.config.ts # Test config
└── eslint.config.js # Linting config
- 📖 Check the README for API documentation
- 🐛 Open an issue for bugs
- 💡 Start a discussion for questions
By contributing, you agree that your contributions will be licensed under the MIT License.