āĻ¸ā§āĻ•āĻŋāĻĒ āĻ•āϰ⧇ āĻŽā§‚āϞ āĻ•āĻ¨ā§āĻŸā§‡āĻ¨ā§āϟ āĻ āϝāĻžāύ

🤝 Contributing to FLX CLI

FLX CLI-āĻ contribution āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āϧāĻ¨ā§āϝāĻŦāĻžāĻĻ! āφāĻŽāϰāĻž community contributions āϕ⧇ āĻ¸ā§āĻŦāĻžāĻ—āϤ āϜāĻžāύāĻžāχ āĻāĻŦāĻ‚ project-āϕ⧇ āφāϰāĻ“ āĻ­āĻžāϞ āĻ•āϰāϤ⧇ āφāĻĒāύāĻžāϰ āϏāĻžāĻšāĻžāĻ¯ā§āϝ āϚāĻžāχāĨ¤

Getting Started​

Prerequisites​

Contributing āĻ•āϰāĻžāϰ āφāϗ⧇ āύāĻŋāĻļā§āϚāĻŋāϤ āĻšāύ āϝ⧇ āφāĻĒāύāĻžāϰ system-āĻ āĻāϗ⧁āϞ⧋ installed āφāϛ⧇:

# Dart SDK (latest stable)
dart --version

# Git
git --version

# IDE (VS Code/IntelliJ/Android Studio)
code --version

Setting Up Development Environment​

  1. Repository Fork āĻ•āϰ⧁āύ:
# Fork the repository to your GitHub account
# Then clone your fork
git clone https://github.com/YOUR_USERNAME/flx_cli.git
cd flx_cli
  1. Dependencies Install āĻ•āϰ⧁āύ:
# Install dependencies
dart pub get

# Run tests to ensure everything works
dart test
  1. Development Branch āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ:
# Create a new branch for your feature
git checkout -b feature/your-feature-name

Development Guidelines​

Code Style​

āφāĻŽāϰāĻž consistent code style maintain āĻ•āϰāĻŋāĨ¤ āĻĒā§āϰāϤāĻŋāϟāĻŋ contribution-āĻ āĻāχ guidelines follow āĻ•āϰ⧁āύ:

// ✅ Good: Clear naming and proper formatting
class FeatureGenerator {
final String featureName;
final TemplateType templateType;

FeatureGenerator({
required this.featureName,
required this.templateType,
});

Future<void> generateFeature() async {
await _validateFeatureName();
await _createDirectoryStructure();
await _generateFiles();
}

Future<void> _validateFeatureName() async {
if (featureName.isEmpty) {
throw ValidationException('Feature name cannot be empty');
}
}
}
// ❌ Bad: Poor naming and formatting
class fg {
String n;
var t;

fg(this.n, this.t);

void gen() async {
if(n=="") throw Exception("bad");
// more code...
}
}

Project Structure​

lib/
├── core/ # Core utilities and constants
│ ├── commands/ # Base command classes
│ ├── generators/ # Code generation utilities
│ ├── templates/ # Template management
│ └── utils/ # Helper utilities
├── features/ # Feature-specific implementations
│ ├── auth/ # Authentication feature generator
│ ├── dashboard/ # Dashboard generator
│ └── common/ # Common features
└── cli/ # CLI interface and argument parsing

Testing Standards​

āφāĻŽāϰāĻž comprehensive testing maintain āĻ•āϰāĻŋāĨ¤ āĻĒā§āϰāϤāĻŋāϟāĻŋ contribution-āĻ tests āĻĨāĻžāĻ•āϤ⧇ āĻšāĻŦ⧇:

// Unit Test Example
import 'package:test/test.dart';
import 'package:flx_cli/features/auth/auth_generator.dart';

void main() {
group('AuthGenerator', () {
late AuthGenerator generator;

setUp(() {
generator = AuthGenerator(
featureName: 'user_auth',
stateManagement: StateManagement.getx,
);
});

test('should generate auth files correctly', () async {
// Arrange
final expectedFiles = [
'auth_controller.dart',
'auth_binding.dart',
'auth_page.dart',
];

// Act
final result = await generator.generate();

// Assert
expect(result.isSuccess, isTrue);
expect(result.generatedFiles, containsAll(expectedFiles));
});

test('should throw exception for invalid feature name', () {
// Arrange & Act & Assert
expect(
() => AuthGenerator(featureName: '', stateManagement: StateManagement.getx),
throwsA(isA<ValidationException>()),
);
});
});
}

Integration Tests​

// Integration Test Example
import 'package:test/test.dart';
import 'package:flx_cli/cli/flx_cli.dart';

void main() {
group('CLI Integration Tests', () {
test('should generate complete feature structure', () async {
// Arrange
final cli = FlxCli();
final args = ['gen', 'feature', 'product', '--state-management=getx'];

// Act
final result = await cli.run(args);

// Assert
expect(result.exitCode, equals(0));
expect(result.output, contains('Feature generated successfully'));

// Verify files exist
expect(File('lib/features/product/presentation/pages/product_page.dart').exists(), isTrue);
expect(File('lib/features/product/domain/entities/product_entity.dart').exists(), isTrue);
});
});
}

Types of Contributions​

🐛 Bug Fixes​

Bug fix āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ:

  1. Issue āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ bug report āϏāĻš
  2. Root cause analyze āĻ•āϰ⧁āύ
  3. Test case āϞāĻŋāϖ⧁āύ bug reproduce āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ
  4. Fix implement āĻ•āϰ⧁āύ
  5. Test case pass āĻ•āϰāĻžāύ

✨ New Features​

New feature add āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ:

  1. Feature proposal āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ GitHub issue-āĻ
  2. Design document āϞāĻŋāϖ⧁āύ
  3. Community feedback āύāĻŋāύ
  4. Implementation plan āĻ•āϰ⧁āύ
  5. Code āĻāĻŦāĻ‚ tests āϞāĻŋāϖ⧁āύ

📝 Documentation​

Documentation improve āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ:

  1. Current documentation review āĻ•āϰ⧁āύ
  2. Missing āĻŦāĻž unclear parts identify āĻ•āϰ⧁āύ
  3. Clear āĻāĻŦāĻ‚ comprehensive content āϞāĻŋāϖ⧁āύ
  4. Examples āĻāĻŦāĻ‚ code samples āϝ⧋āĻ— āĻ•āϰ⧁āύ

🎨 Templates​

New template āϤ⧈āϰāĻŋ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ:

// Template Example
class CustomPageTemplate extends PageTemplate {

String generate(PageConfig config) {
return '''
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class ${config.className}Page extends StatelessWidget {
const ${config.className}Page({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('${config.title}'),
),
body: const Center(
child: Text('${config.className} Page'),
),
);
}
}
''';
}
}

Pull Request Process​

Before Submitting​

  1. Code quality check āĻ•āϰ⧁āύ:
# Format code
dart format .

# Analyze code
dart analyze

# Run tests
dart test

# Check test coverage
dart test --coverage
  1. Commit messages follow āĻ•āϰ⧁āύ:
# Feature commits
feat: add authentication feature generator

# Bug fix commits
fix: resolve null pointer exception in template parser

# Documentation commits
docs: update installation guide with Windows steps

# Test commits
test: add unit tests for dashboard generator

Pull Request Template​

## Description
Brief description of changes made

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement

## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed

## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Tests pass locally

Review Process​

  1. Automated checks: CI/CD pipeline āϏāĻŦ tests āĻāĻŦāĻ‚ quality checks run āĻ•āϰāĻŦ⧇
  2. Code review: Maintainers code review āĻ•āϰāĻŦ⧇
  3. Feedback: Review feedback address āĻ•āϰ⧁āύ
  4. Approval: Approved āĻšāϞ⧇ merge āĻšāĻŦ⧇

Community Guidelines​

Code of Conduct​

āφāĻŽāϰāĻž inclusive āĻāĻŦāĻ‚ welcoming community maintain āĻ•āϰāĻŋ:

  • Respectful communication: āϏāĻŦāĻžāϰ āϏāĻžāĻĨ⧇ respectful āĻ­āĻžāĻŦ⧇ communicate āĻ•āϰ⧁āύ
  • Constructive feedback: Helpful āĻāĻŦāĻ‚ constructive feedback āĻĻāĻŋāύ
  • Collaborative spirit: Team work āĻāĻŦāĻ‚ knowledge sharing encourage āĻ•āϰ⧁āύ
  • Learning mindset: āύāϤ⧁āύ āĻļ⧇āĻ–āĻžāϰ āϜāĻ¨ā§āϝ open āĻĨāĻžāϕ⧁āύ

Communication Channels​

  • GitHub Issues: Bug reports āĻāĻŦāĻ‚ feature requests
  • GitHub Discussions: General discussions āĻāĻŦāĻ‚ questions
  • Discord: Real-time chat āĻāĻŦāĻ‚ community support
  • Twitter: Updates āĻāĻŦāĻ‚ announcements

Development Resources​

Useful Commands​

# Generate new command template
dart run lib/tools/generate_command.dart command_name

# Run specific test file
dart test test/specific_test.dart

# Generate coverage report
dart test --coverage && genhtml coverage/lcov.info -o coverage/html

# Build executable
dart compile exe bin/flx.dart -o flx

Local Testing​

# Test CLI locally
dart run bin/flx.dart gen feature test_feature

# Test with custom configuration
dart run bin/flx.dart config --state-management=bloc

# Test help system
dart run bin/flx.dart --help

Debugging​

// Add debug logging
import 'package:logging/logging.dart';

final _logger = Logger('FeatureGenerator');

void generateFeature() {
_logger.info('Starting feature generation');
// Your code here
_logger.fine('Feature generation completed');
}

Release Process​

Version Numbering​

āφāĻŽāϰāĻž Semantic Versioning āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻŋ:

  • Major (1.0.0): Breaking changes
  • Minor (1.1.0): New features (backward compatible)
  • Patch (1.1.1): Bug fixes

Release Checklist​

  1. Version bump āĻ•āϰ⧁āύ pubspec.yaml-āĻ
  2. CHANGELOG.md update āĻ•āϰ⧁āύ
  3. Tag āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ git tag v1.2.3
  4. Release notes āϞāĻŋāϖ⧁āύ
  5. Binary publish āĻ•āϰ⧁āύ

Getting Help​

Documentation​

  • API Documentation: Comprehensive API docs
  • Examples: Code examples āĻāĻŦāĻ‚ tutorials
  • Best Practices: Development best practices guide

Support​

  • GitHub Issues: Technical problems āĻāĻŦāĻ‚ bug reports
  • Discord Community: Real-time help āĻāĻŦāĻ‚ discussions
  • Email: maintainers@flxcli.dev

Mentorship​

āύāϤ⧁āύ contributors-āĻĻ⧇āϰ āϜāĻ¨ā§āϝ mentorship program available:

  • First-time contributor guide
  • Assigned mentor complex contributions-āĻāϰ āϜāĻ¨ā§āϝ
  • Regular check-ins progress track āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ

āφāĻĒāύāĻžāϰ contribution FLX CLI community-āϕ⧇ āφāϰāĻ“ strong āĻ•āϰ⧇ āϤ⧁āϞāĻŦ⧇āĨ¤ āφāĻŽāϰāĻž āφāĻĒāύāĻžāϰ participation-āĻāϰ āϜāĻ¨ā§āϝ āωāĻ¨ā§āĻŽā§āĻ–!