Skip to content

Commit 5248c7b

Browse files
authored
Minor updates to the playground (#1605)
* Fix hyperlink between parse/print online pages Use a relative link instead of an absolute one to handle hosting on different roots * Rename playground jobs Make it a bit more descriptive which workflow they're attached to with just the name of the job * Remove generated `src/bindings.rs` Exclude the crate from testing to avoid building it on other targets. * Remove unused `[profile.release]` section Inherit the default settings for now and if distribution of the wasm is a problem it can be re-added on a per-CI-job-basis. * Exclude the playground from `cargo doc` * Try to fill in missing file for rustfmt * Try a blank line in a new file * Try printf instead
1 parent 976ce0a commit 5248c7b

7 files changed

Lines changed: 9 additions & 317 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
- uses: actions/checkout@v4
169169
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0
170170
- run: rustup component add rustfmt
171+
- run: printf "\n" > playground/component/src/bindings.rs
171172
# Note that this doesn't use `cargo fmt` because that doesn't format
172173
# modules-defined-in-macros which is in use in `wast` for example. This is
173174
# the best alternative I can come up with at this time

.github/workflows/playground.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defaults:
1717

1818
jobs:
1919
build:
20-
name: Build
20+
name: Build playground deployment
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
@@ -44,7 +44,7 @@ jobs:
4444
path: "./playground/dist"
4545

4646
deploy:
47-
name: Deploy
47+
name: Deploy playground
4848
if: github.ref == 'refs/heads/main'
4949
needs: build
5050
permissions:

playground/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
2+
src/bindings.rs
23
component-built/
34
dist/

playground/component/Cargo.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ wasmprinter = { workspace = true }
1010

1111
[lib]
1212
crate-type = ["cdylib"]
13-
14-
[profile.release]
15-
codegen-units = 1
16-
opt-level = "s"
17-
debug = false
18-
strip = true
19-
lto = true
13+
test = false
14+
doctest = false
15+
doc = false
2016

2117
[package.metadata.component]
2218
package = "component:component"

playground/component/src/bindings.rs

Lines changed: 0 additions & 306 deletions
This file was deleted.

playground/pages/parse.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h1>wasm-tools parse</h1>
6060
<div class="textarea-container">
6161
<div class="description">
6262
<p>Translate from the WebAssembly text format to binary using <a href="https://github.com/bytecodealliance/wasm-tools"><code>wasm-tools parse</code></a>.
63-
You can go the other direction using <a href="/print"><code>print</code></a>.</p>
63+
You can go the other direction using <a href="print"><code>print</code></a>.</p>
6464
</div>
6565
<div class="input-header">wat</div>
6666
<div class="input">

playground/pages/print.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ <h1>wasm-tools print</h1>
9797
<div class="textarea-container">
9898
<div class="description">
9999
<p>Translate WebAssembly binaries to text format using <a href="https://github.com/bytecodealliance/wasm-tools"><code>wasm-tools print</code></a>.
100-
You can go the other direction using <a href="/parse"><code>parse</code></a>.</p>
100+
You can go the other direction using <a href="parse"><code>parse</code></a>.</p>
101101
</div>
102102

103103
<div class="output-header">

0 commit comments

Comments
 (0)