Crates.io | wasm-pkg-loader |
lib.rs | wasm-pkg-loader |
version | 0.4.1 |
source | src |
created_at | 2024-05-08 20:02:13.451362 |
updated_at | 2024-06-20 20:32:23.961588 |
description | Wasm package loader |
homepage | |
repository | https://github.com/bytecodealliance/wasm-pkg-tools/tree/main/crates/wasm-pkg-loader |
max_upload_size | |
id | 1234340 |
size | 37,909 |
A minimal Package Registry interface for read-only consumers.
wasm-pkg-loader
is intended to be used primarily as a library, but it also
provides a simple CLI interface:
$ wasm-pkg-loader wasi:preview1-command-adapter
Package: wasi:preview1-command-adapter
Versions:
0.2.0
$ wasm-pkg-loader wasi:preview-command-adapter fetch 0.2.0
Fetching release details for wasi:preview1-command-adapter@0.2.0...
Downloading content to "wasi-preview1-command-adapter-0.2.0.wasm"...
The e2e tests require:
The oras
CLI tool to be available in
your local PATH
An OCI Distribution Spec-compliant
registry to be running at localhost:5000
. An ephemeral registry can be run with:
$ docker run --rm -p 5000:5000 distribution/distribution:edge
The e2e tests themselves are in the separate tests/e2e
crate:
$ cd tests/e2e
$ cargo run
Until publisher tooling is developed, the oras
CLI tool can be used to publish packages:
Note: The details of this process (like MIME type) are still being worked on.
$ oras push \
"${OCI_REGISTRY}/${WARG_NAMESPACE}/${PACKAGE_MAME}:${SEMVER}" \
"${WASM_FILE}:application/wasm"
# e.g. to push `component.wasm` as "my-namespace:my-pkg@1.0.0" to `localhost:5000`:
$ oras push \
localhost:5000/my-namespace/my-pkg:1.0.0 \
component.wasm:application/wasm
Note: Some registry implementations may require
--image-spec v1.0
for compatibility with this example.