From 6412adc91c5ebb27311255c10d45d0006d8f6b96 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 6 May 2024 15:07:31 +0100 Subject: [PATCH] move daemon crate --- Cargo.lock | 136 +++++++++++++----- Cargo.toml | 1 - crates/atuin-client/src/settings.rs | 4 +- .../atuin-daemon}/Cargo.toml | 0 .../atuin-daemon}/build.rs | 0 .../atuin-daemon}/proto/history.proto | 0 .../atuin-daemon}/src/client.rs | 0 .../atuin-daemon}/src/history.rs | 0 .../atuin-daemon}/src/lib.rs | 0 .../atuin-daemon}/src/server.rs | 0 .../atuin-daemon}/src/server/sync.rs | 0 ui/.gitignore | 1 + 12 files changed, 105 insertions(+), 37 deletions(-) rename {atuin-daemon => crates/atuin-daemon}/Cargo.toml (100%) rename {atuin-daemon => crates/atuin-daemon}/build.rs (100%) rename {atuin-daemon => crates/atuin-daemon}/proto/history.proto (100%) rename {atuin-daemon => crates/atuin-daemon}/src/client.rs (100%) rename {atuin-daemon => crates/atuin-daemon}/src/history.rs (100%) rename {atuin-daemon => crates/atuin-daemon}/src/lib.rs (100%) rename {atuin-daemon => crates/atuin-daemon}/src/server.rs (100%) rename {atuin-daemon => crates/atuin-daemon}/src/server/sync.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index efe58bc4749..d5d78e21df6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,13 +202,14 @@ dependencies = [ [[package]] name = "atuin" -version = "18.1.0" +version = "18.2.0" dependencies = [ "async-trait", "atuin-client", "atuin-common", "atuin-daemon", "atuin-dotfiles", + "atuin-history", "atuin-server", "atuin-server-postgres", "base64 0.21.7", @@ -229,6 +230,7 @@ dependencies = [ "itertools 0.12.1", "log", "ratatui", + "regex", "rpassword", "runtime-format", "rustix", @@ -251,7 +253,7 @@ dependencies = [ [[package]] name = "atuin-client" -version = "18.1.0" +version = "18.2.0" dependencies = [ "async-trait", "atuin-common", @@ -299,7 +301,7 @@ dependencies = [ [[package]] name = "atuin-common" -version = "18.1.0" +version = "18.2.0" dependencies = [ "eyre", "lazy_static", @@ -308,6 +310,8 @@ dependencies = [ "semver", "serde", "sqlx", + "sysinfo", + "thiserror", "time", "typed-builder", "uuid", @@ -336,7 +340,7 @@ dependencies = [ [[package]] name = "atuin-dotfiles" -version = "0.1.0" +version = "0.2.0" dependencies = [ "atuin-client", "atuin-common", @@ -344,12 +348,43 @@ dependencies = [ "eyre", "rand", "rmp", + "serde", + "tokio", +] + +[[package]] +name = "atuin-history" +version = "0.1.0" +dependencies = [ + "async-trait", + "atuin-client", + "atuin-common", + "base64 0.21.7", + "crossterm", + "directories", + "eyre", + "fs-err", + "futures-util", + "indicatif", + "interim", + "itertools 0.12.1", + "log", + "semver", + "serde", + "serde_json", + "sysinfo", + "time", "tokio", + "tracing", + "unicode-segmentation", + "unicode-width", + "uuid", + "whoami", ] [[package]] name = "atuin-server" -version = "18.1.0" +version = "18.2.0" dependencies = [ "argon2", "async-trait", @@ -380,7 +415,7 @@ dependencies = [ [[package]] name = "atuin-server-database" -version = "18.1.0" +version = "18.2.0" dependencies = [ "async-trait", "atuin-common", @@ -393,7 +428,7 @@ dependencies = [ [[package]] name = "atuin-server-postgres" -version = "18.1.0" +version = "18.2.0" dependencies = [ "async-trait", "atuin-common", @@ -563,6 +598,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -655,6 +696,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" +[[package]] +name = "castaway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.0.89" @@ -828,6 +878,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "ryu", + "static_assertions", +] + [[package]] name = "config" version = "0.13.4" @@ -2812,12 +2875,13 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5659e52e4ba6e07b2dad9f1158f578ef84a73762625ddb51536019f34d180eb" +checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" dependencies = [ "bitflags 2.4.2", "cassowary", + "compact_str", "crossterm", "indoc", "itertools 0.12.1", @@ -2880,9 +2944,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -3062,9 +3126,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.4.2", "errno", @@ -3270,9 +3334,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -3313,11 +3377,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", @@ -3331,9 +3395,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", @@ -3722,14 +3786,20 @@ dependencies = [ [[package]] name = "stability" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.52", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "str-buf" version = "1.0.6" @@ -3761,18 +3831,18 @@ checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", @@ -3817,9 +3887,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sysinfo" -version = "0.30.6" +version = "0.30.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6746919caf9f2a85bff759535664c060109f21975c5ac2e8652e60102bd4d196" +checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" dependencies = [ "cfg-if", "core-foundation-sys", @@ -4240,18 +4310,18 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-builder" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444d8748011b93cb168770e8092458cb0f8854f931ff82fdf6ddfbd72a9c933e" +checksum = "77739c880e00693faef3d65ea3aad725f196da38b22fdc7ea6ded6e1ce4d3add" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563b3b88238ec95680aef36bdece66896eaa7ce3c0f1b4f39d38fb2435261352" +checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index fcdb2ccc4b1..e6bdaf36518 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [workspace] members = [ "crates/*", - "./atuin-daemon" ] resolver = "2" diff --git a/crates/atuin-client/src/settings.rs b/crates/atuin-client/src/settings.rs index 3b94dbf4322..92467de7235 100644 --- a/crates/atuin-client/src/settings.rs +++ b/crates/atuin-client/src/settings.rs @@ -342,13 +342,12 @@ pub struct Preview { pub strategy: PreviewStrategy, } -#[derive(Clone, Debug, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub struct Daemon { pub enabled: bool, pub socket_path: String, } -#[derive(Clone, Debug, Deserialize, Serialize)] impl Default for Preview { fn default() -> Self { Self { @@ -357,7 +356,6 @@ impl Default for Preview { } } -#[derive(Clone, Debug, Deserialize, Serialize)] impl Default for Daemon { fn default() -> Self { Self { diff --git a/atuin-daemon/Cargo.toml b/crates/atuin-daemon/Cargo.toml similarity index 100% rename from atuin-daemon/Cargo.toml rename to crates/atuin-daemon/Cargo.toml diff --git a/atuin-daemon/build.rs b/crates/atuin-daemon/build.rs similarity index 100% rename from atuin-daemon/build.rs rename to crates/atuin-daemon/build.rs diff --git a/atuin-daemon/proto/history.proto b/crates/atuin-daemon/proto/history.proto similarity index 100% rename from atuin-daemon/proto/history.proto rename to crates/atuin-daemon/proto/history.proto diff --git a/atuin-daemon/src/client.rs b/crates/atuin-daemon/src/client.rs similarity index 100% rename from atuin-daemon/src/client.rs rename to crates/atuin-daemon/src/client.rs diff --git a/atuin-daemon/src/history.rs b/crates/atuin-daemon/src/history.rs similarity index 100% rename from atuin-daemon/src/history.rs rename to crates/atuin-daemon/src/history.rs diff --git a/atuin-daemon/src/lib.rs b/crates/atuin-daemon/src/lib.rs similarity index 100% rename from atuin-daemon/src/lib.rs rename to crates/atuin-daemon/src/lib.rs diff --git a/atuin-daemon/src/server.rs b/crates/atuin-daemon/src/server.rs similarity index 100% rename from atuin-daemon/src/server.rs rename to crates/atuin-daemon/src/server.rs diff --git a/atuin-daemon/src/server/sync.rs b/crates/atuin-daemon/src/server/sync.rs similarity index 100% rename from atuin-daemon/src/server/sync.rs rename to crates/atuin-daemon/src/server/sync.rs diff --git a/ui/.gitignore b/ui/.gitignore index 5a1d47221b6..e0dacb8f3be 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -22,5 +22,6 @@ dist-ssr *.njsproj *.sln *.sw? +.vite gen