Thank you for considering contributing to mayr_fake_api! 🎉
If you find a bug, please create an issue with:
- Clear title: Brief description of the bug
- Description: Detailed explanation of the issue
- Steps to reproduce: How to reproduce the bug
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Environment: Flutter version, Dart version, OS
- Code samples: Minimal code to reproduce the issue
We welcome feature suggestions! Please create an issue with:
- Clear title: Brief description of the feature
- Use case: Why this feature would be useful
- Proposed solution: How you think it should work
- Alternatives: Other ways to solve the problem
We love pull requests! Here's the process:
- Fork the repository
- Create a branch:
git checkout -b feature/my-feature - Make your changes
- Add tests: Ensure your code is tested
- Run tests:
flutter test - Format code:
dart format . - Analyze code:
dart analyze - Commit: Use clear commit messages
- Push:
git push origin feature/my-feature - Create PR: Open a pull request with a clear description
- Flutter SDK (latest stable)
- Dart SDK (latest stable)
- Git
git clone https://github.com/YoungMayor/mayr_dart_fake_api.git
cd mayr_dart_fake_api
flutter pub getflutter testcd example
flutter pub get
flutter runWe follow the official Dart style guide:
- Use
dart formatto format your code - Follow naming conventions
- Add documentation comments for public APIs
- Keep functions small and focused
- Use meaningful variable names
Add documentation comments for all public APIs:
/// Initializes the fake API.
///
/// The [basePath] specifies where the fake API files are located.
/// The [attachTo] is the Dio instance to attach the interceptor to.
///
/// Example:
/// ```dart
/// await MayrFakeApi.init(
/// basePath: 'assets/api',
/// attachTo: dio,
/// );
/// ```
static Future<void> init({...}) async {
// Implementation
}- Add tests for all new features
- Add tests for bug fixes
- Ensure tests are clear and maintainable
- Use descriptive test names
Example:
test('returns 200 for successful response', () async {
// Arrange
await MayrFakeApi.init(
basePath: 'test/assets/api',
attachTo: dio,
);
// Act
final response = await dio.get('/api/test');
// Assert
expect(response.statusCode, 200);
});We aim for high test coverage. Please ensure your changes are well-tested.
mayr_fake_api/
├── lib/
│ ├── mayr_fake_api.dart # Main export file
│ └── src/
│ ├── mayr_fake_api.dart # Core API class
│ ├── mayr_fake_interceptor.dart # Dio interceptor
│ └── mayr_fake_response.dart # Response model
├── test/
│ ├── mayr_dart_fake_api_test.dart # Unit tests
│ ├── integration_test.dart # Integration tests
│ └── assets/ # Test assets
├── example/ # Example application
├── doc/ # Documentation
├── CHANGELOG.md # Version history
├── LICENSE # MIT License
└── README.md # Main documentation
Use clear, descriptive commit messages:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting)
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
Examples:
feat: add support for PATCH method
fix: handle empty JSON files correctly
docs: update README with new examples
test: add integration tests for wildcards
- Update version in
pubspec.yaml - Update
CHANGELOG.mdwith changes - Ensure all tests pass
- Create a git tag:
git tag v1.0.0 - Push tag:
git push origin v1.0.0 - Publish to pub.dev:
flutter pub publish
All submissions require code review. We'll review:
- Code quality and style
- Test coverage
- Documentation
- Performance implications
- Breaking changes
If you have questions, feel free to:
- Open an issue for discussion
- Ask in the pull request
- Contact the maintainers
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Keep discussions on topic
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing! 🚀