[package]
name = "timezone_provider"
description = "Time zone data providers"
edition.workspace = true
version.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
include = [
    "src/**/*.rs",
    "src/data/*.rs.data",
    "Cargo.toml",
    "LICENSE-Apache",
    "LICENSE-MIT",
    "README.md",
]

[features]
# Allow people to use default-features = false
default = []
datagen = [
    "std",
    "dep:serde",
    "dep:databake",
    "dep:yoke",
    "dep:serde_json",
    "tinystr/serde",
    "tinystr/databake",
    "zerotrie/serde",
    "zerotrie/databake",
    "zerovec/serde",
    "zerovec/databake",
    "zerovec/derive",
    "dep:zoneinfo_rs",
    "experimental_tzif",
]
std = []
# Experimental tzif/tzdb compiled data
experimental_tzif = ["dep:zerofrom", "zerofrom/derive"]

# Performing timezone resolution with the `tzif` crate
tzif = ["dep:tzif", 
    "dep:jiff-tzdb",
    "dep:combine",
    "std"]

# Performing timezone resolution using the `zoneinfo64` crate
# (ICU4C zoneinfo64.res)
zoneinfo64 = ["dep:zoneinfo64"]

[dependencies]

# Provider dependency
zerotrie.workspace = true
zerovec = { workspace = true, features = ["derive", "alloc"] }
tinystr = { workspace = true, features = ["zerovec"] }

# IANA dependency
zoneinfo_rs = { workspace = true, features = ["std", "unstable"], optional = true }

# tzif dependency
tzif = { workspace = true, optional = true }
jiff-tzdb = { workspace = true, optional = true }
combine = { workspace = true, optional = true }
zerofrom = { version = "0.1.6", optional = true }

# zoneinfo64 dependency
zoneinfo64 = { workspace = true, optional = true }

# Databake dependencies
serde = { version = "1.0.225", features = ["derive"], optional = true }
databake = { workspace = true, optional = true, features = ["derive"]}
yoke = { version = "0.8.0", features = ["derive"], optional = true }
serde_json = { version = "1.0.145", optional = true }

[dev-dependencies]
icu_time = { version = "2", features = ["compiled_data"] }

[package.metadata.docs.rs]
all-features = true
