From 6f94333101c004d26115b8276e7fc2604a3c329f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20Alexander=20B=C3=BChler?= <8782386+SeverinAlexB@users.noreply.github.com> Date: Fri, 21 Mar 2025 14:24:34 +0200 Subject: [PATCH] chore: Renamed pubky member dir to pubky-client (#90) * chore: Renamed pubky member dir to pubky-client * fixed paths * fixed wasm test workflow --- .github/workflows/pr-check.yml | 8 ++++---- Cargo.toml | 1 - README.md | 4 ++-- examples/Cargo.toml | 2 +- {pubky => pubky-client}/.cargo/config.toml | 0 {pubky => pubky-client}/Cargo.toml | 0 {pubky => pubky-client}/README.md | 2 +- {pubky => pubky-client}/build.rs | 0 {pubky => pubky-client}/pkg/.gitignore | 0 {pubky => pubky-client}/pkg/LICENSE | 0 {pubky => pubky-client}/pkg/README.md | 2 +- {pubky => pubky-client}/pkg/node-header.cjs | 0 {pubky => pubky-client}/pkg/package.json | 0 {pubky => pubky-client}/pkg/test/auth.js | 0 {pubky => pubky-client}/pkg/test/http.js | 0 {pubky => pubky-client}/pkg/test/keys.js | 0 {pubky => pubky-client}/pkg/test/public.js | 0 {pubky => pubky-client}/pkg/test/recovery.js | 0 {pubky => pubky-client}/pkg/test/utils.js | 0 {pubky => pubky-client}/src/bin/bundle_pubky_npm.rs | 0 {pubky => pubky-client}/src/bin/patch.mjs | 0 {pubky => pubky-client}/src/lib.rs | 0 {pubky => pubky-client}/src/native.rs | 0 {pubky => pubky-client}/src/native/api/auth.rs | 0 {pubky => pubky-client}/src/native/api/http.rs | 0 {pubky => pubky-client}/src/native/api/public.rs | 0 {pubky => pubky-client}/src/native/internal/cookies.rs | 0 {pubky => pubky-client}/src/native/internal/pkarr.rs | 0 {pubky => pubky-client}/src/wasm/api/auth.rs | 0 {pubky => pubky-client}/src/wasm/api/http.rs | 0 {pubky => pubky-client}/src/wasm/api/public.rs | 0 {pubky => pubky-client}/src/wasm/api/recovery_file.rs | 0 {pubky => pubky-client}/src/wasm/mod.rs | 0 {pubky => pubky-client}/src/wasm/wrappers/keys.rs | 0 {pubky => pubky-client}/src/wasm/wrappers/session.rs | 0 pubky-testnet/Cargo.toml | 2 +- 36 files changed, 10 insertions(+), 11 deletions(-) rename {pubky => pubky-client}/.cargo/config.toml (100%) rename {pubky => pubky-client}/Cargo.toml (100%) rename {pubky => pubky-client}/README.md (98%) rename {pubky => pubky-client}/build.rs (100%) rename {pubky => pubky-client}/pkg/.gitignore (100%) rename {pubky => pubky-client}/pkg/LICENSE (100%) rename {pubky => pubky-client}/pkg/README.md (99%) rename {pubky => pubky-client}/pkg/node-header.cjs (100%) rename {pubky => pubky-client}/pkg/package.json (100%) rename {pubky => pubky-client}/pkg/test/auth.js (100%) rename {pubky => pubky-client}/pkg/test/http.js (100%) rename {pubky => pubky-client}/pkg/test/keys.js (100%) rename {pubky => pubky-client}/pkg/test/public.js (100%) rename {pubky => pubky-client}/pkg/test/recovery.js (100%) rename {pubky => pubky-client}/pkg/test/utils.js (100%) rename {pubky => pubky-client}/src/bin/bundle_pubky_npm.rs (100%) rename {pubky => pubky-client}/src/bin/patch.mjs (100%) rename {pubky => pubky-client}/src/lib.rs (100%) rename {pubky => pubky-client}/src/native.rs (100%) rename {pubky => pubky-client}/src/native/api/auth.rs (100%) rename {pubky => pubky-client}/src/native/api/http.rs (100%) rename {pubky => pubky-client}/src/native/api/public.rs (100%) rename {pubky => pubky-client}/src/native/internal/cookies.rs (100%) rename {pubky => pubky-client}/src/native/internal/pkarr.rs (100%) rename {pubky => pubky-client}/src/wasm/api/auth.rs (100%) rename {pubky => pubky-client}/src/wasm/api/http.rs (100%) rename {pubky => pubky-client}/src/wasm/api/public.rs (100%) rename {pubky => pubky-client}/src/wasm/api/recovery_file.rs (100%) rename {pubky => pubky-client}/src/wasm/mod.rs (100%) rename {pubky => pubky-client}/src/wasm/wrappers/keys.rs (100%) rename {pubky => pubky-client}/src/wasm/wrappers/session.rs (100%) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index dc186d8..6123806 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -103,13 +103,13 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Build WASM - working-directory: pubky/pkg + working-directory: pubky-client/pkg run: | npm install npm run build - name: Run the testnet - working-directory: pubky/pkg + working-directory: pubky-client/pkg run: npm run testnet > testnet.log 2>&1 & - name: Wait for testnet homeserver @@ -120,11 +120,11 @@ jobs: done - name: Run Tests (only node-js) - working-directory: pubky/pkg + working-directory: pubky-client/pkg # runing only `test-nodjs` and not browser because of weird `exit` behavior run: npm run test-nodejs - name: Show testnet logs if tests fail - working-directory: pubky/pkg + working-directory: pubky-client/pkg if: failure() run: cat testnet.log diff --git a/Cargo.toml b/Cargo.toml index 99ec038..68fd200 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,5 @@ [workspace] members = [ - "pubky", "pubky-*", "http-relay", "pkarr-republisher", diff --git a/README.md b/README.md index c4106bd..ce21e0a 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Pubky-core combines a [censorship resistant public-key based alternative to DNS] ## Getting started -This repository contains a [Homeserver](./pubky-homeserver), and a [Client](./pubky) (both Rust and JS wasm bindings). +This repository contains a [Homeserver](./pubky-homeserver), and a [Client](./pubky-client) (both Rust and JS wasm bindings). You can a run a local homeserver using `cargo run` with more instructions in the README. Check the [Examples](./examples) directory for small feature-focesed examples of how to use the Pubky client. @@ -45,7 +45,7 @@ Check the [Examples](./examples) directory for small feature-focesed examples o If you prefer to use JavaScript in NodeJs/Browser or any runtime with Wasm support, you can either install from npm [`@synonymdev/pubky`](https://www.npmjs.com/package/@synonymdev/pubky) or build the bindings yourself: ```bash -cd pubky/pkg +cd pubky-client/pkg npm i npm run build ``` diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 03fa3c8..b51570e 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -19,7 +19,7 @@ path = "./request/main.rs" anyhow = "1.0.95" base64 = "0.22.1" clap = { version = "4.5.29", features = ["derive"] } -pubky = { path = "../pubky" } +pubky = { path = "../pubky-client" } pubky-common = { path = "../pubky-common" } reqwest = "0.12.12" rpassword = "7.3.1" diff --git a/pubky/.cargo/config.toml b/pubky-client/.cargo/config.toml similarity index 100% rename from pubky/.cargo/config.toml rename to pubky-client/.cargo/config.toml diff --git a/pubky/Cargo.toml b/pubky-client/Cargo.toml similarity index 100% rename from pubky/Cargo.toml rename to pubky-client/Cargo.toml diff --git a/pubky/README.md b/pubky-client/README.md similarity index 98% rename from pubky/README.md rename to pubky-client/README.md index 38d05af..f6436cd 100644 --- a/pubky/README.md +++ b/pubky-client/README.md @@ -73,7 +73,7 @@ changes. This is a [rust-analyzer issue](https://github.com/rust-lang/rust-analy ## How To Build/Test the NPM Package -1. Go to `pubky/pkg`. +1. Go to `pubky-client/pkg`. 2. Run `npm run build`. 3. Run a testnet mainline DHT, Pkarr relay and Homeserver `npm run testnet` 4. Run tests with `npm run test`. \ No newline at end of file diff --git a/pubky/build.rs b/pubky-client/build.rs similarity index 100% rename from pubky/build.rs rename to pubky-client/build.rs diff --git a/pubky/pkg/.gitignore b/pubky-client/pkg/.gitignore similarity index 100% rename from pubky/pkg/.gitignore rename to pubky-client/pkg/.gitignore diff --git a/pubky/pkg/LICENSE b/pubky-client/pkg/LICENSE similarity index 100% rename from pubky/pkg/LICENSE rename to pubky-client/pkg/LICENSE diff --git a/pubky/pkg/README.md b/pubky-client/pkg/README.md similarity index 99% rename from pubky/pkg/README.md rename to pubky-client/pkg/README.md index 75cfb4c..d8dd29d 100644 --- a/pubky/pkg/README.md +++ b/pubky-client/pkg/README.md @@ -273,7 +273,7 @@ Clone the Pubky repository: ```bash git clone https://github.com/pubky/pubky -cd pubky/pkg +cd pubky-client/pkg ``` Run the local testnet server diff --git a/pubky/pkg/node-header.cjs b/pubky-client/pkg/node-header.cjs similarity index 100% rename from pubky/pkg/node-header.cjs rename to pubky-client/pkg/node-header.cjs diff --git a/pubky/pkg/package.json b/pubky-client/pkg/package.json similarity index 100% rename from pubky/pkg/package.json rename to pubky-client/pkg/package.json diff --git a/pubky/pkg/test/auth.js b/pubky-client/pkg/test/auth.js similarity index 100% rename from pubky/pkg/test/auth.js rename to pubky-client/pkg/test/auth.js diff --git a/pubky/pkg/test/http.js b/pubky-client/pkg/test/http.js similarity index 100% rename from pubky/pkg/test/http.js rename to pubky-client/pkg/test/http.js diff --git a/pubky/pkg/test/keys.js b/pubky-client/pkg/test/keys.js similarity index 100% rename from pubky/pkg/test/keys.js rename to pubky-client/pkg/test/keys.js diff --git a/pubky/pkg/test/public.js b/pubky-client/pkg/test/public.js similarity index 100% rename from pubky/pkg/test/public.js rename to pubky-client/pkg/test/public.js diff --git a/pubky/pkg/test/recovery.js b/pubky-client/pkg/test/recovery.js similarity index 100% rename from pubky/pkg/test/recovery.js rename to pubky-client/pkg/test/recovery.js diff --git a/pubky/pkg/test/utils.js b/pubky-client/pkg/test/utils.js similarity index 100% rename from pubky/pkg/test/utils.js rename to pubky-client/pkg/test/utils.js diff --git a/pubky/src/bin/bundle_pubky_npm.rs b/pubky-client/src/bin/bundle_pubky_npm.rs similarity index 100% rename from pubky/src/bin/bundle_pubky_npm.rs rename to pubky-client/src/bin/bundle_pubky_npm.rs diff --git a/pubky/src/bin/patch.mjs b/pubky-client/src/bin/patch.mjs similarity index 100% rename from pubky/src/bin/patch.mjs rename to pubky-client/src/bin/patch.mjs diff --git a/pubky/src/lib.rs b/pubky-client/src/lib.rs similarity index 100% rename from pubky/src/lib.rs rename to pubky-client/src/lib.rs diff --git a/pubky/src/native.rs b/pubky-client/src/native.rs similarity index 100% rename from pubky/src/native.rs rename to pubky-client/src/native.rs diff --git a/pubky/src/native/api/auth.rs b/pubky-client/src/native/api/auth.rs similarity index 100% rename from pubky/src/native/api/auth.rs rename to pubky-client/src/native/api/auth.rs diff --git a/pubky/src/native/api/http.rs b/pubky-client/src/native/api/http.rs similarity index 100% rename from pubky/src/native/api/http.rs rename to pubky-client/src/native/api/http.rs diff --git a/pubky/src/native/api/public.rs b/pubky-client/src/native/api/public.rs similarity index 100% rename from pubky/src/native/api/public.rs rename to pubky-client/src/native/api/public.rs diff --git a/pubky/src/native/internal/cookies.rs b/pubky-client/src/native/internal/cookies.rs similarity index 100% rename from pubky/src/native/internal/cookies.rs rename to pubky-client/src/native/internal/cookies.rs diff --git a/pubky/src/native/internal/pkarr.rs b/pubky-client/src/native/internal/pkarr.rs similarity index 100% rename from pubky/src/native/internal/pkarr.rs rename to pubky-client/src/native/internal/pkarr.rs diff --git a/pubky/src/wasm/api/auth.rs b/pubky-client/src/wasm/api/auth.rs similarity index 100% rename from pubky/src/wasm/api/auth.rs rename to pubky-client/src/wasm/api/auth.rs diff --git a/pubky/src/wasm/api/http.rs b/pubky-client/src/wasm/api/http.rs similarity index 100% rename from pubky/src/wasm/api/http.rs rename to pubky-client/src/wasm/api/http.rs diff --git a/pubky/src/wasm/api/public.rs b/pubky-client/src/wasm/api/public.rs similarity index 100% rename from pubky/src/wasm/api/public.rs rename to pubky-client/src/wasm/api/public.rs diff --git a/pubky/src/wasm/api/recovery_file.rs b/pubky-client/src/wasm/api/recovery_file.rs similarity index 100% rename from pubky/src/wasm/api/recovery_file.rs rename to pubky-client/src/wasm/api/recovery_file.rs diff --git a/pubky/src/wasm/mod.rs b/pubky-client/src/wasm/mod.rs similarity index 100% rename from pubky/src/wasm/mod.rs rename to pubky-client/src/wasm/mod.rs diff --git a/pubky/src/wasm/wrappers/keys.rs b/pubky-client/src/wasm/wrappers/keys.rs similarity index 100% rename from pubky/src/wasm/wrappers/keys.rs rename to pubky-client/src/wasm/wrappers/keys.rs diff --git a/pubky/src/wasm/wrappers/session.rs b/pubky-client/src/wasm/wrappers/session.rs similarity index 100% rename from pubky/src/wasm/wrappers/session.rs rename to pubky-client/src/wasm/wrappers/session.rs diff --git a/pubky-testnet/Cargo.toml b/pubky-testnet/Cargo.toml index 2ea71c6..dc3c4ec 100644 --- a/pubky-testnet/Cargo.toml +++ b/pubky-testnet/Cargo.toml @@ -19,7 +19,7 @@ tokio = { version = "1.43.0", features = ["full"] } tracing-subscriber = "0.3.19" url = "2.5.4" -pubky = { version = "0.4.2", path = "../pubky" } +pubky = { version = "0.4.2", path = "../pubky-client" } pubky-common = { version = "0.3.1", path = "../pubky-common" } pubky-homeserver = { version = "0.1.2", path = "../pubky-homeserver" }