Thanks for your interest in contributing! We welcome issues, discussions, and pull requests.
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/<your-username>/safe-fetch.git cd safe-fetch
- Install dependencies:
pnpm install
- Run tests to make sure everything works:
pnpm test
- Use TypeScript and follow the existing code patterns
- Format code with Prettier (runs automatically on commit)
- Follow conventional naming:
camelCasefor functions/variables,PascalCasefor types - Keep functions focused and well-documented
- All new features must include tests using Vitest
- Aim for high test coverage of new code paths
- Test both success and error scenarios
- Mock external dependencies appropriately
- Run the test suite:
pnpm test - Check TypeScript compilation:
pnpm build
- Ensure code formatting:
pnpm format
For significant changes, please open an issue first to discuss:
- New features or breaking changes
- Performance improvements
- API modifications
- Create a feature branch from
main:git checkout -b feature/your-feature-name
- Make atomic commits with clear, descriptive messages:
git commit -m "feat: add retry delay jitter support" - Update documentation if behavior changes:
- README.md for user-facing changes
- JSDoc comments for API changes
- Add examples for new features
- Add yourself to CHANGELOG.md under "Unreleased" if you want credit
- Push and create a pull request with:
- Clear title describing the change
- Description of what changed and why
- Reference any related issues
All pull requests must pass:
- ✅ TypeScript compilation (
pnpm build) - ✅ Test suite (
pnpm test) - ✅ Linting (
pnpm lint) - ✅ No conflicting dependencies
src/
├── index.ts # Main export and createSafeFetch
├── types.ts # TypeScript definitions
├── errors.ts # Error constructors and utilities
├── type-guards.ts # Helper functions
└── __tests__/ # Test files
- Check existing issues first
- Include reproduction steps in your PR
- Add regression tests
- Discuss design in an issue first
- Keep features focused and composable
- Update TypeScript types accordingly
- Add comprehensive tests and docs
- Fix typos, improve clarity
- Add missing JSDoc comments
- Update README examples
- Improve error messages
- Questions? Open a discussion
- Bug reports? Use our issue template
- Feature ideas? Start with a feature request
We follow the Contributor Covenant Code of Conduct.
TL;DR: Be respectful, helpful, and constructive. We're all here to build something useful together.
Thank you for contributing! Every improvement, no matter how small, helps make safe-fetch better for everyone.