Make nostr-wasm an optional peer dependency

A default npm install of nostr-tools pulled in nostr-wasm@0.1.0 and its
WASM artifacts even for consumers using only the pure JavaScript
implementation. The WASM adapter already takes an instance supplied by
the caller through setNostrWasm, and the built JavaScript never imports
nostr-wasm at runtime.

Move nostr-wasm to an optional peer dependency, keeping the exact version
as a development dependency for builds and benchmarks. Applications that
select the WASM backend install nostr-wasm@0.1.0 explicitly.
This commit is contained in:
TheCryptoDonkey
2026-09-09 15:28:02 -03:00
committed by fiatjaf
parent 336ff25710
commit ea3be3bac4
+6 -2
View File
@@ -302,13 +302,16 @@
"@noble/hashes": "2.0.1",
"@scure/base": "2.0.0",
"@scure/bip32": "2.0.1",
"@scure/bip39": "2.0.1",
"nostr-wasm": "0.1.0"
"@scure/bip39": "2.0.1"
},
"peerDependencies": {
"nostr-wasm": "0.1.0",
"typescript": ">=5.0.0"
},
"peerDependenciesMeta": {
"nostr-wasm": {
"optional": true
},
"typescript": {
"optional": true
}
@@ -333,6 +336,7 @@
"mitata": "^0.1.6",
"mock-socket": "^9.3.1",
"node-fetch": "^2.6.9",
"nostr-wasm": "0.1.0",
"prettier": "^3.0.3",
"typescript": "^5.8.2"
},