Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow output in any programming language #119

Open
joeskeen opened this issue Feb 1, 2024 · 1 comment
Open

Allow output in any programming language #119

joeskeen opened this issue Feb 1, 2024 · 1 comment

Comments

@joeskeen
Copy link

joeskeen commented Feb 1, 2024

I've been looking into generating some custom TypeScript code based on some 3rd party TypeScript interfaces. I was hoping that this project could work for that, as it seems it is mostly a tool that parses a TypeScript interface then calls renders a Mustache template with the AST/metadata. It seems though that this tool explicitly requires your output to be either Swift or Kotlin. Could it be possible to allow custom language outputs (where the user would have to provide any language-specific transform logic)?

@haven2world
Copy link
Collaborator

Sorry for missing this issue. Yes, I think it's feasible, ts-gyb's workflow is kind of simple. A Parser to read the type information from TS and a render to convert ts type to the target language's type and render the template.

The parsing part can be shared for all target language, and to support a new target language, we just need a new value type transformer to handle the type conversion.

Unluckily, our team doesn't have bandwidth to extend it but welcome to raise the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants