From ea3be3bac43db4e7213df92a125a90b63913f695 Mon Sep 17 00:00:00 2001 From: TheCryptoDonkey Date: Tue, 8 Sep 2026 20:41:11 +0100 Subject: [PATCH] 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. --- package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d91df9c..645b6a0 100644 --- a/package.json +++ b/package.json @@ -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" },