A comprehensive guide on contributing to EletroDS, including project structure, development workflow, and best practices.
Mercado Eletrônico and EletroDS grow even more with your initiative to contribute . Your contributions, whether through bug reports, pull requests, or feedback, are essential to continuously improve this library.
EletroDS is organized as a monorepo using pnpm workspaces and Turborepo for efficient package management. Here's an overview of the key directories and files:
// Main entry point for @mercadoeletronico/eds-next
// Exports all components, composables, and utilities
export * from './components'
export * from './useTheme'
| Package | Description | Path |
|---|---|---|
| @mercadoeletronico/eds-next | Core component library | packages/core/ |
| @mercadoeletronico/eds-tokens | Design tokens (colors, spacing, etc.) | packages/tokens/ |
| @mercadoeletronico/eds-ui | Nuxt UI wrapper layer | packages/ui/ |
| @mercadoeletronico/eslint-config | Shared ESLint configuration | packages/eslint-config/ |
| @mercadoeletronico/ts-config | Shared TypeScript configuration | packages/ts-config/ |
| playwright | E2E and component tests | packages/playwright/ |
packages/core/src/components/
All Vue components organized by name. Each component has its own folder with theme configuration.
packages/tokens/src/
Design tokens including colors, spacing, typography, shadows, and theme definitions.
packages/playwright/tests/
E2E tests using Playwright for comprehensive component testing.
docs/content/
Documentation written in Markdown with Nuxt Content for interactive examples.
We use Jira to manage our development tasks and track progress. All available tasks can be found on our Jira board.
Look for tasks that are unassigned and match your skills.
This ensures proper coordination and avoids duplicate work.
Move the task to "In Development" status.
Use the template provided below to document your progress.
When you take a task, add the following template as a comment in the Jira task:
✨ For validation
**Component Developed:** [Component Name]
**Link:** [Link to component documentation or example]
**Description:** [Brief description of what was implemented]
**Screenshots/Video:**
[Attach screenshots or video demonstrating the component - required for visual validation]
**Testing:**
- [ ] Cypress tests written and passing
- [ ] Component tested in different scenarios
- [ ] Cross-browser testing completed (if applicable)
**Documentation:**
- [ ] Documentation created/updated following Documentation Guide
- [ ] Examples provided
- [ ] Props, events, and slots documented
To begin local development, follow these steps:
git clone <repository-url>
cd me-toolkit
# Using yarn
yarn install
To work on the documentation and run the development server for testing components, run:
yarn dev
This command will start both the documentation server and the development environment for testing components.
We recommend using VSCode alongside the ESLint extension. You can enable auto-fix and formatting when saving your code:
{
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true
}
}
You can use the lint command to check for linting errors:
yarn lint # check for linting errors
Before submitting a MR, ensure that you run the tests:
# Run unit tests
yarn test
# Run Cypress component tests
yarn cy
# Open Cypress component tests
yarn cy:open
All components should have corresponding Cypress tests. Tests should be located in test/unit/components/ and follow the naming convention [ComponentName].spec.js.
Example test structure:
describe('ComponentName', () => {
it('should render correctly', () => {
// Test implementation
})
it('should handle user interactions', () => {
// Test implementation
})
})
When creating or updating component documentation:
Read the Documentation Guide for best practices.
Add your documentation in docs/markdown/components/.
Make sure to document:
Component documentation should follow this structure:
| Section | Description |
|---|---|
| Introduction | Brief description of the component and its purpose |
| Usage Examples | Practical examples showing how to use the component |
| Props Table | Complete list of props with types, defaults, and descriptions |
| Events Table | List of events emitted by the component |
| Slots Table | Available slots and their descriptions |
Before submitting your work for validation, ensure you meet all the following criteria:
Fully Functional
Component is fully functional and works as expected.
Design Guidelines
Component follows the design system guidelines.
Responsive & Accessible
Component is responsive and accessible to all users.
Edge Cases
Component handles edge cases and error states properly.
We use Jira commit format for commit messages. All commits must include the Jira task code and time tracking.
Commit Format:
MW-XXXXX #time Xd - commit message
Where:
MW-XXXXX is the Jira task code#time Xd is the time spent (e.g., 2d for 2 days, 4h for 4 hours)commit message is a brief description of the changesExamples:
MW-67130 #time 2d - add new Button component variant
MW-67131 #time 4h - resolve modal closing issue
MW-67132 #time 1d - update Button component documentation
MW-67133 #time 1h - update dependencies
Branches must follow the naming pattern based on the type of change:
| Branch Type | Pattern | Description | Create From |
|---|---|---|---|
| Feature | feature/MW-XXXXX | New features or enhancements | develop |
| Fix | fix/MW-XXXXX | Bug fixes | develop |
| Hotfix | hotfix/MW-XXXXX | Urgent production fixes | master |
| Hotfeature | hotfeature/MW-XXXXX | Urgent feature implementations | master |
Before creating a MR, update the Jira task with the validation template comment.
Create a branch following the naming conventions:
feature and fix branches: create from develop (e.g., feature/MW-67130, fix/MW-67131)hotfeature and hotfix branches: create from master (e.g., hotfeature/MW-67133, hotfix/MW-67132)Implement your changes following the guidelines above.
Ensure all tests pass and linting is clean.
Update documentation if needed.
Use Jira commit format (e.g., MW-67130 #time 2d - commit message).
Push your branch and create a Merge Request. Link the MR to the Jira task.
Squash and Merge when merging.MW-67130 #time 2d - description)lint and tests work before submitting the MRWe'll review it promptly. If assigned to a maintainer, they'll review it carefully.