mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* New pfs impl * Reached codegen parity with old system * Update all models.cue inputs * Rename all models.cue files * Remove unused prefixfs * Changes Queries->DataQuery schema interface * Recodegen * All tests passing, nearly good now * Add SchemaInterface to kindsys props * Add pascal name deriver * Relocate plugin cue files again * Clarify use of injected fields * Remove unnecessary aliasing * Move DataQuery into mudball * Allow forcing ExpandReferences on go type generation * Move DataQuery def into kindsys, add generator to copy it to common * Fix copy generator to replace package name correctly * Fix duplicate type, test failure * Fix linting issues
31 lines
722 B
Cheetah
31 lines
722 B
Cheetah
package corelist
|
|
|
|
import (
|
|
"fmt"
|
|
"io/fs"
|
|
"sync"
|
|
"github.com/grafana/grafana"
|
|
"github.com/grafana/grafana/pkg/plugins/pfs"
|
|
"github.com/grafana/thema"
|
|
)
|
|
|
|
func parsePluginOrPanic(path string, pkgname string, rt *thema.Runtime) pfs.ParsedPlugin {
|
|
sub, err := fs.Sub(grafana.CueSchemaFS, path)
|
|
if err != nil {
|
|
panic("could not create fs sub to " + path)
|
|
}
|
|
pp, err := pfs.ParsePluginFS(sub, rt)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("error parsing plugin metadata for %s: %s", pkgname, err))
|
|
}
|
|
return pp
|
|
}
|
|
|
|
func corePlugins(rt *thema.Runtime) []pfs.ParsedPlugin{
|
|
return []pfs.ParsedPlugin{
|
|
{{- range .Plugins }}
|
|
parsePluginOrPanic("{{ .Path }}", "{{ .PkgName }}", rt),
|
|
{{- end }}
|
|
}
|
|
}
|