Skip to content

feat: real type Foo = Bar generated for a schema's type alias - #35

Merged
Kinflou merged 2 commits into
mainfrom
feat/type-alias-codegen
Oct 3, 2026
Merged

Kinflou merged 2 commits into
mainfrom
feat/type-alias-codegen

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

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).

Test plan

  • cargo build / cargo test — clean (46 tests), single consistent comline_codegen/comline_core instance in the graph
  • Manual end-to-end: a package with an unused alias (type Lang = Language, never referenced — exactly the user-reported case) and a used one (type UserId = u64; struct Greeting { sender: UserId }), generated for both rust and typescript — both declarations and the by-name field reference appear correctly in both languages

Kinflou added 2 commits October 3, 2026 22:14
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).
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.
@Kinflou
Kinflou merged commit 489c245 into main Oct 3, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/type-alias-codegen branch October 3, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant