[package]
name = "rs-grid-scene"
# Explicit (not workspace-inherited): per-crate independent versioning, bumped by
# release-plz. See release-plz.toml.
version = "0.2.8"
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
readme = "README.md"
authors.workspace = true
publish.workspace = true
description = "Scene graph: converts GridState into renderer-agnostic primitives"
keywords = ["grid", "scene-graph", "renderer", "canvas", "primitives"]
categories = ["graphics", "rendering"]

# Disable the default libtest bench harness for the lib target — see the same
# note in rs-grid-core/Cargo.toml. Lets `cargo bench -- --sample-size N` run
# only the `harness = false` Criterion benches below.
[lib]
bench = false

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
# Golden snapshots of the full SceneFrame (Debug-based, no serde needed).
insta = "1"

[[bench]]
name = "scene_builder"
harness = false

[[bench]]
name = "scroll_frame"
harness = false

[features]
# Optional `serde::Serialize` on the scene output types (SceneFrame and its
# primitives) so a frame can be dumped to JSON for the `scene-dump` CLI / MCP
# and golden snapshot tests. Off by default — keeps it out of the WASM bundle.
serde = ["dep:serde", "dep:serde_json"]

[dependencies]
rs-grid-core = { path = "../rs-grid-core", version = "0.4.0" }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }

[[bin]]
name = "generate-theme"
path = "src/bin/generate_theme.rs"
bench = false

# Dumps a SceneFrame as JSON so an agent can inspect the rendered scene without
# a browser. Needs the `serde` feature (Serialize on the scene types + serde_json).
[[bin]]
name = "scene-dump"
path = "src/bin/scene_dump.rs"
required-features = ["serde"]
bench = false
