This guide is for maintainers and builders working on clayterm itself.
It covers:
- cloning the repo correctly,
- initializing the
claygit submodule, - installing the toolchain needed to compile the C sources to WebAssembly,
- building the local development artifacts, and
- verifying that the repo is ready for development.
It does not cover npm/JSR packaging or publishing.
The local source build is driven by make.
It generates:
clayterm.wasm— the compiled WebAssembly module built from the C sourceswasm.ts— a generated TypeScript file derived fromclayterm.wasm
wasm.ts is generated output, not hand-maintained source.
The build depends on the clay git submodule.
Preferred fresh clone:
git clone --recurse-submodules https://github.com/bombshell-dev/clayterm.git
cd claytermIf you already cloned without submodules:
git submodule update --init --recursiveQuick check:
git submodule status --recursiveYou should also see a populated clay/ directory. If clay/ is missing or
empty, fix the submodule state before building.
You need:
gitmakeclangwith wasm32-capable supportdeno
Equivalent packages are fine if your package manager uses different names.
Install Apple's command line tools first. They provide the base developer tools,
including git and make.
xcode-select --installThen install LLVM and Deno with Homebrew:
brew install llvm denoUse Homebrew LLVM before Apple's system clang when building clayterm:
echo 'export PATH="$(brew --prefix llvm)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcIf you do not already have git available after installing the command line
tools, install it with Homebrew:
brew install gitInstall the build toolchain and Git:
sudo apt-get update
sudo apt-get install -y build-essential clang lld git curlInstall Deno with the official installer:
curl -fsSL https://deno.land/install.sh | shAdd Deno to your shell path:
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcInstall the build toolchain and Git:
sudo dnf install -y clang lld make git curlInstall Deno with the official installer:
curl -fsSL https://deno.land/install.sh | shAdd Deno to your shell path:
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcThe recommended Windows build-host path is WSL2 with Ubuntu.
From an elevated PowerShell prompt:
wsl --install -d UbuntuThen open the Ubuntu environment and follow the Debian / Ubuntu instructions above.
The build host runs inside WSL2, but the resulting WebAssembly artifacts are intended to run on native Windows at runtime.
Before building, confirm the required tools are available:
git --version
make --version
clang --version
deno --versionFor a quick wasm-target smoke test, make sure clang can compile for wasm32:
clang --target=wasm32 -c -x c /dev/null -o /tmp/clayterm-wasm-test.o
rm -f /tmp/clayterm-wasm-test.oOn macOS, if which clang still points to /usr/bin/clang and the wasm test
fails, make sure the Homebrew LLVM bin/ directory is at the front of your
PATH.
Run the local source build from the repository root:
makeThis should produce:
clayterm.wasmwasm.ts
For a clean rebuild:
make clean && makeRe-run make when:
- you change files under
src/ - you update the
claysubmodule clayterm.wasmorwasm.tsis missing- generated outputs look stale after switching branches or pulling changes
When in doubt, use a clean rebuild:
make clean && makeAfter make succeeds, run the test suite:
deno task testBefore opening a PR, it is also a good idea to run the same checks CI runs:
deno task fmt:check
deno lintSymptoms may include build failures such as:
fatal error: '../clay/clay.h' file not found
Recovery:
git submodule update --init --recursiveThen verify the submodule state and rebuild:
git submodule status --recursive
make clean && makeSymptoms may include:
- target-related
clangerrors mentioningwasm32 - linker failures while producing
clayterm.wasm
Recovery:
- make sure you are using an LLVM/Clang build with wasm support
- on macOS, prefer the Homebrew
llvmtoolchain over/usr/bin/clang - on Linux/WSL2, make sure both
clangandlldare installed - rerun the wasm smoke test:
clang --target=wasm32 -c -x c /dev/null -o /tmp/clayterm-wasm-test.o
rm -f /tmp/clayterm-wasm-test.oIf the smoke test fails, fix the toolchain first and only then rerun make.
Symptoms may include:
clayterm.wasmis missingwasm.tsis missing- you changed
src/or updatedclay/, but the generated outputs do not match
Recovery:
make clean && makeThen verify the repo is in a good state:
deno task testThis document is intentionally limited to local source builds for development.
Out of scope:
deno task build:npmdeno task build:jsrnpm publishdeno publish- release tagging and package publishing workflows