From 4c3e159aac05b4e9e4e82bad25724af9dacd8aa5 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Thu, 8 Oct 2026 15:57:19 -0400 Subject: [PATCH 1/2] Polish wit - rename method to create - bump @since to 0.3.0-dev since the interface while very similar is effectively new. Signed-off-by: Scott Andrews --- wit/factory.wit | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wit/factory.wit b/wit/factory.wit index 433c4f1..2d07caa 100644 --- a/wit/factory.wit +++ b/wit/factory.wit @@ -1,7 +1,8 @@ -@since(version = 0.2.0) +@since(version = 0.3.0-dev) interface factory { use componentized:component/types@0.1.0.{wasm, error-code}; - @since(version = 0.2.0) - build-component: func(values: list>) -> result; + /// Create a component implementing `wasi:config/store` with the provided values. + @since(version = 0.3.0-dev) + create: func(values: list>) -> result; } \ No newline at end of file From f5be7ec4ff1f6a98347547335d2e0bb52383fa44 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Thu, 8 Oct 2026 16:06:11 -0400 Subject: [PATCH 2/2] cleanup Signed-off-by: Scott Andrews --- Makefile | 12 ++++++++++-- README.md | 2 +- components/factory/src/lib.rs | 2 +- components/factory/tests/factory.rs | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a020d9e..918f3cd 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ CONFIG_ADAPTER_WASM := crates/componentized-static-config/constants-config.wasm .PHONY: all -all: build components +all: build components test .PHONY: build build: config @@ -49,13 +49,21 @@ install: config cargo +$(RUST_TOOLCHAIN) install --path . --locked .PHONY: clean -clean: clean-wit +clean: clean-components clean-wit + @: + +.PHONY: clean-all +clean-all: clean-components clean-tools clean-wit cargo clean .PHONY: clean-components clean-components: clean-wit rm -rf ${COMPONENTS_DIR} +.PHONY: clean-tools +clean-tools: + rm -rf ${TOOLS_DIR} + .PHONY: clean-wit ## Remove the fetched wit dependencies, fetched again by `make wit` clean-wit: rm -rf wit/deps components/wit/deps components/*/wit/deps diff --git a/README.md b/README.md index 08e668b..606b1db 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Static config components -Create custom wasi:config components with static values. +Create custom `wasi:config` components with static values. - [Build](#build) - [Community](#community) diff --git a/components/factory/src/lib.rs b/components/factory/src/lib.rs index aade62c..d3b0252 100644 --- a/components/factory/src/lib.rs +++ b/components/factory/src/lib.rs @@ -6,7 +6,7 @@ use componentized_static_config::create_component; pub(crate) struct Factory; impl Guest for Factory { - fn build_component(values: Vec<(String, String)>) -> Result { + fn create(values: Vec<(String, String)>) -> Result { let output = create_component(values).map_err(|e| ErrorCode::Other(Some(e.to_string())))?; Ok(output) } diff --git a/components/factory/tests/factory.rs b/components/factory/tests/factory.rs index b336b22..5d40c3c 100644 --- a/components/factory/tests/factory.rs +++ b/components/factory/tests/factory.rs @@ -62,7 +62,7 @@ fn build_component(engine: &Engine, values: &[(&str, &str)]) -> Result> &mut store, &instance, FACTORY_INTERFACE, - "build-component", + "create", &[values], )? { Val::Result(Ok(Some(bytes))) => match *bytes {