diff --git a/README.md b/README.md
index 990d042..ff7fb58 100644
--- a/README.md
+++ b/README.md
@@ -175,6 +175,17 @@ world root {
This component can be used anywhere that WASI 0.2 components can be used. For example, use `wasm-tools compose` as illustrated above.
+### Referencing Wit Packages
+
+By default the project will find all wit files and execute wit-bindgen against each one. This is makes it easy to get started with a single wit file. If you have more complicated wit files, then you can create wit packages. To use folder with all the wit in it you can add the following to your `.csproj`.
+
+```xml
+
+
+
+
+```
+
### WIT strings and memory
The calculator example above works easily because it doesn't need to allocate memory dynamically. Once you start working with strings, you must add an extra line to the `` in your _host_ `.csproj` file (that is, the application that's _importing_ the interface):
diff --git a/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs b/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs
index fecdd40..e52c153 100644
--- a/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs
+++ b/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs
@@ -30,6 +30,13 @@ public void CanBuildComponentWithExport()
Assert.Contains("export test:producer-consumer/operations", witInfo);
}
+ [Fact]
+ public void CanBuildComponentWithWitPackage()
+ {
+ var witInfo = GetWitInfo(FindModulePath($"../testapps/AppWithWitFolder/bin/{Config}", "appwithwitfolder-component.wasm"));
+ Assert.Contains("import test:pkg/folder", witInfo);
+ }
+
[Fact]
public void CanComposeImportWithExport()
{
diff --git a/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj b/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj
index 9f7bff0..bf6eba0 100644
--- a/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj
+++ b/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj
@@ -28,6 +28,7 @@
+
diff --git a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj
new file mode 100644
index 0000000..7962b9c
--- /dev/null
+++ b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+ true
+ wasi-wasm
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/program.cs b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/program.cs
new file mode 100644
index 0000000..d0b58d6
--- /dev/null
+++ b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/program.cs
@@ -0,0 +1 @@
+ImportstestWorld.wit.imports.test.pkg.v0_2_0.FolderInterop.Folder();
diff --git a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/wit/imports.wit b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/wit/imports.wit
new file mode 100644
index 0000000..9f2e0ff
--- /dev/null
+++ b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/wit/imports.wit
@@ -0,0 +1,5 @@
+interface folder { folder: func();}
+
+world imports {
+ import folder;
+}
diff --git a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/wit/world.wit b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/wit/world.wit
new file mode 100644
index 0000000..1a89340
--- /dev/null
+++ b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/wit/world.wit
@@ -0,0 +1,5 @@
+package test:pkg@0.2.0;
+
+world importstest {
+ include imports;
+}