wasm-tools 1.246.0

CLI tools for interoperating with WebAssembly files
Documentation
/// RUN[simple]: component wit --importize-world simple %
/// RUN[simple-rename]: component wit --importize-world simple-rename --importize-out-world-name test-rename  %
/// RUN[simple-component]: component embed --dummy --world simple % | /
///                        component wit --importize
/// RUN[with-deps]: component wit --importize-world with-deps %
/// RUN[simple-toplevel]: component wit --importize-world simple-toplevel %
/// RUN[toplevel-deps]: component wit --importize-world toplevel-deps %
/// FAIL[fail1]: component wit --importize-world fail1 %
/// RUN[trim-imports]: component wit --importize-world trim-imports %
/// RUN[tricky-import]: component wit --importize-world tricky-import %
package importize:importize;

interface t {
  resource r;
}

interface bar {
  use t.{r};

  record foo {
    x: string,
  }

  importize: func(name: r);
}

interface qux {
  use bar.{foo};

  blah: func(boo: foo);
}

interface something-else-dep {
  type t = u32;
}

interface a {
}

interface b {
}

interface with-dep {
  type t = u32;
}

world simple {
  export t;
}
world simple-rename {
  export t;
}
world with-deps {
  import t;
  import bar;

  export qux;
}
world simple-toplevel {
  export foo: func();
  export something: interface {
    foo: func();
  }
}
world toplevel-deps {
  import something-else-dep;

  type s = u32;

  export bar: func() -> s;
  export something-else: interface {
    use something-else-dep.{t};

    bar: func() -> t;
  }
}
world fail1 {
  type foo = u32;

  export foo: func() -> foo;
}
world trim-imports {
  import a;
  import bar: interface {
  }

  type t = u32;
  import foo: func();

  export b;
}
world tricky-import-importized {
  import with-dep;
  use with-dep.{t};
  import f: func() -> t;
}