Aleph-Alpha / ts-rs

Generate TypeScript bindings from Rust types
MIT License
989 stars 99 forks source link

feat: Allow multiple types to set `#[ts(export_to = "...")]` to the same file #316

Open escritorio-gustavo opened 1 month ago

escritorio-gustavo commented 1 month ago

Goal

Allow for multiple types to be exported to the same file by editing the target file when it is encountered by the second time Closes #59

Changes

Created a HashMap mapping file paths to a set of type identifiers and using it to decide whether or not the file should be created from scratch or edited

Checklist

arslnb commented 1 month ago
escritorio-gustavo commented 1 month ago

Hey @arslnb! This feature is pretty much done, but I'd still like to make sure it doesn't break anything. If you have any projects that would benefit from this, would mind testing out this branch and checking if your resulting TypeScript is correct?

gustavo-shigueo commented 3 days ago

Hey @NyxCode! Can you check this one out when you have some time?