resolvePath() normalizes path segments and drops trailing empty
components, so a sed script like 's/world/there/' was rewritten to
's/world/there', losing the closing delimiter and producing
'unterminated substitute replacement'. Skip resolvePath for sed's
script argument(s) (the first non-option arg, or args after -e/-f).
Add uutils/sed to the playground alongside grep, find and diff/cmp. sed
builds a single `sed` binary and, like diffutils, has only pure-Rust
dependencies (fancy-regex and regex, not onig), so its WASM build needs no
WASI SDK — it joins the wasm-standalone matrix with needs_wasi: false.
Register sed as its own on-demand standalone module (sed -> sed.wasm), add
it to the fallback command list, the help/load hints, a substitution
example, the version footer, and tests (stdin substitution, global
substitution over a file, and -n line selection).
The website workflow built all four WASM modules (uutils, grep, find,
diffutils) serially in a single job. Split them so they compile in
parallel: coreutils keeps its own job (it needs the l10n copy, locales.js
and feat_wasm command parsing), while grep/find/diffutils share one matrix
job (grep/find pull in onig_sys and need a WASI sysroot; diffutils is pure
Rust). Each leg uploads its .wasm plus numbered command/version fragments
that the build job stitches into commands.js / version.js; SITE_VERSION is
generated there since it describes the site repo. Add Swatinem/rust-cache
to every build to speed up warm runs.
Add uutils/diffutils to the playground alongside grep and find. The
diffutils binary is a multicall that provides diff and cmp, dispatched on
argv[0], so each command is invoked directly by name. Unlike grep/find it
has only pure-Rust dependencies (regex, not onig), so its WASM build needs
no WASI SDK.
Generalize the standalone-module registry from command->url to
module->{url, commands} so one module can back several commands: diff and
cmp share a single diffutils.wasm, load once on demand, and get one 'Load'
button. Add a couple of near-identical shopping-*.txt sample files so diff
and cmp have a small, readable change to show, plus a diff example, help
entry, version footer, and tests (diff/cmp exact-match; diff -u checked on
its hunk body, since its header carries an environment-dependent mtime).
The standalone WASM modules (grep ~1.4 MB, find ~2.0 MB) were fetched
eagerly at startup, adding ~3.4 MB (~22%) to the initial download for
visitors who never use them. Load them on demand instead: the first time
a command runs it auto-loads its module (with a live 'loading… done'
notice), and a row of 'Load' buttons lets visitors pre-warm them. A
shared in-flight map dedupes a click and a command racing to load the
same module, and buttons stay in sync via a 'uutils:program-loaded'
event whether the module was loaded by click or by use.
Generalize the single-module grep handling into a registry of standalone
WASM modules so additional uutils tools can drop in. Add `find`, built from
uutils/findutils to wasm32-wasip1 in CI, with graceful degradation when the
binary is absent.
Only `find` is shipped: xargs/locate/updatedb need process spawning or an
on-disk database, neither of which works in the browser WASI sandbox.
Add an emoji `find . -name '*.md'` example backed by fruit-emoji files in the
virtual FS to show off Unicode/multibyte filename matching, plus tests.
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.
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.