@factorn/turbo
v0.1.1
Published
Shared Turborepo generators for Factorn projects
Downloads
268
Readme
@factorn/turbo
Shared Turborepo generators for Factorn projects.
Install as a dependency and register generators from a thin local turbo/generators/config.ts. Requires @turbo/gen as a peer dependency.
Setup
pnpm add -D @factorn/turbo @turbo/genturbo/generators/config.ts (at the monorepo root, or inside a workspace):
import type { PlopTypes } from "@turbo/gen";
import { registerGenerators } from "@factorn/turbo";
export default function generator(plop: PlopTypes.NodePlopAPI): void {
registerGenerators(plop);
}Alternatively:
import type { PlopTypes } from "@turbo/gen";
export default function generator(plop: PlopTypes.NodePlopAPI): void {
plop.load("@factorn/turbo");
}Note:
plop.load("@factorn/turbo")resolves the package from the directory that contains your generator config. PreferregisterGeneratorsfrom@factorn/turbowhen the config lives at the monorepo root.
Generators
ts-library
Scaffolds a neutral TypeScript library under your monorepo (default packages/<name>):
- Dual ESM + CJS build with tsdown
- Lint/format via
@factorn/oxc-config - Tests via
@factorn/vitest - TypeScript via
@factorn/ts-config(base.json+ Node types)
turbo gen ts-libraryPrompts:
| Prompt | Default | Notes |
| ------------- | ---------- | ------------------------- |
| scope | @repo | Must start with @ |
| name | — | kebab-case package name |
| description | (empty) | Optional |
| destination | packages | Relative to monorepo root |
Generated packages expect Factorn shared configs and tooling versions to be available via your workspace pnpm catalog (catalog: protocol).
Development
This package dogfoods itself via turbo/generators/config.ts inside the package (discovered as @factorn/turbo/ts-library).
pnpm build # tsdown → dist/
pnpm typecheck
turbo gen # select @factorn/turbo/ts-library