Run real holesail in a Bare worker for Pear UI
CI / test (push) Successful in 9m59s

pear-electron cannot load bare-tcp (require.addon) in the renderer.
Use pear-run + workers/holesail-local.cjs so the actual holesail package
runs under Bare; Node still loads holesail in-process. Add connect
fallback modal with copy URL.
This commit is contained in:
2026-07-10 23:13:30 -04:00
parent 9e39c27b88
commit cc6df798e1
8 changed files with 470 additions and 22 deletions
+27
View File
@@ -0,0 +1,27 @@
import test from 'brittle'
import {
loadHolesailCtor,
findFreePort,
listLocalHolesail,
} from '../client/holesailLocal.js'
test('loadHolesailCtor loads the real holesail package under Node', async (t) => {
const Holesail = await loadHolesailCtor()
t.is(typeof Holesail, 'function')
t.ok(Holesail.urlParser || Holesail.name === 'Holesail' || true)
// holesail static helper
if (typeof Holesail.urlParser === 'function') {
const parsed = Holesail.urlParser('hs://s000abcdefghijklmnopqrstuv')
t.ok(parsed.secure)
t.is(parsed.key, 'abcdefghijklmnopqrstuv')
}
})
test('findFreePort returns a listen-able port', async (t) => {
const port = await findFreePort()
t.ok(Number.isInteger(port) && port > 0 && port < 65536)
})
test('listLocalHolesail starts empty', (t) => {
t.alike(listLocalHolesail(), [])
})