These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 10/5/2026.
Stack
@korulang/stack@0.0.1Declarative service stacks for Koru - compile-time service graphs, compose materialization
stack/index.kz · 2 tors
@korulang/stack — declarative service stacks for Koru · 42 more lines
@korulang/stack — declarative service stacks for Koru
A program declares its services once; `koruc app.kz stack manifest`
materializes the graph into docker-compose YAML. The graph is compile-time
data — cycles and dangling depends_on edges are refusals, not runtime
surprises.
DECLARATION:
import koru/stack
koru/stack:service(db) {
"image": "postgres:16",
"healthcheck": "pg_isready -U shop",
"env": { "POSTGRES_DB": "shop" }
}
[depends_on("db")]koru/stack:service(web) {
"image": "web:latest",
"port": "web_port"
}
// a minimal service is name + body:
koru/stack:service(cache) {
"image": "redis:7"
}
EDGES: [depends_on("a", "b")] annotations on the service declaration —
the same convention std/build:step uses. A dep that declares a
healthcheck emits `condition: service_healthy`; without one it emits
`service_started`.
FLAG-ERASED VALUES: every string field is resolved through build:config
first — a value that names a config key substitutes, anything else is
literal. [build("x")] annotations gate whole declarations, so the graph's
shape and its values both vary per --build flag and resolve before the
manifest exists.
COMMANDS:
koruc app.kz stack manifest — emit compose.yaml
koruc app.kz stack up — validate, emit, compose up -d --wait
koruc app.kz stack down — tear the stack down
koruc app.kz stack logs — follow service logs
~[comptime|command] pub tor stack {
program: *const Program,
allocator: __koru_std.mem.Allocator,
argv: []string
}// Service Declaration (compile-time)
// Declare one service in the stack graph. Collected by `koruc <file> stack`.
// The optional Source body is JSON-ish fields: "healthcheck",
// "port"/"ports", "env" — a field-less service omits the block entirely.
// String values resolve through build:config first, then literal.
// Edges ride annotations: [depends_on("db")] — same convention as
// std/build:step. Flag-gate whole declarations with [build("dev")].
~[comptime|norun] pub tor service { expr: Expression, source: ?Source }