Southclaws / supervillain

Converts Go structs to Zod schemas
MIT License
76 stars 6 forks source link

Output order is sometimes not valid TypeScript #1

Closed Southclaws closed 1 year ago

Southclaws commented 2 years ago

Can't remember what exactly caused this but it's possible to write a Go struct that generates TypeScript code with schemas used before they are declared.

A DAG would help, or some basic heuristic to determine linear usage order.

Southclaws commented 2 years ago

DAG then breadth first walk to pull into array, then reverse the array and write out.

Southclaws commented 1 year ago

Resolved by #6