diff --git a/Cargo.toml b/Cargo.toml index 8beed758..1829ea61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,33 +2,33 @@ resolver = "2" members = [ - "komorebi-windows", - "komorebi-client", + "crates/komorebi-windows", + "crates/komorebi-client", "komorebi-gui", "crates/komorebi-backend", "crates/komorebi-collections", "crates/komorebi-core", "crates/komorebi-config", "crates/komorebi-settings", - "komorebi-layouts", - "komorebi-scrolling", + "crates/komorebi-layouts", + "crates/komorebi-scrolling", "komorebic", - "komorebi-daemon", + "komorebi", "komorebic-no-console", "crates/komorebic-core", "komorebi-bar", - "komorebi-themes", + "crates/komorebi-themes", "crates/komorebi-protocol", "crates/komorebi-transport", "crates/komorebi-bar-core", "komorebi-shortcuts", - "e2e/guest/agent", - "e2e/guest/testwin", - # the daemons of KDE Plasma (Linux) and macOS are built only on their own platform, selected with -p; + "crates/komorebi-e2e-agent", + "crates/komorebi-testwin", + # the Linux and macOS backends are not built by a bare cargo command, they are selected with -p; # `default-members` below is the Windows set that a bare cargo command builds - "komorebi-linux", - "komorebi-macos", - "komorebi-hotkeys", + "crates/komorebi-linux", + "crates/komorebi-macos", + "crates/komorebi-hotkeys", "crates/komorebi-version", "komorebi-recorder", # a development tool (it writes the Nix options of the modules): built and tested by its own checks, @@ -37,28 +37,28 @@ members = [ ] default-members = [ - "komorebi-windows", - "komorebi-client", + "crates/komorebi-windows", + "crates/komorebi-client", "komorebi-gui", "crates/komorebi-backend", "crates/komorebi-collections", "crates/komorebi-core", "crates/komorebi-config", "crates/komorebi-settings", - "komorebi-layouts", - "komorebi-scrolling", + "crates/komorebi-layouts", + "crates/komorebi-scrolling", "komorebic", - "komorebi-daemon", + "komorebi", "komorebic-no-console", "crates/komorebic-core", "komorebi-bar", - "komorebi-themes", + "crates/komorebi-themes", "crates/komorebi-protocol", "crates/komorebi-transport", "crates/komorebi-bar-core", "komorebi-shortcuts", - "e2e/guest/agent", - "e2e/guest/testwin", + "crates/komorebi-e2e-agent", + "crates/komorebi-testwin", "komorebi-recorder", ] diff --git a/crates/komorebi-backend/Cargo.toml b/crates/komorebi-backend/Cargo.toml index 712a6f3b..3cd8f6e1 100644 --- a/crates/komorebi-backend/Cargo.toml +++ b/crates/komorebi-backend/Cargo.toml @@ -5,4 +5,4 @@ description = "What every komorebi daemon asks of its platform: the Backend trai edition = "2024" [dependencies] -komorebi-layouts = { path = "../../komorebi-layouts" } +komorebi-layouts = { path = "../komorebi-layouts" } diff --git a/crates/komorebi-bar-core/Cargo.toml b/crates/komorebi-bar-core/Cargo.toml index 60adb947..3d42fc67 100644 --- a/crates/komorebi-bar-core/Cargo.toml +++ b/crates/komorebi-bar-core/Cargo.toml @@ -13,8 +13,8 @@ lazy_static = { workspace = true } image = "0.25" komorebi-config = { path = "../komorebi-config", default-features = false } reqwest = { version = "0.12", features = ["blocking"] } -komorebi-layouts = { path = "../../komorebi-layouts" } -komorebi-themes = { path = "../../komorebi-themes", default-features = false } +komorebi-layouts = { path = "../komorebi-layouts" } +komorebi-themes = { path = "../komorebi-themes", default-features = false } komorebi-protocol = { path = "../komorebi-protocol", default-features = false } serde = { workspace = true } color-eyre = { workspace = true } diff --git a/crates/komorebi-config/Cargo.toml b/crates/komorebi-config/Cargo.toml index 8c9128f7..d01ff427 100644 --- a/crates/komorebi-config/Cargo.toml +++ b/crates/komorebi-config/Cargo.toml @@ -5,9 +5,9 @@ edition = "2024" description = "The komorebi.json data types (StaticConfig and the types it is made of) and the generation of its JSON Schema" [dependencies] -komorebi-layouts = { path = "../../komorebi-layouts" } +komorebi-layouts = { path = "../komorebi-layouts" } komorebi-protocol = { path = "../komorebi-protocol", default-features = false } -komorebi-themes = { path = "../../komorebi-themes" } +komorebi-themes = { path = "../komorebi-themes" } clap = { workspace = true } color-eyre = { workspace = true } diff --git a/crates/komorebi-core/Cargo.toml b/crates/komorebi-core/Cargo.toml index d82b0408..62a41cd1 100644 --- a/crates/komorebi-core/Cargo.toml +++ b/crates/komorebi-core/Cargo.toml @@ -7,9 +7,9 @@ edition = "2024" [dependencies] komorebi-collections = { path = "../komorebi-collections" } komorebi-config = { path = "../komorebi-config", default-features = false } -komorebi-layouts = { path = "../../komorebi-layouts" } +komorebi-layouts = { path = "../komorebi-layouts" } komorebi-protocol = { path = "../komorebi-protocol" } -komorebi-scrolling = { path = "../../komorebi-scrolling" } +komorebi-scrolling = { path = "../komorebi-scrolling" } color-eyre = { workspace = true } nanoid = "0.5" schemars = { workspace = true, optional = true } diff --git a/crates/komorebi-linux/Cargo.toml b/crates/komorebi-linux/Cargo.toml index f6c3079b..feb87db7 100644 --- a/crates/komorebi-linux/Cargo.toml +++ b/crates/komorebi-linux/Cargo.toml @@ -7,20 +7,20 @@ edition = "2024" [dependencies] komorebi-hotkeys = { path = "../komorebi-hotkeys" } komorebi-themes = { path = "../komorebi-themes" } -komorebi-backend = { path = "../crates/komorebi-backend" } -komorebi-collections = { path = "../crates/komorebi-collections" } -komorebi-core = { path = "../crates/komorebi-core" } +komorebi-backend = { path = "../komorebi-backend" } +komorebi-collections = { path = "../komorebi-collections" } +komorebi-core = { path = "../komorebi-core" } komorebi-layouts = { path = "../komorebi-layouts", features = ["schemars"] } komorebi-scrolling = { path = "../komorebi-scrolling" } -komorebi-config = { path = "../crates/komorebi-config", default-features = false, features = [ +komorebi-config = { path = "../komorebi-config", default-features = false, features = [ "schemars", ] } -komorebi-settings = { path = "../crates/komorebi-settings" } -komorebi-protocol = { path = "../crates/komorebi-protocol", default-features = false, features = [ +komorebi-settings = { path = "../komorebi-settings" } +komorebi-protocol = { path = "../komorebi-protocol", default-features = false, features = [ "schemars", ] } -komorebi-transport = { path = "../crates/komorebi-transport" } -version = { package = "komorebi-version", path = "../crates/komorebi-version" } +komorebi-transport = { path = "../komorebi-transport" } +version = { package = "komorebi-version", path = "../komorebi-version" } clap = { version = "4", features = ["derive", "wrap_help"] } color-eyre = { version = "0.6" } diff --git a/crates/komorebi-linux/src/check.rs b/crates/komorebi-linux/src/check.rs index 8bb21f27..0913990d 100644 --- a/crates/komorebi-linux/src/check.rs +++ b/crates/komorebi-linux/src/check.rs @@ -1812,7 +1812,7 @@ mod tests { let Some(known) = known_keys() else { return; }; - let example = include_str!("../../docs/linux/komorebi.example.json"); + let example = include_str!("../../../docs/linux/komorebi.example.json"); let value: serde_json::Value = serde_json::from_str(example).unwrap(); let findings = check_keys(&value, &known); diff --git a/crates/komorebi-linux/tests/asc.rs b/crates/komorebi-linux/tests/asc.rs index b409a588..d189d4b7 100644 --- a/crates/komorebi-linux/tests/asc.rs +++ b/crates/komorebi-linux/tests/asc.rs @@ -216,7 +216,7 @@ fn the_kinds_of_rule_of_other_platforms_are_read_and_do_nothing() { #[test] fn the_applications_file_komorebic_ships_floats_the_programs_it_names() { let shipped = - Path::new(env!("CARGO_MANIFEST_DIR")).join("../komorebic/src/linux/applications.json"); + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../komorebic/src/linux/applications.json"); let mut desktop = Desktop::load(&applications(&shipped)).unwrap(); assert_eq!( diff --git a/crates/komorebi-linux/tests/config_parity.rs b/crates/komorebi-linux/tests/config_parity.rs index ec6763a2..0762fa8b 100644 --- a/crates/komorebi-linux/tests/config_parity.rs +++ b/crates/komorebi-linux/tests/config_parity.rs @@ -41,7 +41,8 @@ const WINDOWS_ONLY: &[&str] = &[ fn repo_root() -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")) - .parent() + .ancestors() + .nth(2) .unwrap() .to_path_buf() } diff --git a/crates/komorebi-linux/tests/wallpaper.rs b/crates/komorebi-linux/tests/wallpaper.rs index f6aa2f0a..8bb06741 100644 --- a/crates/komorebi-linux/tests/wallpaper.rs +++ b/crates/komorebi-linux/tests/wallpaper.rs @@ -381,7 +381,7 @@ fn theme_options_choose_the_variant_and_the_colour_each_border_takes() { #[test] fn the_wallpaper_example_in_the_docs_loads() { - let docs = Path::new(env!("CARGO_MANIFEST_DIR")).join("../docs/linux/usage/wallpapers.md"); + let docs = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../docs/linux/usage/wallpapers.md"); let docs = std::fs::read_to_string(docs).unwrap(); let json = docs .split("```json\n") diff --git a/crates/komorebi-macos/Cargo.toml b/crates/komorebi-macos/Cargo.toml index 46c9f5ab..1c0032b5 100644 --- a/crates/komorebi-macos/Cargo.toml +++ b/crates/komorebi-macos/Cargo.toml @@ -6,23 +6,23 @@ edition = "2024" [dependencies] komorebi-themes = { path = "../komorebi-themes" } -komorebi-backend = { path = "../crates/komorebi-backend" } -komorebi-collections = { path = "../crates/komorebi-collections" } -komorebi-core = { path = "../crates/komorebi-core" } +komorebi-backend = { path = "../komorebi-backend" } +komorebi-collections = { path = "../komorebi-collections" } +komorebi-core = { path = "../komorebi-core" } komorebi-layouts = { path = "../komorebi-layouts", features = [ "darwin", "schemars", ] } -komorebi-config = { path = "../crates/komorebi-config", default-features = false, features = [ +komorebi-config = { path = "../komorebi-config", default-features = false, features = [ "schemars", ] } -komorebi-settings = { path = "../crates/komorebi-settings" } -komorebi-protocol = { path = "../crates/komorebi-protocol", default-features = false, features = [ +komorebi-settings = { path = "../komorebi-settings" } +komorebi-protocol = { path = "../komorebi-protocol", default-features = false, features = [ "schemars", ] } -komorebi-transport = { path = "../crates/komorebi-transport" } +komorebi-transport = { path = "../komorebi-transport" } quickxml_to_serde = { git = "https://github.com/LGUG2Z/quickxml_to_serde.git", version = "0.6.1" } -version = { package = "komorebi-version", path = "../crates/komorebi-version" } +version = { package = "komorebi-version", path = "../komorebi-version" } base64 = "0.22" block2 = "0.6" diff --git a/crates/komorebi-macos/src/pan.rs b/crates/komorebi-macos/src/pan.rs index 7c08a345..60bc2256 100644 --- a/crates/komorebi-macos/src/pan.rs +++ b/crates/komorebi-macos/src/pan.rs @@ -459,13 +459,13 @@ mod tests { #[test] fn the_swipes_of_a_stream_lift_at_the_speed_that_they_were_made_to() { let long = lift_speed(&moves_of(include_str!( - "../../komorebic/fixtures/pan3-long.transcript.txt" + "../../komorebic-core/fixtures/pan3-long.transcript.txt" ))); let flick = lift_speed(&moves_of(include_str!( - "../../komorebic/fixtures/pan3-flick.transcript.txt" + "../../komorebic-core/fixtures/pan3-flick.transcript.txt" ))); let slow = lift_speed(&moves_of(include_str!( - "../../komorebic/fixtures/pan3-slow.transcript.txt" + "../../komorebic-core/fixtures/pan3-slow.transcript.txt" ))); // 0.128 cm every 8 ms, and 0.267 every 8 diff --git a/crates/komorebi-protocol/Cargo.toml b/crates/komorebi-protocol/Cargo.toml index 50969c57..af798e5a 100644 --- a/crates/komorebi-protocol/Cargo.toml +++ b/crates/komorebi-protocol/Cargo.toml @@ -5,8 +5,8 @@ edition = "2024" description = "The wire types shared by every komorebi daemon and client: SocketMessage and its payloads" [dependencies] -komorebi-layouts = { path = "../../komorebi-layouts" } -komorebi-themes = { path = "../../komorebi-themes" } +komorebi-layouts = { path = "../komorebi-layouts" } +komorebi-themes = { path = "../komorebi-themes" } clap = { workspace = true } color-eyre = { workspace = true } diff --git a/crates/komorebi-settings/Cargo.toml b/crates/komorebi-settings/Cargo.toml index edca4753..fdf6d940 100644 --- a/crates/komorebi-settings/Cargo.toml +++ b/crates/komorebi-settings/Cargo.toml @@ -6,8 +6,8 @@ description = "The settings every komorebi daemon reads while it runs: one immut [dependencies] komorebi-config = { path = "../komorebi-config", default-features = false } -komorebi-layouts = { path = "../../komorebi-layouts" } +komorebi-layouts = { path = "../komorebi-layouts" } komorebi-protocol = { path = "../komorebi-protocol", default-features = false } -komorebi-themes = { path = "../../komorebi-themes", default-features = false } +komorebi-themes = { path = "../komorebi-themes", default-features = false } parking_lot = "0.12" diff --git a/crates/komorebi-windows/Cargo.toml b/crates/komorebi-windows/Cargo.toml index e30e7723..d40a94dc 100644 --- a/crates/komorebi-windows/Cargo.toml +++ b/crates/komorebi-windows/Cargo.toml @@ -8,16 +8,16 @@ edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -komorebi-backend = { path = "../crates/komorebi-backend" } -komorebi-collections = { path = "../crates/komorebi-collections" } -komorebi-core = { path = "../crates/komorebi-core" } -komorebi-config = { path = "../crates/komorebi-config", default-features = false } -komorebi-settings = { path = "../crates/komorebi-settings" } +komorebi-backend = { path = "../komorebi-backend" } +komorebi-collections = { path = "../komorebi-collections" } +komorebi-core = { path = "../komorebi-core" } +komorebi-config = { path = "../komorebi-config", default-features = false } +komorebi-settings = { path = "../komorebi-settings" } komorebi-layouts = { path = "../komorebi-layouts", features = ["win32"] } komorebi-scrolling = { path = "../komorebi-scrolling" } komorebi-themes = { path = "../komorebi-themes" } -komorebi-protocol = { path = "../crates/komorebi-protocol", default-features = false } -komorebi-transport = { path = "../crates/komorebi-transport" } +komorebi-protocol = { path = "../komorebi-protocol", default-features = false } +komorebi-transport = { path = "../komorebi-transport" } base64 = "0.22" bitflags = { version = "2", features = ["serde"] } diff --git a/crates/komorebi-windows/src/pan.rs b/crates/komorebi-windows/src/pan.rs index 51058777..ad3de17d 100644 --- a/crates/komorebi-windows/src/pan.rs +++ b/crates/komorebi-windows/src/pan.rs @@ -388,13 +388,13 @@ mod tests { #[test] fn the_swipes_that_whkd_writes_lift_at_the_speed_that_they_were_made_to() { let long = lift_speed(&moves_of(include_str!( - "../../komorebic/fixtures/pan3-long.transcript.txt" + "../../komorebic-core/fixtures/pan3-long.transcript.txt" ))); let flick = lift_speed(&moves_of(include_str!( - "../../komorebic/fixtures/pan3-flick.transcript.txt" + "../../komorebic-core/fixtures/pan3-flick.transcript.txt" ))); let slow = lift_speed(&moves_of(include_str!( - "../../komorebic/fixtures/pan3-slow.transcript.txt" + "../../komorebic-core/fixtures/pan3-slow.transcript.txt" ))); // 0.128 cm every 8 ms, and 0.267 every 8 diff --git a/crates/komorebic-core/Cargo.toml b/crates/komorebic-core/Cargo.toml index 269fec10..f838c389 100644 --- a/crates/komorebic-core/Cargo.toml +++ b/crates/komorebic-core/Cargo.toml @@ -8,5 +8,5 @@ edition = "2024" clap = { workspace = true } clap_complete = "4" color-eyre = { workspace = true } -komorebi-layouts = { path = "../../komorebi-layouts" } +komorebi-layouts = { path = "../komorebi-layouts" } komorebi-protocol = { path = "../komorebi-protocol", default-features = false } diff --git a/crates/komorebic-core/src/pan.rs b/crates/komorebic-core/src/pan.rs index 4e6103d4..fe06b9a6 100644 --- a/crates/komorebic-core/src/pan.rs +++ b/crates/komorebic-core/src/pan.rs @@ -355,7 +355,7 @@ mod tests { use super::*; const TRANSCRIPT: &str = - include_str!("../../../komorebic/fixtures/gesture-stream.transcript.txt"); + include_str!("../fixtures/gesture-stream.transcript.txt"); fn gestures(told: &[SocketMessage]) -> Vec { told.iter() @@ -542,9 +542,9 @@ mod tests { /// What whkd writes for a swipe of three fingers that goes on for about two seconds, a /// flick, and one that eases to a stop: `whkd touchpad --demo --instant` - const LONG: &str = include_str!("../../../komorebic/fixtures/pan3-long.transcript.txt"); - const FLICK: &str = include_str!("../../../komorebic/fixtures/pan3-flick.transcript.txt"); - const SLOW: &str = include_str!("../../../komorebic/fixtures/pan3-slow.transcript.txt"); + const LONG: &str = include_str!("../fixtures/pan3-long.transcript.txt"); + const FLICK: &str = include_str!("../fixtures/pan3-flick.transcript.txt"); + const SLOW: &str = include_str!("../fixtures/pan3-slow.transcript.txt"); /// How many lines of a transcript are not part of the stream: whkd's demo says which swipe /// it saw, as `swipe swipe3right`, among them, and nothing says that the program that it diff --git a/komorebi-bar/Cargo.toml b/komorebi-bar/Cargo.toml index e505b9be..af6eea2b 100644 --- a/komorebi-bar/Cargo.toml +++ b/komorebi-bar/Cargo.toml @@ -10,7 +10,7 @@ edition = "2024" [dependencies] komorebi-bar-core = { path = "../crates/komorebi-bar-core", default-features = false } -komorebi-client = { path = "../komorebi-client", default-features = false } +komorebi-client = { path = "../crates/komorebi-client", default-features = false } chrono-tz = { workspace = true } chrono = { workspace = true } @@ -38,7 +38,7 @@ tracing = { workspace = true } tracing-subscriber = { workspace = true } [target.'cfg(windows)'.dependencies] -komorebi-themes = { path = "../komorebi-themes", default-features = false } +komorebi-themes = { path = "../crates/komorebi-themes", default-features = false } egui_extras = { workspace = true } # a second renderer, wgpu (Direct3D 12, which has the software adapter WARP), for a machine where OpenGL 2.0 is not # there; glow stays the first (see `renderer_attempts` in windows/mod.rs). Windows only: the macOS bar has no use for it @@ -55,7 +55,7 @@ windows-icons = { git = "https://github.com/LGUG2Z/windows-icons", rev = "0c9d7e windows-icons-fallback = { package = "windows-icons", git = "https://github.com/LGUG2Z/windows-icons", rev = "d67cc9920aa9b4883393e411fb4fa2ddd4c498b5" } [target.'cfg(target_os = "macos")'.dependencies] -komorebi-themes = { path = "../komorebi-themes" } +komorebi-themes = { path = "../crates/komorebi-themes" } icns = "0.4" netdev = "0.40" objc2 = { version = "0.6", default-features = false, features = ["std"] } diff --git a/komorebi-gui/Cargo.toml b/komorebi-gui/Cargo.toml index c7fd2b87..d81a1078 100644 --- a/komorebi-gui/Cargo.toml +++ b/komorebi-gui/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -komorebi-client = { path = "../komorebi-client", default-features = false } +komorebi-client = { path = "../crates/komorebi-client", default-features = false } eframe = { workspace = true } egui_extras = { workspace = true } diff --git a/komorebi-recorder/build.rs b/komorebi-recorder/build.rs index 1586d445..ffb5d0de 100644 --- a/komorebi-recorder/build.rs +++ b/komorebi-recorder/build.rs @@ -14,9 +14,9 @@ //! //! | flavor | directories indexed | //! |---|---| -//! | macOS | `komorebi-macos/src`, the shared crates | -//! | Windows | `komorebi-windows/src`, the shared crates | -//! | KDE | `komorebi-linux/src`, the shared crates | +//! | macOS | `crates/komorebi-macos/src`, the shared crates | +//! | Windows | `crates/komorebi-windows/src`, the shared crates | +//! | KDE | `crates/komorebi-linux/src`, the shared crates | //! //! `KOMOREBI_SRC` names another checkout of the repository to index instead, and `KOMOREBI_COMMIT` the //! commit of the source when it is not a git checkout (nix). The commit otherwise comes from git. @@ -44,8 +44,8 @@ struct Flavor { /// The crates of every flavor that write log statements: the daemons call into them. const SHARED: &[(&str, &str)] = &[ - ("komorebi-client/src", "komorebi_client"), - ("komorebi-layouts/src", "komorebi_layouts"), + ("crates/komorebi-client/src", "komorebi_client"), + ("crates/komorebi-layouts/src", "komorebi_layouts"), ("crates/komorebi-core/src", "komorebi_core"), ("crates/komorebi-transport/src", "komorebi_transport"), ]; @@ -54,7 +54,7 @@ const FLAVORS: &[Flavor] = &[ Flavor { name: "MAC", crates: &[ - ("komorebi-macos/src", "komorebi"), + ("crates/komorebi-macos/src", "komorebi"), SHARED[0], SHARED[1], SHARED[2], @@ -64,7 +64,7 @@ const FLAVORS: &[Flavor] = &[ Flavor { name: "WINDOWS", crates: &[ - ("komorebi-windows/src", "komorebi"), + ("crates/komorebi-windows/src", "komorebi"), SHARED[0], SHARED[1], SHARED[2], @@ -74,7 +74,7 @@ const FLAVORS: &[Flavor] = &[ Flavor { name: "KDE", crates: &[ - ("komorebi-linux/src", "komorebi"), + ("crates/komorebi-linux/src", "komorebi"), SHARED[0], SHARED[1], SHARED[2], diff --git a/komorebi-recorder/src/analysis/catalog.rs b/komorebi-recorder/src/analysis/catalog.rs index 13e04db6..350163ea 100644 --- a/komorebi-recorder/src/analysis/catalog.rs +++ b/komorebi-recorder/src/analysis/catalog.rs @@ -251,12 +251,12 @@ impl Statement { /// level: "INFO".to_string(), /// target: "komorebi::process_event".to_string(), /// template: "processing event: {} for process {} with notification {}".to_string(), - /// file: "komorebi-macos/src/process_event.rs".to_string(), + /// file: "crates/komorebi-macos/src/process_event.rs".to_string(), /// line: 120, /// function: "process_event".to_string(), /// owner: "WindowManager".to_string(), /// }; - /// assert_eq!(statement.location(), "komorebi-macos/src/process_event.rs:120"); + /// assert_eq!(statement.location(), "crates/komorebi-macos/src/process_event.rs:120"); /// assert_eq!(statement.qualified_function(), "WindowManager::process_event"); /// /// // outside any `impl`, the function stands alone @@ -379,7 +379,7 @@ impl Catalog { /// let found = catalog /// .find("komorebi::reaper", Level::Info, "reaping window: 4711") /// .expect("the reaper logs this"); - /// assert_eq!(found.statement.file, "komorebi-macos/src/reaper.rs"); + /// assert_eq!(found.statement.file, "crates/komorebi-macos/src/reaper.rs"); /// assert!(found.statement.template.starts_with("reaping window")); /// /// // no statement could have written this @@ -784,9 +784,9 @@ mod tests { /// The directories of the Mac checkout that its catalog indexes. const MAC_PATHS: &[&str] = &[ - "komorebi-macos/src", - "komorebi-client/src", - "komorebi-layouts/src", + "crates/komorebi-macos/src", + "crates/komorebi-client/src", + "crates/komorebi-layouts/src", "crates/komorebi-core/src", "crates/komorebi-transport/src", ]; @@ -850,7 +850,7 @@ mod tests { ) .expect("the header statement"); - assert_eq!(found.statement.file, "komorebi-macos/src/process_event.rs"); + assert_eq!(found.statement.file, "crates/komorebi-macos/src/process_event.rs"); assert_eq!(found.statement.function, "process_event"); assert_eq!(found.statement.owner, "WindowManager"); assert_eq!(found.confidence, Confidence::Likely); @@ -995,7 +995,7 @@ mod tests { ); assert_eq!(skew.verdict, "same"); assert!(skew.warning.is_none()); - assert!(!skew.file_changed("komorebi-macos/src/window.rs")); + assert!(!skew.file_changed("crates/komorebi-macos/src/window.rs")); // but not if the source had uncommitted changes when indexed let dirty = skew_between( @@ -1026,7 +1026,7 @@ mod tests { .contains("cannot say how they differ") ); // when it cannot be told, nothing is vouched for - assert!(skew.file_changed("komorebi-macos/src/window.rs")); + assert!(skew.file_changed("crates/komorebi-macos/src/window.rs")); } #[test] @@ -1035,7 +1035,7 @@ mod tests { // the commit before the latest change to komorebi's source let Some(history) = git( &repo(), - &["log", "-2", "--format=%H", "--", "komorebi-macos/src"], + &["log", "-2", "--format=%H", "--", "crates/komorebi-macos/src"], ) else { return; }; @@ -1058,9 +1058,9 @@ mod tests { older, indexed, "--", - "komorebi-macos/src", - "komorebi-client/src", - "komorebi-layouts/src", + "crates/komorebi-macos/src", + "crates/komorebi-client/src", + "crates/komorebi-layouts/src", "crates/komorebi-core/src", "crates/komorebi-transport/src", ], @@ -1078,7 +1078,7 @@ mod tests { for file in expected.lines() { assert!(skew.file_changed(file)); } - assert!(!skew.file_changed("komorebi-macos/src/a_file_that_never_changed.rs")); + assert!(!skew.file_changed("crates/komorebi-macos/src/a_file_that_never_changed.rs")); } fn rust_files(directory: &std::path::Path, found: &mut Vec) { @@ -1098,7 +1098,7 @@ mod tests { #[test] fn every_log_statement_in_komorebis_source_is_indexed() { crate::skip_without_komorebi_mac_source!(); - let root = crate::testkit::komorebi_mac_src().join("komorebi-macos/src"); + let root = crate::testkit::komorebi_mac_src().join("crates/komorebi-macos/src"); let mut files = Vec::new(); rust_files(&root, &mut files); @@ -1118,7 +1118,7 @@ mod tests { let indexed = mac() .entries .iter() - .filter(|entry| entry.file.starts_with("komorebi-macos/src/")) + .filter(|entry| entry.file.starts_with("crates/komorebi-macos/src/")) .count(); assert_eq!( indexed, in_source, diff --git a/komorebi-recorder/src/analysis/code.rs b/komorebi-recorder/src/analysis/code.rs index 8baf1c77..c02c8d96 100644 --- a/komorebi-recorder/src/analysis/code.rs +++ b/komorebi-recorder/src/analysis/code.rs @@ -298,7 +298,7 @@ impl Analysis { /// assert_eq!(found.about, "grep Reaping WINDOW"); /// assert!(found.lines.is_empty()); /// assert!(!found.statements.is_empty()); - /// assert!(found.statements.iter().any(|statement| statement.file == "komorebi-macos/src/reaper.rs")); + /// assert!(found.statements.iter().any(|statement| statement.file == "crates/komorebi-macos/src/reaper.rs")); /// # Ok::<(), Box>(()) /// ``` /// diff --git a/komorebi-recorder/src/analysis/flavor/mod.rs b/komorebi-recorder/src/analysis/flavor/mod.rs index a7ef8fc6..4def3901 100644 --- a/komorebi-recorder/src/analysis/flavor/mod.rs +++ b/komorebi-recorder/src/analysis/flavor/mod.rs @@ -203,14 +203,14 @@ impl Flavor { /// ```rust /// use komorebi_recorder::analysis::flavor::Flavor; /// - /// assert_eq!(Flavor::Macos.daemon_source(), "komorebi-macos/src"); + /// assert_eq!(Flavor::Macos.daemon_source(), "crates/komorebi-macos/src"); /// ``` #[must_use] pub const fn daemon_source(self) -> &'static str { match self { - Flavor::Macos => "komorebi-macos/src", - Flavor::Windows => "komorebi-windows/src", - Flavor::Kde => "komorebi-linux/src", + Flavor::Macos => "crates/komorebi-macos/src", + Flavor::Windows => "crates/komorebi-windows/src", + Flavor::Kde => "crates/komorebi-linux/src", } } diff --git a/komorebi-recorder/tests/code.rs b/komorebi-recorder/tests/code.rs index 43634f0b..d9841538 100644 --- a/komorebi-recorder/tests/code.rs +++ b/komorebi-recorder/tests/code.rs @@ -57,7 +57,7 @@ fn a_log_line_is_traced_to_the_statement_that_wrote_it() { assert_eq!(line["target"], "komorebi::reaper"); assert_eq!(line["message"], "reaping window: 4711"); let source = &line["source"]["statement"]; - assert_eq!(source["file"], "komorebi-macos/src/reaper.rs"); + assert_eq!(source["file"], "crates/komorebi-macos/src/reaper.rs"); assert!( source["template"] .as_str() @@ -149,7 +149,7 @@ fn git(args: &[&str]) -> Option { #[test] fn only_the_files_that_changed_since_the_recorded_commit_are_doubted() { komorebi_recorder::skip_without_komorebi_mac_source!(); - let Some(history) = git(&["log", "-2", "--format=%H", "--", "komorebi-macos/src"]) else { + let Some(history) = git(&["log", "-2", "--format=%H", "--", "crates/komorebi-macos/src"]) else { return; }; let Some(older) = history.lines().nth(1) else { @@ -164,9 +164,9 @@ fn only_the_files_that_changed_since_the_recorded_commit_are_doubted() { older, indexed, "--", - "komorebi-macos/src", - "komorebi-client/src", - "komorebi-layouts/src", + "crates/komorebi-macos/src", + "crates/komorebi-client/src", + "crates/komorebi-layouts/src", "crates/komorebi-core/src", "crates/komorebi-transport/src", ]) else { @@ -240,7 +240,7 @@ fn statements_can_be_searched_by_their_text() { let statements = answer["data"]["statements"].as_array().expect("statements"); let in_reaper = statements .iter() - .filter(|statement| statement["file"] == "komorebi-macos/src/reaper.rs") + .filter(|statement| statement["file"] == "crates/komorebi-macos/src/reaper.rs") .count(); assert_eq!(in_reaper, 3, "{statements:#?}"); } diff --git a/komorebi/Cargo.toml b/komorebi/Cargo.toml index 86ac4d72..d4543951 100644 --- a/komorebi/Cargo.toml +++ b/komorebi/Cargo.toml @@ -15,13 +15,13 @@ edition = "2024" color-eyre = { workspace = true } [target.'cfg(windows)'.dependencies] -komorebi-windows = { package = "komorebi-windows", path = "../komorebi-windows", default-features = false } +komorebi-windows = { package = "komorebi-windows", path = "../crates/komorebi-windows", default-features = false } [target.'cfg(target_os = "linux")'.dependencies] -komorebi-linux = { package = "komorebi-linux", path = "../komorebi-linux", default-features = false } +komorebi-linux = { package = "komorebi-linux", path = "../crates/komorebi-linux", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] -komorebi-macos = { package = "komorebi-macos", path = "../komorebi-macos", default-features = false } +komorebi-macos = { package = "komorebi-macos", path = "../crates/komorebi-macos", default-features = false } [features] default = ["schemars"] diff --git a/komorebic/Cargo.toml b/komorebic/Cargo.toml index 22a10124..82d2f2d7 100644 --- a/komorebic/Cargo.toml +++ b/komorebic/Cargo.toml @@ -12,7 +12,7 @@ edition = "2024" # its own (`komorebi-linux`, `komorebi-macos`) and main.rs gives them the name the modules use. [dependencies] -komorebi-client = { path = "../komorebi-client", default-features = false } +komorebi-client = { path = "../crates/komorebi-client", default-features = false } komorebi-config = { path = "../crates/komorebi-config", default-features = false } komorebic-core = { path = "../crates/komorebic-core" } @@ -40,8 +40,8 @@ win-msgbox = "0.2" windows = { workspace = true } [target.'cfg(target_os = "linux")'.dependencies] -komorebi-linux = { package = "komorebi-linux", path = "../komorebi-linux", default-features = false } -komorebi-hotkeys = { path = "../komorebi-hotkeys" } +komorebi-linux = { package = "komorebi-linux", path = "../crates/komorebi-linux", default-features = false } +komorebi-hotkeys = { path = "../crates/komorebi-hotkeys" } version = { package = "komorebi-version", path = "../crates/komorebi-version" } clap_complete = "4" sysinfo = "0.40" diff --git a/komorebic/tests/linux_hotkeys.rs b/komorebic/tests/linux_hotkeys.rs index d64f8e1d..2307ad57 100644 --- a/komorebic/tests/linux_hotkeys.rs +++ b/komorebic/tests/linux_hotkeys.rs @@ -78,7 +78,7 @@ fn stderr(output: &Output) -> String { fn fixture(name: &str) -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")) - .join("../komorebi-hotkeys/tests/fixtures") + .join("../crates/komorebi-hotkeys/tests/fixtures") .join(name) } diff --git a/nix/linux/flake-module.nix b/nix/linux/flake-module.nix index 4b6d7d9e..f08b5323 100644 --- a/nix/linux/flake-module.nix +++ b/nix/linux/flake-module.nix @@ -135,7 +135,7 @@ in # the Linux packages and the platform-neutral crates (layouts, scrolling, themes and the # shared crates/*), whose tests ran in no check. Not `--workspace`: that unifies the - # features of komorebi-daemon and the crates it pulls in, and windows-future fails to build. + # features of komorebi and the crates it pulls in, and windows-future fails to build. linux-nextest = build.craneLib.cargoNextest ( build.individualCrateArgs // { @@ -169,8 +169,8 @@ in pkgs.typescript ]; src = lib.fileset.toSource { - root = ../../komorebi-linux/src/kwin; - fileset = lib.fileset.fileFilter (file: !file.hasExt "rs") ../../komorebi-linux/src/kwin; + root = ../../crates/komorebi-linux/src/kwin; + fileset = lib.fileset.fileFilter (file: !file.hasExt "rs") ../../crates/komorebi-linux/src/kwin; }; } '' diff --git a/nix/linux/root-crates.json b/nix/linux/root-crates.json index 9f412472..2d537bcc 100644 --- a/nix/linux/root-crates.json +++ b/nix/linux/root-crates.json @@ -8,9 +8,9 @@ "crates/komorebi-transport", "crates/komorebi-version", "crates/komorebic-core", - "komorebi-client", - "komorebi-layouts", - "komorebi-scrolling", - "komorebi-themes", + "crates/komorebi-client", + "crates/komorebi-layouts", + "crates/komorebi-scrolling", + "crates/komorebi-themes", "komorebic" ] diff --git a/nix/linux/tests/keybindings.nix b/nix/linux/tests/keybindings.nix index aa1ef6b6..1ee9b924 100644 --- a/nix/linux/tests/keybindings.nix +++ b/nix/linux/tests/keybindings.nix @@ -1,5 +1,5 @@ # `keybindings-fixtures`: every key binding file of the fixture corpus -# (komorebi-hotkeys/tests/fixtures) through `komorebic hotkeys compile --mode auto --dry-run`, +# (crates/komorebi-hotkeys/tests/fixtures) through `komorebic hotkeys compile --mode auto --dry-run`, # the command the NixOS module runs, compared with `keybindings.expected`: the static shortcuts of # each file, the bindings left to the engine, and the diagnostics, as the build log of the module # shows them. After a change that means to change them, write the file again with the loop below, @@ -15,7 +15,7 @@ let in pkgs.runCommand "keybindings-fixtures" { - fixtures = ../../../komorebi-hotkeys/tests/fixtures; + fixtures = ../../../crates/komorebi-hotkeys/tests/fixtures; expected = ./keybindings.expected; samples = lib.fileset.toSource { root = ../../../docs/linux; diff --git a/nix/linux/tests/nixos-module.nix b/nix/linux/tests/nixos-module.nix index d9aace20..6b59b420 100644 --- a/nix/linux/tests/nixos-module.nix +++ b/nix/linux/tests/nixos-module.nix @@ -344,13 +344,13 @@ let withFile = keybindings { format = "sxhkd"; - file = ../../../komorebi-hotkeys/tests/fixtures/plain.sxhkdrc; + file = ../../../crates/komorebi-hotkeys/tests/fixtures/plain.sxhkdrc; }; textAndFile = keybindings { format = "skhd"; text = "alt - h : komorebic focus left\n"; - file = ../../../komorebi-hotkeys/tests/fixtures/plain.skhdrc; + file = ../../../crates/komorebi-hotkeys/tests/fixtures/plain.skhdrc; }; # the typed `config` and the key bindings are two parts of one command line diff --git a/nix/linux/tests/vm/keys-corpus.py b/nix/linux/tests/vm/keys-corpus.py index 88c07afe..3093ce73 100644 --- a/nix/linux/tests/vm/keys-corpus.py +++ b/nix/linux/tests/vm/keys-corpus.py @@ -1,5 +1,5 @@ # vm-keys-skhd, vm-keys-whkd and vm-keys-sxhkd: the case `vm` of the key binding corpus -# (komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module +# (crates/komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module # (`services.komorebi.keybindings`, mode auto). Alt+J can be a static shortcut, which KWin runs # from the system profile; Alt+, cannot, so the module's daemon registers it and runs it. The Rust # tests and `keybindings-fixtures` check the plan; only a real session can say that what the diff --git a/nix/linux/tests/vm/lib/komorebi_vm/platforms/kde/extras/keys_corpus.py b/nix/linux/tests/vm/lib/komorebi_vm/platforms/kde/extras/keys_corpus.py index 851cad1a..b7c3e1eb 100644 --- a/nix/linux/tests/vm/lib/komorebi_vm/platforms/kde/extras/keys_corpus.py +++ b/nix/linux/tests/vm/lib/komorebi_vm/platforms/kde/extras/keys_corpus.py @@ -1,5 +1,5 @@ r"""vm-keys-skhd, vm-keys-whkd and vm-keys-sxhkd: the case `vm` of the key binding corpus -(komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module +(crates/komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module (`services.komorebi.keybindings`, mode auto). Alt+J can be a static shortcut, which KWin runs from the system profile; Alt+, cannot, so the module's daemon registers it and runs it. The Rust tests and `keybindings-fixtures` check the plan; only a real session can say that what the diff --git a/nix/linux/tests/vm/suites/keys-skhd/default.nix b/nix/linux/tests/vm/suites/keys-skhd/default.nix index 5d2dacff..47b2ff61 100644 --- a/nix/linux/tests/vm/suites/keys-skhd/default.nix +++ b/nix/linux/tests/vm/suites/keys-skhd/default.nix @@ -6,7 +6,7 @@ script = "../../keys-corpus.py"; node.services.komorebi.keybindings = { format = "skhd"; - file = ../../../../../../komorebi-hotkeys/tests/fixtures/vm.skhdrc; + file = ../../../../../../crates/komorebi-hotkeys/tests/fixtures/vm.skhdrc; mode = "auto"; }; } diff --git a/nix/linux/tests/vm/suites/keys-sxhkd/default.nix b/nix/linux/tests/vm/suites/keys-sxhkd/default.nix index 301eda30..77dddd55 100644 --- a/nix/linux/tests/vm/suites/keys-sxhkd/default.nix +++ b/nix/linux/tests/vm/suites/keys-sxhkd/default.nix @@ -6,7 +6,7 @@ script = "../../keys-corpus.py"; node.services.komorebi.keybindings = { format = "sxhkd"; - file = ../../../../../../komorebi-hotkeys/tests/fixtures/vm.sxhkdrc; + file = ../../../../../../crates/komorebi-hotkeys/tests/fixtures/vm.sxhkdrc; mode = "auto"; }; } diff --git a/nix/linux/tests/vm/suites/keys-whkd/default.nix b/nix/linux/tests/vm/suites/keys-whkd/default.nix index 843c96e9..cf38777e 100644 --- a/nix/linux/tests/vm/suites/keys-whkd/default.nix +++ b/nix/linux/tests/vm/suites/keys-whkd/default.nix @@ -6,7 +6,7 @@ script = "../../keys-corpus.py"; node.services.komorebi.keybindings = { format = "whkd"; - file = ../../../../../../komorebi-hotkeys/tests/fixtures/vm.whkdrc; + file = ../../../../../../crates/komorebi-hotkeys/tests/fixtures/vm.whkdrc; mode = "auto"; }; } diff --git a/nix/workspace-src.nix b/nix/workspace-src.nix index 86f2e83a..f6c7ed1c 100644 --- a/nix/workspace-src.nix +++ b/nix/workspace-src.nix @@ -38,14 +38,24 @@ let # kept equal to `cargo tree` by tools/kde-closure-check); komorebi-bar and komorebi-bar-core (the egui # bar) are not in it, so an edit of the bar does not rebuild the KDE packages linuxShared = builtins.fromJSON (builtins.readFile ./linux/root-crates.json) ++ [ - "komorebi-daemon" + "komorebi" ]; + # the crates only one platform builds; the Windows set also has the e2e guests and the Windows-only + # binaries, which the other platforms never build linuxOnly = [ - "komorebi-linux" - "komorebi-hotkeys" + "crates/komorebi-linux" + "crates/komorebi-hotkeys" + ]; + macosOnly = [ "crates/komorebi-macos" ]; + windowsOnly = [ + "crates/komorebi-windows" + "crates/komorebi-e2e-agent" + "crates/komorebi-testwin" + "komorebi-gui" + "komorebic-no-console" + "komorebi-shortcuts" ]; - macosOnly = [ "komorebi-macos" ]; # the development tool that writes the Nix options: built by its own checks (nix/nixgen) toolOnly = [ "crates/schemars-nixgen" ]; @@ -53,11 +63,11 @@ let # the recorder and the crates whose source its build script indexes (komorebi-recorder/build.rs) recorderMembers = [ "komorebi-recorder" - "komorebi-windows" - "komorebi-macos" - "komorebi-linux" - "komorebi-client" - "komorebi-layouts" + "crates/komorebi-windows" + "crates/komorebi-macos" + "crates/komorebi-linux" + "crates/komorebi-client" + "crates/komorebi-layouts" "crates/komorebi-core" "crates/komorebi-transport" ]; @@ -65,21 +75,13 @@ let membersOf = { recorder = recorderMembers; nixgen = toolOnly; - # everything but the other two platforms' daemons and the tool + # everything but the other two platforms' crates and the tool windows = builtins.filter (m: !(builtins.elem m (linuxOnly ++ macosOnly ++ toolOnly))) allMembers; linux = linuxOnly ++ linuxShared; - macos = - macosOnly - ++ [ - "komorebic" - "komorebi-client" - "komorebi-bar" - "komorebi-daemon" - "komorebi-layouts" - "komorebi-scrolling" - "komorebi-themes" - ] - ++ builtins.filter (m: lib.hasPrefix "crates/" m && !(builtins.elem m toolOnly)) allMembers; + # everything but the Windows and Linux crates, the tool and the recorder + macos = builtins.filter ( + m: !(builtins.elem m (windowsOnly ++ linuxOnly ++ toolOnly ++ [ "komorebi-recorder" ])) + ) allMembers; }; members = builtins.filter (m: builtins.elem m membersOf.${platform}) allMembers; @@ -92,9 +94,9 @@ let # tests (named by prefix) and drops the other platforms' sharedCrates = [ "komorebic" - "komorebi-client" + "crates/komorebi-client" "komorebi-bar" - "komorebi-daemon" + "komorebi" ]; markers = { windows = "(src/windows(\\.rs|/.*)|tests/windows_.*)"; @@ -158,7 +160,6 @@ let ) || lib.hasPrefix "docs/macos/cli/" rel || lib.hasPrefix "schemas/" rel - || lib.hasPrefix "komorebic/fixtures/" rel # the icon and the guide the recorder embeds, and the installer a test of it reads || lib.hasPrefix "komorebi-recorder/" rel || lib.hasPrefix "wix/" rel; @@ -183,8 +184,7 @@ let macos = lib.hasSuffix ".json" rel && !(lib.hasPrefix "docs/" rel || lib.hasPrefix "schemas/" rel) || lib.hasPrefix "docs/macos/" rel - || lib.hasPrefix "schemas/macos/" rel - || lib.hasPrefix "komorebic/fixtures/" rel; + || lib.hasPrefix "schemas/macos/" rel; # the guide and the icon the recorder embeds, and the installer recorder = lib.hasPrefix "komorebi-recorder/" rel || lib.hasPrefix "wix/" rel; nixgen = false;