diff --git a/Cargo.lock b/Cargo.lock index 8b3cb21dde..e46a0808ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -329,13 +329,15 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", "event-listener", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] @@ -692,6 +694,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[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.83" @@ -886,11 +897,20 @@ version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" dependencies = [ - "error-code", + "error-code 2.3.1", "str-buf", "winapi", ] +[[package]] +name = "clipboard-win" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c57002a5d9be777c1ef967e33674dac9ebd310d8893e4e3437b14d5f0f6372cc" +dependencies = [ + "error-code 3.0.0", +] + [[package]] name = "clipboard_macos" version = "0.1.0" @@ -921,15 +941,6 @@ dependencies = [ "x11rb 0.13.0", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "cmake" version = "0.1.45" @@ -1007,6 +1018,19 @@ dependencies = [ "memchr", ] +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if 1.0.0", + "itoa", + "ryu", + "static_assertions", +] + [[package]] name = "concurrent-queue" version = "2.4.0" @@ -1395,45 +1419,20 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" -version = "0.17.7" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4919d60f26ae233e14233cc39746c8c8bb8cd7b05840ace83604917b51b6c7" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 1.3.2", - "crossterm_winapi 0.6.2", - "lazy_static", + "bitflags 2.4.2", + "crossterm_winapi", "libc", - "mio 0.7.14", - "parking_lot 0.10.2", - "signal-hook 0.1.17", - "winapi", -] - -[[package]] -name = "crossterm" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" -dependencies = [ - "bitflags 1.3.2", - "crossterm_winapi 0.9.1", - "libc", - "mio 0.8.10", + "mio", "parking_lot 0.12.1", - "signal-hook 0.3.17", + "signal-hook", "signal-hook-mio", "winapi", ] -[[package]] -name = "crossterm_winapi" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2265c3f8e080075d9b6417aa72293fc71662f34b4af2612d8d1b074d29510db" -dependencies = [ - "winapi", -] - [[package]] name = "crossterm_winapi" version = "0.9.1" @@ -1583,7 +1582,7 @@ checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.3", - "lock_api 0.4.11", + "lock_api", "once_cell", "parking_lot_core 0.9.9", ] @@ -1951,6 +1950,12 @@ dependencies = [ "str-buf", ] +[[package]] +name = "error-code" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "281e452d3bad4005426416cdba5ccfd4f5c1280e10099e21db27f7c1c28347fc" + [[package]] name = "euc" version = "0.5.3" @@ -1971,9 +1976,24 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener", + "pin-project-lite", +] [[package]] name = "fallible-iterator" @@ -1995,13 +2015,13 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fd-lock" -version = "3.0.13" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" +checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if 1.0.0", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2963,6 +2983,12 @@ dependencies = [ "serde", ] +[[package]] +name = "indoc" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" + [[package]] name = "inline_tweak" version = "1.1.1" @@ -3335,15 +3361,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.11" @@ -3373,6 +3390,15 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "lru" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" +dependencies = [ + "hashbrown 0.14.3", +] + [[package]] name = "lz-fear" version = "0.1.1" @@ -3573,19 +3599,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "mio" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", -] - [[package]] name = "mio" version = "0.8.10" @@ -3598,15 +3611,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - [[package]] name = "more-asserts" version = "0.2.2" @@ -3801,17 +3805,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if 1.0.0", - "libc", -] - [[package]] name = "nix" version = "0.27.1" @@ -3863,7 +3856,7 @@ dependencies = [ "kqueue", "libc", "log", - "mio 0.8.10", + "mio", "walkdir", "windows-sys 0.48.0", ] @@ -3889,14 +3882,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ntapi" -version = "0.3.7" -source = "git+https://github.com/MSxDOS/ntapi.git?rev=9f56b149c9e25796739157c0fce3e0007a7de6eb#9f56b149c9e25796739157c0fce3e0007a7de6eb" -dependencies = [ - "winapi", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -4306,14 +4291,10 @@ dependencies = [ ] [[package]] -name = "parking_lot" -version = "0.10.2" +name = "parking" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.3", -] +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -4322,7 +4303,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", - "lock_api 0.4.11", + "lock_api", "parking_lot_core 0.8.6", ] @@ -4332,24 +4313,10 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api 0.4.11", + "lock_api", "parking_lot_core 0.9.9", ] -[[package]] -name = "parking_lot_core" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93f386bb233083c799e6e642a9d73db98c24a5deeb95ffc85bf281255dffc98" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall 0.1.57", - "smallvec", - "winapi", -] - [[package]] name = "parking_lot_core" version = "0.8.6" @@ -4905,6 +4872,26 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" +[[package]] +name = "ratatui" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "154b85ef15a5d1719bcaa193c3c81fe645cd120c156874cd660fe49fd21d1373" +dependencies = [ + "bitflags 2.4.2", + "cassowary", + "compact_str", + "crossterm", + "indoc", + "itertools 0.12.1", + "lru", + "paste", + "stability", + "strum 0.26.1", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "raw-window-handle" version = "0.4.3" @@ -4952,12 +4939,6 @@ dependencies = [ "yasna", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.2.16" @@ -5395,21 +5376,20 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rustyline" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "994eca4bca05c87e86e15d90fc7a91d1be64b4482b38cb2d27474568fe7c9db9" +checksum = "02a2d683a4ac90aeef5b1013933f6d977bd37d51ff3f4dad829d4931a7e6be86" dependencies = [ "bitflags 2.4.2", "cfg-if 1.0.0", - "clipboard-win 4.5.0", + "clipboard-win 5.0.0", "fd-lock", "home", "libc", "log", "memchr", - "nix 0.26.4", + "nix 0.27.1", "radix_trie", - "scopeguard", "unicode-segmentation", "unicode-width", "utf8parse", @@ -5763,17 +5743,6 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ea33232fdcf1bf691ca33450e5a94dde13e1a8cbb8caabc5e4f9d761e10b1a" -[[package]] -name = "signal-hook" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e31d442c16f047a671b5a71e2161d6e68814012b7f5379d269ebd915fac2729" -dependencies = [ - "libc", - "mio 0.7.14", - "signal-hook-registry", -] - [[package]] name = "signal-hook" version = "0.3.17" @@ -5791,8 +5760,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", - "mio 0.8.10", - "signal-hook 0.3.17", + "mio", + "signal-hook", ] [[package]] @@ -5940,7 +5909,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ - "lock_api 0.4.11", + "lock_api", ] [[package]] @@ -5962,6 +5931,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "stability" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +dependencies = [ + "quote 1.0.35", + "syn 1.0.109", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -6084,7 +6063,16 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", +] + +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +dependencies = [ + "strum_macros 0.26.1", ] [[package]] @@ -6100,6 +6088,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck 0.4.1", + "proc-macro2 1.0.78", + "quote 1.0.35", + "rustversion", + "syn 2.0.48", +] + [[package]] name = "sum_type" version = "0.2.0" @@ -6380,7 +6381,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 0.8.10", + "mio", "num_cpus", "pin-project-lite", "signal-hook-registry", @@ -6444,18 +6445,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", -] - [[package]] name = "toml" version = "0.8.10" @@ -6484,8 +6473,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.2", - "serde", - "serde_spanned", "toml_datetime", "winnow", ] @@ -6659,18 +6646,6 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" -[[package]] -name = "tui" -version = "0.10.0" -source = "git+https://github.com/fdehau/tui-rs.git?branch=paragraph-scroll#54b841fab6cfdb38e8dc1382176e965787964b4c" -dependencies = [ - "bitflags 1.3.2", - "cassowary", - "crossterm 0.17.7", - "unicode-segmentation", - "unicode-width", -] - [[package]] name = "tuple_utils" version = "0.4.0" @@ -6954,7 +6929,7 @@ dependencies = [ "slotmap", "specs", "spin_sleep", - "strum", + "strum 0.24.1", "tracing", "tracing-subscriber", "uuid", @@ -7060,7 +7035,7 @@ dependencies = [ "specs", "tar", "timer-queue", - "toml 0.7.8", + "toml 0.8.10", "tracing", "vek 0.15.8", "veloren-common", @@ -7222,7 +7197,7 @@ dependencies = [ "serde", "serde_json", "specs", - "strum", + "strum 0.24.1", "tokio", "tracing", "vek 0.15.8", @@ -7261,19 +7236,19 @@ dependencies = [ "cansi", "chrono", "clap", - "crossterm 0.26.1", + "crossterm", "hyper", "lazy_static", "mimalloc", "num_cpus", "prometheus", + "ratatui", "ron", "serde", "shell-words", - "signal-hook 0.3.17", + "signal-hook", "tokio", "tracing", - "tui", "veloren-common", "veloren-common-base", "veloren-common-frontend", @@ -7335,7 +7310,7 @@ dependencies = [ "shaderc", "slab", "specs", - "strum", + "strum 0.24.1", "tokio", "tracing", "treeculler", @@ -7431,7 +7406,7 @@ dependencies = [ "rstar", "rusqlite", "serde", - "strum", + "strum 0.24.1", "svg_fmt", "tracing", "tracing-subscriber", @@ -8418,7 +8393,7 @@ dependencies = [ "instant", "libc", "log", - "mio 0.8.10", + "mio", "ndk 0.7.0", "objc2", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 14ce84cf73..ad33f01eb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -159,8 +159,6 @@ clap = { version = "4.2", features = ["derive"]} [patch.crates-io] vek = { git = "https://github.com/yoanlcq/vek.git", rev = "84d5cb65841d46599a986c5477341bea4456be26" } -# ntapi 3.7 fails to compile under windows due to the bug https://github.com/MSxDOS/ntapi/pull/12 -ntapi = { git = "https://github.com/MSxDOS/ntapi.git", rev = "9f56b149c9e25796739157c0fce3e0007a7de6eb" } shred = { git = "https://github.com/amethyst/shred.git", rev = "5d52c6fc390dd04c12158633e77591f6523d1f85" } # This is needed because of an issue with spirv & naga in wgpu 0.18, and there's an issue # with uint in uniforms for gl. diff --git a/client/Cargo.toml b/client/Cargo.toml index f459225045..5f4f252810 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -35,13 +35,13 @@ authc = { git = "https://gitlab.com/veloren/auth.git", rev = "abb1a705827984e117 #TODO: put bot in a different crate #bot only -async-channel = { version = "1.6", optional = true } +async-channel = { version = "2.1", optional = true } voxygen-i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "../voxygen/i18n-helpers", optional = true } client-i18n = { package = "veloren-client-i18n", path = "i18n", optional = true } serde = { workspace = true, features = [ "rc" ], optional = true } ron = { workspace = true, optional = true } clap = { workspace = true, optional = true } -rustyline = { version = "12.0.0", optional = true } +rustyline = { version = "13.0.0", optional = true } ## logging common-frontend = { package = "veloren-common-frontend", path = "../common/frontend", optional = true } diff --git a/common/state/Cargo.toml b/common/state/Cargo.toml index a94ba64808..faa4b6e95b 100644 --- a/common/state/Cargo.toml +++ b/common/state/Cargo.toml @@ -31,7 +31,7 @@ specs = { workspace = true, features = ["serde", "storage-event-control", "deriv # Plugins scopeguard = "1.1.0" serde = { workspace = true, optional = true } -toml = { version = "0.7", optional = true } +toml = { version = "0.8", optional = true } tar = { version = "0.4.37", optional = true } wasmer = { version = "4.0.0", optional = true, default-features = false, features = ["sys", "wat", "cranelift"] } bincode = { workspace = true, optional = true } diff --git a/network/Cargo.toml b/network/Cargo.toml index 0fd16d0228..7aca6938e6 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -31,7 +31,7 @@ tracing = { workspace = true } prometheus = { workspace = true, optional = true } #async futures-util = { workspace = true, features = ["std"] } -async-channel = "1.6" #use for .close() channels +async-channel = "2.1" #use for .close() channels #mpsc channel registry lazy_static = { workspace = true } rand = { workspace = true } diff --git a/network/protocol/Cargo.toml b/network/protocol/Cargo.toml index de820f2a85..3f9522c6b8 100644 --- a/network/protocol/Cargo.toml +++ b/network/protocol/Cargo.toml @@ -27,7 +27,7 @@ bytes = "^1" hashbrown = { workspace = true } [dev-dependencies] -async-channel = "1.6" +async-channel = "2.1" tokio = { workspace = true, features = ["macros"] } criterion = { version = "0.5.1", default-features=false, features=["rayon", "cargo_bench_support", "async_tokio"]} diff --git a/server-cli/Cargo.toml b/server-cli/Cargo.toml index c42ba33618..9621edcc3f 100644 --- a/server-cli/Cargo.toml +++ b/server-cli/Cargo.toml @@ -39,13 +39,14 @@ tokio = { workspace = true, features = ["rt-multi-thread"] } num_cpus = "1.0" cansi = "2.2.1" clap = { workspace = true } -crossterm = "0.26" +crossterm = "0.27" lazy_static = { workspace = true } signal-hook = "0.3.6" shell-words = "1.0.0" tracing = { workspace = true } ron = { workspace = true } serde = { workspace = true, features = [ "rc", "derive" ]} +ratatui = { version = "0.26.0", features = ["crossterm"] } #HTTP axum = { version = "0.6.20" } @@ -54,10 +55,4 @@ prometheus = { workspace = true } chrono = { workspace = true } [target.'cfg(windows)'.dependencies] -mimalloc = "0.1.29" - -[dependencies.tui] -git = "https://github.com/fdehau/tui-rs.git" -branch="paragraph-scroll" -default-features = false -features = ['crossterm'] +mimalloc = "0.1.29" \ No newline at end of file diff --git a/server-cli/src/tui_runner.rs b/server-cli/src/tui_runner.rs index 5284dd1891..7f9d490542 100644 --- a/server-cli/src/tui_runner.rs +++ b/server-cli/src/tui_runner.rs @@ -4,6 +4,13 @@ use crossterm::{ execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; +use ratatui::{ + backend::CrosstermBackend, + layout::Rect, + text::Text, + widgets::{Block, Borders, Paragraph}, + Terminal, +}; use std::{ io, sync::{ @@ -13,13 +20,6 @@ use std::{ time::Duration, }; use tracing::{debug, error, warn}; -use tui::{ - backend::CrosstermBackend, - layout::Rect, - text::Text, - widgets::{Block, Borders, Paragraph, Wrap}, - Terminal, -}; pub struct Tui { pub msg_r: mpsc::Receiver, @@ -140,18 +140,8 @@ impl Tui { let block = Block::default().borders(Borders::ALL); - let wrap = Wrap { - scroll_callback: Some(Box::new(|text_area, lines| { - LOG.resize(text_area.height as usize); - let len = lines.len() as u16; - (len.saturating_sub(text_area.height), 0) - })), - ..Default::default() - }; - - let logger = Paragraph::new(LOG.inner.lock().unwrap().clone()) - .block(block) - .wrap(wrap); + LOG.resize(log_rect.height as usize); + let logger = Paragraph::new(LOG.inner.lock().unwrap().clone()).block(block); f.render_widget(logger, log_rect); let text: Text = input.as_str().into(); diff --git a/server-cli/src/tuilog.rs b/server-cli/src/tuilog.rs index eceb7af987..c9d941a487 100644 --- a/server-cli/src/tuilog.rs +++ b/server-cli/src/tuilog.rs @@ -1,9 +1,13 @@ +use ratatui::{ + prelude::Line, + style::{Color, Modifier, Style}, + text::{Span, Text}, +}; use std::{ io::{self, Write}, sync::{Arc, Mutex}, }; use tracing::warn; -use tui::text::Text; #[derive(Debug, Default, Clone)] pub struct TuiLog<'a> { @@ -29,10 +33,6 @@ impl<'a> Write for TuiLog<'a> { // depend on an old version of nom. Alternatives to consider may include // `vte`, `anstyle-parse`, `vt100`, or others. use cansi::v3::categorise_text; - use tui::{ - style::{Color, Modifier}, - text::{Span, Spans}, - }; let line = core::str::from_utf8(buf).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; @@ -41,7 +41,7 @@ impl<'a> Write for TuiLog<'a> { let mut lines = Vec::new(); for out in categorise_text(line) { - let mut style = tui::style::Style::default(); + let mut style = Style::default(); // NOTE: There are other values returned from cansi that we don't bother to use // for now including background color, italics, blinking, etc. style.fg = match out.fg { @@ -72,12 +72,12 @@ impl<'a> Write for TuiLog<'a> { spans.push(Span::styled(t.to_owned(), style)); } if t.ends_with('\n') { - lines.push(Spans(core::mem::take(&mut spans))); + lines.push(Line::from(core::mem::take(&mut spans))); } } } if !spans.is_empty() { - lines.push(Spans(spans)); + lines.push(Line::from(spans)); } self.inner.lock().unwrap().lines.append(&mut lines); diff --git a/server-cli/src/web/mod.rs b/server-cli/src/web/mod.rs index a73f95b456..eac86e37c8 100644 --- a/server-cli/src/web/mod.rs +++ b/server-cli/src/web/mod.rs @@ -1,6 +1,6 @@ use axum::{extract::State, response::IntoResponse, routing::get, Router}; use core::{future::Future, ops::Deref}; -use hyper::{header, http, Body, StatusCode}; +use hyper::{body::Body, header, http, StatusCode}; use prometheus::{Registry, TextEncoder}; use server::chat::ChatCache; use std::net::SocketAddr; @@ -16,7 +16,7 @@ pub async fn run( ) -> Result<(), hyper::Error> where S: Into, - F: Future, + F: Future + Send, R: Deref + Clone + Send + Sync + 'static, { let metrics = Router::new()