The entire published surface. package.json#exports points here and TypeDoc
documents from here, so a symbol is API when it appears below and internal
when it does not. Keep it a barrel — behaviour belongs in core/.
Layers
Directory
Holds
May import from
index.ts
re-exports only
every layer
core/
behaviour: Service, Logger, the config engine
every layer below
types/
shapes callers receive or supply, incl. capabilities
nothing in src/
constants/
values that never depend on runtime state
nothing in src/
exceptions/
the faults raised
nothing in src/
security/
primitives that exist to be safe
nothing in src/
utils/
helpers any library could use
nothing in src/
Dependency arrows point into the leaf layers and never back out. A lint rule
enforces it, because a convention only survives as long as everyone remembers
it, and the import that breaks it looks like every other import at the point
it is written.
What belongs in this package
The layer everything else depends on, which holds only while it names no
vendor, no runtime, and no HTTP framework. Anything here that seems to need a
vendor SDK, a runtime's types, or an HTTP framework belongs in an adapter
package instead — a second lint rule enforces that too.
Remarks
The entire published surface.
package.json#exportspoints here and TypeDoc documents from here, so a symbol is API when it appears below and internal when it does not. Keep it a barrel — behaviour belongs incore/.Layers
index.tscore/Service,Logger, the config enginetypes/src/constants/src/exceptions/src/security/src/utils/src/Dependency arrows point into the leaf layers and never back out. A lint rule enforces it, because a convention only survives as long as everyone remembers it, and the import that breaks it looks like every other import at the point it is written.
What belongs in this package
The layer everything else depends on, which holds only while it names no vendor, no runtime, and no HTTP framework. Anything here that seems to need a vendor SDK, a runtime's types, or an HTTP framework belongs in an adapter package instead — a second lint rule enforces that too.
Quick start
Author
Bayu Dwiyan Satria
Version
1.0.0
Since
1.0.0