Skip to content

break(kernel): 💥 Add integration extension points - #7

Merged
haskou merged 19 commits into
mainfrom
break/integration-extension-points
Jun 25, 2026
Merged

break(kernel): 💥 Add integration extension points#7
haskou merged 19 commits into
mainfrom
break/integration-extension-points

Conversation

@haskou

@haskou haskou commented Jun 25, 2026

Copy link
Copy Markdown
Owner

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 MessageBus from domain-specific DomainMessageBus.
  • Extends ExpressKernelServer with external controllers, phase hooks, configurable middleware, controller DI integration, duplicate-run protection and an imperative HTTP pipeline registration API.
  • Adds routingControllersOptions passthrough for useExpressServer, including cors, defaultErrorHandler and routing-controllers middleware classes.
  • Resolves express and routing-controllers from the consumer application root so local file: installs do not accidentally use a nested package runtime.
  • Adds a shared HttpErrorHandler for 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, useValue and useFactory, 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 keeping CONTAINER_BUILD=true as fallback.
  • Adds TypeScript moduleResolution: node support 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

  • MessageBus in @haskou/ddd-kernel/contracts/pubsub is now a generic pub/sub contract. Domain-event buses should use DomainMessageBus from @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, optional cors peer usage and HttpErrorHandler
  • 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-injection references
  • TypeScript classic moduleResolution: node compatibility
  • Renovate dependency automation and README badges
  • README branch/release positioning without the old stability section

Validation

  • yarn format:check
  • yarn lint
  • yarn typecheck
  • yarn test
  • yarn test:coverage (100% statements, branches, functions and lines)
  • yarn docs:build
  • yarn --cwd example typecheck
  • yarn --cwd example build
  • NODE_ENV=development PORT=0 timeout 8 yarn --cwd example start

@codecov-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@haskou haskou changed the title break: add integration extension points break(kernel): 💥 Add integration extension points Jun 25, 2026
@haskou
haskou force-pushed the break/integration-extension-points branch from 1c12047 to 65b2030 Compare June 25, 2026 19:39
@haskou
haskou force-pushed the break/integration-extension-points branch from 65b2030 to 0ee5200 Compare June 25, 2026 19:46
@haskou
haskou marked this pull request as ready for review June 25, 2026 19:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ee5200854

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapters/pubsub/amqp/AmqpMessageBusAdapter.ts Outdated
Comment thread src/adapters/ui/express/HttpErrorHandler.ts Outdated
@haskou
haskou merged commit bd4eb1e into main Jun 25, 2026
2 checks passed
@haskou
haskou deleted the break/integration-extension-points branch June 25, 2026 20:01
github-actions Bot added a commit that referenced this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants