[workspace]
members = ["derive", "compatibility"]
resolver = "2"

[workspace.package]
version = "0.2.2"
authors = ["COOLJAPAN OU (Team Kitasan)"]
edition = "2021"
rust-version = "1.74.0"
repository = "https://github.com/cool-japan/oxicode"
license = "Apache-2.0"
description = "A modern binary serialization library - successor to bincode"
readme = "README.md"

[workspace.dependencies]
# Proc macro dependencies
syn = "2.0"
quote = "1.0"
proc-macro2 = "1.0"

# Core dependencies
serde = { version = "1.0", default-features = false }
crc32fast = { version = "1.5" }

# Dev dependencies
criterion = "0.8.2"
tempfile = "3.27"
serde_json = { version = "1.0", default-features = false }
proptest = "1.11"

[package]
name = "oxicode"
version.workspace = true
edition.workspace = true
authors.workspace = true
repository.workspace = true
license.workspace = true
description.workspace = true
readme.workspace = true
rust-version.workspace = true

keywords = ["binary", "encode", "serialize", "bincode", "serialization"]
categories = ["encoding", "network-programming"]

publish = true

[features]
default = ["std", "derive"]
std = ["alloc", "serde?/std"]
alloc = ["serde?/alloc"]
derive = ["oxicode_derive"]
serde = ["dep:serde", "alloc"]  # Serde integration (optional)
simd = []  # SIMD-optimized array encoding (auto-detects CPU capabilities)
compression-lz4 = ["oxiarc-lz4"]  # LZ4 compression (fast, pure Rust)
compression-zstd = ["oxiarc-zstd"]    # Zstd compression (better ratio, pure Rust)
compression = ["compression-lz4"]  # Default compression feature
async-tokio = ["tokio"]  # Async streaming with tokio
checksum = ["dep:crc32fast"]  # CRC32 integrity checking for encoded data
validation = []               # Enable validation trait implementations in tests
versioning = []               # Enable versioning API tests

[dependencies]
oxicode_derive = { path = "derive", version = "0.2.2", optional = true }
serde = { workspace = true, optional = true, features = ["alloc"] }
oxiarc-lz4 = { version = "0.2.7", optional = true }
oxiarc-zstd = { version = "0.2.7", optional = true }
tokio = { version = "1.52", features = ["io-util"], optional = true }
crc32fast = { workspace = true, optional = true }

[dev-dependencies]
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tempfile = { workspace = true }
criterion = { workspace = true }
bincode = { version = "=2.0.1", features = ["serde"] } # Never upgrade to 3.0 (3.x has incompatible API)
tokio = { version = "1.52", features = ["rt", "macros", "io-util", "fs", "time"] }
proptest = { workspace = true }

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

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

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

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

[[bench]]
name = "serde_bench"
harness = false
required-features = ["serde"]

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

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
