Add production Docker deployment

Amp-Thread-ID: https://ampcode.com/threads/T-01a02485-5574-707c-bff4-5668d83bee8a
Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
Amp
2026-08-22 06:54:18 +00:00
co-authored by heaust
parent d95e099fa4
commit eb7508d1c1
11 changed files with 286 additions and 6 deletions
+38
View File
@@ -0,0 +1,38 @@
package main
import (
"os"
"path/filepath"
"testing"
)
func TestLoadPackages(t *testing.T) {
directory := t.TempDir()
for _, name := range []string{
"core.js",
"handles.js",
"worker.js",
"importer-worker.js",
"bvh-worker.js",
filepath.Join("pkg", "yawn_core_bg.wasm"),
} {
path := filepath.Join(directory, name)
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(path, []byte(name), 0o644); err != nil {
t.Fatal(err)
}
}
packages, err := loadPackages(directory)
if err != nil {
t.Fatal(err)
}
if len(packages) != 6 {
t.Fatalf("package count = %d", len(packages))
}
if content := string(packages["pkg/yawn_core_bg.wasm"].content); content != filepath.Join("pkg", "yawn_core_bg.wasm") {
t.Fatalf("WASM content = %q", content)
}
}