I built a code generator package in Kotlin which generates codes for Kotlin, Swift, Web (JS), and React-Native (TypeScript). Basically, you provide your class definition in a DSL style (Similar to TOML) and it will generate the implementation and interfaces of the bridge for different technologies.
Now, I have to generate different languages once the DSL is finalized. To achieve this I use Flask framework architecture. There we have routes with HTML templates. Here each generator has its own templates.