diff --git a/Cargo.lock b/Cargo.lock index 9e10b9f..bdb604a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,6 +14,14 @@ version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +[[package]] +name = "client" +version = "0.1.0" +dependencies = [ + "url", + "wit-bindgen", +] + [[package]] name = "displaydoc" version = "0.2.7" @@ -122,14 +130,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "http-client" -version = "0.1.0" -dependencies = [ - "url", - "wit-bindgen", -] - [[package]] name = "icu_collections" version = "2.2.0" diff --git a/Makefile b/Makefile index c6397c5..25db4ec 100644 --- a/Makefile +++ b/Makefile @@ -66,9 +66,12 @@ ifndef REPOSITORY endif @$(eval FILE := $(@:publish-%=%)) @$(eval COMPONENT := $(if $(filter %.debug.wasm,$(FILE)),$(FILE:%.debug.wasm=%),$(FILE:%.wasm=%))) - @$(eval TITLE := $(if $(filter %.debug.wasm,$(FILE)),$(COMPONENT) (debug),$(COMPONENT))) + @$(eval TITLE := $(subst /,:,$(GITHUB_REPOSITORY))$(if $(filter interface,$(COMPONENT)),,-$(COMPONENT))$(if $(filter %.debug.wasm,$(FILE)), (debug))) @$(eval DESCRIPTION := $(shell head -n 3 "lib/${FILE}.md" | tail -n 1)) - @$(eval REVISION := $(shell git rev-parse HEAD)$(shell git diff --quiet HEAD && echo "+dirty")) + @$(eval COMMIT := $(shell git rev-parse HEAD)) + @$(eval README_DIR := $(if $(wildcard components/$(COMPONENT)/README.md),/components/$(COMPONENT))) + @$(eval URL := https://github.com/${GITHUB_REPOSITORY}/tree/${COMMIT}${README_DIR}) + @$(eval REVISION := ${COMMIT}$(shell git diff --quiet HEAD || echo "+dirty")) @$(eval COMPONENT_VERSION := $(if $(filter %.debug.wasm,$(FILE)),${VERSION}+debug,${VERSION})) @$(eval TAG := $(patsubst v%,%,$(subst +,_,$(COMPONENT_VERSION)))) @$(eval IMAGE := $(if $(filter interface.wasm,$(FILE)),${REPOSITORY}:${TAG},${REPOSITORY}/${COMPONENT}:${TAG})) @@ -79,6 +82,7 @@ endif --annotation "org.opencontainers.image.title=${TITLE}" \ --annotation "org.opencontainers.image.description=${DESCRIPTION}" \ --annotation "org.opencontainers.image.version=${COMPONENT_VERSION}" \ + --annotation "org.opencontainers.image.url=${URL}" \ --annotation "org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}.git" \ --annotation "org.opencontainers.image.revision=${REVISION}" \ --annotation "org.opencontainers.image.licenses=Apache-2.0" \ diff --git a/README.md b/README.md index f4b6065..6f8b330 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ make components ### Components -- [`http-client`](./components/http-client/) +- [`client`](./components/client/) ## Community diff --git a/components/http-client/Cargo.toml b/components/client/Cargo.toml similarity index 90% rename from components/http-client/Cargo.toml rename to components/client/Cargo.toml index 51745c1..25e24c3 100644 --- a/components/http-client/Cargo.toml +++ b/components/client/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "http-client" +name = "client" version = "0.1.0" edition = "2024" license = "Apache-2.0" diff --git a/components/http-client/README.md b/components/client/README.md similarity index 93% rename from components/http-client/README.md rename to components/client/README.md index 2dcab4f..60ce4d3 100644 --- a/components/http-client/README.md +++ b/components/client/README.md @@ -1,4 +1,4 @@ -# `http-client` +# `client` A higher-level HTTP client that delegates to wasi:http/client. @@ -17,7 +17,7 @@ A higher-level HTTP client that delegates to wasi:http/client. - `trace(url, headers, options)` - `query(url, headers, body, options)` -## The `http-client` World +## The `client` World - exports `componentized:http/client` - imports `wasi:http/client@0.3.1` diff --git a/components/http-client/src/lib.rs b/components/client/src/lib.rs similarity index 99% rename from components/http-client/src/lib.rs rename to components/client/src/lib.rs index 8cdb852..d812a1b 100644 --- a/components/http-client/src/lib.rs +++ b/components/client/src/lib.rs @@ -2,7 +2,7 @@ use url::Url; wit_bindgen::generate!({ path: "../wit", - world: "http-client", + world: "client", generate_all, }); diff --git a/components/wit/worlds.wit b/components/wit/worlds.wit index 18cb318..037bbc6 100644 --- a/components/wit/worlds.wit +++ b/components/wit/worlds.wit @@ -1,6 +1,6 @@ package componentized:components; -world http-client { +world client { import wasi:http/client@0.3.0; export componentized:http/client@0.1.0-dev; }