Getting Started

Contribution

A comprehensive guide on contributing to EletroDS, including project structure, development workflow, and best practices.

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.

Before reporting a bug or requesting a feature, make sure that you have read through our documentation and existing issues.

Project Structure

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:

packages/core/src/index.ts
// Main entry point for @mercadoeletronico/eds-next
// Exports all components, composables, and utilities

export * from './components'
export * from './useTheme'

Package Overview

PackageDescriptionPath
@mercadoeletronico/eds-nextCore component librarypackages/core/
@mercadoeletronico/eds-tokensDesign tokens (colors, spacing, etc.)packages/tokens/
@mercadoeletronico/eds-uiNuxt UI wrapper layerpackages/ui/
@mercadoeletronico/eslint-configShared ESLint configurationpackages/eslint-config/
@mercadoeletronico/ts-configShared TypeScript configurationpackages/ts-config/
playwrightE2E and component testspackages/playwright/

Key Directories

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.

Getting Started

Jira Board

We use Jira to manage our development tasks and track progress. All available tasks can be found on our Jira board.

Taking a Task

Browse the Jira board to find an available task

Look for tasks that are unassigned and match your skills.

Communicate with the EDS team PO before assuming the task

This ensures proper coordination and avoids duplicate work.

Assign the task to yourself

Move the task to "In Development" status.

Add a comment using the validation template

Use the template provided below to document your progress.

Validation Template

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
The component link, screenshot/video, and description are required for validation. Make sure to provide clear visual evidence of what was developed.

Local Development

To begin local development, follow these steps:

Clone the repository

Terminal
git clone <repository-url>
cd me-toolkit

Install dependencies

Terminal
# Using yarn
yarn install

Start development

To work on the documentation and run the development server for testing components, run:

Terminal
yarn dev

This command will start both the documentation server and the development environment for testing components.

IDE Setup

We recommend using VSCode alongside the ESLint extension. You can enable auto-fix and formatting when saving your code:

.vscode/settings.json
{
  "editor.codeActionsOnSave": {
    "source.fixAll": false,
    "source.fixAll.eslint": true
  }
}
Since ESLint is already configured to format the code, there's no need for duplicating functionality with Prettier. If you have it installed in your editor, we recommend disabling it to avoid conflicts.

Linting

You can use the lint command to check for linting errors:

Terminal
yarn lint        # check for linting errors

Testing

Before submitting a MR, ensure that you run the tests:

Terminal
# Run unit tests
yarn test

# Run Cypress component tests
yarn cy

# Open Cypress component tests
yarn cy:open

Writing Cypress Tests

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
  })
})

Documentation

Creating Component Documentation

When creating or updating component documentation:

Follow the Documentation Guide

Read the Documentation Guide for best practices.

Create or update the markdown file

Add your documentation in docs/markdown/components/.

Include required sections

Make sure to document:

  • Component introduction
  • Usage examples
  • Props table
  • Events table
  • Slots table

Documentation Structure

Component documentation should follow this structure:

SectionDescription
IntroductionBrief description of the component and its purpose
Usage ExamplesPractical examples showing how to use the component
Props TableComplete list of props with types, defaults, and descriptions
Events TableList of events emitted by the component
Slots TableAvailable slots and their descriptions

Validation Criteria

Before submitting your work for validation, ensure you meet all the following criteria:

Component Development

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.

Testing Checklist

  • Cypress tests are written and passing
  • Component is tested in different scenarios
  • Tests cover main functionality and edge cases
  • Cross-browser testing completed (if applicable)

Documentation Checklist

  • Documentation created/updated following the Documentation Guide
  • Examples provided and working
  • Props, events, and slots are fully documented
  • Documentation is clear and easy to understand

Code Quality Checklist

  • Code follows project conventions
  • ESLint passes without errors
  • No console errors or warnings
  • Code is properly commented where necessary

Submitting Changes

Commit Conventions

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 changes

Examples:

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

Branch Naming Conventions

Branches must follow the naming pattern based on the type of change:

Branch TypePatternDescriptionCreate From
Featurefeature/MW-XXXXXNew features or enhancementsdevelop
Fixfix/MW-XXXXXBug fixesdevelop
Hotfixhotfix/MW-XXXXXUrgent production fixesmaster
Hotfeaturehotfeature/MW-XXXXXUrgent feature implementationsmaster

Making a Merge Request

Update Jira Task

Before creating a MR, update the Jira task with the validation template comment.

Create Branch

Create a branch following the naming conventions:

  • For feature and fix branches: create from develop (e.g., feature/MW-67130, fix/MW-67131)
  • For hotfeature and hotfix branches: create from master (e.g., hotfeature/MW-67133, hotfix/MW-67132)

Make Changes

Implement your changes following the guidelines above.

Test

Ensure all tests pass and linting is clean.

Document

Update documentation if needed.

Commit

Use Jira commit format (e.g., MW-67130 #time 2d - commit message).

Push and Create MR

Push your branch and create a Merge Request. Link the MR to the Jira task.

MR Requirements

Multiple commits are fine; no need to rebase or force push. We'll use Squash and Merge when merging.
  • Follow along the instructions provided when creating a MR
  • Ensure your MR's title includes the Jira task code and follows the commit format (e.g., MW-67130 #time 2d - description)
  • Ensure lint and tests work before submitting the MR
  • Avoid making unrelated changes
  • Include screenshots or videos if the changes are visual

We'll review it promptly. If assigned to a maintainer, they'll review it carefully.

Thanks

Thank you so much for your interest in contributing! We are one ME team