docs/: Static site served and deployed. Includesindex.html,js/main.js(UI, game loader, volume/favorites/recent logic),css/main.css,swf/andiframe/game folders,sw.js(generated), and assets.tools/: Helper scripts —dev_server.py(local server with no-cache headers),deploy.py(updates Ruffle, cache-busts assets, generates service worker),swf.py(SWF utilities).workbox-config.js: Service worker build settings.package.jsondeclaresworkbox-clias a dev dependency (managed with Bun).
- Local run:
python tools/dev_server.pythen openhttp://localhost:8000. - Install tooling:
bun add workbox-cli --dev(required for service worker generation). - Deploy/build:
python tools/deploy.py— downloads Ruffle, versionsjs/css, updates HTML version, and runsworkbox generateSWto createdocs/sw.js. - Optional:
bunx workbox generateSW workbox-config.jsto debug SW generation.
- JavaScript: ES2015+, 4-space indent, camelCase for variables/functions, semicolons. Keep logic in
docs/js/main.js; prefer small, pure helpers. - Python: 4-space indent, PEP 8 style in
tools/*.py. - Game IDs and folders: kebab-case under
docs/swf/anddocs/iframe/(e.g.,docs/swf/learn-to-fly/main.swf,docs/iframe/inside-the-firewall/index.html).
- No automated tests; perform manual checks:
- Start the dev server; open several games; verify fullscreen, search, favorites, recently played, and controls placement.
- Confirm volume slider and mute work for both SWF (Ruffle) and iframe games; settings persist.
- After
deploy.py, enable Offline mode and reload to verify caching; ensure console has no errors.
- Commits: imperative mood with a short scope; prefer typed prefixes (
feat:,fix:,docs:,chore:) consistent with history. - PRs: include a clear description, linked issues, affected paths/games, and screenshots/GIFs for UI changes.
- Adding a game: place assets in the proper folder, then add an entry in
gamesListindocs/js/main.jswithtype(swf/iframe) and optionalframeRate,aspectRatio,spoofUrl, andcategory.
- CSP in
index.htmlis strict; avoid new external origins. - Service worker caches files up to ~25MB (see
workbox-config.js); keep assets small or adjust the limit thoughtfully.