๐ค Contributing to use-typewriter-animation
Thank you for your interest in contributing! This guide will help you get started with contributing to our modern, performant React typewriter animation library.
๐ Quick Startโ
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/use-typewriter-animation.git
- Install dependencies:
bun install
- Run tests:
bun test
- Build the project:
bun run build
๐ ๏ธ Development Setupโ
Prerequisitesโ
- Node.js 18.0.0 or higher
- Bun 1.0.0 or higher (preferred)
- Git latest version
- React knowledge - Familiarity with React hooks and TypeScript
Installationโ
# Clone and navigate
git clone https://github.com/YOUR_USERNAME/use-typewriter-animation.git
cd use-typewriter-animation
# Install dependencies
bun install
# Verify setup
bun test # Run tests (228 tests should pass)
bun run build # Build project
Development Commandsโ
bun test # Run all tests
bun test --watch # Watch mode for development
bun test --coverage # Coverage report
bun run build # Build project
bun run watch # Build in watch mode
bun run format # Format code with Biome
bun run analyze # Check bundle size
๐ Types of Contributionsโ
๐ Bug Fixesโ
- Fix existing bugs and improve error handling
- Performance improvements
- SSR/RSC compatibility fixes
โจ New Featuresโ
- New animation types and customization options
- React 19 concurrent features
- Accessibility improvements
๐ Documentationโ
- Fix typos, add examples, improve API docs
- Create tutorials and troubleshooting guides
๐งช Testsโ
- Add missing test coverage
- Improve test reliability and performance benchmarks
๐ Pull Request Processโ
1. Create Your Branchโ
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix
2. Make Changesโ
- Write code following our TypeScript and React guidelines
- Add tests for new functionality
- Update documentation if needed
- Ensure all tests pass:
bun test
- Build successfully:
bun run build
3. Commit & Pushโ
Use conventional commit format:
git commit -m "feat: add concurrent typing animations"
git commit -m "fix: resolve SSR hydration mismatch"
git commit -m "docs: update API reference"
git push origin feature/your-feature-name
4. Create Pull Requestโ
Include in your PR:
- Clear title and description
- Reference related issues
- List of changes made
- Screenshots/GIFs for UI changes
๐งช Testing Guidelinesโ
Test Requirementsโ
- Unit tests for all new functions/hooks
- TypeScript type tests for type safety
- Performance tests for critical paths
Test Structureโ
describe('useTypewriter', () => {
test('should render text progressively', () => {
expect(typeof useTypewriter).toBe('function');
});
test('should handle edge cases', () => {
// Test implementation
});
});
๐ Code Styleโ
TypeScript Guidelinesโ
- Use strict TypeScript settings
- Export proper types for all APIs
- Add JSDoc comments for public APIs
- Follow React hooks conventions
Formattingโ
We use Biome for code formatting:
bun run format # Format code
bunx biome check . # Check formatting
bunx biome check --apply . # Fix issues
Commit Conventionโ
Follow Conventional Commits:
feat:
- New featurefix:
- Bug fixdocs:
- Documentation changestest:
- Test changesrefactor:
- Code refactoringchore:
- Build/tooling changes
๐ Bug Reportsโ
When reporting bugs, include:
- React version and use-typewriter-animation version
- Environment (browser, Node.js, etc.)
- Steps to reproduce with minimal code example
- Expected vs actual behavior
- CodeSandbox link (preferred)
๐ก Feature Requestsโ
For new features, provide:
- Use case - Why is this needed?
- Proposed API - How should it work?
- Examples - Show usage examples
โฟ Accessibilityโ
All contributions must maintain WCAG 2.1 AA compliance:
- Screen reader support with ARIA live regions
- Full keyboard accessibility
- Respect user motion preferences
- Proper focus management
๐ Performanceโ
Monitor bundle size impact:
bun run analyze
Current targets:
- ESM: ~5.3KB gzipped
- CJS: ~5.6KB gzipped
๐ค Communityโ
Code of Conductโ
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
Getting Helpโ
- ๐ฌ GitHub Discussions - Questions and ideas
- ๐ GitHub Issues - Bug reports and features
๐ Resourcesโ
๐ Recognitionโ
Contributors are recognized in:
- README contributors section
- CHANGELOG.md for each release
- GitHub contributors graph
Questions? Open a discussion or create an issue with the question
label.
Thank you for contributing! ๐