WebAssembly components for the Betty Blocks block store functions (concat
text, format endpoint result, generate UUID, liquid template, ...). Each
function is a Rust crate under functions/<name>/<version>/ that compiles to a
wasm32-wasip2 component. Its interface is wit/world.wit, and the function
definition the block store shows is function.json.
The components are published to the Betty Blocks Azure container registries, where the platform pulls them by their WIT package name and version.
- Rust with the
wasm32-wasip2target (rustup target add wasm32-wasip2) justwkg: the sharedbuild.rsrunswkg wit fetchfor every component to download its WIT dependencies intowit/deps/(gitignored). CI installs wkg 0.15.1.
just build # build every component and copy its .wasm next to its Cargo.toml
just test # build, then run the tests (cargo test)
just format-check # cargo fmt --check
just quality-check # cargo clippy --all-targets -- -D warningsCI runs these with RUSTFLAGS="--deny warnings".
wkg-config.toml maps WIT namespaces to registries (wasi, wasmcloud, and
betty-blocks-types, which lives in the Azure registry). The shared build.rs
passes it to wkg as WKG_CONFIG_FILE, unless WKG_CONFIG_FILE is already
set, so you can point a build at another config.
It is deliberately not called wkg.toml: wkg 0.16 and later look for a
wkg.toml in parent folders and parse it as a project manifest, not as a
registry config.
The committed file points betty-blocks-types at the dev registry
(bettyblocksdev.azurecr.io). The release workflow rewrites that line per
environment.
A failed wkg wit fetch fails the build. It does not fall back to WIT deps
left on disk.
The version that counts is the package version on the first line of each
component's wit/world.wit:
package betty-blocks:concat-text@1.0.0;It is the tag the component is published under. It is independent of the
Cargo.toml version and of the functions/<name>/<version>/ directory.
Every PR that changes a component must raise that version. The
Version Check workflow runs scripts/check-version-bumps.sh on every PR. A
component counts as changed when its src/, Cargo.toml, build.rs or
wit/ (excluding wit/deps/) differs from main. Then:
- the version is unchanged → fails;
- the version went down → fails;
- any increase (major, minor or patch) → passes; treat a breaking change as a new major;
- a component that does not exist on
mainyet may start at any version.
Shared files at the repository root (build.rs, Cargo.toml, Cargo.lock,
wkg-config.toml, Justfile) and tests/ do not count as a change to any
component.
Run it locally with ./scripts/check-version-bumps.sh (it compares against
origin/main).
main is the only branch. A merge to main runs release.yaml:
- CI (
ci.yml) runs first. Nothing is published unless it passes. - For each GitHub environment,
dev(Azurebettyblocksdev, which serves edge and acceptance) andmain(Azure prod), the workflow pointswkg-config.tomlat that environment's registry, builds all components and logs in to the registry. - Each component is published as
<registry>/betty-blocks/<package>:<world.wit version>, but only when that tag does not exist yet (checked withscripts/tag-exists.sh). Existing tags are skipped and logged, never overwritten: the runtime precompiles each tag once, so a new build under an old tag would not reach deployed apps.
To ship a change, bump the version in wit/world.wit; the Version Check makes
sure you do.