Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / index / ConcernDescriptor

Interface: ConcernDescriptor

Defined in: conventions/ConventionLoader.ts:24

Describes one auto-registration concern: where to scan and how to register what it finds.

Properties

name

name: string

Defined in: conventions/ConventionLoader.ts:26

Identifier, e.g. "models". Used as the config key for path overrides.


order

order: number

Defined in: conventions/ConventionLoader.ts:28

Lower runs first (models=10, observers=20, policies=30, listeners=40, …).


dir?

optional dir?: string

Defined in: conventions/ConventionLoader.ts:30

App-relative directory to scan, e.g. "app/models". Omit for one-shot concerns.


envs?

optional envs?: AppEnvironment[]

Defined in: conventions/ConventionLoader.ts:32

Environments this concern runs in. Default: all.

Methods

register()?

optional register(exports, ctx): void | Promise<void>

Defined in: conventions/ConventionLoader.ts:34

Register the relevant exports from one discovered module.

Parameters

exports

Record<string, unknown>

ctx

ConcernContext

Returns

void | Promise<void>


run()?

optional run(ctx): void | Promise<void>

Defined in: conventions/ConventionLoader.ts:36

One-shot hook run once after this concern's files (or instead of scanning).

Parameters

ctx

ConcernContext

Returns

void | Promise<void>