mirror of
https://github.com/openai/codex.git
synced 2026-05-02 20:32:04 +03:00
Move config schema helper out of codex-core package
Keep package-level codex-core checks focused on the library by moving the schema writer binary into its own workspace package and updating the just recipe to call that package directly. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
13
codex-rs/write-config-schema/Cargo.toml
Normal file
13
codex-rs/write-config-schema/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
name = "codex-write-config-schema"
|
||||
version.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
codex-core = { workspace = true }
|
||||
23
codex-rs/write-config-schema/src/main.rs
Normal file
23
codex-rs/write-config-schema/src/main.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
|
||||
/// Generate the JSON Schema for `config.toml` and write it to `config.schema.json`.
|
||||
#[derive(Parser)]
|
||||
#[command(name = "codex-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")
|
||||
.join("config.schema.json")
|
||||
});
|
||||
codex_core::config::schema::write_config_schema(&out_path)?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user