Skip to content

Commit 70b5efc

Browse files
fix: wasi preview2 links (#373)
* fix(docs): repair WASI Preview 2 links * ci(docs): check external links on every build * fix(docs): repair links found by external link checking
1 parent ef83411 commit 70b5efc

14 files changed

Lines changed: 24 additions & 23 deletions

File tree

‎.github/actions/mdbook/action.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ runs:
7070
id: book-build
7171
env:
7272
PUBLISH_DOMAIN: ${{ inputs.publish-domain }}
73+
MDBOOK_OUTPUT__LINKCHECK2__FOLLOW_WEB_LINKS: 'true'
7374
run: |
7475
just build-book
7576
echo "output-path=$(just print-book-dir)" >> $GITHUB_OUTPUT

‎component-model/src/design/component-model-concepts.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ must be invoked in an environment that implements those interfaces.
6161
A [_package_](./packages.md) is a set of WIT files
6262
containing a related set of interfaces and worlds.
6363

64-
For example, the [wasi-http](https://github.com/WebAssembly/WASI/blob/main/proposals/http/wit/proxy.wit) package includes
64+
For example, the [wasi-http](https://github.com/WebAssembly/WASI/blob/wasi-0.2/proposals/http/wit/proxy.wit) package includes
6565
an `imports` world encapsulating the interfaces that an HTTP proxy depends on,
6666
and a `proxy` world that depends on `imports`.
6767

‎component-model/src/design/interfaces.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ and imports anything imported by the "wall clock" interface.
5252
Interfaces are defined using [the WIT language](./wit.md).
5353

5454
[wp-contract]: https://en.wikipedia.org/wiki/Design_by_contract
55-
[wasi-http-handler]: https://github.com/WebAssembly/WASI/blob/main/proposals/http/wit/handler.wit
56-
[wasi-clocks-wall-clock]: https://github.com/WebAssembly/WASI/blob/main/proposals/clocks/wit/wall-clock.wit
55+
[wasi-http-handler]: https://github.com/WebAssembly/WASI/blob/wasi-0.2/proposals/http/wit/handler.wit
56+
[wasi-clocks-wall-clock]: https://github.com/WebAssembly/WASI/blob/wasi-0.2/proposals/clocks/wit/wall-clock.wit
5757

5858
> For a more formal definition of an interface, take a look at the [WIT specification](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md).

‎component-model/src/introduction.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ A system or platform may expose some or all of the WASI APIs to components.
8282

8383
The current stable release of WASI is [WASI 0.2.0](https://github.com/WebAssembly/WASI/pull/577),
8484
which was released on January 25, 2024.
85-
WASI 0.2.0 is [a stable set of WIT definitions](https://github.com/WebAssembly/WASI/blob/main/docs/Preview2.md)
85+
WASI 0.2.0 is [a stable set of WIT definitions](https://github.com/WebAssembly/WASI/blob/wasi-0.2/docs/Preview2.md)
8686
that components can target.
8787
WASI proposals will continue to evolve and new ones will be introduced;
8888
however, users of the component model can now pin to any stable release >= `v0.2.0`.

‎component-model/src/language-support/building-a-simple-component/c.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ that is, code which fulfills the definition of the interface function declared i
9797
9898
"P1" refers to [WASI Preview 1](https://github.com/WebAssembly/WASI/tree/wasi-0.1),
9999
the initial version of the WASI APIs.
100-
"P2" refers to [WASI Preview 2](https://github.com/WebAssembly/WASI/blob/main/docs/Preview2.md),
100+
"P2" refers to [WASI Preview 2](https://github.com/WebAssembly/WASI/blob/wasi-0.2/docs/Preview2.md),
101101
which introduced the component model.
102102
103103
While in the past building a P2 component required conversion from a P1 component,

‎component-model/src/language-support/building-a-simple-component/go.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ $ cargo run --release -- 1 2 ../../../go-adder/main.wasm
102102

103103
With this, we have successfully built and run a basic WebAssembly component with Go 🎉
104104

105-
[crates-wasmtime]: https://crates.io/crates/wasmtime
105+
[crates-wasmtime]: https://docs.rs/wasmtime
106106
[repo-component-docs]: https://github.com/bytecodealliance/component-docs
107107
[docs-adder]: https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/tutorial/wit/adder/world.wit
108108
[componentize-go]: https://github.com/bytecodealliance/componentize-go

‎component-model/src/language-support/building-a-simple-component/rust.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ available targets in the toolchain:
88
- `wasm32-wasip2` ([WASI P2][wasip2])
99

1010
[wasm-core]: https://webassembly.github.io/spec/core/
11-
[wasip1]: https://github.com/WebAssembly/WASI/tree/main/legacy
12-
[wasip2]: https://github.com/WebAssembly/WASI/tree/main/wasip2
11+
[wasip1]: https://github.com/WebAssembly/WASI/tree/wasi-0.1
12+
[wasip2]: https://github.com/WebAssembly/WASI/tree/wasi-0.2
1313

1414
> [!NOTE]
1515
> To use the targets above, ensure that they are enabled via the Rust toolchain (e.g. `rustup`).
@@ -31,7 +31,7 @@ cargo build --target wasm32-wasip2
3131
> the project is in the process of being deprecated as native tooling can be used directly.
3232
3333
[rust]: https://rust-lang.org
34-
[cargo-component]: https://crates.io/crates/cargo-component
34+
[cargo-component]: https://github.com/bytecodealliance/cargo-component
3535

3636
## 1. Setup
3737

@@ -138,8 +138,8 @@ types to a module that can be referred to later.
138138

139139
At present, the code won't *do* much, but that's because we haven't added our implementation yet.
140140

141-
[crates-wit-bindgen]: https://crates.io/crates/wit-bindgen
142-
[crates-wit-bindgen-cli]: https://crates.io/crates/wit-bindgen-cli
141+
[crates-wit-bindgen]: https://docs.rs/wit-bindgen
142+
[crates-wit-bindgen-cli]: https://github.com/bytecodealliance/wit-bindgen#cli-installation
143143
[rustdoc-wit-bindgen-generate]: https://docs.rs/wit-bindgen/latest/wit_bindgen/macro.generate.html
144144

145145
## 5. Implementing the `adder` world via the generated `Guest` Trait
@@ -163,7 +163,7 @@ There are a few points of note in the code listing above:
163163
> To dive into the code generated by the `wit_bindgen::generate!` macro, you can use the [`cargo-expand` crate][crates-cargo-expand]
164164
165165
[export-macro]: https://docs.rs/wit-bindgen/latest/wit_bindgen/macro.generate.html#exports-the-export-macro
166-
[crates-cargo-expand]: https://crates.io/crates/cargo-expand
166+
[crates-cargo-expand]: https://github.com/dtolnay/cargo-expand
167167

168168
## 6. Building a Component
169169

@@ -248,6 +248,6 @@ $ cargo run --release -- 1 2 ../add/target/wasm32-wasip2/release/adder.wasm
248248

249249
With this, we have successfully built and run a basic WebAssembly component with Rust 🎉
250250

251-
[crates-wasmtime]: https://crates.io/crates/wasmtime
251+
[crates-wasmtime]: https://docs.rs/wasmtime
252252
[repo-component-docs]: https://github.com/bytecodealliance/component-docs
253253
[docs-adder]: https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/tutorial/wit/adder/world.wit

‎component-model/src/language-support/creating-runnable-components/rust.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This page has content for both **WASI 0.2** and **WASI 0.3**. Use the tabs below to switch between versions where they differ.
66

7-
> **WASI 0.3 toolchain note.** Rust's [`wasm32-wasip3` target](https://doc.rust-lang.org/nightly/rustc/platform-support/wasm32-wasip3.html) is currently Tier 3 with no prebuilt artifacts; building for it requires constructing the standard library from source. The 0.3 example on this page therefore uses the library/reactor pattern targeting `wasm32-wasip2`, where [`wit-bindgen`](https://crates.io/crates/wit-bindgen)'s `async` feature handles the 0.3 binding generation. There is no Rust-idiomatic 0.3 path for the `fn main()` command-component pattern yet.
7+
> **WASI 0.3 toolchain note.** Rust's [`wasm32-wasip3` target](https://doc.rust-lang.org/nightly/rustc/platform-support/wasm32-wasip3.html) is currently Tier 3 with no prebuilt artifacts; building for it requires constructing the standard library from source. The 0.3 example on this page therefore uses the library/reactor pattern targeting `wasm32-wasip2`, where [`wit-bindgen`](https://docs.rs/wit-bindgen)'s `async` feature handles the 0.3 binding generation. There is no Rust-idiomatic 0.3 path for the `fn main()` command-component pattern yet.
88
99
</div>
1010

‎component-model/src/language-support/importing-and-reusing-components/javascript.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ which contains the `reverse-and-uppercase` function (in JavaScript, `reverseAndU
3535
> Functionality is imported via the `interface`, *not* the `world`.
3636
> `world`s can be included/used, but the syntax is slightly different for that.
3737
38-
The JavaScript to make this work ([`string-reverse-upper.mjs` in `jco/examples`][string-reverse-upper-mjs])
38+
The JavaScript to make this work ([`string-reverse-upper.js` in `jco/examples`][string-reverse-upper-js])
3939
looks like this:
4040

4141
```js
@@ -165,7 +165,7 @@ reverseAndUppercase('!dlroW olleH') = HELLO WORLD!
165165

166166
[wac]: https://github.com/bytecodealliance/wac
167167
[jco-examples-string-reverse-upper]: https://github.com/bytecodealliance/jco/tree/main/examples/components/string-reverse-upper
168-
[string-reverse-upper-mjs]: https://github.com/bytecodealliance/jco/blob/main/examples/components/string-reverse-upper/string-reverse-upper.mjs
168+
[string-reverse-upper-js]: https://github.com/bytecodealliance/jco/blob/main/examples/components/string-reverse-upper/string-reverse-upper.js
169169

170170
## Using `jco transpile` to run components from Javsacript
171171

‎component-model/src/language-support/using-http-in-components/rust.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Add [`wstd`][wstd], a Rust async standard library for Wasm components as a depen
3232
```console
3333
cargo add wstd
3434
```
35-
`wstd` provides idiomatic Rust bindings for WASI standard interfaces [(`wasi:http`)](https://github.com/WebAssembly/WASI/tree/main/proposals/http) to increase ease-of-use for Rust WebAssembly components. Since we are using `wstd`, we will not need to add WIT files or depend on [`wit-bindgen`](https://crates.io/crates/wit-bindgen) directly.
35+
`wstd` provides idiomatic Rust bindings for WASI standard interfaces [(`wasi:http`)](https://github.com/WebAssembly/WASI/tree/main/proposals/http) to increase ease-of-use for Rust WebAssembly components. Since we are using `wstd`, we will not need to add WIT files or depend on [`wit-bindgen`](https://docs.rs/wit-bindgen) directly.
3636

3737

3838
> [!NOTE]

0 commit comments

Comments
 (0)