Thank you for your interest in contributing to the React MFE Shell! This document provides guidelines and information for contributors.
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and constructive in all interactions.
- Node.js 18+
- npm 9+
- Git
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/react-mfe-shell.git cd react-mfe-shell - Install dependencies:
npm install
- Run the development server:
npm run dev
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Follow the existing code style
- Write tests for new functionality
- Update documentation as needed
- Use conventional commit messages
# Run all tests
npm run test
# Run linting
npm run lint
# Run type checking
npm run type-check
# Run code analysis
npm run analyze
# Build the library
npm run buildWe use Conventional Commits:
# Examples:
git commit -m "feat: add new Button variant"
git commit -m "fix: resolve Modal accessibility issue"
git commit -m "docs: update installation instructions"
git commit -m "refactor: improve component organization"Commit Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
- Use TypeScript for all new code
- Provide proper type definitions
- Avoid
anytypes when possible - Use interfaces for object shapes
- Use functional components with hooks
- Follow atomic design principles (Atoms → Molecules → Organisms)
- Provide proper prop types and default values
- Include accessibility attributes (ARIA labels, etc.)
- Write unit tests for all components
- Use React Testing Library for component tests
- Aim for 90%+ test coverage
- Test user interactions and edge cases
- Update README.md for significant changes
- Add JSDoc comments for complex functions
- Update component documentation
- Include usage examples
src/
├── components/
│ ├── atoms/ # Basic building blocks
│ ├── molecules/ # Simple combinations
│ └── organisms/ # Complex combinations
├── contexts/ # React contexts
├── types/ # TypeScript definitions
├── utils/ # Utility functions
└── styles/ # CSS files
- Choose the right level: Atom, Molecule, or Organism
- Create the component file:
ComponentName.tsx - Create the test file:
ComponentName.test.tsx - Export from index: Add to
src/index.ts
import React from 'react';
import { BaseComponentProps } from '../../types';
import { classNames } from '../../utils';
interface ComponentNameProps extends BaseComponentProps {
// Add specific props here
}
const ComponentName: React.FC<ComponentNameProps> = ({
className,
children,
...props
}) => {
return (
<div
className={classNames(
'base-classes',
className
)}
{...props}
>
{children}
</div>
);
};
export default ComponentName;import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import ComponentName from './ComponentName';
describe('ComponentName', () => {
it('renders correctly', () => {
render(<ComponentName>Test content</ComponentName>);
expect(screen.getByText('Test content')).toBeInTheDocument();
});
it('applies custom className', () => {
render(<ComponentName className="custom-class">Content</ComponentName>);
expect(screen.getByText('Content')).toHaveClass('custom-class');
});
});- All tests pass locally
- Code follows style guidelines
- Documentation is updated
- Commit messages follow conventional format
- No console.log statements left in code
- Code analysis passes without issues
Use the provided PR template and include:
- Clear description of changes
- Related issue numbers
- Type of change (bug fix, feature, etc.)
- Testing instructions
- Screenshots (if applicable)
- Automated checks must pass (CI workflow)
- Code review by maintainers
- Testing of the changes
- Approval and merge
Releases are automated using Release-Please:
- Conventional commits trigger version bumps
- Release PR is created automatically
- Manual merge of Release PR creates the release
- Automated deployment to GitHub Pages
Use the bug report template and include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment details
- Code samples (if applicable)
Use the feature request template and include:
- Problem description
- Proposed solution
- Alternative solutions considered
- Additional context
- GitHub Discussions: For general questions
- GitHub Issues: For bugs and feature requests
- GitHub Wiki: For documentation
Contributors will be recognized in:
- GitHub contributors list
- Release notes (for significant contributions)
- Documentation acknowledgments
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).
If you need help with contributing:
- Check existing documentation
- Search existing issues
- Create a discussion post
- Reach out to maintainers
Thank you for contributing to the React MFE Shell!