Feature/engine separation 5#76
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9379e4e31f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # .github/workflows/release.yml # README.md # package-lock.json # package.json
There was a problem hiding this comment.
Pull request overview
This PR streamlines the downloadable release artifact so it can be opened locally and drop PWA/service-worker behaviors, while also tightening runtime routing/service-worker toggles via new Vite env flags.
Changes:
- Added
VITE_APP_MODEandVITE_SERVICE_WORKERenv flags and used them to control PWA routing and service-worker registration. - Updated the release workflow packaging and release instructions to produce a trimmed “open
index.html” downloadable bundle. - Bumped version to
30.0.4.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/vite-env.d.ts |
Adds typings for new Vite env flags used by routing/SW gating. |
src/main.tsx |
Skips service worker registration when explicitly disabled via env. |
src/app-routing.ts |
Treats the build as “PWA route” when VITE_APP_MODE=pwa is set. |
README.md |
Updates downloadable release instructions to match the new local-open packaging intent. |
package.json |
Version bump to 30.0.4. |
package-lock.json |
Lockfile version bump to 30.0.4. |
.github/workflows/release.yml |
Alters build env and adds a new packaging flow for a trimmed local-playable zip. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| mkdir -p release-package/assets | ||
| cp dist/assets/app.css release-package/assets/ | ||
| cp dist/assets/main.js release-package/assets/ | ||
| browser_entry=$( | ||
| node -e 'const { readFileSync } = require("node:fs"); const html = readFileSync("dist/pwa/index.html", "utf8"); const match = html.match(/<script\s+type="module"[^>]*\bsrc="([^"]+\.js)"[^>]*><\/script>/); if (!match) { console.error("Unable to find PWA browser entry script."); process.exit(1); } const src = match[1].replace(/^\.\.\//, "").replace(/^\.\//, ""); console.log(`dist/${src}`);' | ||
| ) | ||
| test -f "${browser_entry}" | ||
| perl -0pe 's#new URL\(`cover\.png`,import\.meta\.url\)\.href#"./assets/cover.png"#g; s#new URL\(`titleBanner\.png`,import\.meta\.url\)\.href#"./assets/titleBanner.png"#g' \ | ||
| "${browser_entry}" > release-package/assets/app.js |
This pull request updates the downloadable release build to produce a simplified, local-playable package that opens directly into the game without a service worker, PWA install prompts, or extra pages. The build and packaging scripts, release instructions, and documentation are all updated to reflect this streamlined experience.
Release packaging and build changes:
VITE_APP_MODE=pwaand disables the service worker (VITE_SERVICE_WORKER=disabled), ensuring the build opens directly into the game and is playable from the file system without a static server. (.github/workflows/release.yml) [1] [2].github/workflows/release.yml)index.htmlafter extracting the archive—no static server required. (.github/workflows/release.yml,README.md) [1] [2]Codebase improvements:
isPwaRoutefunction now checks theVITE_APP_MODEenvironment variable, making route detection more robust for the new build mode. (src/app-routing.ts)src/main.tsx)Other:
30.0.4. (package.json)