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

WIP: add a grafanaApp target to generate playlist like code #480

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

charandas
Copy link

@charandas charandas commented Nov 13, 2024

Here is a first take at generating equivalent code to how playlist currently looks in grafana.

Next up, I need to make the playlist watcher like generation also happen over here under the same target.

Removing codegenPath from this Jenny

I am not sure of how codegenPath could be useful for how Grafana's repo is currently setup. codegenPath is . as I see it, whether I invoke the sdk from within apps/playlist or I sit at the apps directory and do:

 grafana-app-sdk project component add --cuepath ./playlist/kinds --path ./playlist grafanaApp
 
 # alterntively, invoke it from within apps/playlist dir
 grafana-app-sdk project component add grafanaApp

Having a . codegenPath is unnecessarily complex for the template when pkgs are imported.

Removing kindsAreGrouped from this Jenny

Is there a real use case in Grafana for that or can we safely assume that they won't be? Not having this boolean makes the template so much easier on the eyes.

Example output

The outputted app.go looks like this gist with some commentary on the extra curly braces that I don't like.

@charandas charandas self-assigned this Nov 13, 2024
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

Successfully merging this pull request may close these issues.

1 participant