aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
6
akode-rs/config-schema/BUILD.bazel
Normal file
6
akode-rs/config-schema/BUILD.bazel
Normal file
@@ -0,0 +1,6 @@
|
||||
load("//:defs.bzl", "codex_rust_crate")
|
||||
|
||||
codex_rust_crate(
|
||||
name = "config-schema",
|
||||
crate_name = "codex_config_schema",
|
||||
)
|
||||
17
akode-rs/config-schema/Cargo.toml
Normal file
17
akode-rs/config-schema/Cargo.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "akode-config-schema"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "akode-write-config-schema"
|
||||
path = "src/main.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
akode-config = { workspace = true }
|
||||
22
akode-rs/config-schema/src/main.rs
Normal file
22
akode-rs/config-schema/src/main.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
//! Generates the canonical config schema fixture for development and releases.
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Generate the JSON Schema for `config.toml` and write it to `config.schema.json`.
|
||||
#[derive(Parser)]
|
||||
#[command(name = "akode-write-config-schema")]
|
||||
struct Args {
|
||||
#[arg(short, long, value_name = "PATH")]
|
||||
out: Option<PathBuf>,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse();
|
||||
let out_path = args.out.unwrap_or_else(|| {
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../core/config.schema.json")
|
||||
});
|
||||
akode_config::schema::write_config_schema(&out_path)?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user