WIP: add a grafanaApp target to generate playlist like code #480
+344
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 JennyI 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 withinapps/playlist
or I sit at theapps
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 JennyIs 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.