Files
core/website/src/content/docs/concepts/flow.md
T
chrnx 489aa685bb docs: host the docs at green-tea.expressive-tea.io/docs
The site hangs off the expressive-tea.io cPanel as green-tea.expressive-tea.io.
A four-level docs.green-tea.expressive-tea.io subdomain reads badly and would
need its own AutoSSL cert (the *.expressive-tea.io wildcard stops one level
up). A /docs subfolder needs no extra host, DNS, or cert — it's a path — and
is what most projects do.

So the docs site now builds with base: '/docs' (its dist/ contents drop into
the subdomain's docs/ folder in cPanel), the 77 hard-coded content links are
prefixed, and the two hero actions Starlight doesn't rewrite are fixed by
hand. Verified: /docs/ serves, / 404s, no unprefixed internal href remains.
README points at the new docs URL.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-17 10:13:10 -05:00

1.4 KiB

title, description
title description
The typed flow core The functional flow API where the compile-time dependency guarantee lives.

The decorator layer validates the graph at boot. The functional core, flow, validates it in the type checker — before the program ever runs.

import { flow } from '@green-tea/core';

const pipeline = flow()
  .step('db', () => ({ find: (id: string) => id }))
  .step('user', (ctx) => ctx.db.find('u1')); // referencing a missing 'db' would not compile

Each .step(name, fn) adds its output to the accumulated context type (Acc & Out). The next step's ctx is typed with everything produced so far — so reading ctx.db compiles only because a previous step provided db. Reference a key nothing produced and it is a compile error, not a runtime undefined.

This is the strongest guarantee green-tea offers: the type is the dependency contract, checked statically. The decorator layer gives you the same graph with boot-time validation and the ergonomics of classes and decorators; flow gives you compile-time proof.

:::note npm run typecheck in the repo includes a type-level test that asserts this accumulation behaves — a step that reads a missing key is expected to fail compilation. :::

See The dependency graph for how both layers describe the same model.