Contributing
Thank you for your interest in contributing to C3 CloudFront Cache Controller!
Development Environment Setup
Prerequisites
- PHP: 7.4 or higher
- Node.js: 20 or higher
- Git: For version control
Setup Steps
Clone the repository:
bashgit clone https://github.com/amimoto-ami/c3-cloudfront-clear-cache.git cd c3-cloudfront-clear-cache
Install Node.js dependencies:
bashnpm install
Start development environment with wp-env:
bashnpm run dev
Install PHP dependencies
bashnpm run composer:install
Development Workflow
Branch Strategy
master
- Production branchdevelop
- Development branchfeature/*
- Feature branchesbugfix/*
- Bug fix branches
Creating a Feature Branch
bash
git checkout develop
git pull origin develop
git checkout -b feature/your-feature-name
# Make changes and commit
git add .
git commit -m "feat: add your feature description"
# Create pull request
git push origin feature/your-feature-name
Testing
Running Tests
bash
# Run all tests
npm run test
# Run specific test suites
wp-env run tests composer run test:unit
wp-env run tests composer run test:integration
Code Quality
Code Style Checks
bash
# PHP CodeSniffer
wp-env run tests composer run phpcs
# Auto-fix code style
wp-env run tests composer run phpcbf
Pull Requests
Pre-submission Checklist
- [ ] All tests pass
- [ ] Code follows style guidelines
- [ ] Documentation updated (if needed)
Pull Request Template
markdown
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Manual testing completed
Resources
Thank you for contributing!