theseus: ship nostr-tools alongside hermes.mjs in packaged builds

0.3.99 installed users hit "Cannot find package 'nostr-tools' imported from
resources/lib/hermes.mjs" the first time they tried the Create account /
Open existing account button on the Hermes panel. The module was extracted
to resources/lib/ via extraResources (so the same .mjs/.js pattern as the
other lib files), but every other extracted .mjs happens to only pull
node:* builtins — hermes.mjs is the first one that needs real npm deps.

Node's resolver walks up from resources/lib/hermes.mjs looking for a
node_modules sibling and finds nothing: node_modules lives inside app.asar,
unreachable from an extracted file.

Fix: extraResources the nostr-tools dir + its three dep namespaces + the
one WASM dep so the walk finds them.
This commit is contained in:
Local Dev 2026-10-21 20:51:28 +03:00
parent 22e2b3f75e
commit 21310e600b

View file

@ -157,6 +157,22 @@
"from": "lib/hermes.js",
"to": "lib/hermes.mjs"
},
{
"from": "node_modules/nostr-tools",
"to": "node_modules/nostr-tools"
},
{
"from": "node_modules/@noble",
"to": "node_modules/@noble"
},
{
"from": "node_modules/@scure",
"to": "node_modules/@scure"
},
{
"from": "node_modules/nostr-wasm",
"to": "node_modules/nostr-wasm"
},
{
"from": "snapshots/bns-name-snapshot.json",
"to": "bns-name-snapshot.json"