Skip to content

v0.6.0 — blueprint is a generator, not a source of truth (BREAKING)

Choose a tag to compare

@DonaldMurillo DonaldMurillo released this 12 Jun 20:50
· 54 commits to main since this release

Reframes the blueprint as a generator, not a source of truth. gofastr generate now scaffolds owned Go in an idiomatic, module-root layout you read, edit, and commit — no quarantined gen/ directory and no // Code generated … DO NOT EDIT. header. Re-running the generator is add-only and never clobbers your edits.

BREAKING

  • gofastr generate scaffolds into the module root, not gen/. A blueprint scaffolds main.go + entities/ + blueprint/ at the module root, as owned Go with no generated header. Writes are conflict-skip: a re-run adds new files but never overwrites hand-edited code — --force to overwrite. The blueprint is an on-ramp; once scaffolded the generated Go is the source of truth and the running app doesn't need the gofastr.yml.

    • Migration: pass --out=gen (or app.output_dir: gen) to keep the old layout; build/run with go run . instead of go run ./gen. examples/ecommerce scaffolds into an owned app/ subpackage.
  • gofastr migrate diff removed. It applied a blueprint directly onto a live database, treating the blueprint as authoritative over the running schema. Code generation and schema migration are separate concerns.

    • Migration: use gofastr migrate generate <name> to emit a reviewable, versioned migration, then gofastr migrate up; additive columns also converge on boot via AutoMigrate. migrate generate still accepts --from=<blueprint.yml> as an opt-in schema source.

Full notes: see CHANGELOG.md. Pin a version (go get …@v0.6.0).