Thank you for your interest in contributing to Flow! This document provides guidelines for contributing to the project.
Please be respectful and constructive in all interactions with the community.
- Use the GitHub issue tracker
- Search for existing issues before creating a new one
- Provide a clear description and reproduction steps
- Include relevant code samples and error messages
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Write clear, concise code
- Follow the existing code style
- Add tests for new functionality
- Ensure tests pass
swift test - Commit your changes
- Use descriptive commit messages
- Follow conventional commit format:
feat: add new featurefix: resolve bugdocs: update documentationrefactor: improve code structuretest: add testschore: update dependencies
- Push to your fork
git push origin feature/your-feature-name
- Create a Pull Request
- Provide a clear description of changes
- Reference any related issues
- Ensure CI checks pass
Use descriptive titles with keywords for automatic labeling:
- Features:
feat: add new middleware system - Bug Fixes:
fix: resolve task cancellation issue - Documentation:
docs: update getting started guide - Refactoring:
refactor: simplify ActionHandler API - Tests:
test: add coverage for TaskManager - Performance:
perf: optimize state updates - Breaking Changes:
feat!: redesign Store API(note the!) - Maintenance:
chore: update dependencies - Security:
security: fix vulnerability
PRs will be automatically labeled based on these keywords.
- Swift 6.2+
- macOS 15.0+ (for development)
swift buildswift testswift test --enable-code-coverage- SwiftLint: Run
swiftlintto check style - Swift Format: Run
swift-format lint --recursive Sources Tests
Flow/
├── Sources/Flow/
│ ├── Store/ # Core store implementation
│ ├── ActionHandler/ # Action processing
│ ├── Middleware/ # Middleware system
│ └── TestStore/ # Testing utilities
├── Tests/
│ ├── UnitTests/ # Unit tests
│ └── IntegrationTests/ # Integration tests
└── Examples/DemoApp/ # Example application
Flow uses automated releases via GitHub Actions:
- Ensure all tests pass
- Update version in Package.swift if needed
- Create and push a version tag:
git tag v0.2.0 git push origin v0.2.0
- GitHub Actions will:
- Run all tests
- Generate release notes from PR labels
- Create a pre-release
- Review and publish:
- Go to GitHub Releases
- Review the automatically generated notes
- Edit if necessary
- Uncheck "This is a pre-release"
- Click "Publish release"
We follow Semantic Versioning:
- MAJOR (1.0.0): Breaking changes
- MINOR (0.1.0): New features (backward compatible)
- PATCH (0.0.1): Bug fixes (backward compatible)
- Unit tests: Test individual components in isolation
- Integration tests: Test component interactions
- Use TestStore: For feature testing with assertions
- Mock dependencies: Inject mocks via initializers
- Aim for high coverage (>90%)
- All public APIs should be tested
- Test edge cases and error conditions
@MainActor
final class MyFeatureTests: XCTestCase {
func testFeature() async {
let store = TestStore(
initialState: MyFeature.State(),
feature: MyFeature()
)
await store.send(.action) { state in
state.value = expectedValue
}
}
}- Use triple-slash comments (
///) - Document all public APIs
- Include code examples in documentation
- Follow Swift DocC format
/// Processes an action and updates state.
///
/// - Parameters:
/// - action: The action to process
/// - state: The current state
/// - Returns: An ActionTask for side effects
///
/// ## Example
/// ```swift
/// let task = await handler.handle(action: .increment, state: state)
/// ```
public func handle(action: Action, state: State) async -> ActionTask- Open a GitHub Discussion
- Check existing Issues
- Review the Documentation
Thank you for contributing to Flow! 🎉