@@ -22,24 +22,14 @@ Install [`wasmtime`](https://github.com/bytecodealliance/wasmtime#installation):
22
22
``` sh
23
23
curl https://wasmtime.dev/install.sh -sSf | bash
24
24
```
25
- Clone the [ component-docs] ( https://github.com/bytecodealliance/component-docs ) repo:
26
- ``` sh
27
- git clone https://github.com/bytecodealliance/component-docs
28
- ```
29
25
30
26
## 2. Scaffolding a Component
31
27
32
28
We will create a component in Rust that implements the ` add ` function exported
33
- by the [ ` adder ` world] [ docs-adder ] world in the
34
- ` docs:adder `
29
+ by the [ ` adder ` world] [ docs-adder ] world in the ` docs:adder `
35
30
[ package] ( https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#package-names ) .
36
31
37
- First ` cd ` into the ` tutorial ` directory found in the repo we just cloned:
38
- ``` sh
39
- cd component-docs/component-model/examples/tutorial
40
- ```
41
-
42
- Now create a new WebAssembly component package called ` add ` :
32
+ First, we will create a new WebAssembly component package called ` add ` :
43
33
``` sh
44
34
cargo component new add --lib && cd add
45
35
```
@@ -183,7 +173,7 @@ Because the `docs:adder` package is in a different project, we must first tell `
183
173
184
174
``` toml
185
175
[package .metadata .component .target .dependencies ]
186
- "docs:adder" = { path = " ../wit/ adder" } # directory containing the WIT package
176
+ "docs:adder" = { path = " ../adder/wit " } # directory containing the WIT package
187
177
```
188
178
189
179
> [ !NOTE]
@@ -294,8 +284,8 @@ As mentioned above, `cargo component build` doesn't generate a WIT file for a co
294
284
295
285
```toml
296
286
[package.metadata.component.target.dependencies]
297
- "docs:calculator" = { path = "../wit/ calculator" }
298
- "docs:adder" = { path = "../wit/ adder" }
287
+ "docs:calculator" = { path = "../calculator/wit " }
288
+ "docs:adder" = { path = "../adder/wit " }
299
289
```
300
290
301
291
> If the external package refers to other packages, you need to provide the paths to them as well.
0 commit comments