Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ target/
/crates/wasmtime-test
/test.js
/shared
example/package-lock.json
example/hello.component.wasm
examples/hello-world/guest/package-lock.json
examples/hello-world/guest/hello.component.wasm
/build-debug
/build-release
/build-release-weval
Expand Down
4 changes: 2 additions & 2 deletions EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ node componentize.mjs

### Running the Component in Wasmtime

Set up the [Cargo.toml as in the example directory](example/Cargo.toml).
Set up the [Cargo.toml as in the example directory](examples/hello-world/host/Cargo.toml).

Set up [`src/main.rs`](example/src/main.rs) as in the example directory.
Set up [`src/main.rs`](examples/hello-world/host/src/main.rs) as in the example directory.

Building and running the binary should print the result:

Expand Down
Binary file removed examples/hello-world/guest/hello.component.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions examples/hello-world/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export TEST_BINARY_PATH=$(realpath host)/target/release/wasmtime-test
# Build the JS component if not present
echo -e "[info] expecting component WASM at [$COMPONENT_WASM_PATH]...";
if [ ! -f "$COMPONENT_WASM_PATH" ]; then
cd guest && npm install && npm build
cd guest && npm install && npm run build && cd ..
fi

# Build the Rust embedding test binary if not present
echo -e "[info] expecting test binary at [$COMPONENT_WASM_PATH]...";
echo -e "[info] expecting test binary at [$TEST_BINARY_PATH]...";
if [ ! -f "$TEST_BINARY_PATH" ]; then
cd host && cargo build --release
cd host && cargo build --release && cd ..
fi

# Run the test binary, capturing the output
Expand Down