znippy_common/plugins/mod.rs
1//! Plugin source, split the same way the repo-root `plugins/` directory is
2//! split: `native/` for handlers compiled into the host binary, `wasm/` for the
3//! host-side loader of `wasm32-unknown-unknown` modules. No handler source sits
4//! loose beside this file — `znippy-common/tests/plugin_source_layout.rs`
5//! asserts that, and fails naming the stray file.
6//!
7//! The two directories under `znippy-common/src/plugins/` hold **modules**; the
8//! two under the repo root hold **crates**. Same rule, two tiers — which tier a
9//! handler is born into is decided by its dependencies (rule **P-5**,
10//! `.nornir/plugins-design.md` §f3), not by taste.
11//!
12//! ## The module paths are published API
13//!
14//! `znippy_common::plugins::cargo_native::CargoPlugin` and its five siblings are
15//! reached from *outside* this workspace — `holger/traits/src/lib.rs` names them
16//! in non-test code, and several `holger/server/repository/*` crates depend on
17//! `znippy-common` **by version**, so they follow a published path and cannot
18//! follow a directory rename. The `pub use` lines below keep those exact paths
19//! alive; they are the whole compatibility story, and no handler code is
20//! duplicated to provide them.
21
22pub mod native;
23
24#[cfg(feature = "wasm-plugins")]
25pub mod wasm;
26
27// ── Published paths. Do not remove: out-of-workspace consumers resolve
28// `znippy_common::plugins::<x>_native::<X>Plugin` through these. ──
29pub use native::{
30 cargo_native, conda_native, deb_native, gem_native, npm_native, rpm_native, skeletons,
31};
32
33#[cfg(feature = "wasm-plugins")]
34pub use wasm::wasm_loader;