Packs / game-dev-web-public
itch-and-own-host-deploy
Package a browser game for itch.io (zip with index.html at the root, size and file limits, SharedArrayBuffer setting) and for our own host (Cloudflare Pages with COOP/COEP headers)
Install
logicpacks pack use game-dev-web-public/itch-and-own-host-deployget_pack game-dev-web-public/itch-and-own-host-deployThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
itch-freecloudflare-pages - Checks: 2 in
outcome/checks.yaml - Code:
prep_web_build.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
One build folder becomes a valid itch.io HTML5 upload and a Pages deploy, with the cross-origin isolation headers threaded/WASM games need.
Steps
- Build the game into one folder with
index.htmlat its root and only relative paths. - Run
python3 code/prep_web_build.py <build-dir> --out dist/: validates, writes_headers(COOP/COEP + long cache for hashed files), and makesdist/game-itch.zip. - itch.io: create an HTML game, upload the zip, tick 'SharedArrayBuffer support' if the game uses threads, set the viewport size.
- Own host:
wrangler pages deploy <build-dir> --project-name <name>(see the cloudflare space);_headersis applied by Pages. - Check the live page with
headless-game-qa.
Edge cases
- itch.io limits (check current docs): zip upload size, extracted file count, and per-file size.
- Absolute paths (
/assets/..) break on itch.io's subfolder hosting. - COEP require-corp blocks cross-origin assets without CORP/CORS headers: self-host fonts and scripts.
Don'ts
- Don't upload games with third-party assets you have no rights to (keep those private, see igi-games).
- Don't put API keys in the client bundle.