Skip to content

Commit

Permalink
Merge pull request #163 from kate-goldenring/use-wac-plug
Browse files Browse the repository at this point in the history
fix: use wac plug in tutorial and running guide
  • Loading branch information
kate-goldenring authored Oct 9, 2024
2 parents 94eb52f + e660f42 commit 8e38718
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion component-model/examples/tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ world app {
}
```


To expand the exercise to add more components, add another operator world, expand the enum, and modify the `command` component to call it.

## Building and running the example
Expand Down
2 changes: 1 addition & 1 deletion component-model/src/creating-and-consuming/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you're writing a library-style component - that is, one that exports a custom

4. Build your command component to a `.wasm` file. You will not be able to run this in `wasmtime` yet, as its imports are not yet satisfied.

5. Compose your command component with your library component by running `wasm-tools compose <path/to/command.wasm> -d <path/to/library.wasm> -o main.wasm`.
5. Compose your command component with your library component by running `wac plug <path/to/command.wasm> --plug <path/to/library.wasm> -o main.wasm`.

6. Run the composed component using `wasmtime run main.wasm`

Expand Down
6 changes: 3 additions & 3 deletions component-model/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ For reference, see a completed [example](https://github.com/bytecodealliance/com
## Composing the calculator

Now, we are ready to bring our components together into one runnable calculator component, using
`wasm-tools`. We will first compose the calculator component with the add component to satisfy it's
`wac`. We will first compose the calculator component with the add component to satisfy it's
imports. We then compose that resolved calculator component with the command component to satisfy
its `calculate` imports. The result is a command component that has all its imports satisfied and
exports the `wasi:cli/run` function, which can be executed by `wasmtime`.

```sh
wasm-tools compose calculator.wasm -d adder.wasm -o composed.wasm
wasm-tools compose command.wasm -d composed.wasm -o final.wasm
wac plug calculator.wasm --plug adder.wasm -o composed.wasm
wac plug command.wasm --plug composed.wasm -o final.wasm
```

> If you'd prefer to take a more visual approach to composing components, see the [documentation on composing components with wasmbuilder.app](creating-and-consuming/composing.md#composing-components-with-a-visual-interface).
Expand Down

0 comments on commit 8e38718

Please sign in to comment.