Map Node builtins to bare-* via package.json imports and dual-load with which-runtime so holesailBareControl runs on Bare without MODULE_NOT_FOUND for crypto/fs/http/net.
This commit is contained in:
@@ -84,6 +84,7 @@ npx holesail 'hs://s000…'
|
||||
2. **Client-side local proxy** — Tunnels → plug icon runs the **real `holesail` package**.
|
||||
Under pear-electron the UI renderer cannot load bare-tcp (`require.addon is not a function`). Real holesail runs in the **Bare main process**:
|
||||
- Bare entry `index.js` starts `client/holesailBareControl.cjs` (`require('holesail')`) on `http://127.0.0.1:<port>`
|
||||
- Control code uses **Bare modules** (`bare-crypto`, `bare-fs`, `bare-http1`, `bare-net`, …) via `package.json` `imports` maps + `which-runtime`
|
||||
- Endpoint + token written to `<Pear.config.storage>/peardock-holesail-local.json`
|
||||
- UI `client/holesailLocal.js` POSTs `/connect` / `/disconnect` (never loads bare-tcp)
|
||||
- Node tests / non-Pear: in-process `require('holesail')`
|
||||
|
||||
Reference in New Issue
Block a user