[workspace]
members = [".", "alec-ffi", "alec-gateway", "alec-complexity", "alec-testdata", "alec-exporter"]
resolver = "2"

[package]
name = "alec"
version = "1.3.9"
edition = "2021"
rust-version = "1.70"
authors = ["David Martin Venti <contact@alec-codec.com>"]
description = "Adaptive Lazy Evolving Compression - Smart codec for IoT sensor data with 90% compression ratio"
documentation = "https://docs.rs/alec"
homepage = "https://alec-codec.com"
repository = "https://github.com/zeekmartin/alec-codec"
readme = "README.md"
license = "AGPL-3.0"
keywords = ["compression", "iot", "codec", "embedded", "sensor"]
categories = ["compression", "embedded", "encoding"]

# Exclure les fichiers non nécessaires pour crates.io
exclude = [
    "docs/",
    "prompts/",
    ".github/",
    "scripts/",
    "LICENSE-COMMERCIAL.md",
    "*.prompt.md",
]

[badges]
maintenance = { status = "actively-developed" }

[lib]
name = "alec"
path = "src/lib.rs"

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

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

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

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

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

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

[dependencies]
# Error handling (std only, no_std uses manual impls)
thiserror = { version = "1.0", optional = true }

# Hashing (pour le contexte) — no_std compatible
xxhash-rust = { version = "0.8", features = ["xxh64", "xxh32"] }

# CRC32 checksum (for preload files) — no_std compatible
crc = { version = "3.0", default-features = false }

# Temps (optionnel, pour timestamps)
chrono = { version = "0.4", optional = true, default-features = false, features = ["std"] }

# Logging (optionnel)
log = { version = "0.4", optional = true }

# TLS (optionnel)
rustls = { version = "0.21", optional = true }
webpki-roots = { version = "0.25", optional = true }

[dev-dependencies]
# Tests
criterion = "0.5"          # Benchmarks
rand = "0.8"               # Génération de données de test
approx = "0.5"             # Comparaison de floats
tempfile = "3.10"          # Temporary files for testing

[features]
default = ["std"]
std = ["thiserror"]
no_std = []
logging = ["log"]
timestamps = ["chrono"]
tls = ["rustls", "webpki-roots"]
full = ["std", "logging", "timestamps", "tls"]

[profile.release]
lto = true
codegen-units = 1
opt-level = 3

[profile.bench]
lto = true
codegen-units = 1
