Installation
Install the kernel package in an application:
yarn add @haskou/ddd-kernelThat is enough for the core kernel, contracts, domain primitives, dependency injection and in-memory adapters.
Install extra packages only for the adapters your application imports.
The core package does not load optional adapter dependencies from the root import. Install the peer packages listed below only when importing the matching subpath.
Pub/Sub Adapters
The in-memory pub/sub adapter has no extra runtime dependencies.
import { InMemoryPubSub } from '@haskou/ddd-kernel/adapters/pubsub/in-memory';The AMQP adapter uses amqplib:
yarn add amqplibimport { AmqpMessageBusAdapter } from '@haskou/ddd-kernel/adapters/pubsub/amqp';DB Adapters
The in-memory repository adapter has no extra runtime dependencies.
import { InMemoryRepository } from '@haskou/ddd-kernel/adapters/db/in-memory';The MongoDB repository adapter uses mongodb:
yarn add mongodbimport { MongoRepository } from '@haskou/ddd-kernel/adapters/db/mongo';UI Adapters
The Express adapter uses express, routing-controllers and decorator metadata packages:
yarn add express routing-controllers reflect-metadata class-transformer class-validatorimport { ExpressKernelServer } from '@haskou/ddd-kernel/adapters/ui/express';Install cors only when enabling routingControllersOptions.cors:
yarn add corsOther Adapters
Schedulers use node-cron:
yarn add node-cronThe Winston logger uses winston:
yarn add winstonWebSocket helpers use ws:
yarn add wsTypeScript Resolution
The package publishes ESM, CommonJS and declaration files for every public subpath. Modern projects should prefer moduleResolution: "NodeNext" or "Bundler", but declaration mappings are also provided for projects still using classic moduleResolution: "node".