mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
extract kindsys to external library (#64562)
* extract kindsys * reinstate kindsys report This may end up living somewhere else (or not! who knows!), but the important part is that I don't get rid of it right now :) I hate the package layout (kindsysreport/codegen) for the main function and will take pretty much any alternative suggestion, but we can change also change it later. Note that the generated report.json is in a different location - anything using this (ops something) needs to be updated. * kindsysreport in codeowners
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"cuelang.org/go/cue/ast"
|
||||
tsast "github.com/grafana/cuetsy/ts/ast"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/pfs"
|
||||
)
|
||||
|
||||
@@ -16,7 +17,7 @@ import (
|
||||
var importMap = map[string]string{
|
||||
"github.com/grafana/thema": "",
|
||||
|
||||
"github.com/grafana/grafana/pkg/kindsys": "",
|
||||
"github.com/grafana/kindsys": "",
|
||||
"github.com/grafana/grafana/pkg/plugins/pfs": "",
|
||||
"github.com/grafana/grafana/packages/grafana-schema/src/common": "@grafana/schema",
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@ package pfs
|
||||
|
||||
import (
|
||||
"cuelang.org/go/cue/ast"
|
||||
"github.com/grafana/grafana/pkg/kindsys"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
"github.com/grafana/kindsys"
|
||||
"github.com/grafana/thema"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
)
|
||||
|
||||
type PluginDecl struct {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
||||
"github.com/grafana/grafana/pkg/kindsys"
|
||||
"github.com/grafana/kindsys"
|
||||
"github.com/grafana/thema"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package pfs
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/kindsys"
|
||||
"github.com/grafana/kindsys"
|
||||
)
|
||||
|
||||
// GrafanaPlugin specifies what plugins may declare in .cue files in a
|
||||
|
||||
@@ -15,13 +15,14 @@ import (
|
||||
"cuelang.org/go/cue/errors"
|
||||
"cuelang.org/go/cue/parser"
|
||||
"cuelang.org/go/cue/token"
|
||||
"github.com/grafana/grafana/pkg/cuectx"
|
||||
"github.com/grafana/grafana/pkg/kindsys"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
"github.com/grafana/kindsys"
|
||||
"github.com/grafana/thema"
|
||||
"github.com/grafana/thema/load"
|
||||
"github.com/grafana/thema/vmux"
|
||||
"github.com/yalue/merged_fs"
|
||||
|
||||
"github.com/grafana/grafana/pkg/cuectx"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
)
|
||||
|
||||
// PackageName is the name of the CUE package that Grafana will load when
|
||||
@@ -57,7 +58,7 @@ func loadGP(ctx *cue.Context) cue.Value {
|
||||
func PermittedCUEImports() []string {
|
||||
return []string{
|
||||
"github.com/grafana/thema",
|
||||
"github.com/grafana/grafana/pkg/kindsys",
|
||||
"github.com/grafana/kindsys",
|
||||
"github.com/grafana/grafana/pkg/plugins/pfs",
|
||||
"github.com/grafana/grafana/packages/grafana-schema/src/common",
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ package pfs
|
||||
|
||||
import (
|
||||
"cuelang.org/go/cue/ast"
|
||||
"github.com/grafana/grafana/pkg/kindsys"
|
||||
"github.com/grafana/kindsys"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/grafana/grafana/pkg/kindsys"
|
||||
"github.com/grafana/kindsys"
|
||||
)
|
||||
|
||||
// This is a brick-dumb test that just ensures known schema interfaces are being
|
||||
|
||||
Reference in New Issue
Block a user