-
Notifications
You must be signed in to change notification settings - Fork 8
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
[PoC] Use cog to generate go and typescript models + resources #296
Conversation
64d6dbf
to
cfa6a25
Compare
@K-Phoen thank you for experimenting with this! This is something that's been on our radar for a while, but we never had any bandwidth for. Please let us know if we can help get this ready for a review. One notable change we've made since this PR was opened is that we got rid of Thema support, so this should no longer be an issue. |
Not having to support Thema schemas should simplify things :) I'll get back to working on this and let you know if I need a hand! |
Closing this in favor of #485 |
Replaces #296 This PR replaces cuetsy and deepmap/oapi-codegen to generate Go and TS types. Note: the code by cog can be different from what is currently generated, I'd need some help to review these changes and determine if they are correct/acceptable. I followed the [issue tracker tutorial](https://github.com/grafana/grafana-app-sdk/tree/main/docs/tutorials/issue-tracker) and the results seem to make sense to me but I'm far from being an expert 😅
Draft PR meant to try out cog as a potential replacement for Go and Typescript codegen purposes.
ToDo:
thema.CustomKindParser
provided bygrafana-app-sdk
used with cog's CUE parser struggle to correctly handle references to objects defined "above" the currently parsed root. Ex:InnerObject2
(something likecustomKind.lineage._sortedSchemas[1]._#schema.#InnerObject2
), but resolving this path (withLookupPath()
fails on hidden fields introduced by thema (_sortedSchemas
and_#schema
).If thema support isn't meant to stick around long-term, this issue might not be worth solving.
Note: this PR isn't necessarily meant to be finished or merged, it's more a sandbox to play with cog + grafana-app-sdk.