Skip to content

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)

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-game-dev-web-public

Install

logicpacks pack use game-dev-web-public/itch-and-own-host-deploy
get_pack game-dev-web-public/itch-and-own-host-deploy

The 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

  1. Build the game into one folder with index.html at its root and only relative paths.
  2. Run python3 code/prep_web_build.py <build-dir> --out dist/ : validates, writes _headers (COOP/COEP + long cache for hashed files), and makes dist/game-itch.zip.
  3. itch.io: create an HTML game, upload the zip, tick 'SharedArrayBuffer support' if the game uses threads, set the viewport size.
  4. Own host: wrangler pages deploy <build-dir> --project-name <name> (see the cloudflare space); _headers is applied by Pages.
  5. 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.