build(config): add the komorebi-config crate skeleton

Add crates/komorebi-config (edition 2024, root workspace member) with the feature-gated schema module that prints a schema the way komorebic does (pretty JSON plus a newline). No type has moved yet: the crate depends on komorebi-layouts, komorebi-themes and komorebi-protocol, which every type that follows needs.

Verified: native cargo test -p komorebi-config compiles (tier 1). Cargo.lock gains only the new package. Windows, KDE and macOS trees do not depend on the crate yet.
This commit is contained in:
LGUG2Z committed 2026-10-31 01:37:53 -07:00
1 parent b15d7cdc53
commit 67c1189bd8
5 files changed
+67

No files matched your search

Generated
+13
View File
@@ -3439,6 +3439,19 @@ dependencies = [
"serde_json_lenient",
]
[[package]]
name = "komorebi-config"
version = "0.1.42"
dependencies = [
"komorebi-layouts",
"komorebi-protocol",
"komorebi-themes",
"schemars 1.2.3",
"serde",
"serde_json_lenient",
"strum",
]
[[package]]
name = "komorebi-e2e-agent"
version = "0.1.0"
+1
View File
@@ -6,6 +6,7 @@ members = [
"komorebi-client",
"komorebi-gui",
"crates/komorebi-collections",
"crates/komorebi-config",
"komorebi-layouts",
"komorebi-scrolling",
"komorebic",
+29
View File
@@ -0,0 +1,29 @@
[package]
name = "komorebi-config"
version = "0.1.42"
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-protocol = { path = "../komorebi-protocol", default-features = false }
komorebi-themes = { path = "../../komorebi-themes" }
serde = { workspace = true }
serde_json = { workspace = true, features = ["preserve_order"] }
strum = { workspace = true }
# Optional dependencies
schemars = { workspace = true, optional = true }
[dev-dependencies]
schemars = { workspace = true }
[features]
default = ["schemars"]
schemars = [
"dep:schemars",
"komorebi-layouts/schemars",
"komorebi-protocol/schemars",
"komorebi-themes/schemars",
]
+11
View File
@@ -0,0 +1,11 @@
//! The `komorebi.json` data types and the generation of their JSON Schema.
//!
//! The crate holds no window manager code: it knows what a configuration file may say, not
//! how a daemon applies it. The types are moved here from the three daemons one family at a
//! time; the schema of each tree is checked in (`schema.json`, `schema.asc.json`) and
//! `tests/schemas.rs` compares what this crate generates with those files.
#![warn(clippy::all)]
#![allow(clippy::missing_errors_doc, clippy::use_self, clippy::doc_markdown)]
#[cfg(feature = "schemars")]
pub mod schema;
+13
View File
@@ -0,0 +1,13 @@
//! Generation of the JSON Schema files that are checked in next to the sources.
use schemars::JsonSchema;
/// The text `komorebic` prints for the schema of `T` (and that is checked in): pretty
/// JSON followed by a newline.
#[must_use]
pub fn pretty<T: JsonSchema>() -> String {
let schema = schemars::schema_for!(T);
let mut text = serde_json::to_string_pretty(&schema).expect("a schema is JSON");
text.push('\n');
text
}