From c5907a4b59840f4419a0976f8c799dfff9d883b9 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 13 May 2026 08:13:39 +0200 Subject: [PATCH] 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. --- .github/workflows/website.yml | 8 ++++++++ content/playground.md | 3 ++- static/js/wasm-terminal.js | 13 ++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 5aaebaef1..bdf949531 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -138,6 +138,14 @@ jobs: echo "const WASM_LOCALES = [$(echo "$locales" | sed 's/[^,]*/\"&\"/g')];" \ > ../uutils.github.io/static/wasm/locales.js echo "Available locales: $locales" + # Generate the list of available commands from the feat_wasm feature + # in Cargo.toml so the playground stays in sync with the WASM build. + commands=$(sed -n '/^feat_wasm = \[/,/^\]/p' Cargo.toml \ + | grep -oE '"[a-zA-Z0-9_]+"' | tr -d '"' \ + | sort -u | paste -sd, -) + echo "const WASM_COMMANDS = [$(echo "$commands" | sed 's/[^,]*/\"&\"/g')];" \ + > ../uutils.github.io/static/wasm/commands.js + echo "Available commands: $commands" # Record the coreutils commit used to build the WASM binary commit_hash=$(git rev-parse HEAD) commit_short=$(git rev-parse --short HEAD) diff --git a/content/playground.md b/content/playground.md index b500e4261..18f4b5ab2 100644 --- a/content/playground.md +++ b/content/playground.md @@ -19,6 +19,7 @@ template = "page.html" +