feat(sdk): rename attribute to #[chain_module], keep #[fai_module] alias
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s

The public macro name was the last product-scoped 'fai' identifier
in the SDK surface. #[chain_module] is now the primary attribute
(README + examples updated); #[fai_module] stays as a delegating
alias so modules written before the rename keep compiling. 0.2.1.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-07-11 19:02:40 +02:00
parent 40f3dbd885
commit 4b4de3374c
9 changed files with 33 additions and 19 deletions

View file

@ -5,7 +5,7 @@
//! ```ignore
//! use chain_module_sdk::prelude::*;
//!
//! #[fai_module]
//! #[chain_module]
//! fn invoke(_ctx: Context, inputs: Inputs) -> Result<Outputs, ModuleError> {
//! let text = inputs.require_text("input")?;
//! Ok(Outputs::new().with_text("output", format!("got: {text}")))
@ -36,9 +36,9 @@ pub use inputs::Inputs;
pub use outputs::Outputs;
pub use payload::{BytesValue, FileRef, Payload};
pub use chain_module_sdk_macros::fai_module;
pub use chain_module_sdk_macros::{chain_module, fai_module};
// Emit-hook plumbing used by the `#[fai_module]` expansion (wasm32)
// Emit-hook plumbing used by the `#[chain_module]` expansion (wasm32)
// so `Context::emit` reaches the WIT `emit-event` host import.
#[doc(hidden)]
pub use host::__set_emit_hook;
@ -48,11 +48,12 @@ pub(crate) use host::emit;
/// every type a typical module needs into scope.
pub mod prelude {
pub use super::{
BytesValue, Context, FileRef, Inputs, ModuleError, Outputs, Payload, fai_module,
BytesValue, Context, FileRef, Inputs, ModuleError, Outputs, Payload, chain_module,
fai_module,
};
}
/// Internal re-exports the `#[fai_module]` macro expansion depends on.
/// Internal re-exports the `#[chain_module]` macro expansion depends on.
///
/// Not part of the public API. Anything in this module may change
/// between SDK patch releases.