Open ajmcquilkin opened 1 year ago
I would be willing to support this but I would prefer it if using it was a configuration similar to the current handling of bigints with the options Enabled, Error
or something like that.
@Brendonovich has been pushing me towards inlining all of the types in rspc to avoid naming as a problem so having this configuration as an enum would make it possible for me to handle that when I come to implement it.
I don't see myself working on this any time soon but a PR would be welcome. Hit me up on Discord or here if you wanna chat more about specifics if you were going to do a PR.
I'm experiencing the same issue with duplicate type names in different Rust modules when using rspc for Rust and TypeScript communication.
I see there's already a draft PR (#72) addressing this, great job, @ajmcquilkin 👍. Could you share the current progress and status? I'd be happy to assist or discuss further to help move this forward.
Thanks.
At this stage it's on me to find some time and get it merged back into main
because a lot of stuff has a changed since the PR was opened. Definetly my bad for not getting the PR reviewed and merged ealier.
Just submitting this to see if there's any plans to support exporting types with duplicate names. I would love to use
specta
on a project with auto-generated Rust types with significant numbers of duplicate type names. I can imagine a somewhat direct mapping for duplicate type names existing between Rust modules and TypeScript namespaces, although I can't speak to mappings from Rust modules in other languages.Within the
test_duplicate_ty_name
test, I could imagine the following to be a valid TypeScript export from the Rust test modules provided:I don't have much context on what this would take technically to implement, but I'd be happy to investigate if this is something the project would be interested in.