From f85a795067129bf61ef1823ee91d3a05e28e16a4 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:02:52 +0330 Subject: [PATCH 01/11] Update Tauri (2.2.0) and plugins --- Cargo.lock | 97 ++++++++++++++++--------------- Cargo.toml | 2 +- apps/desktop/src-tauri/Cargo.toml | 18 +++--- 3 files changed, 60 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c0fe9f8..5769875d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -982,16 +982,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror 1.0.63", + "thiserror 2.0.6", ] [[package]] @@ -3469,15 +3469,6 @@ dependencies = [ "cfb", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "interpolate_name" version = "0.2.4" @@ -6550,6 +6541,18 @@ dependencies = [ "thiserror 1.0.63", ] +[[package]] +name = "specta-util" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8113d65b58a6de3184b01d6df9e50b6d4bbe7f724251f576d84f23228824456" +dependencies = [ + "ctor", + "serde", + "specta", + "specta-macros", +] + [[package]] name = "spin" version = "0.9.8" @@ -6781,9 +6784,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.30.8" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6682a07cf5bab0b8a2bd20d0a542917ab928b5edb75ebd4eda6b05cbaab872da" +checksum = "3731d04d4ac210cd5f344087733943b9bfb1a32654387dad4d1c70de21aee2c9" dependencies = [ "bitflags 2.6.0", "cocoa 0.26.0", @@ -6796,7 +6799,6 @@ dependencies = [ "gdkwayland-sys", "gdkx11-sys", "gtk", - "instant", "jni", "lazy_static", "libc", @@ -6860,9 +6862,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e545de0a2dfe296fa67db208266cd397c5a55ae782da77973ef4c4fac90e9f2c" +checksum = "2e2e3349fbb2be7af9fad1b43d61ac83ba55ab48d47fbe1b2732f0c8211610a9" dependencies = [ "anyhow", "bytes", @@ -6894,6 +6896,7 @@ dependencies = [ "serde_repr", "serialize-to-javascript", "specta", + "specta-util", "swift-rs", "tauri-build", "tauri-macros", @@ -6913,9 +6916,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd2a4bcfaf5fb9f4be72520eefcb61ae565038f8ccba2a497d8c28f463b8c01" +checksum = "b274ec7239ada504deb615f1c8abd7ba99631e879709e6f10e5d17217058d976" dependencies = [ "anyhow", "cargo_toml", @@ -6935,9 +6938,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf79faeecf301d3e969b1fae977039edb77a4c1f25cc0a961be298b54bff97cf" +checksum = "f77894f9ddb5cb6c04fcfe8c8869ebe0aded4dabf19917118d48be4a95599ab5" dependencies = [ "base64 0.22.1", "brotli", @@ -6962,9 +6965,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52027c8c5afb83166dacddc092ee8fff50772f9646d461d8c33ee887e447a03" +checksum = "3240a5caed760a532e8f687be6f05b2c7d11a1d791fb53ccc08cfeb3e5308736" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -7029,9 +7032,9 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.0.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4307310e1d2c09ab110235834722e7c2b85099b683e1eb7342ab351b0be5ada3" +checksum = "8b59fd750551b1066744ab956a1cd6b1ea3e1b3763b0b9153ac27a044d596426" dependencies = [ "log", "raw-window-handle", @@ -7041,7 +7044,7 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror 1.0.63", + "thiserror 2.0.6", "url", ] @@ -7173,9 +7176,9 @@ dependencies = [ [[package]] name = "tauri-plugin-process" -version = "2.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae06a00087c148962a52814a2d7265b1a0505bced5ffb74f8c284a5f96a4d03d" +checksum = "40cc553ab29581c8c43dfa5fb0c9d5aee8ba962ad3b42908eea26c79610441b7" dependencies = [ "tauri", "tauri-plugin", @@ -7204,15 +7207,15 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "2.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25ac834491d089699a2bc9266a662faf373c9f779f05a2235bc6e4d9e61769a" +checksum = "0f36019ee9832dc99e4450bb55a21cfad8633b19c2c18bd17c7741939b070ede" dependencies = [ - "log", "serde", "serde_json", "tauri", - "thiserror 1.0.63", + "thiserror 2.0.6", + "tracing", "windows-sys 0.59.0", "zbus", ] @@ -7235,9 +7238,9 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7351014c140906bcfff59d96e04b1170c8f602557f40eb37f7de356d4e7067b" +checksum = "ce2d39224390c41ba544f02b4f1721f42256320b3fb8c371e9425cbddeb4a68c" dependencies = [ "base64 0.22.1", "dirs", @@ -7280,9 +7283,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce18d43f80d4aba3aa8a0c953bbe835f3d0f2370aca75e8dbb14bd4bab27958" +checksum = "2274ef891ccc0a8d318deffa9d70053f947664d12d58b9c0d1ae5e89237e01f7" dependencies = [ "dpi", "gtk", @@ -7299,9 +7302,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f442a38863e10129ffe2cec7bd09c2dcf8a098a3a27801a476a304d5bb991d2" +checksum = "3707b40711d3b9f6519150869e358ffbde7c57567fb9b5a8b51150606939b2a0" dependencies = [ "gtk", "http", @@ -7353,9 +7356,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9271a88f99b4adea0dc71d0baca4505475a0bbd139fb135f62958721aaa8fe54" +checksum = "96fb10e7cc97456b2d5b9c03e335b5de5da982039a303a20d10006885e4523a0" dependencies = [ "brotli", "cargo_metadata", @@ -8347,9 +8350,9 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" +checksum = "823e7ebcfaea51e78f72c87fc3b65a1e602c321f407a0b36dbb327d7bb7cd921" dependencies = [ "webview2-com-macros", "webview2-com-sys", @@ -8372,9 +8375,9 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" +checksum = "7a82bce72db6e5ee83c68b5de1e2cd6ea195b9fbff91cb37df5884cbe3222df4" dependencies = [ "thiserror 1.0.63", "windows 0.58.0", @@ -9037,9 +9040,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.47.2" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ce51277d65170f6379d8cda935c80e3c2d1f0ff712a123c8bddb11b31a4b73" +checksum = "1e644bf458e27b11b0ecafc9e5633d1304fdae82baca1d42185669752fe6ca4f" dependencies = [ "base64 0.22.1", "block2", @@ -9067,7 +9070,7 @@ dependencies = [ "sha2", "soup3", "tao-macros", - "thiserror 1.0.63", + "thiserror 2.0.6", "url", "webkit2gtk", "webkit2gtk-sys", diff --git a/Cargo.toml b/Cargo.toml index 4b076191..47e4eb6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ tokio = { version = "1.39.3", features = [ "rt-multi-thread", "time", ] } -tauri = { version = "2.1.1" } +tauri = { version = "2.2.0" } specta = { version = "=2.0.0-rc.20" } scap = { git = "https://github.com/CapSoftware/scap", rev = "58d4410bf52f" } nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "0d3d1f30a78b", features = [ diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index a06751cc..18de3c2c 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -25,17 +25,17 @@ tauri = { workspace = true, features = [ "image-png", ] } tauri-specta = { version = "=2.0.0-rc.20", features = ["derive", "typescript"] } -tauri-plugin-dialog = "2.0.0" +tauri-plugin-dialog = "2.2.0" tauri-plugin-fs = "2.2.0" -tauri-plugin-global-shortcut = "2.1.0" -tauri-plugin-http = "2.1.0" -tauri-plugin-notification = "2.1.0" -tauri-plugin-os = "2.1.0" -tauri-plugin-process = "2.0.1" -tauri-plugin-shell = "2.1.0" -tauri-plugin-single-instance = "2.0.1" +tauri-plugin-global-shortcut = "2.2.0" +tauri-plugin-http = "2.2.0" +tauri-plugin-notification = "2.2.0" +tauri-plugin-os = "2.2.0" +tauri-plugin-process = "2.2.0" +tauri-plugin-shell = "2.2.0" +tauri-plugin-single-instance = "2.2.0" tauri-plugin-store = "2.2.0" -tauri-plugin-updater = "2.2.0" +tauri-plugin-updater = "2.3.1" tauri-plugin-oauth = { git = "https://github.com/FabianLars/tauri-plugin-oauth", branch = "v2" } tauri-plugin-window-state = "2.2.0" tauri-plugin-positioner = "2.2.0" From 3b5dc7d1df4bc6388b7aae54548b2503b6c4ecb9 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:50:28 +0330 Subject: [PATCH 02/11] enable"specta" feature on tauri and remove unnecessary code --- Cargo.lock | 6 +++ Cargo.toml | 7 ++- apps/desktop/src-tauri/Cargo.toml | 2 + apps/desktop/src-tauri/src/lib.rs | 34 ++++++------ apps/desktop/src-tauri/src/windows.rs | 75 ++------------------------- crates/flags/Cargo.toml | 3 ++ crates/media/Cargo.toml | 2 + crates/project/Cargo.toml | 5 +- crates/recording/Cargo.toml | 2 + crates/rendering/Cargo.toml | 2 + 10 files changed, 46 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5769875d..04565d36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -853,6 +853,7 @@ version = "0.1.0" dependencies = [ "serde", "specta", + "specta-util", ] [[package]] @@ -891,6 +892,7 @@ dependencies = [ "screencapturekit", "serde", "specta", + "specta-util", "tempfile", "thiserror 1.0.63", "tokio", @@ -907,6 +909,7 @@ dependencies = [ "serde", "serde_json", "specta", + "specta-util", ] [[package]] @@ -926,6 +929,7 @@ dependencies = [ "serde", "serde_json", "specta", + "specta-util", "thiserror 1.0.63", "tokio", "tracing", @@ -951,6 +955,7 @@ dependencies = [ "pretty_assertions", "serde", "specta", + "specta-util", "thiserror 1.0.63", "tokio", "wgpu", @@ -1947,6 +1952,7 @@ dependencies = [ "serde_json", "specta", "specta-typescript", + "specta-util", "swift-rs", "tauri", "tauri-build", diff --git a/Cargo.toml b/Cargo.toml index 47e4eb6d..95e0dd24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,11 @@ tokio = { version = "1.39.3", features = [ "rt-multi-thread", "time", ] } -tauri = { version = "2.2.0" } -specta = { version = "=2.0.0-rc.20" } +tauri = { version = "2.2.0", features = [ "specta" ] } +specta = { version = "=2.0.0-rc.20", features = [ "derive" ] } +# TODO(Ilya): remove when specta releases rc.21 +specta-util = { version = "^0.0.7", features = [ "export" ] } + scap = { git = "https://github.com/CapSoftware/scap", rev = "58d4410bf52f" } nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "0d3d1f30a78b", features = [ "input-native", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 18de3c2c..abb02b5c 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -25,6 +25,8 @@ tauri = { workspace = true, features = [ "image-png", ] } tauri-specta = { version = "=2.0.0-rc.20", features = ["derive", "typescript"] } +# TODO(Ilya): remove when specta releases rc.21 +specta-util.workspace = true tauri-plugin-dialog = "2.2.0" tauri-plugin-fs = "2.2.0" tauri-plugin-global-shortcut = "2.2.0" diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index c794e18e..a1bf72b8 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -1908,8 +1908,22 @@ pub async fn run() { #[cfg(target_os = "macos")] { - builder = builder.plugin(tauri_nspanel::init()).plugin( - // TODO(Ilya): Also enable for Windows when Tao is updated to `0.31.0` + builder = builder.plugin(tauri_nspanel::init()); + } + + builder + .plugin(tauri_plugin_shell::init()) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_store::Builder::new().build()) + .plugin(tauri_plugin_os::init()) + .plugin(tauri_plugin_process::init()) + .plugin(tauri_plugin_oauth::init()) + .plugin(tauri_plugin_http::init()) + .plugin(tauri_plugin_updater::Builder::new().build()) + .plugin(tauri_plugin_notification::init()) + .plugin(flags::plugin::init()) + .plugin(tauri_plugin_deep_link::init()) + .plugin( tauri_plugin_window_state::Builder::new() .with_state_flags({ use tauri_plugin_window_state::StateFlags; @@ -1929,21 +1943,7 @@ pub async fn run() { _ => label, }) .build(), - ); - } - - builder - .plugin(tauri_plugin_shell::init()) - .plugin(tauri_plugin_dialog::init()) - .plugin(tauri_plugin_store::Builder::new().build()) - .plugin(tauri_plugin_os::init()) - .plugin(tauri_plugin_process::init()) - .plugin(tauri_plugin_oauth::init()) - .plugin(tauri_plugin_http::init()) - .plugin(tauri_plugin_updater::Builder::new().build()) - .plugin(tauri_plugin_notification::init()) - .plugin(flags::plugin::init()) - .plugin(tauri_plugin_deep_link::init()) + ) .invoke_handler({ let handler = specta_builder.invoke_handler(); diff --git a/apps/desktop/src-tauri/src/windows.rs b/apps/desktop/src-tauri/src/windows.rs index ca0e0264..00c7dd34 100644 --- a/apps/desktop/src-tauri/src/windows.rs +++ b/apps/desktop/src-tauri/src/windows.rs @@ -13,9 +13,6 @@ use tauri::{ #[cfg(target_os = "macos")] const DEFAULT_TRAFFIC_LIGHTS_INSET: LogicalPosition = LogicalPosition::new(12.0, 12.0); -#[cfg(target_os = "windows")] -const WIN_WSCAPTION_WSTHICKFRAME_LOGICAL_SIZE: tauri::LogicalSize = tauri::LogicalSize::new(12.0, 35.0); - #[derive(Clone)] pub enum CapWindowId { // Contains onboarding + permissions @@ -254,12 +251,7 @@ impl ShowCapWindow { if FLAGS.pause_resume { width += 32.0; } - let mut height = 40.0; - #[cfg(target_os = "windows")] - { - width -= WIN_WSCAPTION_WSTHICKFRAME_LOGICAL_SIZE.width; - height -= WIN_WSCAPTION_WSTHICKFRAME_LOGICAL_SIZE.height; - } + let height = 40.0; self.window_builder(app, "/in-progress-recording") .maximized(false) @@ -335,44 +327,6 @@ impl ShowCapWindow { window.hide().ok(); - // TODO(Ilya): Remove once Tao is updated to `0.31.0` - #[cfg(target_os = "windows")] - { - use tauri_plugin_positioner::{Position, WindowExt}; - - if matches!( - self, - Self::Setup - | Self::Main - | Self::Editor { .. } - | Self::Settings { .. } - | Self::Upgrade - ) { - let _ = window.move_window(Position::Center); - } - - if matches!(self, Self::InProgressRecording { .. }) { - let _ = window.move_window(Position::BottomCenter); - - if let Ok(outer_size) = window.outer_size() { - let screen_position = monitor.position(); - let window_size = tauri::PhysicalSize:: { - width: outer_size.width as i32, - height: outer_size.height as i32, - }; - let screen_size = tauri::PhysicalSize:: { - width: monitor.size().width as i32, - height: monitor.size().height as i32, - }; - - let _ = window.set_position(tauri::PhysicalPosition { - x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), - y: screen_size.height - (window_size.height - screen_position.y) - 120, - }); - } - } - } - #[cfg(target_os = "macos")] if let Some(position) = id.traffic_lights_position() { add_traffic_lights(&window, position); @@ -395,32 +349,9 @@ impl ShowCapWindow { .shadow(true); if let Some(min) = id.min_size() { - // TODO(Ilya): Remove once Tao is updated to `0.31.0` - // currently, undecorated windows with shadows get the invisible bounds of the titlebar and window frame added to the inner size - #[cfg(target_os = "windows")] - let size = if matches!( - self, - Self::Setup - | Self::Main - | Self::Editor { .. } - | Self::Settings { .. } - | Self::InProgressRecording { .. } - | Self::Upgrade - ) { - ( - min.0 - WIN_WSCAPTION_WSTHICKFRAME_LOGICAL_SIZE.width, - min.1 - WIN_WSCAPTION_WSTHICKFRAME_LOGICAL_SIZE.height, - ) - } else { - min - }; - - #[cfg(not(target_os = "windows"))] - let size = min; - builder = builder - .inner_size(size.0, size.1) - .min_inner_size(size.0, size.1); + .inner_size(min.0, min.1) + .min_inner_size(min.0, min.1); } #[cfg(target_os = "macos")] diff --git a/crates/flags/Cargo.toml b/crates/flags/Cargo.toml index 32deda96..ab9f60c7 100644 --- a/crates/flags/Cargo.toml +++ b/crates/flags/Cargo.toml @@ -5,4 +5,7 @@ edition = "2021" [dependencies] serde = "1.0.214" +# TODO(Ilya): remove when specta releases rc.21 specta.workspace = true + +specta-util.workspace = true diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 4b7f6064..8b97ceec 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -24,6 +24,8 @@ ringbuf = "0.4.7" scap.workspace = true serde = { version = "1", features = ["derive"] } specta.workspace = true +# TODO(Ilya): remove when specta releases rc.21 +specta-util.workspace = true tempfile = "3.12.0" thiserror.workspace = true tracing = { version = "0.1", features = ["release_max_level_info"] } diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.toml index 125233e4..44cc3c13 100644 --- a/crates/project/Cargo.toml +++ b/crates/project/Cargo.toml @@ -4,7 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] -specta = { workspace = true, features = ["derive"] } +specta.workspace = true +# TODO(Ilya): remove when specta releases rc.21 +specta-util.workspace = true + serde = { version = "1.0.209", features = ["derive"] } serde_json = "1.0.127" either = "1.13.0" diff --git a/crates/recording/Cargo.toml b/crates/recording/Cargo.toml index 71ac98de..e400ead1 100644 --- a/crates/recording/Cargo.toml +++ b/crates/recording/Cargo.toml @@ -9,6 +9,8 @@ cap-media = { path = "../media" } cap-flags = { path = "../flags" } specta.workspace = true +# TODO(Ilya): remove when specta releases rc.21 +specta-util.workspace = true tokio.workspace = true flume.workspace = true thiserror.workspace = true diff --git a/crates/rendering/Cargo.toml b/crates/rendering/Cargo.toml index 81f67f86..eb628408 100644 --- a/crates/rendering/Cargo.toml +++ b/crates/rendering/Cargo.toml @@ -9,6 +9,8 @@ bytemuck = { version = "1.7", features = ["derive"] } futures-intrusive = "0.5.0" serde = "1.0.209" specta.workspace = true +# TODO(Ilya): remove when specta releases rc.21 +specta-util.workspace = true wgpu.workspace = true image = "0.25.2" cap-project = { path = "../project" } From e5e98eb297c9e5c9e911264a732dab0d6e95096d Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:05:55 +0330 Subject: [PATCH 03/11] preparescript: avoid re-download if sidecar exists --- apps/desktop/scripts/prepare.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/desktop/scripts/prepare.js b/apps/desktop/scripts/prepare.js index 0f98ac05..204a3776 100644 --- a/apps/desktop/scripts/prepare.js +++ b/apps/desktop/scripts/prepare.js @@ -63,12 +63,20 @@ async function unzip(targetPath, outputPath) { async function prepareFfmpegSidecar() { const binaries = FFMPEG_BINARIES[rsTargetTriple]; const ffmpegDownloadPath = path.join(binariesDir, "ffmpeg-download.zip"); + const ffmpegBinaryPath = path.join(ffmpegUnzippedPath, binaries.path); + const ffmpegSidecarName = `ffmpeg-${rsTargetTriple}${fileExtension}`; + const finalDestinationPath = path.join(binariesDir, ffmpegSidecarName); + + if (await exists(finalDestinationPath)) { + console.log(`Using ffmpeg sidecar: ${ffmpegSidecarName}`); + return; + } // Skip downloading if the archive already exists - if (!(await exists(ffmpegDownloadPath))) { + if (!(await exists(ffmpegBinaryPath))) { if (await exists(ffmpegUnzippedPath)) return; console.log( - `Couldn't locate "ffmpeg-download.zip" in "${ffmpegDownloadPath}"` + `Couldn't locate "${ffmpegSidecarName}" or "ffmpeg-download.zip" in "${ffmpegDownloadPath}"` ); console.log(`Downloading from: ${binaries.url}`); await fs.mkdir(binariesDir, { recursive: true }); @@ -131,20 +139,15 @@ async function prepareFfmpegSidecar() { } } - const ffmpegBinaryPath = path.join(ffmpegUnzippedPath, binaries.path); - const ffmpegSidecarName = `ffmpeg-${rsTargetTriple}${fileExtension}`; - const finalDestinationPath = path.join(binariesDir, ffmpegSidecarName); - if (await exists(finalDestinationPath)) { - console.log(`Using ffmpeg sidecar: ${ffmpegSidecarName}`); - return; - } - console.log(`Copying ffmpeg binary to '${ffmpegSidecarName}'...`); - await fs.copyFile( + await fs.rename( ffmpegBinaryPath, path.join(binariesDir, ffmpegSidecarName) ); + + console.log("Removing unzipped ffmpeg folder"); + await fs.rm(ffmpegUnzippedPath, { recursive: true, force: true }); } /** @@ -173,9 +176,7 @@ async function semverToWIXCompatibleVersion(cargoFilePath) { const numMatch = buildOrPrerelease.match(/\d+$/); build = numMatch ? parseInt(numMatch[0]) : 0; } - const wixVersion = `${major}.${minor}.${patch}${ - build === 0 ? "" : `.${build}` - }`; + const wixVersion = `${major}.${minor}.${patch}${build === 0 ? "" : `.${build}`}`; if (wixVersion !== ver) console.log(`Using wix-compatible version ${ver} --> ${wixVersion}`); return wixVersion; @@ -268,8 +269,7 @@ async function main() { } main().catch((err) => { - console.error("--- Preparation Failed"); + console.error("\n--- Preparation Failed"); console.error(err); console.error("---"); - process.exit(1); }); From 57c904217d611a0542171fb9177cb48e39110d63 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:40:28 +0330 Subject: [PATCH 04/11] Update Cargo.lock --- Cargo.lock | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44f21de6..fbef8758 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -468,7 +468,6 @@ checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", - "axum-macros", "base64 0.22.1", "bytes", "futures-util", @@ -519,17 +518,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "backtrace" version = "0.3.73" @@ -725,19 +713,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "build-time" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" -dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "built" version = "0.7.4" @@ -971,7 +946,6 @@ version = "0.1.0" dependencies = [ "anyhow", "bezier_easing", - "build-time", "bytemuck", "cap-flags", "cap-project", @@ -982,7 +956,6 @@ dependencies = [ "futures", "futures-intrusive", "image 0.25.5", - "log", "nix 0.29.0", "pretty_assertions", "serde", From cc5bfac93a29ee435e6837b3f86ee607d2ce6ada Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Mon, 13 Jan 2025 23:27:39 +0330 Subject: [PATCH 05/11] Update Cargo.lock --- Cargo.lock | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index fbef8758..44f21de6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -468,6 +468,7 @@ checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", + "axum-macros", "base64 0.22.1", "bytes", "futures-util", @@ -518,6 +519,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "axum-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "backtrace" version = "0.3.73" @@ -713,6 +725,19 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "build-time" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" +dependencies = [ + "chrono", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "built" version = "0.7.4" @@ -946,6 +971,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bezier_easing", + "build-time", "bytemuck", "cap-flags", "cap-project", @@ -956,6 +982,7 @@ dependencies = [ "futures", "futures-intrusive", "image 0.25.5", + "log", "nix 0.29.0", "pretty_assertions", "serde", From 60cca2f92037bead99cb54d35e25ef91690afd52 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Tue, 14 Jan 2025 01:04:59 +0330 Subject: [PATCH 06/11] Remove unused wrong import and update cargo lock --- Cargo.lock | 75 +------------------------------------ crates/rendering/src/lib.rs | 1 - 2 files changed, 2 insertions(+), 74 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e4297689..e8e60aed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -890,6 +890,7 @@ dependencies = [ "serde_json", "specta", "specta-typescript", + "specta-util", "swift-rs", "tauri", "tauri-build", @@ -1018,6 +1019,7 @@ dependencies = [ "serde", "serde_json", "specta", + "specta-util", ] [[package]] @@ -1998,79 +2000,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "desktop" -version = "0.3.10" -dependencies = [ - "anyhow", - "axum", - "base64 0.22.1", - "cap-editor", - "cap-export", - "cap-ffmpeg-cli", - "cap-flags", - "cap-media", - "cap-project", - "cap-recording", - "cap-rendering", - "cap-utils", - "chrono", - "clipboard-rs", - "cocoa 0.26.0", - "core-foundation 0.10.0", - "core-graphics 0.24.0", - "cpal 0.15.3 (git+https://github.com/RustAudio/cpal?rev=f43d36e55494993bbbde3299af0c53e5cdf4d4cf)", - "device_query", - "dotenvy_macro", - "ffmpeg-next", - "flume 0.11.0", - "futures", - "futures-intrusive", - "global-hotkey", - "image 0.25.5", - "keyed_priority_queue", - "mp4", - "nix 0.29.0", - "objc", - "objc2-app-kit", - "png", - "rand 0.8.5", - "reqwest", - "rodio", - "scap", - "sentry", - "serde", - "serde_json", - "specta", - "specta-typescript", - "swift-rs", - "tauri", - "tauri-build", - "tauri-nspanel", - "tauri-plugin-deep-link", - "tauri-plugin-dialog", - "tauri-plugin-fs", - "tauri-plugin-global-shortcut", - "tauri-plugin-http", - "tauri-plugin-notification", - "tauri-plugin-oauth", - "tauri-plugin-os", - "tauri-plugin-positioner", - "tauri-plugin-process", - "tauri-plugin-shell", - "tauri-plugin-single-instance", - "tauri-plugin-store", - "tauri-plugin-updater", - "tauri-plugin-window-state", - "tauri-specta", - "tempfile", - "tokio", - "tracing", - "uuid", - "windows 0.58.0", - "windows-sys 0.59.0", -] - [[package]] name = "device_query" version = "2.1.0" diff --git a/crates/rendering/src/lib.rs b/crates/rendering/src/lib.rs index c7ba8996..37b4f7dc 100644 --- a/crates/rendering/src/lib.rs +++ b/crates/rendering/src/lib.rs @@ -8,7 +8,6 @@ use cap_project::{ REGULAR_SMOOTHING_SAMPLES, REGULAR_VELOCITY_THRESHOLD, SLOW_SMOOTHING_SAMPLES, SLOW_VELOCITY_THRESHOLD, XY, }; -use cap_recording::segmented_actor::RecordingSegment; use core::f64; use decoder::{AsyncVideoDecoder, AsyncVideoDecoderHandle}; use futures::future::OptionFuture; From 8e4a836af957983a18f3b56dded8446310511538 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Tue, 14 Jan 2025 01:52:23 +0330 Subject: [PATCH 07/11] display_for_window and get_monitor_refresh_rate platform impls --- crates/media/src/platform/macos.rs | 41 +++++++++++++++ crates/media/src/sources/screen_capture.rs | 61 +++++----------------- 2 files changed, 54 insertions(+), 48 deletions(-) diff --git a/crates/media/src/platform/macos.rs b/crates/media/src/platform/macos.rs index 36d3ac43..544aacbb 100644 --- a/crates/media/src/platform/macos.rs +++ b/crates/media/src/platform/macos.rs @@ -329,3 +329,44 @@ pub fn monitor_bounds(id: u32) -> Bounds { } } } + +pub fn get_display_refresh_rate( + display_id: core_graphics::display::CGDirectDisplayID, +) -> Option { + use core_graphics::display::CGDisplay; + + Some( + CGDisplay::new(display_id) + .display_mode()? + .refresh_rate() + .round() as u32, + ) +} + +pub fn display_for_window( + window: core_graphics::window::CGWindowID, +) -> Option { + use core_foundation::array::CFArray; + use core_graphics::{ + display::{CFDictionary, CGDisplay, CGRect}, + window::{create_description_from_array, kCGWindowBounds}, + }; + + let descriptions = create_description_from_array(CFArray::from_copyable(&[window]))?; + + let window_bounds = CGRect::from_dict_representation( + &descriptions + .get(0)? + .get(unsafe { kCGWindowBounds }) + .downcast::()?, + )?; + + for id in CGDisplay::active_displays().ok()? { + let display = CGDisplay::new(id); + if window_bounds.is_intersects(&display.bounds()) { + return Some(display); + } + } + + None +} diff --git a/crates/media/src/sources/screen_capture.rs b/crates/media/src/sources/screen_capture.rs index b1d9359e..74d7ebf6 100644 --- a/crates/media/src/sources/screen_capture.rs +++ b/crates/media/src/sources/screen_capture.rs @@ -171,7 +171,10 @@ impl ScreenCaptureSource { }; if let Some(Target::Display(d)) = &target { + #[cfg(target_os = "macos")] dbg!(d.raw_handle.display_mode().unwrap().refresh_rate()); + #[cfg(target_os = "windows")] + dbg!(platform::get_display_refresh_rate(d.raw_handle)); } Options { @@ -487,57 +490,19 @@ pub fn list_windows() -> Vec<(CaptureWindow, Target)> { pub fn get_target_fps(target: &scap::Target) -> Option { #[cfg(target_os = "macos")] - { - match target { - scap::Target::Display(display) => refresh_rate_for_display(display.raw_handle.id), - scap::Target::Window(window) => { - refresh_rate_for_display(display_for_window(window.raw_handle)?.id) - } + match target { + scap::Target::Display(display) => platform::get_display_refresh_rate(display.raw_handle.id), + scap::Target::Window(window) => { + platform::get_display_refresh_rate(platform::display_for_window(window.raw_handle)?.id) } } - #[cfg(not(target_os = "macos"))] - { - todo!() - } -} - -#[cfg(target_os = "macos")] -fn display_for_window( - window: core_graphics::window::CGWindowID, -) -> Option { - use core_foundation::array::CFArray; - use core_graphics::{ - display::{CFDictionary, CGDisplay, CGRect}, - window::{create_description_from_array, kCGWindowBounds}, - }; - - let descriptions = create_description_from_array(CFArray::from_copyable(&[window]))?; - - let window_bounds = CGRect::from_dict_representation( - &descriptions - .get(0)? - .get(unsafe { kCGWindowBounds }) - .downcast::()?, - )?; - - for id in CGDisplay::active_displays().ok()? { - let display = CGDisplay::new(id); - if window_bounds.is_intersects(&display.bounds()) { - return Some(display); + #[cfg(target_os = "windows")] + match target { + scap::Target::Display(display) => platform::get_display_refresh_rate(display.raw_handle), + scap::Target::Window(window) => { + platform::get_display_refresh_rate(platform::display_for_window(window.raw_handle)?) } } - + #[cfg(not(any(target_os = "windows", target_os = "macos")))] None } - -#[cfg(target_os = "macos")] -fn refresh_rate_for_display(display_id: core_graphics::display::CGDirectDisplayID) -> Option { - use core_graphics::display::CGDisplay; - - Some( - CGDisplay::new(display_id) - .display_mode()? - .refresh_rate() - .round() as u32, - ) -} From 63d3b2574a5bf293c0a64746c930a8a8f2e8e7b1 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Tue, 14 Jan 2025 01:52:53 +0330 Subject: [PATCH 08/11] more windows impl --- crates/media/src/platform/win.rs | 45 ++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/crates/media/src/platform/win.rs b/crates/media/src/platform/win.rs index bc98a457..5331c95f 100644 --- a/crates/media/src/platform/win.rs +++ b/crates/media/src/platform/win.rs @@ -11,8 +11,9 @@ use windows::Win32::Graphics::Dwm::{ DwmGetWindowAttribute, DWMWA_CLOAKED, DWMWA_EXTENDED_FRAME_BOUNDS, }; use windows::Win32::Graphics::Gdi::{ - EnumDisplayDevicesW, EnumDisplayMonitors, GetMonitorInfoW, DISPLAY_DEVICEW, HDC, HMONITOR, - MONITORINFOEXW, + EnumDisplayDevicesW, EnumDisplayMonitors, EnumDisplaySettingsW, GetMonitorInfoW, + MonitorFromWindow, DEVMODEW, DISPLAY_DEVICEW, HDC, HMONITOR, MONITORINFO, MONITORINFOEXW, + MONITOR_DEFAULTTONULL, }; use windows::Win32::System::Threading::{ OpenProcess, QueryFullProcessImageNameW, PROCESS_NAME_FORMAT, PROCESS_QUERY_LIMITED_INFORMATION, @@ -304,3 +305,43 @@ pub fn display_names() -> HashMap { names } + +pub fn get_display_refresh_rate(monitor: HMONITOR) -> Option { + let mut monitorinfoexw: MONITORINFOEXW = unsafe { std::mem::zeroed() }; + monitorinfoexw.monitorInfo.cbSize = std::mem::size_of::() as u32; + + if let Err(_) = + unsafe { GetMonitorInfoW(monitor, &mut monitorinfoexw.monitorInfo as *mut MONITORINFO) } + .ok() + { + return None; + } + + let mut dev_mode: DEVMODEW = unsafe { std::mem::zeroed() }; + dev_mode.dmSize = std::mem::size_of::() as u16; + + let device_name = PCWSTR::from_raw(monitorinfoexw.szDevice.as_ptr()); + + if let Err(_) = unsafe { + EnumDisplaySettingsW( + device_name, + windows::Win32::Graphics::Gdi::ENUM_CURRENT_SETTINGS, + &mut dev_mode, + ) + } + .ok() + { + return None; + } + + Some(dev_mode.dmDisplayFrequency) +} + +pub fn display_for_window(window: HWND) -> Option { + let hwmonitor = unsafe { MonitorFromWindow(window, MONITOR_DEFAULTTONULL) }; + if hwmonitor.is_invalid() { + None + } else { + Some(hwmonitor) + } +} From ff0bc5e97273bf592ab0233ec081daea8c12f255 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:14:13 +0330 Subject: [PATCH 09/11] Windows hw device --- crates/rendering/src/decoder.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/rendering/src/decoder.rs b/crates/rendering/src/decoder.rs index f18724b9..6298d4d6 100644 --- a/crates/rendering/src/decoder.rs +++ b/crates/rendering/src/decoder.rs @@ -142,8 +142,14 @@ impl AsyncVideoDecoder { ) .ok() } + #[cfg(target_os = "windows")] + { + decoder + .try_use_hw_device(AVHWDeviceType::AV_HWDEVICE_TYPE_D3D11VA, Pixel::NV12) + .ok() + } - #[cfg(not(target_os = "macos"))] + #[cfg(not(any(target_os = "macos", target_os = "windows")))] None }; From 3670144ad47db1d22f8e0e942cb068d1702322a3 Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:22:34 +0330 Subject: [PATCH 10/11] Update todo comment --- Cargo.toml | 2 +- apps/desktop/src-tauri/Cargo.toml | 2 +- crates/flags/Cargo.toml | 2 +- crates/media/Cargo.toml | 2 +- crates/project/Cargo.toml | 2 +- crates/recording/Cargo.toml | 2 +- crates/rendering/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 95e0dd24..7ee6b6b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ tokio = { version = "1.39.3", features = [ ] } tauri = { version = "2.2.0", features = [ "specta" ] } specta = { version = "=2.0.0-rc.20", features = [ "derive" ] } -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta-util = { version = "^0.0.7", features = [ "export" ] } scap = { git = "https://github.com/CapSoftware/scap", rev = "58d4410bf52f" } diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 497e2c25..2bf1d444 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -25,7 +25,7 @@ tauri = { workspace = true, features = [ "image-png", ] } tauri-specta = { version = "=2.0.0-rc.20", features = ["derive", "typescript"] } -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta-util.workspace = true tauri-plugin-dialog = "2.2.0" tauri-plugin-fs = "2.2.0" diff --git a/crates/flags/Cargo.toml b/crates/flags/Cargo.toml index ab9f60c7..7fe9b1f3 100644 --- a/crates/flags/Cargo.toml +++ b/crates/flags/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] serde = "1.0.214" -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta.workspace = true specta-util.workspace = true diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index cd602571..2804acba 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -24,7 +24,7 @@ ringbuf = "0.4.7" scap.workspace = true serde = { version = "1", features = ["derive"] } specta.workspace = true -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta-util.workspace = true tempfile = "3.12.0" thiserror.workspace = true diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.toml index bfbcc3b6..6c07c035 100644 --- a/crates/project/Cargo.toml +++ b/crates/project/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] specta.workspace = true -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta-util.workspace = true serde = { version = "1", features = ["derive"] } diff --git a/crates/recording/Cargo.toml b/crates/recording/Cargo.toml index e400ead1..9a3e49bf 100644 --- a/crates/recording/Cargo.toml +++ b/crates/recording/Cargo.toml @@ -9,7 +9,7 @@ cap-media = { path = "../media" } cap-flags = { path = "../flags" } specta.workspace = true -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta-util.workspace = true tokio.workspace = true flume.workspace = true diff --git a/crates/rendering/Cargo.toml b/crates/rendering/Cargo.toml index 294eea00..05708de6 100644 --- a/crates/rendering/Cargo.toml +++ b/crates/rendering/Cargo.toml @@ -19,7 +19,7 @@ image = "0.25.2" log = "0.4" serde = "1.0.209" specta.workspace = true -# TODO(Ilya): remove when specta releases rc.21 +# TODO(Ilya): Remove with next tauri and specta updates specta-util.workspace = true thiserror.workspace = true wgpu.workspace = true From da0033959622d4cf67cbec1f25eef18792ad39dc Mon Sep 17 00:00:00 2001 From: Ilya <47112191+ItsEeleeya@users.noreply.github.com> Date: Sun, 19 Jan 2025 15:24:49 +0330 Subject: [PATCH 11/11] Bump tauri version, fixing specta version --- Cargo.lock | 55 ++++++++++--------------------- Cargo.toml | 4 +-- apps/desktop/src-tauri/Cargo.toml | 2 -- crates/flags/Cargo.toml | 3 -- crates/media/Cargo.toml | 2 -- crates/project/Cargo.toml | 2 -- crates/recording/Cargo.toml | 2 -- crates/rendering/Cargo.toml | 2 -- 8 files changed, 19 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef7f4129..a4ac472e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -894,7 +894,6 @@ dependencies = [ "serde_json", "specta", "specta-typescript", - "specta-util", "swift-rs", "tauri", "tauri-build", @@ -968,7 +967,6 @@ version = "0.1.0" dependencies = [ "serde", "specta", - "specta-util", ] [[package]] @@ -1007,7 +1005,6 @@ dependencies = [ "screencapturekit", "serde", "specta", - "specta-util", "tempfile", "thiserror 1.0.63", "tokio", @@ -1024,7 +1021,6 @@ dependencies = [ "serde", "serde_json", "specta", - "specta-util", ] [[package]] @@ -1045,7 +1041,6 @@ dependencies = [ "serde", "serde_json", "specta", - "specta-util", "thiserror 1.0.63", "tokio", "tracing", @@ -1075,7 +1070,6 @@ dependencies = [ "pretty_assertions", "serde", "specta", - "specta-util", "thiserror 1.0.63", "tokio", "wgpu", @@ -1122,12 +1116,12 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.17.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" dependencies = [ "serde", - "toml 0.8.2", + "toml 0.8.19", ] [[package]] @@ -2234,7 +2228,7 @@ dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.2", + "toml 0.8.19", "vswhom", "winreg", ] @@ -6623,18 +6617,6 @@ dependencies = [ "thiserror 1.0.63", ] -[[package]] -name = "specta-util" -version = "0.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8113d65b58a6de3184b01d6df9e50b6d4bbe7f724251f576d84f23228824456" -dependencies = [ - "ctor", - "serde", - "specta", - "specta-macros", -] - [[package]] name = "spin" version = "0.9.8" @@ -6860,7 +6842,7 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.2", + "toml 0.8.19", "version-compare", ] @@ -6944,9 +6926,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.2.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2e3349fbb2be7af9fad1b43d61ac83ba55ab48d47fbe1b2732f0c8211610a9" +checksum = "78f6efc261c7905839b4914889a5b25df07f0ff89c63fb4afd6ff8c96af15e4d" dependencies = [ "anyhow", "bytes", @@ -6978,7 +6960,6 @@ dependencies = [ "serde_repr", "serialize-to-javascript", "specta", - "specta-util", "swift-rs", "tauri-build", "tauri-macros", @@ -6998,9 +6979,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b274ec7239ada504deb615f1c8abd7ba99631e879709e6f10e5d17217058d976" +checksum = "8e950124f6779c6cf98e3260c7a6c8488a74aa6350dd54c6950fdaa349bca2df" dependencies = [ "anyhow", "cargo_toml", @@ -7014,7 +6995,7 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "toml 0.8.2", + "toml 0.8.19", "walkdir", ] @@ -7088,7 +7069,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.8.2", + "toml 0.8.19", "walkdir", ] @@ -7148,7 +7129,7 @@ dependencies = [ "tauri-plugin", "tauri-utils", "thiserror 2.0.6", - "toml 0.8.2", + "toml 0.8.19", "url", "uuid", ] @@ -7466,7 +7447,7 @@ dependencies = [ "serde_with", "swift-rs", "thiserror 2.0.6", - "toml 0.8.2", + "toml 0.8.19", "url", "urlpattern", "uuid", @@ -7747,14 +7728,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.22", ] [[package]] @@ -7786,8 +7767,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.5.0", - "serde", - "serde_spanned", "toml_datetime", "winnow 0.5.40", ] @@ -7799,6 +7778,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.5.0", + "serde", + "serde_spanned", "toml_datetime", "winnow 0.6.20", ] diff --git a/Cargo.toml b/Cargo.toml index 7ee6b6b2..0e3d3e32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,10 +18,8 @@ tokio = { version = "1.39.3", features = [ "rt-multi-thread", "time", ] } -tauri = { version = "2.2.0", features = [ "specta" ] } +tauri = { version = "2.2.3", features = [ "specta" ] } specta = { version = "=2.0.0-rc.20", features = [ "derive" ] } -# TODO(Ilya): Remove with next tauri and specta updates -specta-util = { version = "^0.0.7", features = [ "export" ] } scap = { git = "https://github.com/CapSoftware/scap", rev = "58d4410bf52f" } nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "0d3d1f30a78b", features = [ diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 8844e3af..55b0d4b8 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -25,8 +25,6 @@ tauri = { workspace = true, features = [ "image-png", ] } tauri-specta = { version = "=2.0.0-rc.20", features = ["derive", "typescript"] } -# TODO(Ilya): Remove with next tauri and specta updates -specta-util.workspace = true tauri-plugin-dialog = "2.2.0" tauri-plugin-fs = "2.2.0" tauri-plugin-global-shortcut = "2.2.0" diff --git a/crates/flags/Cargo.toml b/crates/flags/Cargo.toml index 7fe9b1f3..32deda96 100644 --- a/crates/flags/Cargo.toml +++ b/crates/flags/Cargo.toml @@ -5,7 +5,4 @@ edition = "2021" [dependencies] serde = "1.0.214" -# TODO(Ilya): Remove with next tauri and specta updates specta.workspace = true - -specta-util.workspace = true diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 2804acba..f707da41 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -24,8 +24,6 @@ ringbuf = "0.4.7" scap.workspace = true serde = { version = "1", features = ["derive"] } specta.workspace = true -# TODO(Ilya): Remove with next tauri and specta updates -specta-util.workspace = true tempfile = "3.12.0" thiserror.workspace = true tracing = { version = "0.1", features = ["release_max_level_info"] } diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.toml index 6c07c035..46eb4ba3 100644 --- a/crates/project/Cargo.toml +++ b/crates/project/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" [dependencies] specta.workspace = true -# TODO(Ilya): Remove with next tauri and specta updates -specta-util.workspace = true serde = { version = "1", features = ["derive"] } serde_json = "1.0.127" diff --git a/crates/recording/Cargo.toml b/crates/recording/Cargo.toml index 71d61672..7dd6376f 100644 --- a/crates/recording/Cargo.toml +++ b/crates/recording/Cargo.toml @@ -10,8 +10,6 @@ cap-flags = { path = "../flags" } cap-utils = { path = "../utils" } specta.workspace = true -# TODO(Ilya): Remove with next tauri and specta updates -specta-util.workspace = true tokio.workspace = true flume.workspace = true thiserror.workspace = true diff --git a/crates/rendering/Cargo.toml b/crates/rendering/Cargo.toml index 05708de6..f73679d4 100644 --- a/crates/rendering/Cargo.toml +++ b/crates/rendering/Cargo.toml @@ -19,8 +19,6 @@ image = "0.25.2" log = "0.4" serde = "1.0.209" specta.workspace = true -# TODO(Ilya): Remove with next tauri and specta updates -specta-util.workspace = true thiserror.workspace = true wgpu.workspace = true bezier_easing = "0.1.1"