From 1053b92accee1d52050067d75f36c74a5fa4ca87 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 2 Sep 2026 20:09:46 -0700 Subject: The single-file wallet returns as a first-class artifact: every build now emits standalone.html (~950KB, everything inlined, boots from a bare file:// with no server), How it works grows a 'Keep a copy' card linking the download, and the tab strip's phantom double-tap dies — the pointerdown's paired click was arriving after the render had already swapped in fresh handlers, and with toggling tabs that ghost click un-did the tap it belonged to. The timestamp guard now lives on the DOM node, which survives the morph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- build.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'build.js') diff --git a/build.js b/build.js index cfc1a58..e2c0217 100644 --- a/build.js +++ b/build.js @@ -413,6 +413,12 @@ if (import.meta.main) { if (/^(app|chunk)-[A-Za-z0-9]+\.js$/.test(f) && !keep.has(f)) await Bun.file('dist/' + f).delete(); } + // The standalone single-file wallet: everything inlined (deferred features + // included), no PWA plumbing — meant to be downloaded from /standalone.html + // and opened straight from a disk. Network features still reach out when + // online; the wallet itself needs no server. + await Bun.write('dist/standalone.html', await buildHtml({ minify: true, pwa: false })); + // Lazy-loaded QR decoder — kept out of index.html, fetched only when a // browser without BarcodeDetector opens the scanner. await Bun.write('dist/jsqr.js', await buildJsQr()); @@ -447,6 +453,8 @@ if (import.meta.main) { const kb = (Buffer.byteLength(html) / 1024).toFixed(0); const jkb = (Buffer.byteLength(rawJs) / 1024).toFixed(0); const ckb = (chunks.reduce((n, c) => n + Buffer.byteLength(c.text), 0) / 1024).toFixed(0); + const skb = ((await Bun.file('dist/standalone.html').arrayBuffer()).byteLength / 1024).toFixed(0); console.log(`✓ dist/index.html (${kb} KB) + app-${version}.js (${jkb} KB) + ${chunks.length} deferred chunk(s) (${ckb} KB) — offline use: install the PWA`); + console.log(`✓ dist/standalone.html (${skb} KB) — the single-file save-and-run wallet`); console.log(`✓ PWA: manifest.webmanifest, sw.js (cold-${version}), ${STATIC.length} icons, jsqr.js, nip46.js, ${locales.length} locales`); } -- cgit v1.2.3