refactor: split backend into standalone server project
Remove embedded frontend and workflow editor assets, add standalone API deployment configuration, and retain the current backend service updates.
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/token"
|
||||
@@ -15,9 +16,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
enumsPkgName = "enums"
|
||||
enumsDir = "internal/pkg/enums"
|
||||
outputPath = "web/lib/generated/enums.ts"
|
||||
enumsPkgName = "enums"
|
||||
enumsDir = "internal/pkg/enums"
|
||||
defaultOutputPath = "dist/enums.ts"
|
||||
)
|
||||
|
||||
type enumValueType string
|
||||
@@ -47,15 +48,18 @@ type enumDef struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
outputPath := flag.String("output", defaultOutputPath, "TypeScript enum output path")
|
||||
flag.Parse()
|
||||
|
||||
defs, err := parseEnums(enumsDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
content := buildTSFile(defs)
|
||||
if err := os.MkdirAll(filepath.Dir(outputPath), 0o755); err != nil {
|
||||
if err := os.MkdirAll(filepath.Dir(*outputPath), 0o755); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := os.WriteFile(outputPath, []byte(content), 0o644); err != nil {
|
||||
if err := os.WriteFile(*outputPath, []byte(content), 0o644); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user