20 Commits

Author SHA1 Message Date
Sylvestre Ledru 281bf18b68 playground: fix history.replaceState shadowed by terminal's history global 2026-06-02 20:46:12 +02:00
Sylvestre Ledru 617f980bf5 playground: update URL when clicking an example 2026-06-02 18:05:37 +02:00
Sylvestre Ledru ea9dcebef6 playground: show the grep build commit and date
The playground version line records the coreutils WASM commit and the
site commit, but grep (built as its own standalone WASM module) had no
provenance shown. Capture grep's commit/short/date in the workflow and
append a UUTILS_GREP_VERSION block to version.js, then render it next to
"Built from uutils/coreutils ..." as "grep <short> (<date>)" linking to
the uutils/grep commit.
2026-06-02 16:41:03 +02:00
Sylvestre Ledru 77efde6da3 Add uutils grep to the playground
grep ships as its own standalone WASM module (not part of the coreutils
multicall binary) and depends on the Oniguruma C library, so the website
workflow now checks out uutils/grep, installs the WASI SDK to provide a
wasm sysroot for the onig_sys C sources, builds grep.wasm, and appends
"grep" to the generated command list.

The terminal loads grep.wasm as an optional second module and dispatches
grep directly (argv[0] = "grep"). grep defaults to --color=never since the
WASI shim reports stdout as a TTY, which would otherwise emit match-
highlight escapes that corrupt piped output; explicit --color is honored.

Adds a grep emoji example and grep WASM integration tests.
2026-06-02 13:47:45 +02:00
Sylvestre Ledru c037b4553e Show uutils.github.io build commit on the playground page
Alongside the coreutils WASM commit, record the website repo's
commit/date in version.js (SITE_VERSION) and display it next to
the existing build info on the playground.
2026-05-29 10:58:06 +02:00
Sylvestre Ledru 27435ba3dc Fix id collision between commands placeholder and section heading
Zola auto-generates id="available-commands" on the "Available commands"
<h2>. The placeholder <p> shared that id, so getElementById matched the
heading first and the populate-from-WASM_COMMANDS script ended up
overwriting the heading text — rendering the command list at h2 size.
Rename the placeholder to a non-colliding id.
2026-05-13 08:43:16 +02:00
Sylvestre Ledru bf07dc3dc3 Populate playground's "Available commands" list from WASM_COMMANDS
Replaces the hand-maintained inline-code list in playground.md with
a placeholder that the page script fills from the build-generated
WASM_COMMANDS, so the prose section stays in sync with the actual
feat_wasm contents of the WASM binary.
2026-05-13 08:16:53 +02:00
Sylvestre Ledru c5907a4b59 Generate playground command list from coreutils feat_wasm
Previously the list of WASM-bundled utilities was hardcoded in
wasm-terminal.js and playground.md, which drifted from the actual
feat_wasm feature in coreutils/Cargo.toml (e.g. dd, tty, yes were
missing). The website workflow now parses feat_wasm at build time
and emits static/wasm/commands.js, which the terminal prefers over
its built-in fallback list.
2026-05-13 08:13:39 +02:00
Sylvestre Ledru d843e3d2c2 Show uutils commit hash and date on playground page
Emit a version.js alongside the WASM binary in CI recording the
coreutils commit used for the build, and display it under the
terminal with a link to the commit on GitHub.
2026-04-13 09:02:41 +02:00
Sylvestre Ledru 834f710c0f fix typos 2026-04-05 09:48:25 +02:00
Sylvestre Ledru b9f48cf0df fix typos 2026-04-05 09:41:29 +02:00
Sylvestre Ledru 19abaf2af8 Add link to GitHub source on playground page 2026-04-04 23:35:44 +02:00
Sylvestre Ledru b39e3382e8 Playground: add input redirection example 2026-04-04 12:43:52 +02:00
Sylvestre Ledru ddd1a9237d Playground: add "How It Works" technical documentation page
Explains the architecture (xterm.js, JS shell, WASI shim, WASM binary),
command lifecycle, pipeline execution, WASM loading, command parsing,
and the Rust side (feat_wasm, multicall binary, WASI adaptations,
locale embedding). Also adds Weblate link for missing translations.
2026-04-04 12:43:52 +02:00
Sylvestre Ledru d2d1f52a10 Playground: document ?cmd= URL parameter with examples 2026-04-04 11:38:44 +02:00
Sylvestre Ledru c73db9b8ad improve the wording 2026-04-04 11:32:59 +02:00
Sylvestre Ledru 294191f601 Playground: add uname -a example 2026-04-04 11:20:27 +02:00
Sylvestre Ledru adb9c19c51 Playground: dynamic locale dropdown from build-generated list 2026-04-04 11:11:34 +02:00
Sylvestre Ledru 965c898e51 Playground fixes: avoid double-fetch, CSP-safe event handling, hide from nav
- Clone WASM response before compileStreaming so fallback doesn't re-fetch
- Guard against concurrent ensureRuntime() calls with a promise cache
- Replace inline onclick with event delegation for CSP compatibility
- Add SRI note for WASI shim dynamic import
- Skip l10n tests that require French translations in WASM binary
- Replace uninteresting fmt example with printf sheep | nl
- Hide Playground link from top navigation for now
2026-04-03 22:13:57 +02:00
Sylvestre Ledru 5c22a5b3d6 Add interactive WASM playground for uutils coreutils
A browser-based terminal that runs real Rust coreutils compiled to
WebAssembly (wasm32-wasip1) using @bjorn3/browser_wasi_shim.

Features:
- xterm.js terminal with command history and line editing
- Pipe support (cmd1 | cmd2 | cmd3), file redirects (>)
- Persistent virtual filesystem across commands
- cd/pwd builtins with virtual working directory
- Locale support (locale builtin + selector)
- UTF-8/multibyte correct output (raw ConsoleStdout, fixed args_sizes_get)
- Click-to-run example buttons
- Inline wasm_example shortcode for blog posts
2026-04-03 21:47:38 +02:00