From 92c6c2c63294d882d06d8165c7c610bb866d9f62 Mon Sep 17 00:00:00 2001 From: Kinflou Date: Sat, 3 Oct 2026 22:14:51 +0800 Subject: [PATCH 1/2] feat: real type Foo = Bar generated for a schema's type alias comline-core reworked how `type` aliases freeze (ComlineProject/core#55): each now freezes to its own named FrozenUnit::TypeAlias, same as a struct/enum declaration, instead of being substituted away. Both generators pick this up (ComlineProject/comline-rust#16, ComlineProject/comline-typescript#14) - a schema's `type UserId = u64` now produces a real `pub type UserId = u64;` / `export type UserId = number;`, with fields that use the alias referencing it by name instead of the resolved primitive. Bumps all four pins in lockstep, in dependency order (generation first, since the two per-language codegens consume its types). --- Cargo.lock | 8 ++++---- Cargo.toml | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e4c555b..76887e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,7 +389,7 @@ dependencies = [ [[package]] name = "comline-codegen" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=1464e4fd87537ef6591ba8b165838467e0c33d83#1464e4fd87537ef6591ba8b165838467e0c33d83" +source = "git+https://github.com/ComlineProject/generation?rev=8e28be4566546d3feb8c5caae35d111e7a54df7e#8e28be4566546d3feb8c5caae35d111e7a54df7e" dependencies = [ "comline-core", "eyre", @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=65d986d98900382aa069ed7b787fade6e0fa5c80#65d986d98900382aa069ed7b787fade6e0fa5c80" +source = "git+https://github.com/ComlineProject/comline-rust?rev=2ad8b7423978c17617f01dabbca3a6434c690393#2ad8b7423978c17617f01dabbca3a6434c690393" dependencies = [ "comline-codegen", "comline-core", @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "comline-codegen-typescript" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-typescript?rev=09db5448994b7475b2f6f748ebaad2a0172d7f05#09db5448994b7475b2f6f748ebaad2a0172d7f05" +source = "git+https://github.com/ComlineProject/comline-typescript?rev=e4163a49a33b9ed20d9a03ebf5ad7a866ebf8d89#e4163a49a33b9ed20d9a03ebf5ad7a866ebf8d89" dependencies = [ "comline-codegen", "comline-core", @@ -418,7 +418,7 @@ dependencies = [ [[package]] name = "comline-core" version = "0.1.0" -source = "git+https://github.com/ComlineProject/core?rev=af7e90452334d302c91b7f8815ad44e2bedfebf9#af7e90452334d302c91b7f8815ad44e2bedfebf9" +source = "git+https://github.com/ComlineProject/core?rev=9ec094ec8e573350c6f230aaa58388d032aaa966#9ec094ec8e573350c6f230aaa58388d032aaa966" dependencies = [ "ariadne", "bincode", diff --git a/Cargo.toml b/Cargo.toml index fb02ba9..1146616 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,15 +29,17 @@ toml = "0.8" # needs real I/O (git fetch, filesystem), so it's off by default for # `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 = "af7e90452334d302c91b7f8815ad44e2bedfebf9", features = ["deps"] } -# All three pinned to revs that already agree on comline-core@af7e904 (a -# transparent `type` alias declaration, core#54) — bumped together, in -# dependency order: generation#24 first (comline-rust/comline-typescript's -# own codegen crates consume `comline-codegen`'s types, so they can't bump -# ahead of it), then comline-rust#15 and comline-typescript#13. -comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "1464e4fd87537ef6591ba8b165838467e0c33d83" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "65d986d98900382aa069ed7b787fade6e0fa5c80", optional = true } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "09db5448994b7475b2f6f748ebaad2a0172d7f05", optional = true } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "9ec094ec8e573350c6f230aaa58388d032aaa966", features = ["deps"] } +# All three pinned to revs that already agree on comline-core@9ec094e (a +# `type` alias now freezes to its own named unit instead of being +# substituted away, so a generator can emit a real `type Foo = Bar;`, +# core#55) — bumped together, in dependency order: generation#26 first +# (comline-rust/comline-typescript's own codegen crates consume +# `comline-codegen`'s types, so they can't bump ahead of it), then +# comline-rust#16 and comline-typescript#14. +comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "8e28be4566546d3feb8c5caae35d111e7a54df7e" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "2ad8b7423978c17617f01dabbca3a6434c690393", optional = true } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "e4163a49a33b9ed20d9a03ebf5ad7a866ebf8d89", optional = true } [features] # Which language generators are compiled in. Drop one to shed its whole From 4118f976dd1fe4c83fcab5999342de4cc2788a88 Mon Sep 17 00:00:00 2001 From: Kinflou Date: Sat, 3 Oct 2026 22:18:57 +0800 Subject: [PATCH 2/2] style: fix rustfmt violations in build.rs Slipped through in the --version feature (#34) - this repo's CI runs cargo fmt --check, caught here when it ran on this PR's otherwise- unrelated branch. --- build.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 2e38c45..8e848ee 100644 --- a/build.rs +++ b/build.rs @@ -58,11 +58,13 @@ fn emit_version_info() { println!("cargo:rerun-if-changed=.git/HEAD"); println!("cargo:rerun-if-changed=.git/refs"); - let hash = run(&["git", "rev-parse", "--short=12", "HEAD"]).unwrap_or_else(|| "unknown".to_string()); + let hash = + run(&["git", "rev-parse", "--short=12", "HEAD"]).unwrap_or_else(|| "unknown".to_string()); let dirty = run(&["git", "status", "--porcelain"]).is_some_and(|s| !s.is_empty()); let branch = run(&["git", "rev-parse", "--abbrev-ref", "HEAD"]).unwrap_or_else(|| "unknown".to_string()); - let commit_count = run(&["git", "rev-list", "--count", "HEAD"]).unwrap_or_else(|| "unknown".to_string()); + let commit_count = + run(&["git", "rev-list", "--count", "HEAD"]).unwrap_or_else(|| "unknown".to_string()); let build_date = run(&["date", "-u", "+%Y-%m-%dT%H:%M:%SZ"]).unwrap_or_else(|| "unknown".to_string()); @@ -79,7 +81,10 @@ fn emit_version_info() { /// Run a command, returning trimmed stdout on success - `None` on any /// failure (missing binary, non-zero exit, not a git repo, ...). fn run(args: &[&str]) -> Option { - let output = ProcessCommand::new(args[0]).args(&args[1..]).output().ok()?; + let output = ProcessCommand::new(args[0]) + .args(&args[1..]) + .output() + .ok()?; if !output.status.success() { return None; }