wechaty / go-wechaty

Go Wechaty is a Conversational SDK for Chatbot Makers Written in Go
https://github.com/wechaty/go-wechaty-getting-started
Apache License 2.0
502 stars 92 forks source link

Generate Puppet Schema from TypeScript Automatically #26

Open huan opened 4 years ago

huan commented 4 years ago

As mentioned by @suntong from https://github.com/wechaty/go-wechaty/issues/11#issuecomment-612524123:

"Convert TypeScript types to GO" right? -- https://app.quicktype.io/#l=Go Meaning that we should make TypeScript type definitions as individual files, separate their implementations from them. So whenever the types get changed, the Go/Java/Python type definition files can be changed semi-automatically as well.

I believe it will be great if we can have a good design to use the automatic generation from this tool because the wechaty-puppet will be changed in the future frequently, and it will be great if we can be prepared and leave all the work to the machine.

Link to Python: https://github.com/wechaty/python-wechaty/issues/10

huan commented 4 years ago

Update: we can import all the wechaty-puppet schemas from the go-grpc.

Python Wechaty team are using this strategy, and I'd like to suggest our Go team to try it if the Python team proved it works well.