A documentation orchestrator for orkestrel projects.
- Run from orkestrel/docs with the parent directory named
orkestrel - Auto-discovers sibling packages (e.g., core, validator) and skips docs itself
- Copies each package’s guides into
docs/packages/<pkg>/guides - Generates TypeDoc API docs into
docs/packages/<pkg>/apiusing a central TypeDoc config in this repo (with pass-through overrides) - Generates
llms.txtandllms-full.txtfor each package by default (soft run), with--hardenabling link validation - Uses hashing to skip unchanged work; cache stored at
docs/packages/cache.json
orkestrel/
core/
validator/
llms-txt/
docs/
src/
tests/
guides/
packages/
cache.json
<pkg>/
api/
guides/
llms.txt
llms-full.txt
npm install
npm run build
# Soft run (default): guides + api + llms (no link validation); selective by cache
npm run sync
# Hard run: adds link validation for LLMs outputs
npm run sync:hard
# Clean outputs before generating (only for changed targets)
npm run sync:clean
# Help (after build)
node dist\cli.js --help
Advanced flags (after build):
node dist\cli.js sync --include core --include validator --exclude docs --clean --hard --no-llms --dry-run
TypeDoc dependency handling flags (after build):
# Auto-install dependencies when missing (default: true)
node dist\cli.js sync --typedoc-auto-install=true
# Disable auto-install to surface errors instead
node dist\cli.js sync --typedoc-auto-install=false
# Choose package manager for auto-install (auto-detected by lockfile when omitted)
node dist\cli.js sync --typedoc-pm pnpm
Notes:
- Auto-install runs per package directory (npm ci/install, pnpm install, or yarn install). In dry-run, it only logs the intended command.
- A
package.jsonmust exist in each package directory before TypeDoc generation.
All types are centralized in src/types.ts (strict typing, no any). Guards and assertions are exported to help narrow unknown inputs.
createOrkestrelConfig(opts: OrkEslintOptions)– Flat ESLint config (Nuxt + TS + TSDoc/JSDoc + restrictions). Pass-through:nuxt(merged),extendRules,extendJsdocRules,extendTsdocRules,additionalConfigs.generateLlmsOutputs(opts: LlmsOptions)– Wraps@orkestrel/llms-txt.generateAll.- Pass-through of every
GenerateConfigfield exceptdocsDir(derived as<pkgDir>/guides). hardforcesvalidateLinks: trueregardless of providedvalidateLinks.onValidateProgresspropagates to underlying generator.dryRunis wrapper-only (not forwarded) and prints intended actions.
- Pass-through of every
generateApiDocs(opts: GenerateApiOptions)– Wraps TypeDocApplication.bootstrap.- Requires a
package.jsoninopts.pkgDir. - Auto-detects entry points (index/main fallback to
expandstrategy). Override viaentryPoints,entryPointStrategy,tsconfig. extraApplicationOptionsshallow-merged last to allow full access to TypeDoc bootstrap options.- Dependency handling:
autoInstallDeps(default: true) — whenpackage.jsondeclares dependencies andnode_modulesis missing, automatically install.packageManager—'npm' | 'pnpm' | 'yarn'preferred tool when auto-installing (auto-detected by lockfile when omitted).
dryRunprints the resolved invocation and any planned installs without side effects.
- Requires a
runSync(opts: SyncOptions)– Orchestrates guides/API/LLMs for all changed packages.- Pass-through:
llmsfor LLM generator (minusdocsDir/outDir),typedocfor TypeDoc overrides (entryPoints,entryPointStrategy,tsconfig,extraApplicationOptions,autoInstallDeps(default true),packageManager). - Hash-based skipping;
hardandgenerateLlmscontrol validation and inclusion. dryRunprints all file operations without mutating.
- Pass-through:
copyGuides(opts: CopyGuidesOptions)– Copies guides for a single package.helpers– Internal utilities (hashing, discovery) exposed for advanced tooling.- Validation helpers:
isSyncOptions,assertSyncOptions,isLlmsOptions,assertLlmsOptions,isGenerateApiOptions,assertGenerateApiOptions,isOrkEslintOptions,assertOrkEslintOptions.
import {
runSync,
generateLlmsOutputs,
generateApiDocs,
createOrkestrelConfig,
assertSyncOptions
} from '@orkestrel/docs'
// 1. ESLint flat config
export default await createOrkestrelConfig({
stylisticIndent: 'tab',
extendRules: { 'no-console': 'warn' }
})
// 2. Single package LLM generation with hard validation
await generateLlmsOutputs({
pkgDir: 'packages/core',
outDir: 'docs/packages/core',
hard: true,
concurrency: 8,
timeoutMs: 5000,
onValidateProgress: e => console.log('links', e.validated, '/', e.total)
})
// 3. Single package API docs with extra TypeDoc options
await generateApiDocs({
pkgDir: 'packages/core',
outDir: 'docs/packages/core/api',
baseConfigPath: 'typedoc.base.json',
entryPoints: ['packages/core/src/index.ts'],
extraApplicationOptions: { treatWarningsAsErrors: true }
// autoInstallDeps defaults to true; to disable: autoInstallDeps: false
})
// 4. Multi-package orchestrated sync (dry run)
const syncCfg: unknown = {
include: [],
exclude: [],
clean: false,
hard: true,
generateLlms: true,
dryRun: true,
typedoc: { entryPointStrategy: 'expand' },
llms: { concurrency: 4 }
}
assertSyncOptions(syncCfg)
await runSync(syncCfg) // narrowed- All public option objects use readonly fields and avoid mutation.
- Pass-through fields mirror underlying library types for full control.
- Wrapper-only flags (
hard,dryRun) modify or bypass internal behavior deterministically. - No non-null assertions (
!) orany; narrowing helpers are provided instead.
- Auto-discovers sibling packages (directories with a package.json) under the parent
orkestrelfolder. - Hashing ensures unchanged packages are skipped.
- Central base config at
typedoc.base.json. - Override entry points/strategy per package via
GenerateApiOptionsorSyncOptions.typedoc.
- Based on
@orkestrel/llms-txt(Markdown → deterministic text transforms). hardrun forces link validation.- Outputs normalized to root of each package docs folder.
This repo exports createOrkestrelConfig() (Flat config) that:
- Pulls @nuxt/eslint-config/flat
- Adds TypeScript rule hardening
- Enforces TSDoc syntax + JSDoc rules for public API
- Restricts type/interface declarations to
src/types.ts - Ignores
guides/**and generatedpackages/**/api/**
Usage in a package:
// eslint.config.mjs
import { createOrkestrelConfig } from '@orkestrel/docs/eslint'
export default await createOrkestrelConfig({ stylisticIndent: 'tab', allowTypesFile: 'src/types.ts' })docs/packages/cache.jsontracks per-packageguidesHashandapiHash.- Only changed packages are rebuilt.
Scripts:
npm run check— typechecknpm test— tests (Vitest)npm run format— ESLint autofixnpm run build— compile TypeScript
See guides in guides/ for concepts, start, tips, and contribute.