Skip to main content

Testing and CI

Recommended test layers, CI commands, and production release checks for registry-build consumers.

LayerWhat to testWhy
Config testsloading, defaults, merge, extends, validationcatches wrong config shape early
Extension testsindex-build, components, colors, component-index, adapterscatches deterministic output regressions
Change detection testscache keys, affected-path matching, incremental rebuildproves cache correctness
Golden testsfull generated fixture treeprotects output contracts
Consumer smoke testsreal app/package scriptsproves the actual integration path
Pack/install smoke testspacked CLI works in a temp consumerproves publish surface

Good baseline commands

For the package itself:

bun run check-types
bun test
bun run build
bun run check-types
bun test
bun run build

For a real consumer:

bun run check-types
registry-build build
bun run check-types
registry-build build

For an installability check:

npm pack --dry-run
npm pack --dry-run

Golden output strategy

Golden fixtures are the strongest regression net for this kind of package.

Use them when you need to detect:

  • ordering changes
  • emitted file name changes
  • content rewrite regressions
  • stale file cleanup regressions
  • extension output drift

The most reliable pattern is:

  1. create a small fixture source tree
  2. run the full build into a temp output directory
  3. compare the generated files with checked-in expected outputs

Consumer CI example

bun run check-types
bun run build:reg
bun run build
bun run check-types
bun run build:reg
bun run build

This keeps the generated registry path in the same pipeline as the app build that consumes it.


Release checklist

Package checks before publish

Make sure typecheck passes, tests pass, build output is generated cleanly, the packed tarball exposes the expected bin and exports, and a temp consumer can execute the installed CLI.

Consumer checks before rollout

Make sure the owning app or package can run registry-build build, a no-op warm build rewrites nothing, changed-only runs only touch the expected artifacts, and the downstream app build still passes with the generated files.

Debugging checks when something drifts

Compare generated outputs against the last known good tree, inspect the cache manifest under .registry-build/, run once with incremental: false if you need to rule out cache behavior, and prefer deterministic ordering in custom generators and extensions.


Production standard