Thank you for your interest in contributing to this project! This guide will help you understand our development process and how to contribute effectively.
-
Fork and Clone
git clone https://github.com/your-username/micro-frontend-nextjs.git cd micro-frontend-nextjs -
Install Dependencies
pnpm install
-
Start Development
pnpm dev
-
Run Tests
pnpm test pnpm test:e2e
main- Production-ready codedevelop- Integration branch for featuresfeature/*- New featuresfix/*- Bug fixesdocs/*- Documentation updates
We follow Conventional Commits:
type(scope): description
# Examples:
feat(host): add user authentication
fix(cart): resolve quantity update bug
docs(readme): improve installation guide
test(products): add ProductCard component testsTypes:
feat- New featuresfix- Bug fixesdocs- Documentationtest- Testsrefactor- Code refactoringperf- Performance improvementschore- Maintenance tasks
- Use strict TypeScript configuration
- Define interfaces for all data structures
- Use proper type annotations for function parameters and return values
- Avoid
anytype - use proper typing instead
- Use functional components with hooks
- Implement proper error boundaries
- Use Next.js Image component for images
- Follow React best practices for performance
- Each micro frontend must be independently deployable
- Minimize shared dependencies
- Use proper error handling for remote loading failures
- Test each micro frontend in isolation
- Write unit tests for all new components and utilities
- Achieve minimum 80% test coverage for new code
- Include integration tests for critical user flows
- Use descriptive test names that explain the behavior
-
Create Feature Branch
git checkout -b feature/your-feature-name
-
Develop with Tests
- Write tests first (TDD approach recommended)
- Ensure all existing tests pass
- Add new tests for your feature
-
Code Review Checklist
- Code follows project conventions
- Tests written and passing
- Documentation updated
- No console.log statements
- Proper TypeScript types
- Performance considerations addressed
-
Create Application Structure
mkdir apps/remote-new-feature cd apps/remote-new-feature # Set up Next.js with Module Federation
-
Update Configuration
- Add to
pnpm-workspace.yaml - Configure Module Federation in
next.config.js - Update host app to consume new remote
- Add TypeScript declarations
- Add to
-
Documentation
- Update README.md
- Add architectural diagrams if needed
- Document API contracts
- Include usage examples
-
Automated Checks
- TypeScript compilation
- ESLint rules
- Unit tests
- E2E tests
- Build process
-
Manual Review
- Code quality and patterns
- Architecture adherence
- Performance implications
- Security considerations
- Documentation quality
-
Review Criteria
- ✅ Functionality works as expected
- ✅ Code is readable and maintainable
- ✅ Tests provide adequate coverage
- ✅ No breaking changes (or properly documented)
- ✅ Performance impact is acceptable
- Test individual components in isolation
- Mock external dependencies
- Focus on component behavior, not implementation
- Use descriptive test names
// Good test name
test('should add product to cart when add button is clicked')
// Bad test name
test('cart test')- Test interaction between micro frontends
- Verify Module Federation loading
- Test cross-application state management
- Include error scenarios
- Test complete user journeys
- Cover critical business flows
- Include various browser scenarios
- Test responsive design
- Use JSDoc for functions and classes
- Document complex algorithms or business logic
- Include examples for public APIs
- Keep comments up-to-date with code changes
- Update feature lists
- Include new setup instructions
- Add architectural changes
- Update technology stack information
- Document all exposed components from remotes
- Include props and their types
- Provide usage examples
- Document error handling
- Check existing issues
- Try to reproduce the bug
- Test in different browsers/environments
- Gather relevant information
## Bug Description
Clear description of the bug
## Steps to Reproduce
1. Step one
2. Step two
3. Step three
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- Browser: Chrome 91.0
- OS: macOS 11.4
- Node.js: 18.15.0
- PNPM: 8.6.0
## Additional Context
Screenshots, logs, etc.- Check if feature exists
- Consider if it fits project scope
- Think about implementation complexity
- Consider alternative solutions
## Feature Description
Clear description of the proposed feature
## Use Case
Why is this feature needed?
## Proposed Solution
How should this feature work?
## Alternatives Considered
Other ways to achieve the same goal
## Additional Context
Mockups, examples, references- Questions: Use GitHub Discussions
- Bugs: Create GitHub Issues
- Security: Email maintainers privately
- General Help: Check documentation first
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to the future of micro frontends! 🚀