appstruct-codegen 0.2.0

Deterministic Rust, SQL, OpenAPI, TypeScript, and React generation for AppStruct
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use appstruct_codegen::plan;
use appstruct_compiler::compile_project;
use appstruct_ir::EntityId;
use std::path::Path;

#[test]
fn malformed_ir_is_rejected_before_generators_traverse_it() {
    let fixture = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../tests/fixtures/m0-project");
    let mut ir = compile_project(&fixture).unwrap();
    ir.relations[0].target = EntityId("app::Missing".to_owned());

    let error = plan(&ir).unwrap_err();
    assert!(error.to_string().contains("relations[0].target"));
}