From 2af4f210c1f7af8f9b43aceaad9aa44ba84e3bf1 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Tue, 9 Jul 2024 22:58:00 +0200 Subject: [PATCH] refactor: update to ratatui v0.27 --- .github/dependabot.yml | 2 -- Cargo.lock | 53 +++++++++++++++++++++--------------------- Cargo.toml | 5 ++-- src/interactive/mod.rs | 3 ++- 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 521a174d..1b685279 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,8 +12,6 @@ updates: commit-message: prefix: "build(cargo):" ignore: - - dependency-name: crossterm - update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"] - dependency-name: rustls* update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"] - dependency-name: "*" diff --git a/Cargo.lock b/Cargo.lock index 5245ff29..fb987e65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -277,7 +277,7 @@ version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -568,12 +568,6 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -630,17 +624,11 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indoc" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" - [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -733,7 +721,6 @@ dependencies = [ "clap", "clap_complete", "clap_mangen", - "crossterm", "ego-tree", "rand", "ratatui", @@ -893,28 +880,29 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.26.2" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" +checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" dependencies = [ "bitflags 2.5.0", "cassowary", "compact_str", "crossterm", - "indoc", "itertools", "lru", "paste", "stability", "strum", + "strum_macros", "unicode-segmentation", + "unicode-truncate", "unicode-width", ] [[package]] name = "ratatui-binary-data-widget" version = "0.1.0" -source = "git+https://github.com/EdJoPaTo/ratatui-binary-data-widget?branch=main#4405e4547d25917f217a810920813bf1a00de1fc" +source = "git+https://github.com/EdJoPaTo/ratatui-binary-data-widget?branch=main#26fa10a4891746892739b2a8a8e13ec344d381dd" dependencies = [ "ratatui", ] @@ -1279,11 +1267,11 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", @@ -1423,9 +1411,9 @@ dependencies = [ [[package]] name = "tui-tree-widget" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6201de8ad8d88cb6cac4cfe3436d9a1ea31c0732a7aec4c2cc3b23186ad7dcc" +checksum = "0ac69db35529be6a75f9d27516ff33df299e2e8e961a1986d52185cef0427352" dependencies = [ "ratatui", "unicode-width", @@ -1485,11 +1473,22 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode-truncate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" +dependencies = [ + "itertools", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "untrusted" diff --git a/Cargo.toml b/Cargo.toml index 7a35f7d4..4d726694 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,10 +31,9 @@ url = "2" anyhow = "1" chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] } clap = { version = "4", features = ["deprecated", "derive", "env", "wrap_help"] } -crossterm = "0.27" ego-tree = "0.6" rand = "0.8" -ratatui = "0.26" +ratatui = "0.27" ratatui-binary-data-widget = { git = "https://github.com/EdJoPaTo/ratatui-binary-data-widget", branch = "main" } rmpv = { version = "1", features = ["with-serde"] } rumqttc = { version = "0.24", features = ["websocket"] } @@ -44,7 +43,7 @@ rustls-pemfile = "2" rustls-pki-types = "1" serde = { version = "1", features = ["derive"] } serde_json = "1" -tui-tree-widget = "0.20" +tui-tree-widget = "0.21" url = "2" # https://crates.io/crates/cargo-deb diff --git a/src/interactive/mod.rs b/src/interactive/mod.rs index 79c40fff..5809f566 100644 --- a/src/interactive/mod.rs +++ b/src/interactive/mod.rs @@ -1,6 +1,7 @@ use std::time::{Duration, Instant}; -use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEventKind}; +use ratatui::crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEventKind}; +use ratatui::crossterm; use ratatui::backend::{Backend, CrosstermBackend}; use ratatui::layout::{Alignment, Position, Rect}; use ratatui::text::Span;