Gunnar

nordisk/gunnar-ui

crates/gunnar-ui-build-thing/Cargo.toml

# gunnar-ui's **build thing**, as the dwarves forge finds it: a `cdylib` named
# `<repo>-build-thing` over `gunnar-ui-recipe`'s declaration.
#
# ## A SHIM — the recipe is `gunnar-ui-recipe`
#
# dwarves' code road (`dwarves/crates/dwarves/src/build_thing/code.rs`) looks for
# a package named `<repo>-build-thing` at `crates/<name>` or the repository root
# and REFUSES it unless `[lib] crate-type` contains `cdylib` (a wasm32 build of
# an rlib emits no `.wasm`). So both the name and the crate-type are a contract
# with another repository.
#
# A `cdylib` lib gets no `--extra-filename`, so two units of it overwrite one
# rlib (cargo#6313). NOTHING may depend on this crate: `xtask` depends on
# `gunnar-ui-recipe`. This crate is the re-export, the wasm ABI macro and the
# `emit` door.
[package]
name = "gunnar-ui-build-thing"
description = "gunnar-ui's build thing as the dwarves forge loads it: the wasm32 cdylib exporting nornir-build-thing's plugin ABI over gunnar-ui-recipe's declaration, plus the `emit` door that writes .nornir/build-variants.toml."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
publish.workspace = true

[lib]
name = "gunnar_ui_build_thing"
# The contract with dwarves (header). `cdylib` is the wasm32 plugin; `rlib` is
# what this crate's own `[[bin]]` links.
crate-type = ["cdylib", "rlib"]

[[bin]]
# `cargo run -p gunnar-ui-build-thing -- emit` is the documented door that writes
# `.nornir/build-variants.toml`; the emitted file's header names that command.
name = "gunnar-ui-build-thing"
path = "src/main.rs"

[dependencies]
# The recipe. Everything this crate exports is the recipe's, re-exported.
gunnar-ui-recipe = { version = "1.5.0", path = "../gunnar-ui-recipe" }
# `export_build_thing!` and the `plugin::BuildThing` trait the macro needs in
# scope — the same entry the recipe uses, so the two cannot resolve to different
# versions of the ABI. From the registry, never a sibling path: see the recipe's
# manifest for why this repository may not reach outside its own checkout.
nornir-build-thing = { version = "0.2.0", default-features = false }
anyhow = "1"