1b23a14ee7
docs/api/mods-reference.md lists every capability, world, interface, type, function and hook of horizon:mods, generated from crates/horizon-mod-sdk/wit/horizon.wit and the manifest's capabilities by a test in horizon-mods (feature pack, as CI runs it). The test fails when the page is out of date (HORIZON_WRITE_DOCS=1 rewrites it), when a function has no doc comment, or when a capability grants an interface the contract lacks. The WIT's undocumented functions and fields get doc comments (no change to the contract itself). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.4 KiB
TOML
40 lines
1.4 KiB
TOML
[package]
|
|
name = "horizon-mods"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version = "1.86"
|
|
description = "Horizon's mod runtime: sandboxed WebAssembly components (docs/mods.md)"
|
|
|
|
[dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "1.1.6"
|
|
zip = { version = "2", default-features = false, features = ["deflate"] }
|
|
log = "0.4"
|
|
# The 36 LTS line: security fixes until August 2027, and it builds on the client's Rust.
|
|
wasmtime = { version = "36.0.18", default-features = false, features = ["runtime", "cranelift", "component-model", "std"], optional = true }
|
|
# Turns a mod's core module into a component (cargo horizon-mod build, the tests).
|
|
wit-component = { version = "0.239", optional = true }
|
|
wit-parser = { version = "0.239", optional = true }
|
|
|
|
[features]
|
|
# Loads and runs mods (the game's `mods` feature); without it only manifests,
|
|
# content and packaging. Off by default so builds that don't run mods (the
|
|
# game's tests and probes) skip wasmtime and cranelift.
|
|
runtime = ["dep:wasmtime"]
|
|
pack = ["dep:wit-component", "dep:wit-parser"]
|
|
|
|
# Runs real mods: `cargo test -p horizon-mods --features runtime,pack`.
|
|
[[test]]
|
|
name = "sandbox"
|
|
required-features = ["runtime", "pack"]
|
|
|
|
# docs/api/mods-reference.md from the WIT contract (HORIZON_WRITE_DOCS=1 rewrites it).
|
|
[[test]]
|
|
name = "api_reference"
|
|
required-features = ["pack"]
|
|
|
|
[lints]
|
|
workspace = true
|