Thank you for your interest in contributing to JSON Fields! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Testing
- Pull Request Process
- Reporting Issues
We are committed to providing a friendly, safe, and welcoming environment for all contributors.
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Accept feedback gracefully
- Harassment, discrimination, or offensive comments
- Personal attacks or trolling
- Publishing private information without consent
- Any conduct that could reasonably be considered inappropriate
- Fork the repository
- Clone your fork:
git clone https://github.com/sciphergfx/json-fields.git cd json-fields - Add the upstream remote:
git remote add upstream https://github.com/sciphergfx/json-fields.git
- Node.js 20.12.0 or higher
- npm 10.5.0 or higher
- Git
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Start development server
npm run devnpm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run lint:fix- Fix linting issues
- Check the Issues page
- Look for issues labeled
good first issueorhelp wanted - Comment on the issue to let others know you're working on it
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-number-description- Write clean, readable code
- Follow the existing code style
- Add comments for complex logic
- Update documentation if needed
git add .
git commit -m "feat: add new feature" # Use conventional commitsWe use Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, semicolons, etc.)refactor:Code refactoringperf:Performance improvementstest:Test additions or fixeschore:Build process or auxiliary tool changes
- Use functional components with hooks
- Follow ESLint rules (run
npm run lint) - Use meaningful variable and function names
- Keep components small and focused
- Extract reusable logic into custom hooks
src/
├── components/ # React components
│ ├── Component.jsx
│ └── Component.test.jsx (if applicable)
├── hooks/ # Custom React hooks
├── utils/ # Utility functions
├── constants/ # Constants and configuration
└── assets/ # Static assets
// Good
const processJsonData = (data) => {
if (!data) return null
return data.map((item) => ({
...item,
processed: true,
}))
}
// Avoid
const process = (d) => (d ? d.map((i) => ({ ...i, p: 1 })) : null)import React, { useState, useEffect } from 'react'
import { Box, Text } from '@chakra-ui/react'
/**
* ComponentName - Brief description
* @param {Object} props - Component props
* @returns {JSX.Element} Rendered component
*/
const ComponentName = ({ prop1, prop2 }) => {
// State declarations
const [state, setState] = useState(null)
// Effects
useEffect(() => {
// Effect logic
}, [dependency])
// Event handlers
const handleClick = () => {
// Handler logic
}
// Render
return (
<Box>
<Text>{prop1}</Text>
</Box>
)
}
export default ComponentNameimport { render, screen, fireEvent } from '@testing-library/react'
import ComponentName from './ComponentName'
describe('ComponentName', () => {
it('should render correctly', () => {
render(<ComponentName />)
expect(screen.getByText('Expected Text')).toBeInTheDocument()
})
it('should handle user interaction', () => {
render(<ComponentName />)
fireEvent.click(screen.getByRole('button'))
// Assert expected behavior
})
})# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run tests with coverage
npm test -- --coverage-
Update your branch:
git fetch upstream git rebase upstream/main
-
Run quality checks:
npm run lint npm test npm run build -
Test your changes:
- Test all features affected by your changes
- Test on different browsers if applicable
- Check responsive design on mobile devices
- Push your changes to your fork
- Go to the original repository
- Click "New Pull Request"
- Select your fork and branch
- Fill out the PR template:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [ ] All tests pass
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No console errors/warnings- Respond to code review feedback promptly
- Make requested changes in new commits
- Keep the PR updated with the main branch
- Be patient - reviewers are volunteers
Include:
- Clear, descriptive title
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Browser and OS information
- Error messages from console
Template:
## Bug Description
Clear description of the bug
## Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. Enter '...'
4. See error
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- Browser: [e.g., Chrome 120]
- OS: [e.g., macOS 14]
- Node version: [e.g., 20.12.0]
## Additional Context
Any other relevant informationInclude:
- Clear description of the feature
- Use case and benefits
- Possible implementation approach
- Mock-ups or examples (if applicable)
If you have questions:
- Check the README and documentation
- Search existing issues
- Ask in discussions or create a new issue
Contributors will be recognized in:
- The project README
- Release notes
- Contributors page
Thank you for contributing to JSON Fields! 🎉