Skip to main content

Codegen & graphify

Code generation

Two generators run: auto_route (router.gr.dart) and json_serializable (bloc state.g.dart). After changing a route or a @JsonSerializable state, regenerate.

Always scope codegen to the file you changed with --build-filter, then verify the diff — build_runner can clobber a hand-maintained sibling .g.dart:

cd app
fvm dart run build_runner build --delete-conflicting-outputs \
--build-filter "lib/inside/blocs/<feature>/state.g.dart"

git diff --stat # confirm ONLY the intended .g.dart changed
# if a sibling was clobbered, restore it byte-for-byte:
git checkout HEAD -- lib/inside/blocs/<other>/state.g.dart

The SDK's Drift schema regen is similar — run it from packages/client_sdk/ and scope to lib/src/adapters/local/local_database.g.dart, then restore any clobbered siblings.

graphify

The repo ships an AST-only graphify knowledge graph at graphify-out/ (no API cost). For "where is X / how does Y work", query the graph — it returns a scoped subgraph far smaller than grep:

graphify query "how does the app persist a kid's chosen colour"
graphify path "SetupBloc" "HouseholdRepository" # the relationship between two nodes
graphify explain "kidColorResolved" # one focused concept

After modifying code, keep the graph current:

graphify update .

graph.json + GRAPH_REPORT.md are committed; the cache + HTML view are gitignored (regenerable).