grafana / grafana-app-sdk

An SDK for developing apps for grafana using kubernetes-like storage and operators
Apache License 2.0
48 stars 8 forks source link

[codegen] Add Ability to Use an Existing Go or TypeScript Type for Fields in Spec/Status #375

Open IfSentient opened 3 months ago

IfSentient commented 3 months ago

It would be nice to have a way to tell the codegen to use an existing go type (such as a kubernetes type) for a field in the spec or status when generating code. The CUE source would still need to define the type properly for OpenAPI generation, but could reference an existing type to use for the generated go or TypeScript, perhaps with something like @app-sdk(gotype="repo/pkg.Type").

bcotton commented 2 months ago

Related to this, it would be good to have codegen generate a set of common types, perhaps from a common.cue that could be referenced from all other Kinds, but would be generated into it's own separate package.