Repository navigation
v1.0.0
Changes
- break(kernel): 💥 Add integration extension points
Release details
- npm: https://www.npmjs.com/package/@haskou/ddd-kernel/v/1.0.0
- Pull request: #7
- Source branch:
break/integration-extension-points - Version bump:
major
Pull request notes
Summary
- Adds a consumer middleware pipeline with built-in idempotency, correlation/causation and retry middleware.
- Adds metadata-aware consumer execution context and AMQP transport metadata propagation.
- Adds publisher hooks, domain-aware publish context and configurable post-publish hook error policy.
- Separates generic
MessageBusfrom domain-specificDomainMessageBus. - Extends
ExpressKernelServerwith external controllers, phase hooks, configurable middleware, controller DI integration, duplicate-run protection and an imperative HTTP pipeline registration API. - Adds
routingControllersOptionspassthrough foruseExpressServer, includingcors,defaultErrorHandlerand routing-controllers middleware classes. - Resolves
expressandrouting-controllersfrom the consumer application root so localfile:installs do not accidentally use a nested package runtime. - Adds a shared
HttpErrorHandlerfor Express/routing-controllers applications, covering malformed JSON, payload-too-large errors, custom app handlers, HTTP status errors, flattened validation errors and unhandled 500 responses. - Adds dependency injection overrides with
useClass,useValueanduseFactory, including support for unresolved references generated from external package imports. - Keeps the instance kernel active during dependency injection so the instance API and legacy static facade stay aligned.
- Adds
kernel.dependencyInjection({ containerBuild })so applications can choose container generation explicitly, while keepingCONTAINER_BUILD=trueas fallback. - Adds TypeScript
moduleResolution: nodesupport coverage. - Polishes the example app with constructor injection, consumer middleware registration, HTTP middleware/hooks/error handling, shutdown hooks and explicit DI build configuration.
- Removes the README stability section now that this is intentionally a major-impact API change.
- Raises coverage thresholds to 100% for statements, branches, functions and lines.
- Adds Renovate dependency automation, a README dependency automation badge and compatible dependency updates.
Breaking changes
MessageBusin@haskou/ddd-kernel/contracts/pubsubis now a generic pub/sub contract. Domain-event buses should useDomainMessageBusfrom@haskou/ddd-kernel/domain.- Route/controller construction can now be delegated to the kernel DI container through
ExpressKernelServer, which changes the recommended route wiring style to constructor injection. - The Express adapter now exposes explicit registration APIs for controllers, middleware, hooks and error handlers; applications should prefer those over ad-hoc local wrappers.
Documentation
Updated docs cover:
- consumer middleware pipeline, metadata and idempotency store expectations
- message bus publisher hooks and hook error policy
- Express phase hooks, external controller registration, HTTP middleware registration,
routingControllersOptions, optionalcorspeer usage andHttpErrorHandler - app-specific HTTP error mappings through
HttpErrorHandler({ handlers }) - scheduler error policy usage
- dependency injection build configuration through
kernel.dependencyInjection({ containerBuild }) - dependency injection overrides for swapping adapters in tests/runtime bootstrap
- external package contract overrides for generated
node-dependency-injectionreferences - TypeScript classic
moduleResolution: nodecompatibility - Renovate dependency automation and README badges
- README branch/release positioning without the old stability section
Validation
yarn format:checkyarn lintyarn typecheckyarn testyarn test:coverage(100% statements, branches, functions and lines)yarn docs:buildyarn --cwd example typecheckyarn --cwd example buildNODE_ENV=development PORT=0 timeout 8 yarn --cwd example start