CodeVetter · Repo Unpack · Extension points
avajs/ava
AVA exposes several deliberate extension seams rather than one general plugin registry. User macros and setup modules customize test behavior, while providers customize loading and compilation. Shared-worker factories supply cross-file services through a versioned messaging protocol. CLI flags, declaration chains, reporters, and public types form coordinated internal extension surfaces.
- CLI options are centralized in FLAGS and yargs command definitions; adding an execution option also requires mapping it into combined configuration and Api constructor options.
- createChain() uses a WeakMap registry and metadata flags to compose declaration APIs; macros are frozen exec/title records interpreted by parseTestArgs().
- Configuration may export an async factory receiving projectDir; require entries can name setup modules or argument tuples whose default functions are awaited before tests.
- provider-manager imports a provider factory and negotiates ava-8; the negotiated interface supplies AVA version, projectDir, findFiles(), and glob normalization, with @ava/typescript as the registered provider.
- Provider main hooks contribute extensions, update globs, and compile state; worker hooks expose canLoad()/load(), while watcher hooks interpret compilation changes.
- ava/plugin.registerSharedWorker() deduplicates registrations by filename and requires ava-4; its factory interface exposes readiness, broadcasts, subscriptions, connected test workers, and per-worker teardown.
- Reporter classes consume plan.status stateChange events through startRun()/endRun(); experimental observeRun exposes an async event iterator only when observeRunsFromConfig is enabled.
- registerCompletionHandler() adds ordered callbacks scheduled on nextTick without awaiting results; exported declaration files provide the corresponding typed public API surface.