[package]
name = "cddl"
description = "Parser for the Concise data definition language (CDDL)"
repository = "https://github.com/anweiss/cddl"
homepage = "https://cddl.anweiss.tech"
license = "MIT"
version = "0.5.2"
authors = ["Andrew Weiss <andrew.weiss@outlook.com>"]
readme = "README.md"
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
serde_json = { version = "1.0", optional = true, default-features = false }
serde_cbor = { version = "0.10", optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
half = "1.3"
lexical = "^4.0"
clap = "2.33"
base16 = "0.2"
base64 = "0.10"
chrono = "0.4"
uriparse = { version = "0.6", optional = true }
itertools = "0.8"
annotate-snippets = "0.7"

[dependencies.regex]
version = "1.3"
default-features = false
features = ["std"]

[dev-dependencies]
pretty_assertions = { git = "https://github.com/colin-kiegel/rust-pretty-assertions" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
crossterm = "0.9"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
console_error_panic_hook = { version = "0.1", optional = true }
wee_alloc = { version = "0.4", optional = true }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.2"

[features]
default = ["std"]
std = ["serde_json", "serde_cbor", "serde"]
nightly = ["uriparse"]

[[bin]]
name = "cddl"
required-features = ["std"]
path = "src/bin/cddl.rs"

[[bin]]
name = "repl"
required-features = ["std"]
path = "src/bin/repl.rs"

[profile.release]
opt-level = "s"
lto = true
