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

CLI tool / usage in CI #1

Open
tmr232 opened this issue Dec 21, 2024 · 2 comments
Open

CLI tool / usage in CI #1

tmr232 opened this issue Dec 21, 2024 · 2 comments

Comments

@tmr232
Copy link

tmr232 commented Dec 21, 2024

I just watched the video presenting this tool, and it looks amazing! Thanks for the hard work!

I have one suggestion - can we have a CLI tool that goes over the .tb files and generates the types from them?
Since this is doing code-generation, I'd like to have a way to verify, in CI, that the current generated code matches the type-buddy files.
Additionally, a CLI tool would mean that it's also usable for people using IDEs without the plugin.

Thanks!

@chwoerz
Copy link
Contributor

chwoerz commented Dec 21, 2024

Thanks :)

Sure, I will create a CLI for this 👍. Great idea

@davidsl4
Copy link

A CLI tool would also benefit those using different IDEs, but I have another, more intriguing solution.

With babel transformers we could make it automatically convert a custom syntax, for example, type function Simple<T> {} to TS's syntax type Simple<T> = ..., and that output would then be used by the tsc to compile.

Usually, I would proceed with that solution, make a POC develop the idea to its completion, and then create a pull request, but I can see a problem we will face ahead of time, and it is the syntax highlighting in the different IDEs, that won't recognize the type function syntax, and for that, I don't have a solution.

A more permanent solution would be filing a TypeScript proposal to incorporate this feature in the TypeScript language natively.

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

3 participants