feat: enhance PWA support and streamline release packaging#75
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c21b934b4
ℹ️ 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".
|
|
||
| mkdir -p release-package/assets | ||
| cp dist/assets/app.css release-package/assets/ | ||
| cp dist/assets/main.js release-package/assets/ |
There was a problem hiding this comment.
Copy the emitted app bundle instead of main.js
In the release workflow I inspected, this packaging step now copies dist/assets/main.js, but the Vite build is configured in vite.config.ts with entryFileNames: "assets/app.js", and the built pwa/index.html will reference that emitted app.js. Because the shell is running with set -euo pipefail, the cp fails before the zip is created on every release build; even if it did not fail, the archive would omit the script that index.html loads.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR updates the downloadable “web.zip” release to be a trimmed, locally playable build that launches straight into the full-screen game while disabling PWA/service-worker behaviors, and updates docs + build-time switches to support that mode.
Changes:
- Introduces
VITE_APP_MODEandVITE_SERVICE_WORKERenv switches and uses them to control routing and service worker registration. - Adjusts routing so “PWA shell” can be enabled explicitly at build time (not only by
/pwa/path). - Reworks the GitHub Actions release packaging to assemble a reduced release bundle and updates README + version.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/vite-env.d.ts |
Adds typed Vite env vars for app mode and service worker control. |
src/main.tsx |
Skips service worker registration when VITE_SERVICE_WORKER=disabled. |
src/app-routing.ts |
Treats PWA routing as enabled when VITE_APP_MODE=pwa (in addition to /pwa/ paths). |
README.md |
Updates release documentation to describe the trimmed, local-play build and new env switches. |
package.json |
Bumps version to 30.0.3. |
package-lock.json |
Updates lockfile version fields to match 30.0.3. |
.github/workflows/release.yml |
Builds with PWA mode + SW disabled and packages a trimmed release 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/ |
This pull request updates the release packaging process and documentation to produce a more streamlined, local-playable web build. The downloadable release now opens directly into the game, omitting the landing page, About page, Storybook, service worker, and PWA install metadata. The release workflow and related documentation have been updated to reflect these changes, and the service worker is conditionally disabled in the build.
Release workflow and packaging improvements:
.github/workflows/release.yml) has been updated to:VITE_APP_MODEtopwaandVITE_SERVICE_WORKERtodisabledfor the build.index.htmlto remove PWA and install metadata.README.txtinto the release package and clarify instructions about browser security and asset loading.Documentation updates:
README.mdnow describes the downloadable release as a trimmed, local-play build without PWA features, and details the new environment variables and limitations. [1] [2]Codebase changes for PWA mode and service worker:
isPwaRoutefunction insrc/app-routing.tsnow checks theVITE_APP_MODEenvironment variable, making PWA mode explicit in the build.src/main.tsxis now disabled ifVITE_SERVICE_WORKERis set to"disabled".Version bump:
30.0.3inpackage.json.