Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

facett-form/Cargo.toml

[package]
name = "facett-form"
description = "facett — administrative/CRUD forms (labelled fields + per-field validation via egui_form/garde, dirty-tracking, JSON copy/paste)"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
# Development notes, agent instructions and machine-local tooling stay in the
# repository; they are not part of the published crate.
exclude = [
    ".nornir/",
]

[dependencies]
facett-core = { path = "../facett-core", version = "0.3.0" }
egui = { workspace = true }
egui_form = { version = "0.10", default-features = false, features = ["validator_garde"] }
garde = { version = "0.23", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = { workspace = true }
# Pure-Rust PDF writer (byte-buffer only — itoa/ryu, no OS deps), so the form's
# render-to-PDF path shells out to nothing and compiles for wasm32 like the panel.
pdf-writer = "0.15"

# `testmatrix` feature only — the functional-status emitter. Optional + off by
# default so the default build pulls nothing. Sibling path dep (all repos live
# under one root), mirroring the reference wiring in korp-collectors.
nornir-testmatrix = { version = "0.2", default-features = false, optional = true }

[features]
default = []
# The masked date field validates a YYYY-MM-DD string without a date dep.
# `testmatrix` — turn the form's `functional_status(...)` self-reports into real
# nornir test-matrix rows; compiled OUT of the default build (a `#[inline]` no-op).
testmatrix = ["dep:nornir-testmatrix", "nornir-testmatrix/testmatrix"]

[dev-dependencies]
# The reusable native+wasm demo HOST — the `form_panel` example mounts the form as a
# Codeberg-Pages web demo and a native window from one source (see facett-demo/README).
facett-wasm-demo = { path = "../facett-wasm-demo"}

# Native-only host dep: the native eframe `form_demo`/`form_panel` name. STILL
# target-gated after the glow→wgpu purge, for a new reason: eframe's plain `wgpu`
# feature expands to `egui-wgpu/default`, which re-enables `wgpu/webgl`. Ungated,
# cargo would unify that across both targets and put the dead WebGL2 backend into the
# wasm bundle — the same harm the old `glow` did, by a different route. The wasm side
# takes `wgpu_no_default_features` from facett-wasm-demo instead.
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
# `wgpu_no_default_features`, NOT `wgpu` (LAW 4 / GFX_V2 Decision 0). eframe's plain
# `wgpu` feature expands to `egui-wgpu/default` -> `wgpu/default` -> `wgpu-hal/default`
# -> **glow**, the GL backend this constellation dropped. Cargo features are additive
# and unify across the whole graph, so one DEV dependency spelling it this way turns the
# GL backend on for every crate here, normal edges included. Backends come from the
# workspace `wgpu` entry.
eframe = { version = "0.36", default-features = false, features = ["default_fonts", "wgpu_no_default_features", "wayland", "x11"] }

# `form_panel` needs `wasm-bindgen` for its `#[wasm_bindgen(start)]` web entry point.
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen = "0.2"

[[example]]
name = "form_demo"
path = "examples/form_demo.rs"

[[example]]
name = "form_panel"
path = "examples/form_panel.rs"