mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +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:
10
codex-rs/Cargo.lock
generated
10
codex-rs/Cargo.lock
generated
@@ -1833,7 +1833,6 @@ dependencies = [
|
||||
"bm25",
|
||||
"chardetng",
|
||||
"chrono",
|
||||
"clap",
|
||||
"codex-api",
|
||||
"codex-app-server-protocol",
|
||||
"codex-apply-patch",
|
||||
@@ -2913,6 +2912,15 @@ dependencies = [
|
||||
"winres",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codex-write-config-schema"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"codex-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "color-eyre"
|
||||
version = "0.6.5"
|
||||
|
||||
@@ -65,6 +65,7 @@ members = [
|
||||
"utils/oss",
|
||||
"utils/fuzzy-match",
|
||||
"utils/stream-parser",
|
||||
"write-config-schema",
|
||||
"codex-client",
|
||||
"codex-api",
|
||||
"state",
|
||||
|
||||
@@ -9,10 +9,6 @@ doctest = false
|
||||
name = "codex_core"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "codex-write-config-schema"
|
||||
path = "src/bin/config_schema.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -26,7 +22,6 @@ base64 = { workspace = true }
|
||||
bm25 = { workspace = true }
|
||||
chardetng = { workspace = true }
|
||||
chrono = { workspace = true, features = ["serde"] }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
codex-api = { workspace = true }
|
||||
codex-app-server-protocol = { workspace = true }
|
||||
codex-apply-patch = { workspace = true }
|
||||
|
||||
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 }
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
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)]
|
||||
@@ -12,9 +13,11 @@ struct Args {
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse();
|
||||
let out_path = args
|
||||
.out
|
||||
.unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("config.schema.json"));
|
||||
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(())
|
||||
}
|
||||
2
justfile
2
justfile
@@ -76,7 +76,7 @@ mcp-server-run *args:
|
||||
|
||||
# Regenerate the json schema for config.toml from the current config types.
|
||||
write-config-schema:
|
||||
cargo run -p codex-core --bin codex-write-config-schema
|
||||
cargo run -p codex-write-config-schema
|
||||
|
||||
# Regenerate vendored app-server protocol schema artifacts.
|
||||
write-app-server-schema *args:
|
||||
|
||||
Reference in New Issue
Block a user