forge_codegen/lib.rs
1//! FORGE binding generation system.
2//!
3//! Generates type-safe frontend bindings from Rust source code.
4//! Supports two targets: SvelteKit (TypeScript) and Dioxus (Rust).
5//!
6//! # Architecture
7//!
8//! The system has three layers:
9//!
10//! 1. **Parser** (`parser.rs`) — Extracts schema definitions from Rust AST.
11//! 2. **Binding IR** (`binding.rs`) — Pre-computes all function binding facts once.
12//! 3. **Emitters** (`emit.rs`, `typescript/`, `dioxus/`) — Generate target code
13//! using shared type mapping functions, eliminating duplication.
14//!
15//! The key design principle: every type mapping and utility function exists in
16//! exactly one place (`emit.rs`), so edge cases can't diverge between targets.
17
18mod binding;
19pub mod dioxus;
20mod emit;
21pub mod parser;
22pub mod typescript;
23
24pub use dioxus::DioxusGenerator;
25pub use parser::parse_project;
26pub use typescript::{Error, GenerateOptions, RUNES_SVELTE_TS, TypeScriptGenerator};