Add tuple-form union variants#31
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Details
Closes #24.
What Was Added
(/)support.Number(i64).union RequestId { Number(Int) String(String) }.What Was Changed/Deleted
Variant(T)instead of rendering synthetic field names like_0: T.75 KBto75.5 KBto account for the new syntax support.Breaking Changes
How Do The Automated Tests Prove It Works?
packages/typediagram/test/converters/rust.test.tsnow includesemits tuple enum variants from tuple-form union syntax, which parses tuple-form DSL and asserts Rust output containsNumber(i64)andString(String).make cipassed for the branch, including typediagram, CLI, VS Code, and web test suites, web Playwright coverage merge, and the typediagram bundle-size gate.