Skip to main content

gentleduck/registry build

Generic index-building core with explicit extensions, type-safe config, and incremental rebuilds.

What this package is

A consumer-owned build system for indexable content.

Use it when you need to:

  • Declare one or more named collections of data or source trees.
  • Attach structured metadata to those collections.
  • Emit machine-readable indexes or repository artifacts.
  • Generate derived outputs: manifests, search indexes, component indexes, theme files.
  • Keep the build reproducible and consumer-owned instead of hardcoding repo paths.

The package splits into a small core and explicit extensions. The base runner stays reusable; docs-site builds still work through a compatibility layer.


Why it exists

The old approach to registry generation looks like this:

  • Arrays of entries hardcoded in source.
  • Output paths hidden behind environment variables.
  • Framework-specific logic baked into the build.
  • One repo layout assumed forever.

registry-build replaces that with:

  • A typed registry-build.config.ts.
  • A generic collections model for non-UI consumers.
  • Path-aware config composition with extends.
  • Explicit extension hooks for optional outputs.
  • CLI-driven execution.
  • Incremental caching for repeated local builds.

Architecture at a glance

Loading diagram...


Capability map

LayerResponsibilityWhy it matters
Config loaderDiscover config, resolve extends, normalize pathsConsumers own the build contract
Collections modelMaterialize named datasets and source declarationsNon-UI consumers get a generic starting point
Compatibility layerTranslate legacy UI config into generic collection artifactsExisting docs-style builds keep working while the core evolves
Built-in extensionsIndex build, components, colors, component index, validation, bannerAll processing is extension-driven, nothing runs by default
Custom extensionsAdd repository indexes, manifests, search indexes, or any domain-specific outputComposable and explicit
CLIRun builds from app/package rootsWorks like a normal tool, not a repo-only script
Performance layerFile-hash cache, write skipping, changed-only mode, bounded concurrencyFast warm builds and less filesystem churn


Installation


npm install @gentleduck/registry-build

npm install @gentleduck/registry-build

Core model


Typical use cases

  • Build a docs-site registry from component source folders.
  • Emit an installable JSON index for a CLI.
  • Generate an Arch-like repository database and search manifest.
  • Create a component import map for a framework.
  • Generate theme and token payloads from static data files.
  • Produce custom artifacts through extension hooks after the base registry runs.

Production checklist

  • Keep the config beside the app or package that owns the outputs.
  • Start new non-UI builds from collections rather than UI compatibility fields.
  • Declare every UI registry item type through the registry:${string} namespace.
  • Use extensions for optional or logic-bearing outputs.
  • Verify two consecutive warm builds rewrite zero files when nothing changed.
  • Keep .registry-build/ ignored by Git.
  • Add typecheck, docs-content build, and at least one consumer smoke test to CI.