Skip to content

Latest commit

 

History

History
164 lines (116 loc) · 3.52 KB

File metadata and controls

164 lines (116 loc) · 3.52 KB

Contributing to Make Bundle

Thank you for considering contributing to make-bundle!

Development Setup

Prerequisites

  • Docker and Docker Compose
  • Make

Installation

# Clone repository
git clone https://github.com/neuralglitch/make-bundle.git
cd make-bundle

# Install dependencies
docker compose run --rm php composer install

Development Workflow

Running Tests

# Run all tests
make test

# Run tests with coverage
make test-coverage

# View coverage report
open build/coverage/index.html

Coverage Target: >80% line coverage for testable code

Code Quality

# PHPStan (static analysis)
make phpstan

# Psalm (static analysis)
make psalm

# PHP CS Fixer (code style)
make cs-fix

# Run all checks
make test && make phpstan && make psalm

Code Style

This project follows:

  • PSR-12 coding standards
  • PHP 8.1+ features
  • Strict types (declare(strict_types=1))
  • Final classes where appropriate
  • Array type hints in PHPDoc

Adding New Features

When adding new features:

  1. Update Configuration - Add properties to BundleConfiguration
  2. Update Wizard - Add questions to BundleConfigAssistant
  3. Create Templates - Add Twig templates if needed
  4. Update Service - Extend CreateBundleService generation logic
  5. Add Tests - Write tests for new functionality
  6. Update Documentation - Document user-facing changes

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes
  4. Add tests (maintain >80% coverage)
  5. Run quality checks:
    make test
    make phpstan
    make psalm
    make cs-fix
  6. Commit with clear message
  7. Push to your fork
  8. Open a Pull Request

PR Requirements

  • ✅ All tests passing
  • ✅ PHPStan Level max: 0 errors
  • ✅ Psalm: 0 errors, 0 INFO issues
  • ✅ Coverage >80% for new code
  • ✅ Code follows PSR-12
  • ✅ Documentation updated
  • ✅ CHANGELOG.md updated (user-facing changes only)

Code Review

What Reviewers Look For

Tests - New code should be tested
Type Safety - Proper type hints and PHPDoc
Documentation - User-facing features documented
Backward Compatibility - No breaking changes without major version
Code Quality - Follows existing patterns

Debugging

Enable Verbose Output

# PHPUnit verbose
docker compose run --rm php vendor/bin/phpunit --verbose

# PHPStan verbose
docker compose run --rm php vendor/bin/phpstan analyse -vvv

# Psalm verbose
docker compose run --rm php vendor/bin/psalm -vvv

Test Single File

# Single test class
docker compose run --rm php vendor/bin/phpunit tests/Service/CreateBundleServiceTest.php

# Single test method
docker compose run --rm php vendor/bin/phpunit --filter testCreateBasicBundle

Generate Temporary Bundle for Testing

# Generate in /tmp for inspection
bin/console make:bundle test/debug-bundle /tmp

# Inspect generated files
cat /tmp/test/debug-bundle/src/TestDebugBundle.php

Release Process

  1. Update version in CHANGELOG.md
  2. Run full test suite
  3. Tag release: git tag v1.0.0
  4. Push tag: git push origin v1.0.0
  5. GitHub Actions will handle the rest

Questions?

License

By contributing, you agree that your contributions will be licensed under the MIT License.