[package]
name = "ftracker-identifiers"
version = "0.0.2"
edition = "2024"
license = "MIT"
repository = "https://github.com/lnivva/ftracker-identifiers"
rust-version = "1.93.0"
description = "Validated, no_std-first identifier types: CNPJ, ISIN, CFI, and ISO 3166-1 country codes."
readme = "README.md"
documentation = "https://docs.rs/ftracker-identifiers"
keywords = ["cnpj", "isin", "cfi", "iso3166", "no_std"]
categories = ["parser-implementations", "no-std", "data-structures", "finance"]
# The CFI taxonomy seed and its code generator are build-time tooling only; the committed
# `src/cfi/table.rs` is what compiles, so downstream consumers never need them.
exclude = ["/data", "/src/bin/generate_cfi_table.rs", "/fuzz"]

[dependencies]
serde = { version = "1", features = ["derive"], default-features = false, optional = true }
schemars = { version = "1", default-features = false, optional = true }
arbitrary = { version = "1", features = ["derive"], optional = true }
proptest = { version = "1", default-features = false, optional = true }
# Only used by the `generate_cfi_table` binary under the `codegen` feature (see `[[bin]]` below).
# Off by default, so downstream builds never compile it.
serde_json = { version = "1", optional = true }

[dev-dependencies]
criterion = "0.8.2"
proptest = "1"
serde_json = "1"

[features]
default = ["std"]

std = [
    "serde?/std",
    "schemars?/std",
    "proptest?/std",
]

serde = ["dep:serde"]
schemars = ["dep:schemars", "serde"]
arbitrary = ["dep:arbitrary"]
# `proptest/alloc` (allocation) and `proptest/no_std` (libm-backed float math) let the strategies
# build under `no_std`. The `std` feature above additionally turns on `proptest/std` when the
# standard library is available, which supersedes the libm math paths.
proptest = ["dep:proptest", "proptest/alloc", "proptest/no_std"]

# Internal build-time tooling only (the CFI table generator); not a downstream integration.
codegen = ["dep:serde_json"]

# Build the docs.rs documentation with every optional integration enabled, so the feature-gated
# `serde`/`schemars`/`arbitrary`/`proptest` items appear in the rendered API docs.
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

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

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

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

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

# Build-time tooling: regenerates `src/cfi/table.rs` from `data/cfi.json`. Gated behind `codegen`
# so it (and its `serde_json` dependency) is skipped by default and for downstream consumers.
# Run via `just cfi-generate`.
[[bin]]
name = "generate_cfi_table"
required-features = ["codegen"]
