Astromech
@theholocron/astromech is the task runner behind holocron run. A repo declares one task manifest, and every surface is derived from it:
holocron run <task>(local)holocron run ci(the CI suite, run locally)- the generated GitHub Actions workflows
- the
package.jsonscripts - the branch-protection required-checks list
It is a plain library, not a capability plugin. @theholocron/cli depends on it and instantiates it once.
Installation
Section titled “Installation”pnpm add @theholocron/astromechMost repos never import it directly: they use it through the CLI. Import it to build tooling on the same manifest.
import { createAstromech } from "@theholocron/astromech";
const astromech = createAstromech({ cwd });
const report = astromech.run("test:unit", { passthrough: ["--watch"] });// { status: "ok" | "fail" | "skip" | "dry-run" | "unknown", command?, message? }Key points
Section titled “Key points”- Tasks are named by intent, not tool. A repo declares
test:unit, notvitest. The registry maps each task name to what it runs (vitest, tsc, eslint, prettier, knip, gitleaks, semantic-release, an Astro build, and so on), and tool names never appear inholocron.config.ts. - Resolution.
holocron run <task>(a flat id such astest:unitorbuild, or a suite such astestthat runs the leaves the repo lists; the old dotted names still work and print a deprecation notice) usesturbo.jsonif it defines the task, then apackage.jsonscript, then the registry’s local runner. A task made of jobs runs each job in order. A known task with nothing to run exits 0 (1 with--required), and an unknown task is an error. - Task entries. Each manifest entry can set
ci,local,requiredandwith(per-repo overrides on the reusable workflow).local: falsemakes a task CI-only. - Config.
defineConfigcomes from the zero-runtime-dependency@theholocron/astromech/configsubpath. The manifest is thetaskskey ofholocron.config.*, with an optional dedicatedastromech.config.*merged on top, loaded through@theholocron/datapad. - Generated surfaces.
thinCallers()returns the workflow files,packageScripts()thepackage.jsonscripts,requiredChecks()the branch-protection contexts (ciandDCOwhere theciaggregate check is hosted),aggregateCaller()the caller of that aggregate. Thecodecov.ymlcomes from thecoverageprovider, not from astromech.holocron syncandholocron setupwrite them. - Running CI locally.
ci()runs every required task in CI order and sets the exit code ofholocron run ci. - Release-time deploys. A package can declare a
deploytask withon: "release", andholocron deploy on-releasedeploys it when a release changes it or one of itsworkspace:*dependencies. - Lint subpath.
@theholocron/astromech/lintholds the commit-message linter and the ignore lists, shared with Sentinel so its central checks skip exactly what each repo’s own CI skips. - Repo-validation subpath.
@theholocron/astromech/repo-validationholds the rules of thevalidate:specsandvalidate:docschecks as pure functions, run by the CLI (holocron probe docs presence) from git and by Sentinel from the GitHub API, so the two cannot disagree. - Upgrade subpath.
@theholocron/astromech/upgradeholds the repo-agnostic upgrade machinery behindholocron upgrade:runUpgradeNode()rewrites every Node.js version pin (engines.node,@types/node,.nvmrc,.node-version, workflownode-version:, DockerfileFROM node:,.tool-versions) from one major to another, andfetchLatestFromNpm()resolves a package’s latest version. The Holocron-specific parts, which are the@theholocron/*pin filter and theholocron.config.tsmigration, stay in the CLI.
Related
Section titled “Related”holocron runandholocron run ciholocron syncandholocron deploy- Configuration
- Source and the full task table:
cli/astromechon GitHub
The full API reference is generated from the package’s TSDoc comments.