scaffolding icon indicating copy to clipboard operation
scaffolding copied to clipboard

[SPIKE] Consider auto-generating TS types for entries

Open mattyg opened this issue 1 year ago • 2 comments

There are several libraries to automate generation of rust types. We could consider using them to generate TS types for custom entry types to simplify the scaffolding logic a bit.

mattyg avatar Oct 26 '24 14:10 mattyg

Thanks for bringing this up, the manual codegen we have now is not really sufficient and I don't see the need to re-invent the wheel with Rust to TS codegen. I had been looking into this for a while actually, specifically the typeshare and ts-rs crates.

The others you share look promising as well, especially specta.

The end goal for us would be finding a way to convert an EntryDefinition based off what the dev provides us via the cli into TS types using one of the crates, I couldn't find a programatic way to do this yet with the crates I tried out initially, but I can look into this further again as a spike.

c12i avatar Oct 29 '24 06:10 c12i

Hello. Not sure if it solves your problem but I made this tool that generates TS bindings for a zome: https://github.com/ddd-mtl/zits

ddd-mtl avatar May 23 '25 12:05 ddd-mtl