OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet-desktop commits / c55e80e

Wire up pear-runtime for P2P OTA updates
- Add pear-runtime dependency for OTA update awareness - Add upgrade field pointing to pear://nfwe...dxfy - Add non-blocking OTA init in index.cjs (CJS dynamic import pattern) - Add .pear-git/ci.yaml for CI runner deploy steps Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c55e80ece07a168c44feade20f967574f4020244
by plankatron <fleeky@gmail.com> · 2026-02-20T20:43:50.000Z

Changed files (3) +30 -1

.pear-git/ci.yaml +4 -0
……@@ -0,0 +1,4 @@
1steps:
2 - name: copy-deps
3 run: cp -r /storage/projects/code/hypercore-kb/hyper-fleeky/hyper-wallet-desktop/node_modules .
4 timeout: 120
index.cjs +22 -0
……@@ -8,6 +8,9 @@
88require('bare-node-runtime/global')
99require('bare-node-runtime/imports')
1010
11const fs = require('bare-fs')
12const path = require('bare-path')
13
1114const Runtime = require('pear-electron')
1215const Bridge = require('pear-bridge')
1316const http = require('bare-http1')
……@@ -15,6 +18,25 @@ const http = require('bare-http1')
1518// Import the wallet server
1619const { startServer } = require('./wallet-server.cjs')
1720
21// Initialize pear-runtime for P2P OTA updates (non-blocking)
22try {
23 const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'))
24 if (pkg.upgrade) {
25 import('pear-runtime').then(({ default: PearRuntime }) => {
26 const os = require('bare-os')
27 const p = os.platform()
28 const name = 'hyper-wallet-desktop'
29 let dir
30 if (p === 'darwin') dir = path.join(os.homedir(), 'Library', 'Application Support', name)
31 else if (p === 'win32') dir = path.join(os.homedir(), 'AppData', 'Roaming', name)
32 else dir = path.join(os.homedir(), '.config', name)
33
34 const runtime = new PearRuntime({ dir, app: __dirname, version: pkg.version || '1.1.0', upgrade: pkg.upgrade })
35 runtime.on('updated', () => { runtime.applyUpdate().catch(() => {}) })
36 }).catch(() => {})
37 }
38} catch {}
39
1840async function main() {
1941 console.log('🚀 Hyper Wallet Desktop starting...')
2042
package.json +4 -1
……@@ -1,8 +1,10 @@
11{
22 "name": "hyper-wallet-desktop",
3 "version": "1.0.0",
3 "version": "1.1.0",
44 "type": "module",
55 "main": "index.cjs",
6 "private": true,
7 "upgrade": "pear://nfwe34qee4u6qsb63ewmu46xe5srekg98toku95cqh5gsgitdxfy",
68 "imports": {
79 "#node:*": "bare:*"
810 },
……@@ -61,6 +63,7 @@
6163 "pear-bridge": "^1.2.0",
6264 "pear-electron": "^1.7.20",
6365 "pear-pipe": "^1.0.1",
66 "pear-runtime": "^0.4.2",
6467 "protomux": "^3.6.0",
6568 "qrcode": "^1.5.4"
6669 }