Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - 2026-02-24

### Added
- **Complex Enum Variant Support**: Full support for Rust enums with tuple and struct variants
- Simple enums (unit variants only) continue to generate TypeScript string literal unions / `z.enum()`
- Complex enums (tuple or struct variants) now generate TypeScript discriminated unions / `z.discriminatedUnion()`
- Variant payloads are fully typed, including nested structs and generics
- Enum variants are included in the AST cache for efficient subsequent runs

### Changed
- **Serde Attribute Parsing**: Replaced regex-based parsing with `syn` AST functions
- More robust and accurate handling of `#[serde(...)]` attributes
- Eliminates edge cases caused by pattern matching on raw token strings

## [0.4.2] - 2026-02-15

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-typegen"
version = "0.4.2"
version = "0.5.0"
authors = [ "Stefan Poindl" ]
description = "A rust crate that automatically generates TypeScript models and bindings from your Tauri commands"
edition = "2021"
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/dependency_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ mod tests {
file_path: file.to_string(),
is_enum: false,
serde_rename_all: None,
serde_tag: None,
enum_variants: None,
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/analysis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ impl CommandAnalyzer {
if item_enum.ident == type_name
&& self.struct_parser.should_include_enum(item_enum)
{
return self.struct_parser.parse_enum(item_enum, file_path);
return self.struct_parser.parse_enum(
item_enum,
file_path,
&mut self.type_resolver,
);
}
}
_ => {}
Expand Down
Loading