Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: The new version of the interface package and crates, e.g. 0.1.0 or 0.2.0-dev
required: true
type: string
default: "0.0.0-dev" # the current version, kept current by scripts/bump-version.sh
default: "0.1.0" # the current version, kept current by scripts/bump-version.sh

jobs:
# bumps the version with read only access, the changes are handed to the pull-request job as a
Expand Down
14 changes: 7 additions & 7 deletions components/wit-tools/tests/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use wasmtime::{
component::{Component, Instance, Linker, Val},
};

const WIT_INTERFACE: &str = "componentized:component/wit@0.0.0-dev";
const WIT_INTERFACE: &str = "componentized:component/wit@0.1.0";

/// The root of the repository, where the Makefile is.
fn repo_root() -> &'static Path {
Expand Down Expand Up @@ -304,11 +304,11 @@ fn summarize_itself() {

assert_eq!(
strings(field(&summary, "imports")),
vec!["componentized:component/types@0.0.0-dev"]
vec!["componentized:component/types@0.1.0"]
);
assert_eq!(
strings(field(&summary, "exports")),
vec!["componentized:component/wit@0.0.0-dev"]
vec!["componentized:component/wit@0.1.0"]
);
}

Expand All @@ -333,7 +333,7 @@ fn summarize_parsed() {

assert_eq!(
strings(field(&summary, "exports")),
vec!["componentized:component/wit@0.0.0-dev"]
vec!["componentized:component/wit@0.1.0"]
);
}

Expand Down Expand Up @@ -396,7 +396,7 @@ fn print_itself() {
assert_eq!(printed, expected_print(&own_bytes));
assert!(printed.starts_with("package root:component;\n"));
assert_eq!(printed.matches("package root:component").count(), 1);
assert!(printed.contains("package componentized:component@0.0.0-dev {"));
assert!(printed.contains("package componentized:component@0.1.0 {"));
}

#[test]
Expand Down Expand Up @@ -480,7 +480,7 @@ fn print_itself_without_additional_packages() {

assert_eq!(
printed,
"package root:component;\n\nworld root {\n import componentized:component/types@0.0.0-dev;\n\n export componentized:component/wit@0.0.0-dev;\n}\n"
"package root:component;\n\nworld root {\n import componentized:component/types@0.1.0;\n\n export componentized:component/wit@0.1.0;\n}\n"
);
}

Expand All @@ -507,7 +507,7 @@ fn print_itself_selected_packages() {
.expect("prints");
// componentized:component is the only other package
assert_eq!(printed, all);
assert!(printed.contains("package componentized:component@0.0.0-dev {"));
assert!(printed.contains("package componentized:component@0.1.0 {"));
}

#[test]
Expand Down
30 changes: 15 additions & 15 deletions components/wit/worlds.wit
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
package componentized:components;

world wit-tools {
export componentized:component/wit@0.0.0-dev;
export componentized:component/wit@0.1.0;
}

world filesystem-loader {
import wasi:filesystem/types@0.3.0;
import wasi:filesystem/preopens@0.3.0;
import componentized:component/types@0.0.0-dev;
export componentized:component/path-loader@0.0.0-dev;
import componentized:component/types@0.1.0;
export componentized:component/path-loader@0.1.0;
}

world http-loader {
import componentized:http/client@0.1.0;
import componentized:component/types@0.0.0-dev;
export componentized:component/path-loader@0.0.0-dev;
import componentized:component/types@0.1.0;
export componentized:component/path-loader@0.1.0;
}

world oci-loader {
import componentized:oci/client@0.1.0;
import componentized:oci/media-types@0.1.0;
import componentized:component/types@0.0.0-dev;
export componentized:component/path-loader@0.0.0-dev;
import componentized:component/types@0.1.0;
export componentized:component/path-loader@0.1.0;
}

world path-loader {
import filesystem-loader: componentized:component/path-loader@0.0.0-dev;
import http-loader: componentized:component/path-loader@0.0.0-dev;
import oci-loader: componentized:component/path-loader@0.0.0-dev;
import filesystem-loader: componentized:component/path-loader@0.1.0;
import http-loader: componentized:component/path-loader@0.1.0;
import oci-loader: componentized:component/path-loader@0.1.0;

import componentized:component/types@0.0.0-dev;
export componentized:component/path-loader@0.0.0-dev;
import componentized:component/types@0.1.0;
export componentized:component/path-loader@0.1.0;
}

world wac-loader {
import componentized:component/types@0.0.0-dev;
export componentized:component/wac-loader@0.0.0-dev;
import componentized:component/types@0.1.0;
export componentized:component/wac-loader@0.1.0;
}

world test-loader-harness {
import componentized:component/path-loader@0.0.0-dev;
import componentized:component/path-loader@0.1.0;
import wasi:cli/environment@0.3.0;
import wasi:cli/stdout@0.3.0;
import wasi:cli/stderr@0.3.0;
Expand Down
14 changes: 7 additions & 7 deletions wit/loaders.wit
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/// Loads a component from a path.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
interface path-loader {
use types.{wasm, error-code};

/// Loads the component at `path`. The forms of path supported depend on the
/// implementation, e.g. a filesystem path, an HTTP URL or an OCI reference.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
load: async func(path: string) -> result<wasm, error-code>;
}

/// Composes components with WAC (WebAssembly Compositions).
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
interface wac-loader {
use types.{wasm, error-code};

type package-name = string;

/// A component, named by the package a WAC composition refers to it as.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
type dependency = tuple<package-name, wasm>;

/// How to compose components.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
variant plan {
/// A WAC script.
wac(string),
Expand All @@ -30,9 +30,9 @@ interface wac-loader {

/// Plugs the exports of each of `plugs` into the matching imports of `socket`, returning the
/// composed component.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
plug: async func(socket: wasm, plugs: list<wasm>) -> result<wasm, error-code>;
/// Composes the `dependencies` as described by `plan`, returning the composed component.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
compose: async func(plan: plan, dependencies: list<dependency>) -> result<wasm, error-code>;
}
8 changes: 4 additions & 4 deletions wit/types.wit
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// Types shared by the interfaces in this package.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
interface types {

/// An error from a call.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
variant error-code {
/// A value cannot be parsed to its expected type.
malformed(malformed),
Expand All @@ -17,7 +17,7 @@ interface types {
}

/// A `malformed` input.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
record malformed {
/// Calls accepting multiple inputs name the one that is malformed.
name: option<string>,
Expand All @@ -26,7 +26,7 @@ interface types {
}

/// The bytes of a WebAssembly binary, a component unless stated otherwise.
@since(version = 0.0.0-dev)
@since(version = 0.1.0)
type wasm = list<u8>;

}
Loading
Loading