mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 01:02:42 +08:00
codegen: Introduce TS codegen veneer (#54816)
* Split all named types out into defs, etc. * Use latest cuetsy, refactor generators accordingly * Return AST type from plugin TS generator * Near-complete checkin of TS veneer code generator * First full completed pass * Improve the attribute name * Defer use of the dashboard veneer type to follow-up * Remove dummy index, prettier on veneer * Fix merge errors in gen.go * Add match field to SpecialValueMap * Fix backend lint errors
This commit is contained in:
@ -89,12 +89,15 @@ func main() {
|
||||
|
||||
var wdm codegen.WriteDiffer
|
||||
for _, ptp := range ptrees {
|
||||
wdm, err = ptp.Tree.GenerateTS(ptp.Path)
|
||||
tfast, err := ptp.Tree.GenerateTypeScriptAST()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "generating typescript failed for %s: %s\n", ptp.Path, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
wd.Merge(wdm)
|
||||
// nil return if there was nothing to generate (no slot implementations)
|
||||
if tfast != nil {
|
||||
wd[filepath.Join(ptp.Path, "models.gen.ts")] = []byte(tfast.String())
|
||||
}
|
||||
|
||||
relp, _ := filepath.Rel(groot, ptp.Path)
|
||||
wdm, err = ptp.Tree.GenerateGo(ptp.Path, codegen.GoGenConfig{
|
||||
|
Reference in New Issue
Block a user