Aleph-Alpha/ts-rs

Feature request: Export in the same file

tymmesyde opened this issue · 4 comments

Is your feature request related to a problem? Please describe.
I would like to export multiple types in the same file instead of creating a file for each
Or this is this currently achievable?

Describe the solution you'd like
Something like #[ts(export_to_single_file)] that exports every types related to this container into the same file

Describe alternatives you've considered
It could work with #[ts(export_to = "Setting.ts")], but currently it overrides the content if i declare this multiple times

Additional context

Likewise, I'd like to see this feature as well! Now that #[ts(export, export_to = "myfile.ts")] will automatically export types present in the fields of the type (that derive TS), it would be helpful if those types would be exported to the same file as the root/top-level containing type.

Duplicate of #59

We can't quite do this yet because our exports are generated though tests, which run in parallel and completely out of our control, so we can't really sync exporting in a way that would allow this to work

Describe alternatives you've considered
It could work with #[ts(export_to = "Setting.ts")], but currently it overrides the content if i declare this multiple times

Please checkout #316! It implements this very feature, and I'd like to have some users' feedback to make sure it doesn't break things before merging