PWA configuration (manifest, service worker, offline shell) (#18) #40
No reviewers
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol!40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "18-pwa-configuration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #18.
Summary
/manifest.webmanifestviaapp/manifest.ts, plus PNG (192/512) and SVG icons rendered frompublic/icon.svgbyscripts/render-icons.mjs.@serwist/next: precaches the build manifest, runtime caches with Serwist'sdefaultCache, falls back to/offlinefor any document navigation that misses cache. Registered from a client component (app/sw-register.tsx) on idle, mounted in the root layout./offlinepage (force-static) for the offline shell./,/offline,/manifest.webmanifest,/sw.js, icons,/workbox-prefix) with reasoning inline inlib/auth/public-routes.ts.tsconfig.sw.json) targetingWebWorkerlibs soapp/sw.tstypechecks against worker globals;npm run typecheckruns both passes.next.config.mjswraps the config withwithSerwistand adds a webpack externals matcher that externalises both Node-only DB packages (pg/libsql family) and thenode:URI scheme — needed because Next.js's instrumentation compile follows the dynamic import frominstrumentation.tsintodb/client.ts, which has top-levelimport fs from "node:fs". Without externalisingnode:URIs,npm run deverrors withUnhandledSchemeError: Reading from "node:fs" is not handled by plugins.tests/middleware.test.ts) extended to assert the new PWA-essential public routes.Test plan
npm run typecheck— passes both app and SW configs.npm run lint— clean.npm test— 61 passed / 20 skipped.npm run build— succeeds, service worker bundled, 11 routes generated.npm run dev— starts clean, nonode:fserror./,/manifest.webmanifest,/offline,/icon-192.png,/sw.js→ 200;/dashboard→ 401 (default-deny intact)./offlinefallback render without a network round-trip.The three manual browser checks above are the issue's acceptance criteria and need a real browser to verify.
🤖 Generated with Claude Code
4266ea0704cf9337fdc3