| Command | Description |
|---|---|
flutter test |
Run all tests |
flutter test test/<module> |
Run specific module tests |
dart analyze |
Static analysis (zero warnings required) |
dart format . |
Format all code |
dart fix --apply |
Auto-fix issues |
cd example && flutter run |
Run example app |
dart pub publish --dry-run |
Validate before release |
Every feature, fix, or refactor follows red-green-refactor:
- Red -- Write a failing test
- Green -- Write minimum code to pass
- Refactor -- Clean up, keep tests green
Verification cycle: Edit -> flutter test -> dart analyze -> repeat until green
setUp(): AlwaysMagicApp.reset()+Magic.flush()-- clears IoC and facade caches- Mock via contract inheritance, not code generation -- no mockito
- Tests mirror
lib/src/structure intest/ - Controller tests:
Magic.put<T>(controller)to inject - Integration tests in
test/integration/
ci.yml: push/PR -> flutter pub get -> flutter analyze --no-fatal-infos -> dart format --set-exit-if-changed -> flutter test --coverage
publish.yml: git tag -> validate (analyze + format + test) -> auto-publish to pub.dev
- Commit style:
type(scope): description(conventional commits) - Types:
feat,fix,refactor,chore,docs,test - Branch naming:
feat/,fix/,chore/,docs/ - Protected
master-- all changes via PR
After ANY source code change, sync before committing:
CHANGELOG.md-- Add entry under[Unreleased]doc/-- Update relevant documentationREADME.md-- Update if new features or API changesskills/magic-framework/-- Update if API, facades, or patterns changedexample/-- Update or create example usage