@bounda-dev/cli
v0.2.3
Published
The bounda CLI: reads the project layout and writes the registry and the types
Readme
@bounda-dev/cli
The bounda command line. It reads your project layout and writes the registry and every
argument type, so a Bounda app has no file to keep in sync by hand.
npm install -D @bounda-dev/cli
npx bounda generatebounda generate [--root <dir>] [--app-dir <dir>] [--tsconfig <file>] [--no-infer] [--watch]
bounda rebuild <read-model> [--root <dir>] [--config <file>] [--registry <file>]
bounda dead-letters list [--kind <kind>] [--status <status>] [--handler <name>] [--limit <n>] [--json]
bounda dead-letters retry <id>
bounda dead-letters discard <id>It reads app/domain and app/read by file and directory names, plus what each module at an
aggregate's root exports, and writes
.bounda/registry.ts, .bounda/register.d.ts, .bounda/types.ts and one +types/<name>.ts next
to every module. An aggregate without state.ts gets its state inferred from what its
events' begin and evolve return, with the TypeScript compiler. A layout that breaks a convention exits with code 1 and
names every offending file.
Keep it as prepare so a fresh clone generates on install, and --watch while you work:
{ "scripts": { "prepare": "bounda generate", "dev": "bounda generate --watch" } }In a React Router app the bounda() plugin from @bounda-dev/react-router/vite runs the
generator inside Vite instead.
bounda rebuild <read-model> projects the whole stream into a fresh table and swaps it in without
taking the read model offline: for a projection that had a bug, or a view that lost a field or
changed a field's type. bounda dead-letters lists the handler runs that gave up and retries or
discards them.
Status
0.x. Until 1.0 the API can still change between minor versions, and every change that breaks something is called out in the changelog.
Docs: docs.bounda.dev/reference/cli. Source and issues: github.com/bounda-dev/bounda.
