Repository navigation
fix(pwa): make the app installable and surface the install/update prompt - #25
Merged
Merged
Conversation
…manifest scope - Emit manifest.webmanifest per build target so id/start_url/scope/icons stay inside the deployment base (GitHub Pages /PokeGuru/ build was non-installable because id was "/"). - Add public/pwa-capture.js, a plain <head> script that captures beforeinstallprompt/appinstalled before React mounts and re-broadcasts them; InstallPrompt now consumes the stashed event. - Point package.json homepage at https://pokeguru.vercel.app, bump 1.7.2. - Document the fixes in RELEASE_NOTES, extend CI build checks and tests. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Node cannot require() a .webmanifest extension, so the manifest installability assertion crashed for the wrong reason. Read the file and also assert every icon URL sits inside the manifest scope. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The live app reports "no installable PWA available" and the install prompt never shows. Three separate causes:
gh-pagesis an August build with nomanifest.webmanifestand nosw.js— the Pages SPA fallback servedindex.htmlfor both paths, so anyone openingdlinacre.github.io/PokeGurugot a non-installable app.package.jsonhomepage and the README still pointed there.id: "/"while the Pages deployment lives under/PokeGuru/—idoutsidescopeis not installable.beforeinstallprompt. The event fires once; it was only listened for after React mounted, so it could be missed entirely and the in-app install invitation could never appear.What changed
src/pwa/manifest-template.json, soid,start_url,scope, icons and shortcuts always sit inside the deployment base (/for Vercel,/PokeGuru/for Pages).public/pwa-capture.js, a plain external<head>script (CSP-safe) that capturesbeforeinstallprompt/appinstalledbefore React loads, stashes the event and re-broadcasts it.InstallPromptconsumes the stashed event as well as live ones.package.jsonhomepage →https://pokeguru.vercel.app; README leads with the live Vercel app and describes Pages as a secondary mirror; version bumped to 1.7.2.public/.nojekyllso a Pages deploy publishes_*assets.dist/pwa-capture.jsexists and that the built manifest'sid/start_url/scopeagree; new tests pin manifest installability for both bases and the pre-mount capture path.Verification
npm run lint,npm run typecheck,npm test→ 24 files / 197 tests passing.id/start_url/scope=/, icons + shortcuts absolute under/.id/start_url/scope=/PokeGuru/, SWBASE=/PokeGuru/, capture script at/PokeGuru/pwa-capture.js.