From 8c59acc69efd023108709860a484c612bd6db9e5 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Sun, 4 Oct 2026 17:27:17 -0400 Subject: [PATCH] Add media-types components Contains common OCI related media types constants. Signed-off-by: Scott Andrews --- README.md | 1 + components/media-types/README.md | 3 + .../media-types/wit/media-types.constants.wit | 5 ++ components/media-types/wkg.lock | 12 ++++ components/media-types/wkg.toml | 2 + wit/media-types.wit | 58 +++++++++++++++++++ 6 files changed, 81 insertions(+) create mode 100644 components/media-types/README.md create mode 100644 components/media-types/wit/media-types.constants.wit create mode 100644 components/media-types/wkg.lock create mode 100644 components/media-types/wkg.toml create mode 100644 wit/media-types.wit diff --git a/README.md b/README.md index 38527a7..5e30b6e 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ The cli tools the build uses, [`wasm-tools`](https://github.com/bytecodealliance ### Components - [`client`](./components/client/) +- [`media-types`](./components/media-types/) ## Community diff --git a/components/media-types/README.md b/components/media-types/README.md new file mode 100644 index 0000000..287e083 --- /dev/null +++ b/components/media-types/README.md @@ -0,0 +1,3 @@ +# `media-types` + +Common OCI related media types. diff --git a/components/media-types/wit/media-types.constants.wit b/components/media-types/wit/media-types.constants.wit new file mode 100644 index 0000000..94f9cd0 --- /dev/null +++ b/components/media-types/wit/media-types.constants.wit @@ -0,0 +1,5 @@ +package componentized:oci-component; + +world media-types { + export componentized:oci/media-types@0.1.0-dev; +} diff --git a/components/media-types/wkg.lock b/components/media-types/wkg.lock new file mode 100644 index 0000000..5b9a143 --- /dev/null +++ b/components/media-types/wkg.lock @@ -0,0 +1,12 @@ +# This file is automatically generated. +# It is not intended for manual editing. +version = 1 + +[[packages]] +name = "wasi:clocks" +registry = "wasi.dev" + +[[packages.versions]] +requirement = "=0.3.0" +version = "0.3.0" +digest = "sha256:59e1f4079e64ada450e19ffc9d08854c904e356ed8cc1fda36ff4fe150264db2" diff --git a/components/media-types/wkg.toml b/components/media-types/wkg.toml new file mode 100644 index 0000000..5d5ee40 --- /dev/null +++ b/components/media-types/wkg.toml @@ -0,0 +1,2 @@ +[overrides] +"componentized:oci" = { path = "../../wit" } diff --git a/wit/media-types.wit b/wit/media-types.wit new file mode 100644 index 0000000..d21bc31 --- /dev/null +++ b/wit/media-types.wit @@ -0,0 +1,58 @@ +/// Common OCI related media types +@since(version = 0.1.0-dev) +interface media-types { + /// Content Descriptor + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.descriptor.v1+json" + application-vnd-oci-descriptor-v1-json: func() -> string; + + /// OCI Layout + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.layout.header.v1+json" + application-vnd-oci-layout-header-v1-json: func() -> string; + + /// Image Index + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.image.index.v1+json" + application-vnd-oci-image-index-v1-json: func() -> string; + + /// Image manifest + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.image.manifest.v1+json" + application-vnd-oci-image-manifest-v1-json: func() -> string; + + /// Image config + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.image.config.v1+json" + application-vnd-oci-image-config-v1-json: func() -> string; + + /// "Layer", as a tar archive + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.image.layer.v1.tar" + application-vnd-oci-image-layer-v1-tar: func() -> string; + + /// "Layer", as a tar archive compressed with gzip + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.image.layer.v1.tar+gzip" + application-vnd-oci-image-layer-v1-tar-gzip: func() -> string; + + /// "Layer", as a tar archive compressed with zstd + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.image.layer.v1.tar+zstd" + application-vnd-oci-image-layer-v1-tar-zstd: func() -> string; + + /// Empty for unused descriptors + /// https://specs.opencontainers.org/image-spec/media-types/#oci-image-media-types + /// @value "application/vnd.oci.empty.v1+json" + application-vnd-oci-empty-v1-json: func() -> string; + + /// WASM config + /// https://tag-runtime.cncf.io/wgs/wasm/deliverables/wasm-oci-artifact/#configmediatype-applicationvndwasmconfigv0json + /// @value "application/vnd.wasm.config.v0+json" + application-vnd-wasm-config-v0-json: func() -> string; + + /// WASM + /// https://www.iana.org/assignments/media-types/application/wasm + /// @value "application/wasm" + application-wasm: func() -> string; +}