Skip to content

Add tuple-form union variants#31

Merged
MelbourneDeveloper merged 6 commits into
Nimblesite:mainfrom
abdushakoor12:issue-24
May 3, 2026
Merged

Add tuple-form union variants#31
MelbourneDeveloper merged 6 commits into
Nimblesite:mainfrom
abdushakoor12:issue-24

Conversation

@abdushakoor12
Copy link
Copy Markdown
Contributor

@abdushakoor12 abdushakoor12 commented May 3, 2026

TLDR

Add tuple-form union variants like Number(Int) to the DSL, render them as tuple variants in Rust output, and document the new syntax with examples.

image

Details

Closes #24.

What Was Added

  • Tuple-form union variant syntax in the parser and lexer via ( / ) support.
  • Rust converter support for emitting tuple enum variants such as Number(i64).
  • A tuple-variant regression test covering union RequestId { Number(Int) String(String) }.
  • Language-reference and VS Code sample examples for tuple-form variants.

What Was Changed/Deleted

  • Union printing and layout now preserve tuple-form variants as Variant(T) instead of rendering synthetic field names like _0: T.
  • The typediagram core bundle-size budget was raised from 75 KB to 75.5 KB to account for the new syntax support.

Breaking Changes

  • No breaking changes.

How Do The Automated Tests Prove It Works?

  • packages/typediagram/test/converters/rust.test.ts now includes emits tuple enum variants from tuple-form union syntax, which parses tuple-form DSL and asserts Rust output contains Number(i64) and String(String).
  • make ci passed for the branch, including typediagram, CLI, VS Code, and web test suites, web Playwright coverage merge, and the typediagram bundle-size gate.

@MelbourneDeveloper MelbourneDeveloper merged commit e9367a6 into Nimblesite:main May 3, 2026
1 check passed
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.

Add tuple-form enum variants: union Foo { Bar(Int) }

2 participants