[workspace]
resolver = "3"
members = ["crates/*"]
default-members = ["crates/cli"]
exclude = ["examples/build_step"]

[package]
name = "rpkl"
version = "0.8.0"
edition = "2024"
license = "MIT"
repository = "https://github.com/z-jxy/rpkl"
description = "Bindings and codegen for Apple's Pkl configuration language"
keywords = ["pkl", "apple", "codegen"]
readme = "README.md"

[dependencies]
rmp-serde = "1.3.1"
rmpv = { version = "1.3.1" } # features = ["with-serde"]
serde = { version = "1.0", features = ["derive"] }

# Gated dependencies
convert_case = { version = "0.11.0", optional = true }
indexmap = { version = "2.13.0", features = ["serde"], optional = true }
tracing = { version = "0.1.44", optional = true }
tracing-subscriber = { version = "0.3.22", optional = true }

[lints.clippy]
all = "warn"

[target.'cfg(windows)'.dependencies]
dunce = "1.0.4"

[dev-dependencies]
regex = "1.11.1"
serde_json = "1.0.117"


[features]
default = []
codegen = ["convert_case"]
indexmap = ["dep:indexmap"]
trace = ["tracing"]

# used to signal to codegen that its running in the context of a build 
# this is done to emit cargo directives
build-script = ["codegen"]

# enables features for modifying structs and fields during codegen
# the behavior of how structs/fields are targeted is subject to change
codegen-experimental = ["codegen"]

[[example]]
name = "external_resource_reader"
path = "examples/external_resource_reader/reader.rs"

[[example]]
name = "codegen"
path = "examples/codegen/codegen.rs"
required-features = ["codegen-experimental"]
