From b37a95caf60ac8adb4b0aefbfd74d5f581ddfa95 Mon Sep 17 00:00:00 2001 From: Kinflou Date: Sun, 11 Oct 2026 04:54:11 +0800 Subject: [PATCH 1/3] feat: --external-std / comline.toml external_std for comline generate Wires comline-rust#30's external_std opt-in through the CLI: a new comline.toml [generate] external_std field (per-target override, COMLINE_GENERATE_EXTERNAL_STD env var, --external-std flag), same precedence chain mode/out/layout already use. Also fixes a real gap found while testing end-to-end: code mode's own driver independently expects a generated file for every schema it knows about, which breaks once a generator deliberately drops one (std's own schemas, under external_std) - skip that check for std specifically, mirroring the same namespace-prefix convention the generator itself uses to decide what to drop. Bumps comline-codegen/-rust/-typescript to revs carrying GenRequest.external_std (generation#40, comline-rust#30, comline-typescript#25 - all branch-tip, pending merge). --- Cargo.lock | 6 +-- Cargo.toml | 20 ++++---- docs/cli.md | 26 ++++++++--- src/cli.rs | 5 ++ src/commands/generate.rs | 14 ++++++ src/gen_config.rs | 89 ++++++++++++++++++++++++++++++++++-- src/main.rs | 2 + tests/cli/generate.rs | 99 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 238 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 912c941..9359b33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "comline-codegen" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=2b5c46eefab186d24f5e883cef3fa79e4cb83ffd#2b5c46eefab186d24f5e883cef3fa79e4cb83ffd" +source = "git+https://github.com/ComlineProject/generation?rev=efbd9824eb4ee28bd91b1aaa04a52883d4e1ab45#efbd9824eb4ee28bd91b1aaa04a52883d4e1ab45" dependencies = [ "comline-core", "eyre", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=8844c3e8ab61cd6f3edb8c17082c93f35db6f943#8844c3e8ab61cd6f3edb8c17082c93f35db6f943" +source = "git+https://github.com/ComlineProject/comline-rust?rev=930f02d7acbaf8f52803434f857528300a0db882#930f02d7acbaf8f52803434f857528300a0db882" dependencies = [ "comline-codegen", "comline-core", @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "comline-codegen-typescript" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-typescript?rev=1e934a6e98e6f447d1cfe78dc5b22dff1e491f8f#1e934a6e98e6f447d1cfe78dc5b22dff1e491f8f" +source = "git+https://github.com/ComlineProject/comline-typescript?rev=86ddc4a016d5d6251179a140c808e4109d65895c#86ddc4a016d5d6251179a140c808e4109d65895c" dependencies = [ "comline-codegen", "comline-core", diff --git a/Cargo.toml b/Cargo.toml index f5942bf..e6dbe0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,16 +30,16 @@ toml = "0.8" # `comline-core`'s wasm32 consumers (the playground editor, the language # server); the CLI is the one consumer that actually runs `comline build`. comline-core = { git = "https://github.com/ComlineProject/core", rev = "6431e61a4f1073aceeaee7be7df83e6b77b2acd5", features = ["deps"] } -# All three pinned to revs that already agree on comline-core@6431e61 -# (core#73 - settings hover for .ids and .idp) - bumped together: -# generation#38's branch-tip commit (comline-rust/comline-typescript's own -# codegen crates consume `comline-codegen`'s types, so this pins the exact -# same generation rev they do - 2b5c46e, not generation's later merge -# commit from step 3, since Cargo only unifies a git dependency across -# byte-identical revs), then comline-rust#27 and comline-typescript#24. -comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "2b5c46eefab186d24f5e883cef3fa79e4cb83ffd" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "8844c3e8ab61cd6f3edb8c17082c93f35db6f943", optional = true } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "1e934a6e98e6f447d1cfe78dc5b22dff1e491f8f", optional = true } +# All three pinned to revs that agree on one `comline-codegen` - bumped +# together: generation#40's branch-tip commit (GenRequest.external_std - +# comline-rust/comline-typescript's own codegen crates consume +# `comline-codegen`'s types, so this pins the exact same generation rev +# they do, since Cargo only unifies a git dependency across byte-identical +# revs), then comline-rust#30 and comline-typescript#25 (both branch-tip, +# pending those PRs' merge). +comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "efbd9824eb4ee28bd91b1aaa04a52883d4e1ab45" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "930f02d7acbaf8f52803434f857528300a0db882", optional = true } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "86ddc4a016d5d6251179a140c808e4109d65895c", optional = true } [features] # Which language generators are compiled in. Drop one to shed its whole diff --git a/docs/cli.md b/docs/cli.md index 2bf5801..186b90c 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -215,7 +215,7 @@ comline build --watch ### `comline generate` ``` -comline generate [--target ] [--out ] [--layout