Examples
Four runnable projects under examples/. Each is self-contained. Copy one
somewhere else and it still builds.
| Directory | Demonstrates |
|---|---|
01-hello | The minimum module. Both defaults. |
02-lib-and-app | deps, profile, static linkage, the C-ABI boundary. |
03-services | All three kinds, a shared library, multiple deps, mixed profiles. |
04-validation | Every rejection the schema performs, with real cue output. |
05-import-mode | link: "import", a dependency merged as a Zig module instead of linked. |
06-clusters | Clusters: import graphs behind abi boundaries, the shape for large projects. |
Each has its own README with exact commands and their output.
cd examples/03-services
./gen_build_spec.sh
zig build
./zig-out/bin/gateway
zig build test --summary all
To build and test all of them at once:
./setup.sh --examples
The older examples/*.cue files (minimal.cue, microservice.cue,
multi_lib.cue) are illustrative fragments. They are not runnable on their
own.