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:
sam boyer
2022-09-26 11:26:18 -04:00
committed by GitHub
parent f8240e4b0a
commit e2ff875976
26 changed files with 1920 additions and 517 deletions

View File

@ -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{