feat: Initial rewrite of python render tool

This commit is contained in:
2026-03-16 03:14:33 +01:00
commit 9d122cf07b
24 changed files with 4457 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
[package]
name = "xtask"
version = "0.1.0"
edition = "2024"
[dependencies]
repo_path = "1.2.4"
schemars = { workspace = true }
serde_json = { workspace = true }
crete = { path = ".." }
+24
View File
@@ -0,0 +1,24 @@
use std::fs::File;
use std::io::Write;
use crete::cluster::OptionalCluster;
use crete::node::OptionalNode;
use repo_path::repo_path;
use schemars::{JsonSchema, schema_for};
fn write<T>(name: &str)
where
T: JsonSchema,
{
let mut path = repo_path!("schemas").join(name);
path.add_extension("json");
let mut file = File::create(path).unwrap();
let schema = serde_json::to_string_pretty(&schema_for!(T)).unwrap();
file.write_all(schema.as_bytes()).unwrap();
}
fn main() {
write::<OptionalCluster>("cluster");
write::<OptionalNode>("node");
}