Commit Graph

261 Commits

Author SHA1 Message Date
Sylvestre Ledru c596ff7755 Playground: add support for I/O redirection (< > >>)
Parse < (stdin from file), > (stdout to file), and >> (append) in
the command line. Files are read from and written to the persistent
virtual filesystem, so redirected output persists across commands.
2026-04-04 12:43:52 +02:00
Sylvestre Ledru 99aadcf376 Playground: remove ".." JS workaround, now handled in ls 2026-04-04 12:43:52 +02:00
Sylvestre Ledru aec0f96454 Playground: clarify shell vs. coreutils responsibilities in docs
Explain that constructs like if/while/for, globbing, and variable
expansion are shell features, not coreutils features, and why they
are not available in the playground's minimal JS shell.
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 17e38beade Playground: fix corrupted file sizes in ls output
browser_wasi_shim's Filestat.write_bytes() uses setUint8 for the
1-byte filetype field at offset 16, leaving bytes 17-23 unwritten.
Since Rust allocates the stat buffer with MaybeUninit, those padding
bytes contain stack garbage that corrupts the struct.

Fix by replacing write_bytes with a version that writes filetype as
a full 8-byte BigUint64 (zero-extended), clearing the padding.
Also add a test asserting file sizes are reasonable.
2026-04-04 11:55:54 +02:00
Sylvestre Ledru 0c49cf76fd Add tests for ls -al WASI fixes (timestamps, parent dir) 2026-04-04 11:43:46 +02:00
Sylvestre Ledru a800abdb28 Playground: fix ls -al timestamps and parent dir access
Patch browser_wasi_shim File/Directory stat() to return current
timestamps instead of epoch 0 (which showed Jan 1 1970).

Patch path_filestat_get and path_open to resolve ".." at the
preopened root to "." instead of failing with NOTCAPABLE, matching
real filesystem behavior.
2026-04-04 11:43:42 +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 a3bbcc284d Playground: add tab completion for commands and filenames 2026-04-04 11:31:05 +02:00
Sylvestre Ledru 294191f601 Playground: add uname -a example 2026-04-04 11:20:27 +02:00
Sylvestre Ledru 2cbd80d6fd Playground: support ?cmd= URL parameter to run commands on load 2026-04-04 11:20:21 +02:00
Sylvestre Ledru adb9c19c51 Playground: dynamic locale dropdown from build-generated list 2026-04-04 11:11:34 +02:00
Sylvestre Ledru e7c117a617 CI: generate available locales list during WASM build 2026-04-04 11:11:33 +02:00
Sylvestre Ledru e6d078d6b2 Add French l10n test for arch --help in WASM playground 2026-04-04 11:11:32 +02:00
Sylvestre Ledru d66a1d720f Skip WASM sort tests when sort traps in the build
sort hits 'unreachable' in some WASM builds. Probe once and skip
sort-dependent tests rather than failing CI.
2026-04-03 22:24:50 +02:00
Sylvestre Ledru 83fac47ca8 Show WASM binary size in playground loading message 2026-04-03 22:18:11 +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 c380111f50 Remove CLAUDE.md symlink (kept externally) 2026-04-03 21:47:38 +02:00
Sylvestre Ledru 48dbdb0506 Add DEVELOPMENT.md with build and testing instructions 2026-04-03 21:47:38 +02:00
Sylvestre Ledru adc6d38c5a Add playground tests and CI integration
- Browser-based unit tests (111 tests) covering parsing, builtins,
  pipes, UTF-8, l10n, virtual filesystem, and WASM integration
- Headless Puppeteer test runner (scripts/run-tests.js)
- CI workflow step to build WASM and run tests
2026-04-03 21:47:38 +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
Sylvestre Ledru a52c902b3f Fix video attribution: Rust at TU Delft by Terts Diepraam 2026-04-01 17:31:52 +02:00
Sylvestre Ledru b9e16ec334 Add FLOSS Weekly episode 792 to Talks & Media page 2026-04-01 17:30:32 +02:00
Sylvestre Ledru dd36252661 Add link to Talks & Media page from homepage 2026-04-01 17:26:26 +02:00