Skip to main content

Crate gize_generator

Crate gize_generator 

Source
Expand description

Code generation engine for Gize.

Two responsibilities:

  1. Turn gize_core specs into file contents (via gize_templates).
  2. Write those files safely — never clobbering user code without --force, and supporting --dry-run (ADR-012).

Re-exports§

pub use plan::FileOp;
pub use plan::OpKind;
pub use plan::Plan;
pub use registry::Edit;
pub use registry::register_module;
pub use writer::Options;
pub use writer::Report;
pub use writer::Writer;

Modules§

plan
A Plan is the set of file operations a generator wants to perform. Building the plan is pure (no I/O), which makes generators easy to test and makes --dry-run trivial: we simply render the plan instead of applying it.
registry
Idempotent edits to “registry” files — the ones gize make app must update in place rather than create: src/app/mod.rs (module + route wiring).
scaffold
High-level generators. Each returns a pure Plan; applying it is the [Writer]’s job. This separation keeps generation testable and makes --dry-run free.
writer
Applies a Plan to the filesystem, honouring the Gize safety model (ADR-012): never overwrite an existing file unless force is set, and write nothing at all when dry_run is set.