srik_cli 0.3.0
srik_cli: ^0.3.0 copied to clipboard
Flutter project scaffolder. Choose architecture (Clean, MVVM, Feature-first, Simple), design preset, gradients, and spacing. Generate projects and add features.
Changelog #
0.3.0 #
Build flavors. srik create --flavors=dev,staging,prod (or the interactive
prompt) scaffolds a project with separate build variants — each with its own
app name, bundle ID suffix, API base URL, and entry point. Without --flavors,
output is unchanged from 0.2.x. Verified on all four architectures: generated
projects pass flutter analyze with zero issues, and flutter build apk --flavor dev produces a working APK.
New #
--flavorsoption onsrik create(comma-separated, e.g.dev,staging,prod) plus an interactive prompt. Flavor names are validated (lowercase, start with a letter; duplicates and reserved words likemain/testare rejected).- Dart: one entry point per flavor (
lib/main_<flavor>.dart);main.dartdefaults to the first flavor. A generatedapp_config.dartexposes aFlavorenum and anAppConfig(app name, API base URL, bundle suffix) selected at startup viaAppConfig.current. The app title and Dio base URL are driven by the active flavor. Config file location follows the chosen architecture (core/config,shared/config, orconfig). - Android: a
productFlavorsblock is inserted intoandroid/app/build.gradle{.kts}(Kotlin and Groovy DSL both supported), parsed and inserted inside theandroid { }block rather than appended.AndroidManifest.xmlis wired to@string/app_nameso per-flavor names show on device. - iOS: a
FLAVORS_IOS_SETUP.mdwith step-by-step Xcode instructions (the.pbxprojis intentionally not edited programmatically). - VS Code:
.vscode/launch.jsonwith one launch configuration per flavor. - README: a "Flavors" section with per-flavor run/build commands.
srik.yamlrecords the chosen flavors under aflavors:list.
0.2.1 #
Internal optimizations — no user-facing behavior changes. Generated output is
identical (and still passes flutter analyze with zero issues on all four
architectures).
Performance #
srik createrunsflutter pub getandgit initconcurrently, then commits — shaving time off project creation.- Uses
flutter create --emptywhen the installed Flutter supports it (3.6+), skipping the throwaway counter-app boilerplate.
Internal #
- Deduplicated architecture templates: shared
main.dart,app.dart, the Dio client, the go_router config, and the home screen body now live inlib/templates/shared/snippets.dart. Each architecture composes these snippets instead of copy-pasting source, so a change is made in one place.
Docs #
- README: added an optional "Faster startup" (AOT compile) section.
- README: corrected
add feature/add screendocs — they support all four architectures (since 0.2.0), not just Clean.
0.2.0 #
First public release after 0.1.0. Massive expansion of architecture, design, and code-generation capabilities.
New #
- Architecture choice —
srik create --arch=<arch>picks one of:clean— Clean Architecture (core + layered features/)mvvm— Model-View-ViewModel (models/ services/ viewmodels/ views/)feature-first— flat per-feature folders under features/simple— minimal structure, no layering
- Design presets —
--design=material|vibrant|minimal; each generates a full set of design tokens (colors, spacing, radius, typography) from your brand color. - Gradient themes —
--gradientflag generatesapp_gradients.dartwith brand-derived linear and radial gradients. - Spacing scales —
--spacing=compact|normal|spaciouspicks the density of the spacing tokens. srik add feature <name>— generates a full feature module appropriate to the project's architecture (works for all four archs).srik add screen <name> --feature <feature>— adds a screen (and optional provider) to an existing feature; works for all four archs.srik create --verbose/-vfor extra diagnostics.- Spinner shown during
flutter createandflutter pub get. srik.yamlis read automatically when runningsrik addfrom any subdirectory of a project.
Generated-code quality #
- Generated
main.dartinitializesSharedPreferencesand wires it intoProviderScope— no moreUnimplementedErrorat startup. - Generated projects pass
flutter analyzewith zero issues across all four architectures, both aftercreateand afteradd feature/add screen. - Generated repo stubs use a clear
TODOinstead of fakeFuture.delayed. - All generated code uses package imports (
package:app/...) for robustness.
Correctness #
srik.yamlmutation safely rewrites the file via a managed template (no more fragile line-based parsing).- Enum parsers (
AppArchitecture,DesignPreset,SpacingScale) throwFormatExceptionon unknown input instead of silently defaulting. LoggerhonorsNO_COLOR, non-TTY stdout, and Windows ANSI support.srik createvalidates that--outputexists and is writable before starting generation.srik doctortolerates empty/non-string version output.FeatureGenerator.designDirForerrors loudly on unknown architectures.
UX #
- Error messages echo the user's bad input and show a concrete example (e.g. "Invalid feature name 'Foo Bar'. ... Example: user_profile").
- Interactive prompts cover architecture, design preset, gradient, and spacing.
srik.yamlnow ships with a documented header explaining every field.
Internal #
- Unified
ProjectGeneratordispatches to per-architecture template sets. - Architecture templates split into
lib/templates/architectures/. - Per-arch add templates in
lib/templates/add/. - Shared design + common templates in
lib/templates/shared/. - Test suite expanded to 57 tests (was 8 in 0.1.0): integration tests across all four architectures, multi-arch add tests, validators, enums, generators.
0.1.0 #
Initial release.
srik create <name>generates a Clean Architecture + Riverpod project with go_router, Dio, shared_preferences, design tokens, and a sample feature.srik doctorchecks the environment.--versionflag.- Interactive prompts,
--no-interactivemode, input validation, git init.