Skip to main content

๐Ÿค 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โ€‹

  1. Fork the repository on GitHub
  2. Clone your fork: git clone https://github.com/YOUR_USERNAME/use-typewriter-animation.git
  3. Install dependencies: bun install
  4. Run tests: bun test
  5. 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 feature
  • fix: - Bug fix
  • docs: - Documentation changes
  • test: - Test changes
  • refactor: - Code refactoring
  • chore: - 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โ€‹

๐Ÿ“š 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! ๐Ÿš€