// Package server — JS bundle builder. // // Reads original Odoo JS source files from the addon directories, transpiles // ES modules to odoo.define() format using the Go transpiler, and // concatenates everything into a single JS bundle served at startup. // // This replaces the separate `go run ./cmd/transpile` build step — no // pre-transpiled build/js directory is needed. package server import ( "log" "net/http" "os" "path/filepath" "strings" "time" "odoo-go/pkg/tools" ) // buildJSBundle reads all JS files listed in assets_js.txt from the original // Odoo source directories, transpiles ES modules on-the-fly, and returns the // concatenated bundle as a single string. // // xmlTemplateBundle is the compiled XML templates JS (from compileXMLTemplates), // injected where xml_templates_bundle.js appears in the asset list. // // The first entry (module_loader.js) is excluded from the bundle because it // must load before the bundle via its own