HaloStack Docs
Open App
Tools

Generators

Turborepo + Plop generators that scaffold convention-following boilerplate and auto-wire it into the monorepo.

@halostack/generators provides Turborepo + Plop generators that scaffold boilerplate which already follows the repo's conventions — and, just as importantly, wires that boilerplate into the monorepo for you. You run it from the repo root with bun run gen. It's not a library: it has no exports, only generator configuration and Handlebars templates.

Running

The gen command can be used interactively or driven by arguments for CI and scripting:

Under the hood, gen proxies to turbo gen (the gen binary comes from @turbo/gen). The name prompt enforces lowercase kebab-case, which lets the {{kebabCase}}, {{camelCase}}, {{pascalCase}}, and {{titleCase}} helpers derive every other casing of the name from a single input.

Generators

Each generator creates files in a conventional location and then auto-wires the new code into wherever it needs to be registered, so the scaffold is usable right away.

The module scaffold ships with an in-memory store so that it compiles immediately. Swap that store for Drizzle plus drizzle-typebox once you add a table — packages/elysia/src/modules/todos shows the canonical shape to aim for.

Structure

  • turbo/generators/config.ts registers every generator. It's the default export that turbo discovers.
  • turbo/generators/templates/<name>/*.hbs holds the Handlebars templates. Biome skips .hbs files, so the templates must emit output that's already formatted (tabs, double quotes, sorted classes) — the generated .ts / .tsx is what actually gets linted.

Conventions

Action paths are prefixed with {{ turbo.paths.root }}/, because turbo runs the generator from this workspace; a bare path would resolve here rather than at the repo root.

After running the module generator, run bun run check (which sorts the injected import) and bun run typecheck. The generated output is expected to pass both with zero hand-edits.