Add Hono health-check integration with options-first API, typed variables support, and integration coverage#161
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
==========================================
+ Coverage 98.21% 98.30% +0.08%
==========================================
Files 14 15 +1
Lines 1064 1179 +115
Branches 75 77 +2
==========================================
+ Hits 1045 1159 +114
Misses 13 13
- Partials 6 7 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot can you make it just like fastify or avvio integration where we pass medicus options directly instead of having to create a medicus instance separately? |
arthurfiorette
left a comment
There was a problem hiding this comment.
Please also bump a patch version of this package
Done in a941e78. |
This PR adds first-class Hono support so Medicus can expose health endpoints in Hono apps with the same HTTP semantics used by existing integrations. It also aligns docs/navigation and package metadata so the integration is discoverable and install-safe.
Integration:
createHonoHealthCheckHandlersrc/integrations/hono.tswith a Hono handler factory backed by shared HTTP utilities.Medicusinstance.debug,last, andsimulate=healthy|degraded|unhealthy.200for healthy/degraded,503for unhealthy), with configurable response headers.c) as the Medicus context for checkers (no custom context override path).lastbehavior for HTTP responses while using request-scoped Medicus instances.Typing support for Hono context variables
MedicusVariables<E, P, I>so users can type-safec.set('medicus', ...)andc.get('medicus').Context<E, P, I>generics through Hono integration types so custom context generics are preserved.Unit coverage for Hono behavior
test/integrations/hono.test.ts.Docs and navigation updates
docs/integrations/hono.mdwith usage, query params, and options.Package metadata
honoas an optional peer dependency and as a dev dependency for local test execution.1.3.1.