From 94255397b5416b1feb2b56a791bc8775b533e783 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 | 30 ++++++++++-------------------- Cargo.toml | 8 +++----- src/interactive/mod.rs | 5 +++-- 4 files changed, 16 insertions(+), 29 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 97d600c7..01d7e8c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -631,15 +631,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -749,7 +740,6 @@ dependencies = [ "clap", "clap_complete", "clap_mangen", - "crossterm", "ego-tree", "rand", "ratatui", @@ -763,7 +753,6 @@ dependencies = [ "serde", "serde_json", "tui-tree-widget", - "unicode-width", "url", ] @@ -913,19 +902,20 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.26.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef" +checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" dependencies = [ "bitflags", "cassowary", "compact_str", "crossterm", - "itertools 0.12.1", + "itertools", "lru", "paste", "stability", "strum", + "strum_macros", "unicode-segmentation", "unicode-truncate", "unicode-width", @@ -934,7 +924,7 @@ dependencies = [ [[package]] name = "ratatui-binary-data-widget" version = "0.1.0" -source = "git+https://github.com/EdJoPaTo/ratatui-binary-data-widget?branch=main#32cfa2d930728429780e5032722d7350c1ca7ce6" +source = "git+https://github.com/EdJoPaTo/ratatui-binary-data-widget?branch=ratatui-v0.27#2644c0b93e4a5de4c6e93aed8f55a2ad7b40e5cd" dependencies = [ "ratatui", ] @@ -1444,9 +1434,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", @@ -1512,16 +1502,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" dependencies = [ - "itertools 0.13.0", + "itertools", "unicode-segmentation", "unicode-width", ] [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "untrusted" diff --git a/Cargo.toml b/Cargo.toml index 96b20f20..949be415 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,11 +31,10 @@ 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-binary-data-widget = { git = "https://github.com/EdJoPaTo/ratatui-binary-data-widget", branch = "main" } +ratatui = "0.27" +ratatui-binary-data-widget = { git = "https://github.com/EdJoPaTo/ratatui-binary-data-widget", branch = "ratatui-v0.27" } rmpv = { version = "1", features = ["with-serde"] } rumqttc = { version = "0.24", features = ["websocket"] } rustls = "0.22" @@ -44,8 +43,7 @@ rustls-pemfile = "2" rustls-pki-types = "1" serde = { version = "1", features = ["derive"] } serde_json = "1" -tui-tree-widget = "0.20" -unicode-width = "=0.1.12" # remove version pinning when https://github.com/ratatui-org/ratatui/pull/1226 is released +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 d4325ae9..5ff8ca3c 100644 --- a/src/interactive/mod.rs +++ b/src/interactive/mod.rs @@ -1,13 +1,14 @@ use std::time::{Duration, Instant}; -use crossterm::event::{ +use ratatui::crossterm::event::{ Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseButton, MouseEventKind, }; +use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEventKind}; use ratatui::backend::{Backend, CrosstermBackend}; use ratatui::layout::{Alignment, Position, Rect}; use ratatui::text::Span; use ratatui::widgets::Paragraph; -use ratatui::{Frame, Terminal}; +use ratatui::{crossterm, Frame, Terminal}; use rumqttc::{Client, Connection}; use self::ui::ElementInFocus;