Show HN: Guts – convert Golang types to TypeScript
4 days ago
- #Code Generation
- #Golang
- #TypeScript
- guts is a library for converting Golang types to TypeScript to maintain consistent type definitions across frontend and backend.
- It is designed to be used as a library rather than a command-line tool, allowing for dynamic configuration.
- The tool parses Golang packages, converts the AST to TypeScript AST, and serializes it using the TypeScript compiler API.
- Supports customization through mutations, such as converting enums to union types.
- Unlike static generators, guts offers programmatic flexibility and ensures semantically correct TypeScript definitions.
- Leverages the official TypeScript compiler for accurate and up-to-date language feature support.