codama-idl / codama

Generate clients, CLIs, documentation and more from your Solana programs
MIT License
73 stars 16 forks source link

[renderers-js] Expose `dependsOn` and `resolvedInputName` in resolver scope #71

Open lorisleiva opened 3 months ago

lorisleiva commented 3 months ago

When generating the resolverScope object which is then passed to every resolver function call, we could provide more available data to enable more powerful and reusable resolver logic.

For instance we could add:

That way, the same resolver function can be used for multiple values as the dependsOn array and the resolvedInputName string can be used to distinguish between them.