From a4fb228f32f196e39a9181808c3b3655403830eb Mon Sep 17 00:00:00 2001 From: Adam Doyle Date: Tue, 3 Dec 2024 17:45:50 -0500 Subject: [PATCH] update/cleanup deps --- Cargo.lock | 110 ++++++++++++-------------------------- clients/leptos/Cargo.toml | 26 ++------- lib/Cargo.toml | 2 - lib/src/lib.rs | 49 +++++++++-------- server/Cargo.toml | 1 - 5 files changed, 63 insertions(+), 125 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fdee3b..de86cea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,15 +112,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41058deaa38c9d9dd933d6d238d825227cffa668e2839b52879f6619c63eee3b" dependencies = [ "futures", - "thiserror 2.0.3", + "thiserror 2.0.4", "wasm-bindgen-futures", ] [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "approx" @@ -131,12 +131,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - [[package]] name = "async-compression" version = "0.4.18" @@ -324,30 +318,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bitcode" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1bce7608560cd4bf0296a4262d0dbf13e6bcec5ff2105724c8ab88cc7fc784" -dependencies = [ - "arrayvec", - "bitcode_derive", - "bytemuck", - "glam", - "serde", -] - -[[package]] -name = "bitcode_derive" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a539389a13af092cd345a2b47ae7dec12deb306d660b2223d25cd3419b253ebe" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "bitflags" version = "2.6.0" @@ -396,12 +366,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" -[[package]] -name = "bytemuck" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" - [[package]] name = "byteorder" version = "1.5.0" @@ -453,18 +417,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1" dependencies = [ "anstream", "anstyle", @@ -482,7 +446,6 @@ checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" name = "client" version = "0.1.0" dependencies = [ - "bitcode", "codee", "console_error_panic_hook", "console_log", @@ -1034,12 +997,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "glam" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" - [[package]] name = "gloo-net" version = "0.6.0" @@ -1179,9 +1136,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1774,7 +1731,7 @@ dependencies = [ "server_fn", "slotmap", "tachys", - "thiserror 2.0.3", + "thiserror 2.0.4", "throw_error", "typed-builder", "typed-builder-macro", @@ -1799,7 +1756,7 @@ dependencies = [ "leptos", "paste", "send_wrapper", - "thiserror 2.0.3", + "thiserror 2.0.4", "unic-langid", "wasm-bindgen", "wasm-bindgen-futures", @@ -1815,7 +1772,7 @@ dependencies = [ "config", "regex", "serde", - "thiserror 2.0.3", + "thiserror 2.0.4", "typed-builder", ] @@ -1908,7 +1865,7 @@ dependencies = [ "reactive_graph", "send_wrapper", "tachys", - "thiserror 2.0.3", + "thiserror 2.0.4", "url", "wasm-bindgen", "web-sys", @@ -1949,8 +1906,6 @@ dependencies = [ name = "lib" version = "0.1.0" dependencies = [ - "anyhow", - "bitcode", "rand", "serde", "tracing", @@ -2586,7 +2541,7 @@ dependencies = [ "send_wrapper", "serde", "slotmap", - "thiserror 2.0.3", + "thiserror 2.0.4", "web-sys", ] @@ -2820,7 +2775,6 @@ version = "0.1.0" dependencies = [ "anyhow", "axum", - "bitcode", "clap", "console-subscriber", "futures", @@ -2857,7 +2811,7 @@ dependencies = [ "serde_json", "serde_qs", "server_fn_macro_default", - "thiserror 2.0.3", + "thiserror 2.0.4", "throw_error", "url", "wasm-bindgen", @@ -3079,7 +3033,8 @@ dependencies = [ [[package]] name = "thaw" version = "0.4.0-beta5" -source = "git+https://github.com/thaw-ui/thaw.git#152cfc8dfedefe29be3554788901dc9a2e19b01b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "591dd40ab307d315d87efba582aeea2daeaee6f0e98ad18a29fb71623690f5b4" dependencies = [ "cfg-if", "chrono", @@ -3101,7 +3056,8 @@ dependencies = [ [[package]] name = "thaw_components" version = "0.2.0-beta5" -source = "git+https://github.com/thaw-ui/thaw.git#152cfc8dfedefe29be3554788901dc9a2e19b01b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b78f7dbac63ff9441e1c28052ac09fc4d7e639e984e5fd6f246822af99348e8" dependencies = [ "cfg-if", "leptos", @@ -3114,7 +3070,8 @@ dependencies = [ [[package]] name = "thaw_macro" version = "0.1.0-beta5" -source = "git+https://github.com/thaw-ui/thaw.git#152cfc8dfedefe29be3554788901dc9a2e19b01b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d45908e1603ea516d8b902f67364850ce759f90107a9f8745ca42460828e38a9" dependencies = [ "proc-macro2", "quote", @@ -3124,7 +3081,8 @@ dependencies = [ [[package]] name = "thaw_utils" version = "0.1.0-beta5" -source = "git+https://github.com/thaw-ui/thaw.git#152cfc8dfedefe29be3554788901dc9a2e19b01b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3bd6eb1d5b5f034efcf6abaca19dcdf01b5e4a198ad59916a02e52886eb1823" dependencies = [ "cfg-if", "chrono", @@ -3146,11 +3104,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" dependencies = [ - "thiserror-impl 2.0.3", + "thiserror-impl 2.0.4", ] [[package]] @@ -3166,9 +3124,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" dependencies = [ "proc-macro2", "quote", @@ -3196,9 +3154,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -3217,9 +3175,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -3237,9 +3195,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", diff --git a/clients/leptos/Cargo.toml b/clients/leptos/Cargo.toml index 6845dc5..2972e40 100644 --- a/clients/leptos/Cargo.toml +++ b/clients/leptos/Cargo.toml @@ -4,41 +4,25 @@ version = "0.1.0" edition = "2021" authors = ["Adam Doyle "] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] # Cards -bitcode = "0" lib = { workspace = true } serde_json = "1" # Leptos -leptos = { version = "0.7.0-rc1", features = ["csr", "nightly"] } -leptos_meta = { version = "0.7.0-rc1" } -leptos_router = { version = "0.7.0-rc1", features = ["nightly"] } -# leptos = { git = "https://github.com/leptos-rs/leptos.git", features = ["csr", "nightly"] } -# leptos_meta = { git = "https://github.com/leptos-rs/leptos.git" } -# leptos_router = { git = "https://github.com/leptos-rs/leptos.git", features = ["nightly"] } +leptos = { version = "0", features = ["csr", "nightly"] } +leptos_meta = { version = "0" } +leptos_router = { version = "0", features = ["nightly"] } console_error_panic_hook = "0" console_log = "1" log = "0" # Leptos-use -leptos-use = { version = "0.14.0-rc3", features = ["use_media_query"] } +leptos-use = { version = "0", features = ["use_media_query"] } codee = "0" -# codee = { path = "../../../codee" } # UI stuff -# thaw = { version = "0.4.0-beta", features = ["csr", "nightly"] } -# thaw = { path = "../../thaw/thaw", features = ["csr", "nightly"] } -# thaw = { git = "https://github.com/adoyle0/thaw.git", features = [ -# "csr", -# "nightly", -# ] } -thaw = { git = "https://github.com/thaw-ui/thaw.git", features = [ - "csr", - "nightly", -] } +thaw = { version = "0.4.0-beta", features = ["csr", "nightly"] } icondata = "0" [dev-dependencies] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index e1bf23d..8419d80 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -4,8 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -anyhow = "1" -bitcode = "0" rand = "0" serde = "1" tracing = "0" diff --git a/lib/src/lib.rs b/lib/src/lib.rs index f11b260..785665a 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1,9 +1,8 @@ -use bitcode::{Decode, Encode}; use serde::{Deserialize, Serialize}; pub enum ClientToServerMessage {} -#[derive(Serialize, Deserialize, Encode, Decode, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub enum ServerToClientMessage { CardPacksMeta(CardPacksMeta), ChatMessage(ChatMessage), @@ -17,7 +16,7 @@ pub enum ServerToClientMessage { UserUpdate(UserUpdate), } -#[derive(Serialize, Deserialize, Encode, Decode)] +#[derive(Serialize, Deserialize)] pub enum CardsMessage { BlackCardMeta(BlackCardMeta), CardPackMeta(CardPackMeta), @@ -34,52 +33,52 @@ pub enum CardsMessage { } /// Judge decision -#[derive(Clone, Serialize, Deserialize, Encode, Decode)] +#[derive(Clone, Serialize, Deserialize)] pub struct JudgeDecisionRequest { pub game_id: String, pub winning_cards: Vec, } /// White Card Meta -#[derive(Debug, Clone, Encode, Decode, Hash, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Hash, Eq, PartialEq, Serialize, Deserialize)] pub struct WhiteCardMeta { pub uuid: String, pub text: String, } /// Judge entry -#[derive(Debug, Clone, Encode, Decode, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct JudgeEntry { pub cards_to_judge: Vec, } /// Judge round -#[derive(Debug, Clone, Encode, Decode, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct JudgeRound { pub entries: Vec, } /// Delete game request -#[derive(Encode, Decode, Serialize, Deserialize)] +#[derive(Serialize, Deserialize)] pub struct GameDeleteRequest { pub delete_game_id: String, } /// Game join request -#[derive(Encode, Decode, Serialize, Deserialize)] +#[derive(Serialize, Deserialize)] pub struct GameJoinRequest { pub id: String, } /// Player Move Request -#[derive(Clone, Encode, Decode, Serialize, Deserialize)] +#[derive(Clone, Serialize, Deserialize)] pub struct PlayerMoveRequest { pub game_id: String, pub card_ids: Vec, } /// Game Player Meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct GamePlayerMeta { pub name: String, pub score: u32, @@ -87,7 +86,7 @@ pub struct GamePlayerMeta { } /// Game meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct GameMeta { pub uuid: String, pub name: String, @@ -101,21 +100,21 @@ pub struct GameMeta { } /// Black card meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct BlackCardMeta { pub text: String, pub pick: u32, } /// Game state meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct GameStateMeta { pub black: Option, // this has to be an option or prost gets cranky pub white: Vec, } /// Game browser meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct GameBrowserMeta { pub uuid: String, pub name: String, @@ -125,7 +124,7 @@ pub struct GameBrowserMeta { } /// Card Pack Meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct CardPackMeta { pub name: String, pub pack: String, @@ -134,57 +133,57 @@ pub struct CardPackMeta { } /// Card Packs Meta -#[derive(Clone, Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct CardPacksMeta { pub official_meta: Vec, pub unofficial_meta: Vec, } /// Games update -#[derive(Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct GamesUpdate { pub games: Vec, } /// Chat update -#[derive(Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct ChatUpdate { pub room: String, pub users: Vec, } /// User login request (to change name) -#[derive(Encode, Decode, Serialize, Deserialize)] +#[derive(Serialize, Deserialize)] pub struct UserLogInRequest { pub username: String, } /// Response to user name change containing new name -#[derive(Debug, Encode, Decode, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct UserUpdate { pub username: String, } /// Chat message -#[derive(Debug, Encode, Decode, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct ChatMessage { pub text: String, } /// Server user count -#[derive(Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct ServerOnlineUsers { pub online_users: u32, } /// Server games count -#[derive(Encode, Decode, Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct ServerActiveGames { pub active_games: u32, } /// New game request structure -#[derive(Encode, Decode, Serialize, Deserialize)] +#[derive(Serialize, Deserialize)] pub struct NewGameRequest { pub game_name: String, pub game_packs: Vec, diff --git a/server/Cargo.toml b/server/Cargo.toml index 4caa619..84df752 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -9,7 +9,6 @@ lib = { workspace = true } anyhow = "1" axum = { version = "0", features = ["ws"] } -bitcode = "0" clap = { version = "4", features = ["cargo"] } futures = "0" rand = "0"