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 { 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