stackchain library
Stackchain — config-driven Flutter project scaffolding that evolves.
dart run stackchain init
dart run stackchain feature auth
dart run stackchain test auth
dart run stackchain sync
dart run stackchain upgrade
dart run stackchain migrate --state cubit
Classes
- BrickEngine
- Mason-like brick generator: file templates + vars + hooks.
- CrudRecipe
-
List + form extras for
stackchain crud <entity>. - CustomMethodStubber
-
Scans
// <stackchain:custom>for methods and stubs tests in*_custom_test.dart. - DoctorEngine
-
Extended diagnostics + optional auto-repair for
stackchain doctor. - FeatureRecipeExtras
- Extra widgets / barrel files for known shippable feature recipes.
- FeatureRemover
-
Removes a feature that was added via
feature/add. - FeatureRemoveReport
- FeatureRenamer
- Renames a feature across yaml, files, tests, router, and DI.
- FeatureRenameReport
- FeatureTestGenerator
- Generates unit / widget / integration tests for one or more features.
- FeatureTestReport
-
Result of
stackchain test. - FeatureTestTemplates
- Stack-aware unit / widget / integration test scaffolds for one feature.
- MigrationEngine
- Intentional stack evolution (e.g. bloc → cubit, go_router stays).
- MigrationPatch
- Declarative migration patch from CLI flags.
- MigrationReport
- ModulesConfig
- Optional product modules toggled from config.
- OwnedRegions
- Stackchain-owned marker ids for presentation / test scaffolds.
- PreservingFileWriter
-
Writes stackchain-owned files while preserving
// <stackchain:custom>code. - PresetRegistry
- Named production blueprints composed on top of stackchain.yaml.
- ProjectGenerator
- Orchestrates full project generation.
- ProjectSync
- Incrementally wires router + DI from StackchainConfig using smart merges.
- QualityGate
- Validates generated / synced project structure for production trust.
- QualityReport
- Result of a post-generate quality gate.
- RegionMerger
- Marker-based smart merges for Stackchain-managed Dart regions.
- SmartFileMerger
- High-level smart merge API used by sync / upgrade / vertical slices.
- StackchainConfig
-
Root configuration loaded from
stackchain.yaml. - TemplateRenderer
-
Lightweight Mustache-style renderer (Mason-like
{{var}}/{{var.case}}). - UpgradeEngine
- Evolves an existing Stackchain project: deps, sync, lockfile, quality gate.
- UpgradeReport
- VerticalSliceGenerator
- Adds a feature as a full vertical slice: files + router + DI + tests.
- YamlParser
-
Parses and validates
stackchain.yaml.
Enums
- TestType
-
Layers produced by
stackchain test.
Extensions
- PresetApply on StackchainConfig
- Applies a preset map onto a partially built config path via YamlParser.
Constants
- stackchainPackageVersion → const String
- Stackchain package version — keep in sync with pubspec.yaml.
- templateSuffix → const String
-
Trailing marker on template files so
dart formatskips unparsable mustache sources such aswidget.dart.tpl.
Functions
-
configFromLooseMap(
Map< String, Object?> map, {required List<String> features, String? packageName, ModulesConfig? modules}) → StackchainConfig - Resolves enum fields from a loose preset/user map (for migrations).
-
customTestPathFor(
String feature) → String - Convenience for callers that only have a feature name.
-
featurePascal(
String feature) → String - Expose pascal for tests.
-
stripTemplateSuffix(
String path) → String - Removes a trailing templateSuffix from a rendered brick path.