crates/dwarves-web-client/Cargo.toml
[package]
name = "dwarves-web-client"
version = "0.1.4"
edition = "2021"
description = "The grpc-web (browser) client for dwarves-server's `dwarf.v1` forge service. REUSES the SAME proto (crates/dwarves-embed/proto/dwarf.proto) → the SAME generated tonic `DwarfClient` + message types the native embed client uses; only the TRANSPORT differs — on wasm it rides `tonic-web-wasm-client` (grpc-web over the browser `fetch` API), where the native client rides a tonic Channel. Bearer auth is the standard `authorization: Bearer <token>` grpc metadata. Its own crate so the wasm demo (dwarves-gui) can link a browser-safe forge client WITHOUT the heavy native `dwarves-embed` (which pulls the whole forge domain + jera + facett)."
license = "MIT OR Apache-2.0"
repository = "https://git.gunnar.rs/nordisk/dwarves"
# publish = true (2026-08-23) — required by `dwarves-gui`, which now publishes so the
# `dwarves-ui-gpu` binary can ship. The `false` here named no condition either.
publish = true
[dependencies]
# The generated `dwarf.v1` client + message types. Client-only codegen (no server, no
# transport): the transport is supplied per-target below. Mirrors dwarves-embed's tonic
# pins so cargo unifies on ONE `tonic`/`prost`.
tonic = { version = "0.14", default-features = false, features = ["codegen"] }
prost = "0.14"
tonic-prost = "0.14"
# ── wasm (the browser transport) ─────────────────────────────────────────────
# `tonic-web-wasm-client` is the tonic transport for grpc-web in the browser (it drives
# the fetch API under the hood). Only linked for wasm; the native side of this crate is
# just the generated `pb` types (the native LIVE client is `dwarves-embed`, unchanged).
# 0.9, not 0.7: 0.7 implements tonic 0.13's `Service`, and this crate generates its
# client with tonic 0.14 (line 16), so on wasm32 `DwarfClient::new(Client::new(..))`
# did not type-check (E0277/E0599, measured on oden 2026-09-29). 0.9 is on tonic 0.14.
[target.'cfg(target_arch = "wasm32")'.dependencies]
tonic-web-wasm-client = "0.9"
[build-dependencies]
# Pure-Rust proto codegen (no protoc/C — the nordisk zero-shell charter), exactly like
# crates/dwarves-embed/build.rs. Points at the SAME proto file so the generated client +
# message set are byte-identical to the native embed client's.
tonic-prost-build = { version = "0.14" }
protox = "0.9"