This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"cuelang.org/go/cue/cuecontext" | |
"cuelang.org/go/pkg/encoding/yaml" | |
"github.com/grafana/grafana/pkg/coremodel/dashboard" | |
"github.com/grafana/thema" | |
"github.com/grafana/thema/encoding/openapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node1: string @cuetsy(kind="type") | |
node2: string | *int @cuetsy(kind="type") | |
node3: *"foo" | "bar" | "baz" @cuetsy(kind="enum", memberNames="Foo|Bar|Baz") | |
node4: node3 | node2 | |
node5: { | |
inner: string | |
n3: node3 | |
} @cuetsy(kind="interface") | |
// Each other file in this gist corresponds to taking a field under ref here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"title": "dashboard", | |
"version": "0.0" | |
}, | |
"paths": {}, | |
"components": { | |
"schemas": { | |
"dashboard": { | |
"type": "object", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Core Thema definition | |
#Lin: { | |
joinSchema: _ | |
sch: joinSchema | |
} | |
///////////////////// | |
// Lineage subtype def (proposed to be new core joinSchema def) | |
#B: #Lin & { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kernel | |
import ( | |
"cuelang.org/go/cue" | |
"cuelang.org/go/encoding/gocode/gocodec" | |
"github.com/grafana/thema" | |
) | |
// An InputKernel accepts all the valid inputs for a given lineage, converges | |
// them onto a single statically-chosen schema version, and emits the result in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Kubernetes | |
info: { | |
title: *"Kubernetes" | string | |
version: *"v1.23.0" | string | |
} | |
#SchemaMap: { | |
// CustomResourceColumnDefinition specifies a column for server | |
// side printing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package schema | |
TableCellDisplayModeType: *"auto" | "color-text" | "color-background" | "color-background-solid" | "gradient-gauge" | "lcd-gauge" | "json-view" | "basic" | "image" @cuetsy(kind="enum",memberNames="Auto|ColorText|ColorBackground|ColorBackgroundSolid|GradientGauge|LcdGauge|JSONView|BasicGauge|Image") | |
TableFieldOptions: { | |
align: string | |
modeOptions: TableCellDisplayMode | |
hidden?: bool | |
minWidth?: number | |
width?: number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/grafana/scuemata" | |
// Make the whole file a scuemata.Family | |
scuemata.Family | |
lineages: [{ | |
// Schema versions are implicitly defined by the schema's position in the arrays | |
schemas: [ | |
{ // Schema 0.0 | |
somefield: string | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/grafana/scuemata" | |
// Make the whole file a scuemata.Family | |
scuemata.Family | |
lineages: [{ // Lineage 0 | |
schemas: [{ // Schema 0.0 | |
boolish: "true" | "false" | bool | string | |
}] | |
}, | |
{ // Lineage 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ui from '@grafana-schema'; | |
///////////////////////////////////////////////////// | |
// SOURCE CUE PATH packages/grafana-schema/src/schema/graph.cue | |
///////////////////////////////////////////////////// | |
export enum AxisPlacement { | |
Auto = 'auto', | |
Bottom = 'bottom', | |
Hidden = 'hidden', | |
Left = 'left', |