From 381a634692194bd42796eec3eabc672545bec62a Mon Sep 17 00:00:00 2001 From: nazeh Date: Thu, 1 Aug 2024 16:04:25 +0300 Subject: [PATCH] chore(js): publish 0.1.7 --- pubky/pkg/.gitignore | 2 +- pubky/pkg/README.md | 2 +- pubky/pkg/package.json | 15 +++++++-------- pubky/pkg/test/auth.js | 2 +- pubky/pkg/test/keys.js | 2 +- pubky/pkg/test/public.js | 8 ++++---- pubky/src/wasm/keys.rs | 2 +- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pubky/pkg/.gitignore b/pubky/pkg/.gitignore index bc0022f..d2a005f 100644 --- a/pubky/pkg/.gitignore +++ b/pubky/pkg/.gitignore @@ -1,5 +1,5 @@ -nodejs/* browser.js coverage node_modules package-lock.json +pubky* diff --git a/pubky/pkg/README.md b/pubky/pkg/README.md index d44efc2..fbe89d2 100644 --- a/pubky/pkg/README.md +++ b/pubky/pkg/README.md @@ -24,7 +24,7 @@ let homeserver = PublicKey.from("8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn4 await client.signup(keypair, homeserver) -const publicKey = keypair.public_key(); +const publicKey = keypair.publicKey(); // Pubky URL let url = `pubky://${publicKey.z32()}/pub/example.com/arbitrary`; diff --git a/pubky/pkg/package.json b/pubky/pkg/package.json index 53b52b5..73ee93c 100644 --- a/pubky/pkg/package.json +++ b/pubky/pkg/package.json @@ -2,7 +2,7 @@ "name": "@synonymdev/pubky", "type": "module", "description": "Pubky client", - "version": "0.1.4", + "version": "0.1.7", "license": "MIT", "repository": { "type": "git", @@ -17,16 +17,15 @@ "prepublishOnly": "npm run build && npm run test" }, "files": [ - "nodejs/*", - "index.js", - "browser.js" + "nodejs/pubky_bg.wasm", + "nodejs/pubky.js", + "nodejs/pubky.d.ts", + "browser.js", + "index.js" ], "main": "index.js", "browser": "browser.js", - "types": "pubky.d.ts", - "sideEffects": [ - "./snippets/*" - ], + "types": "nodejs/pubky.d.ts", "keywords": [ "web", "dht", diff --git a/pubky/pkg/test/auth.js b/pubky/pkg/test/auth.js index d738c99..7b15483 100644 --- a/pubky/pkg/test/auth.js +++ b/pubky/pkg/test/auth.js @@ -6,7 +6,7 @@ test('auth', async (t) => { const client = PubkyClient.testnet(); const keypair = Keypair.random() - const publicKey = keypair.public_key() + const publicKey = keypair.publicKey() const homeserver = PublicKey.from('8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo') await client.signup(keypair, homeserver) diff --git a/pubky/pkg/test/keys.js b/pubky/pkg/test/keys.js index 306e21e..377160a 100644 --- a/pubky/pkg/test/keys.js +++ b/pubky/pkg/test/keys.js @@ -7,7 +7,7 @@ test('generate keys from a seed', async (t) => { const keypair = Keypair.from_secret_key(secretkey) - const publicKey = keypair.public_key() + const publicKey = keypair.publicKey() t.is(publicKey.z32(), 'gcumbhd7sqit6nn457jxmrwqx9pyymqwamnarekgo3xppqo6a19o') }) diff --git a/pubky/pkg/test/public.js b/pubky/pkg/test/public.js index 9a8b5c2..cd1cb5c 100644 --- a/pubky/pkg/test/public.js +++ b/pubky/pkg/test/public.js @@ -10,7 +10,7 @@ test('public: put/get', async (t) => { const homeserver = PublicKey.from('8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo'); await client.signup(keypair, homeserver); - const publicKey = keypair.public_key(); + const publicKey = keypair.publicKey(); let url = `pubky://${publicKey.z32()}/pub/example.com/arbitrary`; @@ -49,7 +49,7 @@ test("not found", async (t) => { const homeserver = PublicKey.from('8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo'); await client.signup(keypair, homeserver); - const publicKey = keypair.public_key(); + const publicKey = keypair.publicKey(); let url = `pubky://${publicKey.z32()}/pub/example.com/arbitrary`; @@ -62,7 +62,7 @@ test("unauthorized", async (t) => { const client = PubkyClient.testnet(); const keypair = Keypair.random() - const publicKey = keypair.public_key() + const publicKey = keypair.publicKey() const homeserver = PublicKey.from('8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo') await client.signup(keypair, homeserver) @@ -90,7 +90,7 @@ test("forbidden", async (t) => { const client = PubkyClient.testnet(); const keypair = Keypair.random() - const publicKey = keypair.public_key() + const publicKey = keypair.publicKey() const homeserver = PublicKey.from('8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo') await client.signup(keypair, homeserver) diff --git a/pubky/src/wasm/keys.rs b/pubky/src/wasm/keys.rs index d1ef078..ea5ea2c 100644 --- a/pubky/src/wasm/keys.rs +++ b/pubky/src/wasm/keys.rs @@ -22,7 +22,7 @@ impl Keypair { Self(pkarr::Keypair::from_secret_key(&bytes)) } - #[wasm_bindgen] + #[wasm_bindgen(js_name = "publicKey")] /// Returns the [PublicKey] of this keypair. pub fn public_key(&self) -> PublicKey { PublicKey(self.0.public_key())