[package]
name = "holtburger-resource-http"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "HTTP-backed ResourceSource for holtburger-dat — wasm32-only. Fetches an HBA bundle once at construction time, then serves the existing sync ResourceSource trait from in-memory state. Empty crate on native targets."

# Wasm32-only crate. The lib.rs body is gated to `target_arch = "wasm32"`
# so `cargo check` / `cargo test` on native still walk the workspace
# without dragging in `web-sys` or wasm-bindgen-futures; the
# browser-only deps are likewise target-gated below. Mirrors the layout
# of `crates/holtburger-transport-ws`.

[dependencies]
holtburger-dat = { workspace = true }
holtburger-manifest = { workspace = true }
# `futures` is needed unconditionally because the `inflight` URL-fetch
# dedup primitive (F.35) uses `futures::future::Shared` and is
# target-agnostic so its native tests run under cargo test. Browser
# `fetch_bytes` futures still only compile under wasm32 — see the
# target-gated `[target.'cfg(target_arch="wasm32")'.dependencies]`
# block below for the web-sys/wasm-bindgen deps.
futures = { workspace = true }

[dev-dependencies]
# Native test runner for `inflight` dedup tests.
tokio = { workspace = true, features = ["rt", "macros", "time", "rt-multi-thread", "sync"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
log = { workspace = true }
serde_json = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
version = "0.3"
features = [
    "Headers",
    "Request",
    "RequestInit",
    "RequestMode",
    "Response",
    "Window",
    "WorkerGlobalScope",
]
