Draft PR meant to try out cog as a potential replacement for Go and Typescript codegen purposes.
ToDo:
[ ] the thema.CustomKindParser provided by grafana-app-sdk used with cog's CUE parser struggle to correctly handle references to objects defined "above" the currently parsed root. Ex:
#InnerObject2: { // ← object defined "above" the current root
name: string
details: {
}
}
spec: { // ← current root
inner: #InnerObject1
// ...
}
Cog detects this case correctly, gets the path to InnerObject2 (something like customKind.lineage._sortedSchemas[1]._#schema.#InnerObject2), but resolving this path (with LookupPath() 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.
Draft PR meant to try out cog as a potential replacement for Go and Typescript codegen purposes.
ToDo:
[ ] the
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:Cog detects this case correctly, gets the path to
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.