diff --git a/AGENTS.md b/AGENTS.md index 1a8ac78..f0909b8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,9 @@ make DEBUG=1 # Alternative debug flag make web # WASM build → dist-web/ make web-serve # WASM build + HTTP server on :8080 make windows # Cross-compile → dist-win64/ +make k8s # Build web + container image + deploy to local k3s make clean # Remove all build artifacts +./deploy.sh # Full deploy: clean build → container → k3s rollout ``` Compiler flags: `-Wall -Wextra -std=c11 -I include -I src` @@ -33,11 +35,15 @@ There are no test or lint targets. Verify changes by building with `make` and co - **WASM builds** require the Emscripten SDK. The `emsdk/` directory in the project root is gitignored; source the environment before building: ```bash - source ~/emsdk/emsdk_env.sh # or wherever emsdk is installed + source emsdk/emsdk_env.sh make web ``` - **Windows cross-compilation** requires MinGW (`x86_64-w64-mingw32-gcc`) and vendored SDL2 development libraries in `deps/win64/` (also gitignored). +- **Web deployment** goes through Cloudflare CDN (`jnr.schick-web.site`). After deploying + a new build, **purge the Cloudflare cache** so stale `.js`/`.wasm` files are not served. + Emscripten's `.js` and `.wasm` outputs are tightly coupled (EM_ASM address tables must + match); serving a cached `.js` with a fresh `.wasm` causes runtime crashes. ## Project Structure @@ -264,5 +270,5 @@ incremental progress. | `TICK_RATE` | 60 | Fixed timestep Hz | | `DEFAULT_GRAVITY` | 980.0f | px/s² | | `MAX_ENTITIES` | 512 | Entity pool size | -| `MAX_ENTITY_SPAWNS` | 128 | Per-level spawn slots | -| `MAX_EXIT_ZONES` | 8 | Per-level exit zones | +| `MAX_ENTITY_SPAWNS` | 512 | Per-level spawn slots | +| `MAX_EXIT_ZONES` | 16 | Per-level exit zones | diff --git a/Containerfile b/Containerfile index 5dfe10e..cedb234 100644 --- a/Containerfile +++ b/Containerfile @@ -18,3 +18,9 @@ FROM docker.io/joseluisq/static-web-server:2 COPY dist-web/ /public/ + +# Disable the default cache-control headers which cache .js for 1 year. +# The .js and .wasm files must always be fetched together (EM_ASM address +# table in JS must match the compiled WASM), so aggressive caching causes +# "No EM_ASM constant found" errors after redeployments. +ENV SERVER_CACHE_CONTROL_HEADERS=false