Skip to main content

camel_wit/
lib.rs

1/// WIT source for the `plugin` world (standalone file).
2pub const PLUGIN_WIT: &str = include_str!("../wit/camel-plugin.wit");
3
4/// WIT source for the `bean` world (standalone file, same package as PLUGIN_WIT).
5pub const BEAN_WIT: &str = include_str!("../wit/camel-bean.wit");
6
7/// Combined WIT package with both `plugin` and `bean` worlds in a single document.
8pub const FULL_WIT: &str = include_str!("../wit/camel-all.wit");
9
10/// Absolute path to the `wit/` directory bundled with this crate.
11///
12/// This path is resolved at **compile time** via `CARGO_MANIFEST_DIR` and
13/// points to the `camel-wit` source directory (local path dep or registry
14/// unpack location). It is stable during builds and in development tooling,
15/// but is **not** a reliable runtime path in redistributed binaries.
16///
17/// Prefer the `*_WIT` string constants for embedding WIT content robustly.
18/// Use this only for CLI tooling that needs filesystem access at build/dev time
19/// (e.g. `wasm-tools`, `wit-bindgen` CLI invoked from a build script).
20pub fn wit_dir() -> &'static std::path::Path {
21    std::path::Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/wit"))
22}