wasm-tools 1.251.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;
}

world simple {
    export t;
}

world simple-rename {
    export t;
}

world with-deps {
    export qux;
}

world simple-toplevel {
    export foo: func();
    export something: interface {
        foo: func();
    }
}

world toplevel-deps {
    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;
}

interface a {}
interface b {}

world trim-imports {
  import a;
  import foo: func();
  import bar: interface {}
  type t = u32;
  export b;
}

interface with-dep {
  type t = u32;
}

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