GUI-free half of the cce toolkit: config, input, IPC, spec parsers
git clone https://git.lucas.co/cce-core.git
feat: a default `config` feature gating config and input
`config` and `input` are the only modules that need kdl and serde_json.
With default features off, the crate is the spec parsers, units, the
animations switch and IPC on log, web-time and libc alone — what
cce-window-manager takes for its camera ramp, so it gains no KDL or JSON
in place of the ramp parser it used to mirror. CI tests both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
.github/workflows/ci.yml | 1 +
Cargo.toml | 9 +++++++--
src/lib.rs | 2 ++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 02dc891..42a9da7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,3 +17,4 @@ jobs:
- run: cargo build --all-targets
- run: cargo test
- run: cargo test --features test-isolation
+ - run: cargo test --no-default-features
diff --git a/Cargo.toml b/Cargo.toml
index 43b5972..f6ab8d6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,11 @@ name = "cce_core"
path = "src/lib.rs"
[features]
+default = ["config"]
+# `config` and `input`: the KDL config and input.kdl. Off, the crate is the
+# spec parsers, units, the animations switch and IPC alone, on log, web-time
+# and libc — what cce-window-manager takes for its camera ramp.
+config = ["dep:kdl", "dep:serde_json"]
# What `cfg(test)` means inside this crate, for a DEPENDENT's test build: the
# config home is a per-process directory nobody creates, natural scrolling
# reads false and the animations switch is on unless a test forces it, so a
@@ -19,8 +24,8 @@ path = "src/lib.rs"
test-isolation = []
[dependencies]
-kdl = "4.6"
-serde_json = "1.0"
+kdl = { version = "4.6", optional = true }
+serde_json = { version = "1.0", optional = true }
log = "0.4"
# `Instant` that works in the browser: std's panics on wasm32-unknown-unknown.
web-time = "1"
diff --git a/src/lib.rs b/src/lib.rs
index 76ca4bb..be9cfa9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,8 +12,10 @@
//! not draw — the compositor, a sync daemon, a CLI helper — depends on it
//! directly and links none of the toolkit's Wayland, Vulkan or text stack.
pub mod color;
+#[cfg(feature = "config")]
pub mod config;
pub mod droplet;
+#[cfg(feature = "config")]
pub mod input;
#[cfg(not(target_arch = "wasm32"))]
pub mod ipc;