moarch 1.6.5
moarch: ^1.6.5 copied to clipboard
Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.
Changelog #
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog.
[Unreleased] #
Fixed #
Found by actually running moarch init --all + moarch create feature --all against a real flutter create project and checking flutter pub get / flutter analyze — several of these meant the documented quick-start flow didn't compile out of the box.
PubspecUtils._ensureSectioncorruptedpubspec.yaml. It misread the nestedsdk: flutterline underflutter:(present in everyflutter createproject) as the end of thedependencies:section, so all new dependencies were inserted in the wrong place and produced a duplicate YAML key that madeflutter pub getfail outright.- Generated
app_router.dartreferenced an undefinedauthNotifierProviderandAppRoutes.login(which is commented out by default) — a freshmoarch init --allproject never compiled. The auth-guard redirect is now documented as an opt-in commented example instead of active code. - Generated
dio_client.dartreferencedAppEnv.prodBaseUrl/AppEnv.devBaseUrl, which don't exist on the generatedAppEnv(onlybaseUrldoes). - Generated
safe_api_call.darthad a stray~character right after the opening string literal, which was a syntax error. - Generated
connectivity_service.dartimported a garbled path (core/utils/appappLogger.iger.dart) and called an undefined top-levellog()instead ofappLogger. - Generated
media_service.dartcalledFilePicker.pickFiles(...)statically;pickFilesis an instance method onFilePicker.platform. - Generated use case (
get_<name>.dart) imported acore/usecases/usecase.dartbase class that is never generated anywhere, and its import path torepository_impl.darthad one extra../. Use cases are now self-contained (no missing base class) with corrected import depth. - Generated repository interface/impl never declared the
getAll()method that the generated use case called against it. - Generated notifier (
<name>_notifier.dart) only imported the repository provider when "Use Cases" was not selected, soauthRepositoryProviderwas undefined whenever use cases were included (the notifier's_repogetter needs it either way). - Generated
<name>_remote_datasource.dartcalledsafeApiCallwithout importing the file that defines it. create feature <name>with the "Local/Cache Datasource" layer selected wrote the connectivity service to the wrong path and passed the wrong variable name into the generated datasource (swapped arguments).- Generated
AppImagewidget had a syntax error (?.isValidUrl != nullwith no receiver). - Generated
AppAvatar/AppImagewidgets checked a method tear-off instead of callingisValidUrl(), so an invalid URL was never actually detected.
Added #
- CI workflow (
dart analyze,dart format --set-exit-if-changed,dart test,dart pub publish --dry-run) on push/PR tomain. moarch doctorcommand to sanity-check an existing scaffolded project.--dry-runflag onmoarch initto preview generated files without writing them.--verboseflag to print stack traces on unexpected errors.- Per-item descriptions and a quit option (
q) in the interactive checklist prompt. - Real dark theme (
AppTheme.dark) instead of an empty stub, with matching dark color tokens inAppConstants. - Dark-mode variant in the generated
flutter_native_splash.yaml.
Changed #
initandcreate feature/create modelnow roll back files they created if scaffolding fails partway through, instead of leaving the target project in a half-generated state.initalso restores the originalpubspec.yamlon failure.- CLI version string is now read from a single source (
lib/src/version.dart) instead of being hardcoded inrunner.dart.
Known gaps (not addressed this round — out of scope) #
- The generated
test/test_helper.dartreferencesmocktail, which isn't declared as a dependency, so it doesn't compile as-is. Left untouched since testing scaffolding is handled by the separatemogen_unit_tests/mogen_integration_testspackages.