[package]
name = "rbox"
description = "Rust library for interacting with the local and export data of Pioneers Rekordbox DJ software"
readme = "README.md"
version.workspace = true
authors.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
repository.workspace = true
edition.workspace = true
rust-version.workspace = true

[lib]
name = "rbox"

[features]
default = ["bundled-vendored-openssl", "full"]
# Component features
full        = ["master-db", "one-library", "anlz", "xml", "settings"]
master-db   = ["anlz", "dep:diesel", "dep:libsqlite3-sys", "dep:quick-xml", "dep:rand", "dep:uuid", "dep:dunce"]
one-library = ["dep:diesel", "dep:diesel_migrations", "dep:libsqlite3-sys", "dep:dunce"]
anlz        = ["dep:binrw", "dep:modular-bitfield"]
settings    = ["dep:binrw", "dep:parse-display", "dep:crc16"]
xml         = ["dep:quick-xml", "dep:lazy-regex"]
# Features for SQLCipher support
bundled = ["libsqlite3-sys/bundled-sqlcipher"]
bundled-vendored-openssl = ["libsqlite3-sys/bundled-sqlcipher-vendored-openssl"]
# Features for the bindings
pyo3 = ["dep:pyo3", "dep:rbox-derives"]
napi = ["dep:napi", "dep:napi-derive"]

[dependencies]
serde             = { workspace = true }
serde_json        = { workspace = true }
chrono            = { workspace = true }
thiserror         = { version = "2.0" }
sysinfo           = { version = "0.37" }
dunce             = { version = "1.0", optional = true }
libsqlite3-sys    = { version = "0.33", features = ["sqlcipher"], optional = true }
diesel            = { version = "2.3", features = ["sqlite", "r2d2", "128-column-tables", "returning_clauses_for_sqlite_3_35"], optional = true }
diesel_migrations = { version = "2.3", features = ["sqlite"], optional = true }
rand              = { version = "0.9", optional = true }
uuid              = { version = "1.16", features = ["v4"], optional = true }
quick-xml         = { version = "0.38", features = ["serialize"], optional = true }
binrw             = { version = "0.15", optional = true }
modular-bitfield  = { version = "0.13", optional = true }
lazy-regex        = { version = "3.4", optional = true }
crc16             = { version = "0.4", optional = true }
parse-display     = { version = "0.10", optional = true }
# Binding dependencies
pyo3              = { workspace = true, optional = true }
rbox-derives      = { path = "../rbox-derives", version = "0.1.0", optional = true }
napi              = { workspace = true, optional = true }
napi-derive       = { workspace = true, optional = true }

[dev-dependencies]
anyhow            = { workspace = true }
rstest            = { version = "0.26.1" }
tempfile          = { version = "3.23" }
criterion         = { version = "0.7" }

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