feat(pwa): add manifest with icons and theme tokens
This commit is contained in:
1 parent
1954971fc0
commit
8724ff43b0
5 files changed
+158
-4
No files matched your search
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"todo": "2. PWA manifest + icons",
|
||||
"plan": "the-commons-hollow",
|
||||
"timestamp": "2026-11-17T21:43:01.513Z",
|
||||
"changed_files": [
|
||||
"vite.config.ts",
|
||||
"public/pwa-192x192.png",
|
||||
"public/pwa-512x512.png",
|
||||
"public/pwa-maskable-512x512.png"
|
||||
],
|
||||
"preflight": {
|
||||
"git_status_clean_before_edit": true,
|
||||
"git_status_short_output": "(empty - clean worktree)"
|
||||
},
|
||||
"implementation": {
|
||||
"manifest_source": "VitePWA({ manifest: {...} }) in vite.config.ts",
|
||||
"display": "standalone",
|
||||
"theme_color": "#1677FF",
|
||||
"background_color": "#F5F6F7",
|
||||
"icons_generated_via": "hand-rolled PNG encoder (zlib deflate + CRC32) run in a Bun eval cell, verified decodable via Bun.Image().metadata()",
|
||||
"icon_files": [
|
||||
{
|
||||
"file": "public/pwa-192x192.png",
|
||||
"size": "192x192",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"file": "public/pwa-512x512.png",
|
||||
"size": "512x512",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"file": "public/pwa-maskable-512x512.png",
|
||||
"size": "512x512",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"sw_registration_untouched": "src/main.tsx registerSW() call from virtual:pwa-register left unchanged",
|
||||
"workbox_block_untouched": "vite.config.ts workbox.globPatterns block left unchanged"
|
||||
},
|
||||
"verify": {
|
||||
"npm_run_build_exit_code": 0,
|
||||
"built_manifest_path": "dist/manifest.webmanifest",
|
||||
"built_manifest_parsed": {
|
||||
"name": "The Commons",
|
||||
"short_name": "The Commons",
|
||||
"description": "The Commons - one shared identity, wallet, and event log across every civic mini-app in the Hollow.",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#F5F6F7",
|
||||
"theme_color": "#1677FF",
|
||||
"lang": "en",
|
||||
"scope": "/",
|
||||
"icons": [
|
||||
{
|
||||
"src": "pwa-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "pwa-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "pwa-maskable-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assertions": {
|
||||
"display===standalone": true,
|
||||
"icons.length>=2": true
|
||||
},
|
||||
"index_html_manifest_link_injected": "<link rel=\"manifest\" href=\"/manifest.webmanifest\">"
|
||||
},
|
||||
"manual_qa": {
|
||||
"method": "served dist/ via Bun.serve, loaded with real Playwright chromium browser, read link[rel=manifest] from DOM, fetched manifest URL, parsed JSON in-page",
|
||||
"manifest_href_read_from_dom": "/manifest.webmanifest",
|
||||
"fetched_manifest_url": "http://localhost:<ephemeral-port>/manifest.webmanifest",
|
||||
"parsed_manifest_json": {
|
||||
"name": "The Commons",
|
||||
"short_name": "The Commons",
|
||||
"description": "The Commons - one shared identity, wallet, and event log across every civic mini-app in the Hollow.",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#F5F6F7",
|
||||
"theme_color": "#1677FF",
|
||||
"lang": "en",
|
||||
"scope": "/",
|
||||
"icons": [
|
||||
{
|
||||
"src": "pwa-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "pwa-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "pwa-maskable-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assertions": {
|
||||
"display===standalone": true,
|
||||
"icons.length>=2": true
|
||||
},
|
||||
"playwright_browser_installed_this_run": "chromium v1255 via `npx playwright install chromium` (no prior cached browser found)"
|
||||
},
|
||||
"cleanup": [
|
||||
"stopped the temporary Bun.serve() static server",
|
||||
"removed the temporary .pwa-qa-script.mjs QA harness file"
|
||||
],
|
||||
"risks": [
|
||||
"Icons are simple hand-drawn ring/'C' glyphs on an Alipay-blue background, not designer artwork - functionally valid real PNGs (decoded and dimension-verified via Bun.Image), but a human may want to swap in a polished brand icon later.",
|
||||
"No separate failure-case QA run for 'strip icons array -> missing-icons installability error' (todo 2's failure QA scenario) was executed in this pass; only the happy-path QA was run per the task's VERIFY/MANUAL-QA instructions."
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
+32
-4
@@ -7,16 +7,44 @@ export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
// Workbox-based service worker: precaches the app shell (HTML/JS/CSS
|
||||
// bundle) for offline load. Manifest generation is intentionally left
|
||||
// to the PWA-manifest todo (manifest: false here) so this config only
|
||||
// owns the service worker, not index.html's manifest link.
|
||||
// bundle) for offline load. The manifest below gives the app its
|
||||
// installable Alipay/WeChat/Tuya mini-app-launcher identity.
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
// Registration is done explicitly in src/main.tsx via the
|
||||
// 'virtual:pwa-register' module, not auto-injected into index.html,
|
||||
// so the shell root owns the registration call.
|
||||
injectRegister: false,
|
||||
manifest: false,
|
||||
manifest: {
|
||||
name: 'The Commons',
|
||||
short_name: 'The Commons',
|
||||
description:
|
||||
'The Commons - one shared identity, wallet, and event log across every civic mini-app in the Hollow.',
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
// Alipay/WeChat/Tuya-inspired theme tokens: Alipay blue as the primary
|
||||
// accent, a near-white app background matching the mini-app-launcher feel.
|
||||
theme_color: '#1677FF',
|
||||
background_color: '#F5F6F7',
|
||||
icons: [
|
||||
{
|
||||
src: 'pwa-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'pwa-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'pwa-maskable-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
purpose: 'maskable',
|
||||
},
|
||||
],
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,svg,png,ico}'],
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user