Documentation
¶
Overview ¶
Package main reads ../../services-config.json and emits Go-literal declarations for deployment.Prod, deployment.Test, deployment.ProdConf, and deployment.TestConf into ../../data_static_js.go.
Why a generator: the deployment package's runtime init() invokes encoding/json on the embedded services-config.json to populate those four vars. TinyGo 0.41.1's stdlib doesn't ship the reflect runtime helpers (reflect.unsafe_New, reflect.mapassign, etc.) that encoding/json needs, so the import was blocking TinyGo compilation of the install-page WASM (pkg/skywireconfig/genvisor + autoconfigcmd). The split is:
- config.go struct defs, var declarations.
- config_native.go (!js) json.Unmarshal-based init for non-WASM builds, with SKYDEPLOY override support.
- config_js.go (js) init that copies from data_static_js.
- data_static_js.go (js) static Go literals, generated here.
Lives under deployment/cmd/gen (not deployment/internal/gen) per project convention against `internal/` packages — those break out-of-tree test infrastructure that imports skywire from vendor.
Run via `go generate ./deployment/` or directly:
cd deployment/cmd/gen && go run .