#package #loader #registry #oci #wasi #interface

wasm-pkg-loader

Wasm package loader

5 releases (3 breaking)

0.4.1 Jun 20, 2024
0.4.0 Jun 20, 2024
0.3.0 May 17, 2024
0.2.0 May 15, 2024
0.1.0 May 8, 2024

#644 in WebAssembly

Download history 965/week @ 2024-09-17 669/week @ 2024-09-24 314/week @ 2024-10-01 364/week @ 2024-10-08 305/week @ 2024-10-15 331/week @ 2024-10-22 624/week @ 2024-10-29 717/week @ 2024-11-05 148/week @ 2024-11-12 51/week @ 2024-11-19 73/week @ 2024-11-26 225/week @ 2024-12-03 230/week @ 2024-12-10 129/week @ 2024-12-17 13/week @ 2024-12-24 128/week @ 2024-12-31

548 downloads per month

Apache-2.0 WITH LLVM-exception

105KB
2K SLoC

Wasm Package Loader

A minimal Package Registry interface for read-only consumers.

CLI

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"...

Running Tests

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

Publishing to OCI

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.

Dependencies

~31–50MB
~781K SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy