Aleph-Alpha / ts-rs

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

proof-of-concept of type overrides using the CLI #334

Open NyxCode opened 2 weeks ago

NyxCode commented 2 weeks ago

This PR implements a POC of how we could implement type overrides using the CLI.

NyxCode commented 2 weeks ago

I am in no way sure that this is the right way to implement this. Besides the implementation (are environment variables really the right choice here?), these overrides would apply to the whole dependency chain. That might be the right behavior, but I'm not sure.

gustavo-shigueo commented 1 week ago

I am in no way sure that this is the right way to implement this. [...] (are environment variables really the right choice here?)

I like this implementation, and I'm not sure there even is another option to get cargo test to read the overrides without environment variables

Besides the implementation [...], these overrides would apply to the whole dependency chain. That might be the right behavior, but I'm not sure.

I think this is the right behavior. If, for example, the user wants u64 to be treated as number, they probably want it like that all the way up the chain

gustavo-shigueo commented 3 days ago

Hey @NyxCode! Is there anything else you'd like to do before merging this into the cli branch?