Resources
Contributing
Thank you for your interest in contributing to NovaForms! This document provides guidelines and information for contributors.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Contributing Guidelines
- Pull Request Process
- Issue Reporting
- Development Workflow
- Testing
- Documentation
- Release Process
Code of Conduct
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [contact information].
Getting Started
Prerequisites
- Node.js 16+ and npm
- Git
- Basic knowledge of React and JavaScript/TypeScript
- Familiarity with form libraries and validation concepts
Fork and Clone
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/reactfast/forms.git cd reactfastforms - Add the upstream repository:
git remote add upstream https://github.com/reactfast/forms.git
Development Setup
Installation
# Install dependencies
npm install
# Install peer dependencies for development
npm install react react-dom
Development Scripts
# Start development server
npm run dev
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Run linting
npm run lint
# Fix linting issues
npm run lint:fix
# Build the library
npm run build
# Build documentation
npm run build:docs
Project Structure
NovaForms/
├── src/
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript type definitions
│ ├── constants/ # Constants and enums
│ ├── registry/ # Field registry system
│ ├── engine/ # Rules engine
│ ├── state/ # State management
│ └── validation/ # Validation system
├── docs/ # Documentation
├── examples/ # Example implementations
├── tests/ # Test files
└── package.json
Contributing Guidelines
Types of Contributions
We welcome several types of contributions:
- Bug fixes: Fix issues and improve stability
- New features: Add new field types or functionality
- Documentation: Improve docs, add examples, fix typos
- Tests: Add test coverage for existing or new features
- Performance: Optimize existing code
- Examples: Add example implementations
Before You Start
- Check existing issues and pull requests to avoid duplicates
- For significant changes, open an issue first to discuss the approach
- Ensure your changes align with the project's goals and architecture
Code Style
- Follow the existing code style and patterns
- Use TypeScript for type safety
- Write clear, self-documenting code
- Add comments for complex logic
- Follow React best practices
Commit Messages
Use clear, descriptive commit messages:
feat: add new color picker field type
fix: resolve validation error in email field
docs: update installation instructions
test: add tests for array field validation
refactor: improve rules engine performance
Pull Request Process
Before Submitting
- Test your changes: Ensure all tests pass
- Update documentation: Update relevant docs if needed
- Add tests: Include tests for new functionality
- Check linting: Fix any linting issues
- Update examples: Add examples for new features
Pull Request Template
When creating a pull request, please include:
- Description: Clear description of changes
- Type: Bug fix, feature, documentation, etc.
- Testing: How you tested the changes
- Breaking changes: Any breaking changes and migration path
- Related issues: Link to related issues
Review Process
- Automated checks must pass (tests, linting, build)
- Code review by maintainers
- Discussion and feedback incorporation
- Approval and merge
Issue Reporting
Bug Reports
When reporting bugs, please include:
- Description: Clear description of the bug
- Steps to reproduce: Detailed steps to reproduce
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Environment: Node.js version, browser, OS
- Code example: Minimal code example if possible
Feature Requests
For feature requests, include:
- Description: Clear description of the feature
- Use case: Why this feature would be useful
- Proposed solution: Your suggested implementation
- Alternatives: Other approaches you've considered
Development Workflow
Branch Naming
Use descriptive branch names:
feature/color-picker-fieldfix/email-validation-bugdocs/update-installation-guidetest/add-validation-tests
Development Process
- Create a feature branch from
main - Make your changes
- Write/update tests
- Update documentation
- Test thoroughly
- Submit pull request
Testing Your Changes
# Run all tests
npm test
# Run specific test file
npm test -- --testNamePattern="color picker"
# Run tests with coverage
npm run test:coverage
# Test in different environments
npm run test:ci
Testing
Test Structure
- Unit tests: Test individual functions and components
- Integration tests: Test component interactions
- E2E tests: Test complete user workflows
- Performance tests: Test performance characteristics
Writing Tests
// Example test structure
describe('ColorPickerField', () => {
it('should render color picker input', () => {
// Test implementation
});
it('should handle color value changes', () => {
// Test implementation
});
it('should validate color format', () => {
// Test implementation
});
});
Test Coverage
- Aim for high test coverage (>80%)
- Test edge cases and error conditions
- Test accessibility features
- Test performance characteristics
Documentation
Documentation Standards
- Write clear, concise documentation
- Include code examples
- Update docs when adding features
- Follow the existing documentation style
Documentation Types
- API Documentation: Function and component references
- User Guides: Step-by-step tutorials
- Examples: Working code examples
- Architecture: Internal system documentation
Updating Documentation
When adding features:
- Update relevant documentation files
- Add code examples
- Update the README if needed
- Add migration guides for breaking changes
Release Process
Version Numbering
We follow Semantic Versioning:
- Major (1.0.0): Breaking changes
- Minor (0.1.0): New features, backward compatible
- Patch (0.0.1): Bug fixes, backward compatible
Release Checklist
- [ ] All tests pass
- [ ] Documentation updated
- [ ] Breaking changes documented
- [ ] Migration guide provided (if needed)
- [ ] Version number updated
- [ ] Changelog updated
- [ ] Release notes prepared
Community
Getting Help
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Documentation: Check existing docs first
Contributing to Discussions
- Be respectful and constructive
- Search existing discussions before creating new ones
- Provide clear, detailed information
- Help others when you can
Recognition
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes
- Project documentation
License
By contributing to NovaForms, you agree that your contributions will be licensed under the same license as the project.
Questions?
If you have questions about contributing, please:
- Check existing documentation
- Search GitHub issues and discussions
- Open a new issue with the "question" label
Thank you for contributing to NovaForms! 🚀