Contributing Guidelines¶
This document provides guidelines for contributing to the Elome Frontend project.
Getting Started¶
- Fork the repository: Start by forking the repository to your GitHub account.
- Clone the repository: Clone your fork to your local machine.
- Install dependencies: Install the project dependencies.
- Create a branch: Create a new branch for your contribution.
Development Workflow¶
Code Style¶
The project uses ESLint for code linting. Make sure your code follows the project's style guidelines by running:
Commit Guidelines¶
We follow the Conventional Commits specification for commit messages:
Types include:
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Changes that do not affect the meaning of the code (formatting, etc.)
- refactor: Code changes that neither fix a bug nor add a feature
- perf: Performance improvements
- test: Adding or correcting tests
- chore: Changes to the build process or auxiliary tools
Examples:
feat(cart): add ability to remove items from cart
fix(checkout): resolve issue with payment processing
docs: update README with new setup instructions
Pull Request Process¶
- Update your fork: Make sure your fork is up to date with the main repository.
- Push your changes: Push your changes to your fork.
- Create a pull request: Create a pull request from your fork to the main repository.
- Describe your changes: Provide a clear description of the changes you've made.
- Address review comments: Make any requested changes and push them to your branch.
Testing¶
All new features and bug fixes should include tests. Run the tests to make sure your changes don't break existing functionality:
Documentation¶
Update documentation to reflect any changes you make:
- Code comments: Add JSDoc comments to functions, methods, and classes.
- README: Update the README if your changes affect setup or usage.
- API documentation: Update API documentation if you change GraphQL queries or mutations.
- Component documentation: Update component documentation if you add or modify components.
Component Development¶
When developing new components:
- Place components in the appropriate directory
- Include proper documentation
- Write tests for the component
- Follow the project's naming conventions
Store Development¶
When working with stores:
- Keep stores focused on a specific domain
- Implement proper error handling
- Add TypeScript types for state and actions
- Write tests for store actions and getters
Best Practices¶
Performance¶
- Minimize component re-renders
- Use computed properties for derived state
- Implement lazy loading for components and routes
- Optimize images and assets
Accessibility¶
- Use semantic HTML elements
- Add ARIA attributes where necessary
- Ensure keyboard navigation works
- Maintain sufficient color contrast
Security¶
- Validate user input
- Sanitize data from external sources
- Use HTTPS for all API requests
- Don't store sensitive information in client-side storage
Code Review Checklist¶
Before submitting a pull request, make sure your code meets these criteria:
- Code follows the project's style guidelines
- All tests pass
- New features include tests
- Documentation is updated
- No console errors or warnings
- No unused variables or imports
- Commit messages follow the conventional commits format
Getting Help¶
If you need help or have questions:
- Check the existing documentation
- Look for similar issues in the issue tracker
- Ask for help in the pull request
- Contact the project maintainers
License¶
By contributing to this project, you agree that your contributions will be licensed under the project's license.