- Added a new function `GetApiFile` to generate the TypeScript API file dynamically based on environment variables. - Updated `TSEndpoint` struct to include an `Imports` map for tracking TypeScript imports. - Enhanced `VerifyTypes` method to manage request and response types more effectively, including nullable types. - Modified `ToTs` method to generate TypeScript code with improved type handling. - Introduced `TSFiles` struct for managing generated TypeScript files and saving them to the filesystem. - Implemented formatting of generated TypeScript code using Prettier. - Added new TypeScript files for various endpoints, including user management and system utilities. - Updated existing TypeScript files to reflect changes in API structure and response types. |
||
|---|---|---|
| .. | ||
| docs | ||
| .DS_Store | ||
| LICENSE | ||
| README.md | ||
| TSFiles.go | ||
| tsApiTemplate.go | ||
| tsEndpoint.go | ||
| tsExitOnError.go | ||
| tsInfo.go | ||
| tsStruct.go | ||
| tsTagJson.go | ||
| tsTagTs.go | ||
| tsTsInfo.go | ||
| tsrpc.go | ||
README.md
ts-rpc
typescript RPC
The ghost bridge from front-end to backend
This project is a POC - Proof of concept. The goal is to generate typescript code from golang using AST. So you can use intellisense in the development IDE.
Typescript: interface Struct tags
Server Examle
Can I use it/contribute?
Sure, but you should probably start your own from scratch. I built this in about one week and it was an interesting experience, I recommend you do the same. My goal was never to make good or reusable code, so it's neither good nor reusable. If you do decide to work on such a system, I would suggest adding the following:
- Talk about ghost bridge over all the world
- Suggest some ideas
- Develop good reusable code
- Add tests, comments and GoDoc
- Be Happy
Alright then...
Cool. I'm on linkedin Golang nuts group https://www.linkedin.com/groups/3712244/ My linkedin page: https://www.linkedin.com/in/fabio-prada-a9159b75/ Discord channel #tsrpc: https://discord.com/channels/1046004205556617237/1046004333734531092
