diff --git a/Cargo.lock b/Cargo.lock index 070d77cd..c9f72605 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1073,7 +1073,6 @@ version = "1.0.2" dependencies = [ "anyhow", "common", - "device", "flume 0.11.1", "futures", "fuzzy-matcher", @@ -1081,6 +1080,7 @@ dependencies = [ "instant", "itertools 0.13.0", "log", + "nip4e", "nostr-sdk", "person", "settings", @@ -1413,7 +1413,6 @@ dependencies = [ "auto_update", "chat", "common", - "device", "gpui-pre", "gpui-pre-linux", "gpui-pre-macos", @@ -1422,6 +1421,7 @@ dependencies = [ "gpui-pre-windows", "log", "nip29", + "nip4e", "nostr-sdk", "person", "settings", @@ -1441,7 +1441,6 @@ dependencies = [ "common", "console_error_panic_hook", "console_log", - "device", "getrandom 0.2.17", "getrandom 0.3.4", "getrandom 0.4.3", @@ -1451,6 +1450,7 @@ dependencies = [ "instant", "log", "nip29", + "nip4e", "person", "settings", "state", @@ -1823,26 +1823,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "device" -version = "1.0.2" -dependencies = [ - "anyhow", - "common", - "flume 0.11.1", - "gpui-pre", - "instant", - "log", - "nostr-sdk", - "person", - "settings", - "smallvec", - "smol", - "state", - "theme", - "ui", -] - [[package]] name = "digest" version = "0.10.7" @@ -4577,6 +4557,26 @@ dependencies = [ "ui", ] +[[package]] +name = "nip4e" +version = "1.0.2" +dependencies = [ + "anyhow", + "common", + "flume 0.11.1", + "gpui-pre", + "instant", + "log", + "nostr-sdk", + "person", + "settings", + "smallvec", + "smol", + "state", + "theme", + "ui", +] + [[package]] name = "no_std_io2" version = "0.9.4" @@ -9438,12 +9438,12 @@ dependencies = [ "chat", "chat_ui", "common", - "device", "gpui-pre", "instant", "log", "nip29", "nip29_ui", + "nip4e", "nostr-connect", "nostr-sdk", "person", diff --git a/crates/chat/Cargo.toml b/crates/chat/Cargo.toml index ad7fd71b..e0dcd9f7 100644 --- a/crates/chat/Cargo.toml +++ b/crates/chat/Cargo.toml @@ -7,7 +7,7 @@ publish.workspace = true [dependencies] common = { path = "../common" } state = { path = "../state" } -device = { path = "../device" } +nip4e = { path = "../nip4e" } person = { path = "../person" } settings = { path = "../settings" } diff --git a/crates/chat/src/room.rs b/crates/chat/src/room.rs index 00bd2294..59c3545d 100644 --- a/crates/chat/src/room.rs +++ b/crates/chat/src/room.rs @@ -3,7 +3,7 @@ use std::hash::{Hash, Hasher}; use anyhow::{Error, anyhow}; use common::EventExt; -use device::DeviceRegistry; +use nip4e::DeviceRegistry; use gpui::{App, AppContext, Context, EventEmitter, SharedString, Task}; use instant::Duration; use itertools::Itertools; diff --git a/crates/device/Cargo.toml b/crates/nip4e/Cargo.toml similarity index 97% rename from crates/device/Cargo.toml rename to crates/nip4e/Cargo.toml index fa2b0c37..9ec26d9b 100644 --- a/crates/device/Cargo.toml +++ b/crates/nip4e/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "device" +name = "nip4e" version.workspace = true edition.workspace = true publish.workspace = true diff --git a/crates/device/src/lib.rs b/crates/nip4e/src/lib.rs similarity index 100% rename from crates/device/src/lib.rs rename to crates/nip4e/src/lib.rs diff --git a/crates/workspace/Cargo.toml b/crates/workspace/Cargo.toml index 90e002e4..018905b9 100644 --- a/crates/workspace/Cargo.toml +++ b/crates/workspace/Cargo.toml @@ -9,7 +9,7 @@ ui = { path = "../ui" } theme = { path = "../theme" } common = { path = "../common" } state = { path = "../state" } -device = { path = "../device" } +nip4e = { path = "../nip4e" } chat = { path = "../chat" } chat_ui = { path = "../chat_ui" } nip29 = { path = "../nip29" } diff --git a/crates/workspace/src/dialogs/restore.rs b/crates/workspace/src/dialogs/restore.rs index 7196bc00..b5211aaf 100644 --- a/crates/workspace/src/dialogs/restore.rs +++ b/crates/workspace/src/dialogs/restore.rs @@ -1,12 +1,11 @@ -use instant::Duration; - use anyhow::Error; -use device::DeviceRegistry; use gpui::prelude::FluentBuilder; use gpui::{ AppContext, Context, Entity, IntoElement, ParentElement, Render, SharedString, Styled, Subscription, Task, Window, div, }; +use instant::Duration; +use nip4e::DeviceRegistry; use nostr_sdk::prelude::*; use theme::ActiveTheme; use ui::button::{Button, ButtonVariants}; diff --git a/crates/workspace/src/lib.rs b/crates/workspace/src/lib.rs index 72cd17a0..42b226dc 100644 --- a/crates/workspace/src/lib.rs +++ b/crates/workspace/src/lib.rs @@ -5,7 +5,7 @@ use anyhow::Error; use auto_update::AutoUpdater; use chat::{ChatEvent, ChatRegistry}; use common::download_dir; -use device::{DeviceEvent, DeviceRegistry}; +use nip4e::{DeviceEvent, DeviceRegistry}; use gpui::{ Action, App, AppContext, Context, Entity, InteractiveElement, IntoElement, ParentElement, Render, SharedString, Styled, Subscription, Task, Window, div, px, diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index c587cccb..a9f13c51 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -33,7 +33,7 @@ ui = { path = "../crates/ui" } theme = { path = "../crates/theme" } common = { path = "../crates/common" } state = { path = "../crates/state" } -device = { path = "../crates/device" } +nip4e = { path = "../crates/nip4e" } chat = { path = "../crates/chat" } nip29 = { path = "../crates/nip29" } settings = { path = "../crates/settings" } diff --git a/desktop/src/main.rs b/desktop/src/main.rs index c19a3b30..a1efb187 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -73,7 +73,7 @@ fn main() { // Initialize device signer // // NIP-4e: https://github.com/nostr-protocol/nips/blob/per-device-keys/4e.md - device::init(cx); + nip4e::init(cx); // Initialize app registry chat::init(cx); diff --git a/web/Cargo.toml b/web/Cargo.toml index 2e701222..51482e8b 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -14,7 +14,7 @@ ui = { path = "../crates/ui" } theme = { path = "../crates/theme" } common = { path = "../crates/common" } state = { path = "../crates/state" } -device = { path = "../crates/device" } +nip4e = { path = "../crates/nip4e" } chat = { path = "../crates/chat" } nip29 = { path = "../crates/nip29" } settings = { path = "../crates/settings" } diff --git a/web/src/lib.rs b/web/src/lib.rs index ce22e58a..91398653 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -65,7 +65,7 @@ pub fn run() -> Result<(), JsValue> { // Initialize device signer // // NIP-4e: https://github.com/nostr-protocol/nips/blob/per-device-keys/4e.md - device::init(cx); + nip4e::init(cx); // Initialize app registry chat::init(cx);