[package]
name = "cross_usb"
version = "0.1.2"
authors = ["G2-Games <ke0bhogsg@gmail.com>"]
repository = "https://github.com/G2-Games/cross-usb"
documentation = "https://docs.rs/cross_usb"

description = """
A a Rust USB library which works seamlessly across both native and WASM targets
"""

keywords = ["usb", "wasm", "web-usb"]
categories = ["wasm", "web-programming", "hardware-support"]
readme = "README.md"
license = "AGPL-3.0"
edition = "2021"

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

# Wasm deps
[target.'cfg(target_family = "wasm")'.dependencies]
wasm-bindgen = "0.2.84"
wasm-bindgen-futures = "0.4.39"
js-sys = "0.3.67"

[target.'cfg(target_family = "wasm")'.dependencies.web-sys]
version = "0.3"
features = [
    "Window",
    "Navigator",
    "console",
    "Usb",
    "UsbDevice",
    "UsbInterface",
    "UsbRecipient",
    "UsbRequestType",
    "UsbControlTransferParameters",
    "UsbDeviceRequestOptions",
    "UsbInTransferResult",
    "UsbOutTransferResult",
    "Storage"
]

# Non-wasm deps
[target.'cfg(not(target_family = "wasm"))'.dependencies]
nusb = "0.1.5"

[dev-dependencies]
tokio-test = "0.4.3"

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

[dependencies]
thiserror = "1.0.56"

[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
dwarf-debug-info = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc", "wasm32-unknown-unknown"]