Skip to content

Repository files navigation

@ankhorage/devtools

license: MIT npm: v2.0.4 runtime: bun typescript: strict eslint: checked prettier: checked build: checked tests: checked paradox: warnings

Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects

Usage

CLI

Ankhorage packages expose their command-line interface through ankh. Use ankh --help to discover available package commands, or run a package command with --help for package-specific usage.

# Install the Ankhorage CLI
bun add --global @ankhorage/ankh

# Show usage information for devtools
ankh devtools --help

Standalone package ESLint configuration

Configure ESLint for a standalone TypeScript package with the Devtools shared policy.

export default createConfig({
  tsconfigRootDir: __dirname,
  project: ['./tsconfig.json'],
  files: ['src/**/*.{ts,tsx}'],
});

This package contains 1 additional example. See the generated documentation for the complete set.

Configuration

Example

import { readFileSync } from 'node:fs';

import { defineParadoxConfig } from '@ankhorage/paradox';

import { renderBunPolicyDocumentation } from './src/policy/renderBunPolicyDocumentation.js';

export default defineParadoxConfig({
  mode: 'write',
  docs: {
    usage: {
      description: renderBunPolicyDocumentation(
        readFileSync(new URL('./src/cli/usage.md', import.meta.url), 'utf8'),
      ),
    },
  },
  package: {
    root: '.',
    entrypoints: [
      'src/cli/index.ts',
      'src/tools/eslint/index.ts',
      'src/tools/knip/index.ts',
      'src/apmRelease.ts',
      'src/types/public.ts',
    ],
  },
  output: { dir: './paradox' },
});

Generated documentation

Public API

Utilities

validateApmReleaseCandidate
validateApmReleaseCandidate(candidate: ApmPackedReleaseCandidate, options?: ApmReleaseValidationOptions) => ApmReleaseValidationResult

Validate packed owner evidence using the released APM protocol, never a copied schema. Opt-in packages declare ankh.apm with protocolVersion and a package-relative descriptor. No metadata means not applicable, not a claim that no migration is needed. The descriptor declares supported no-migration, required migration, or unsupported/manual history explicitly. Previous descriptors enforce immutable migration checksums and related descriptors validate cross-owner prerequisites. Package-owned source-to-target tests must also cover skipped versions, idempotency, interruption/recovery, and unsupported historical states.

Module: src/features/apm-release-validation/application/validateApmReleaseCandidate.ts Source: src/features/apm-release-validation/application/validateApmReleaseCandidate.ts:31:1 Related symbols: ApmPackedReleaseCandidate, ApmReleaseValidationOptions, ApmReleaseValidationResult

validatePackedApmReleaseAsync
validatePackedApmReleaseAsync(targetDirectory: string, options?: ApmReleaseValidationOptions) => Promise<ApmReleaseValidationResult>

Validate script-free publish bytes and optionally retain that exact accepted archive. Release order is APM protocol, package-owner metadata/code, then consuming applications. Build after Changesets versioning and descriptor synchronization. Execute package-owned acceptance tests, then validate with explicit owner-code consent. The child probe uses the packed package's native public export resolution and installed dependencies, not omitted source. Consent permits trusted executable code; a child process is not a security sandbox. An artifactPath retains accepted bytes exclusively, so publication need not repack or rerun lifecycle scripts. expectedIntegrity rejects a stale candidate before any owner code loads.

Module: src/features/apm-release-validation/composition/validatePackedApmReleaseAsync.ts Source: src/features/apm-release-validation/composition/validatePackedApmReleaseAsync.ts:17:1 Related symbols: ApmReleaseValidationOptions, ApmReleaseValidationResult