@arbitrat/core
v1.0.1
Published
Shared TypeScript primitives for Arbitrat generators.
Readme
@arbitrat/core
Shared TypeScript primitives for Arbitrat generators. The unglamorous parts of scaffolding — filesystem, subprocesses, package.json, Infisical-wrapped scripts, add-on graphs — so @arbitrat/next-generator and @arbitrat/nest-generator do not each invent a slightly different bug.
This package is for people writing generators, not for application code. If you reached for it from a Next app, you probably wanted a service module instead.
Opinionated for Arbitrat. If the approach is not yours, do not take a dependency. arbitrat.org
Install
npm install @arbitrat/coreNode.js 20+. The published package is TypeScript source (src/index.ts). There is no compile step to hunt for.
What it gives you
Import from @arbitrat/core:
| Area | Exports |
| --- | --- |
| Add-ons | Addon, AddonRegistry, resolveAddonOrder |
| Context | GeneratorContext |
| Errors | GeneratorError (structured message + remediation) |
| Files | FileSystemService, pathExists |
| Process | CommandRunner |
| Names | sanitizeProjectName, toPackageName |
| Safety | rollbackIfCreated |
| Scripts | ScriptManager, wrapScript, INFISICAL_PREFIX |
| Manifest | PackageJsonManager |
| Package managers | NpmPackageManager, PnpmPackageManager, createPackageManager |
| Docs | DocumentationManager, generated-section helpers |
| Prisma | PRISMA_VERSION, PRISMA_SCHEMA, PRISMA_CONFIG, generatePrismaClient |
Scripts added through packageJson.scripts.add(...) are wrapped with Infisical. Do not wrap them yourself; the double-wrap is how secrets get “managed” twice and still leak in a screenshot.
Tiny example
import { AddonRegistry, FileSystemService, PackageJsonManager } from "@arbitrat/core";
const registry = new AddonRegistry();
// register add-ons, resolve order, apply against a GeneratorContextPublic surface: src/index.ts.
