First off, thank you for considering contributing to @BeefreeSDK/react-email-builder! 🎉
- Code of Conduct
- Getting Started
- Development Process
- Commit Guidelines
- Pull Request Process
- Testing
- Code Style
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/react-email-builder.git cd react-email-builder - Install dependencies:
yarn install
- Create a branch for your changes:
git checkout -b feature/your-feature-name
yarn startThis will start the development server with hot reload at http://localhost:3000.
yarn build# Watch mode
yarn test
# Single run
yarn test:ci
# With coverage
yarn test:ci --coverageyarn lintWe follow Conventional Commits specification.
<type>(<scope>): <subject>
<body>
<footer>
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that don't affect code meaning (formatting, etc.)refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementstest: Adding or updating testschore: Changes to build process or auxiliary tools
feat(useBuilder): add support for dynamic language switching
fix(Builder): prevent memory leak on unmount
docs(README): update installation instructions
test(useBuilder): add tests for config updatesThis project uses Husky and commitlint to enforce conventional commits. Invalid commit messages will be rejected.
- Update documentation if needed
- Add tests for new features
- Ensure all tests pass:
yarn test:ci - Ensure linting passes:
yarn lint - Update CHANGELOG.md under
[Unreleased]section - Create the PR with a clear description of changes
- Link related issues using keywords (e.g., "Fixes #123")
Follow the same convention as commits:
feat: add collaborative editing support
fix: resolve memory leak in Builder component
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
Describe how you tested your changes
## Checklist
- [ ] Tests pass locally
- [ ] Linting passes
- [ ] Documentation updated
- [ ] CHANGELOG updated- Place tests in
__tests__directories alongside source files - Use descriptive test names
- Test both success and error cases
- Maintain > 80% code coverage
describe('ComponentName', () => {
it('should do something specific', () => {
// Arrange
const input = setupInput()
// Act
const result = performAction(input)
// Assert
expect(result).toBe(expected)
})
})- Use TypeScript for all new code
- Enable
strictmode - Avoid
anytypes when possible - Use explicit return types for functions
- Use functional components with hooks
- Use
useCallbackanduseMemoappropriately - Avoid inline arrow functions in JSX props
- Components: PascalCase (
Builder,MyComponent) - Hooks: camelCase with
useprefix (useBuilder,useRegistry) - Files: Match the component/hook name
- Constants: UPPER_SNAKE_CASE
// 1. Imports (grouped and sorted)
import { useState } from 'react'
import type { SomeType } from './types'
// 2. Types/Interfaces
interface Props {
// ...
}
// 3. Component/Function
export const Component = (props: Props) => {
// 4. Hooks
const [state, setState] = useState()
// 5. Handlers
const handleClick = () => {}
// 6. Effects
useEffect(() => {}, [])
// 7. Render
return <div />
}Feel free to open an issue for questions or discussions!
Thank you for your contribution! 🚀