All versions since [0.4.0]
[0.4.0]
Changed
- BREAKING: Middleware composition uses config objects instead of tuples. (#117)
Domain-producing middleware now uses
{fn, setPath}config objects instead of[fn, setPath]tuples. Response-only middleware (cors, securityHeaders, cacheControl, rateLimit, precondition, validate, jsonApiQuery) are plain functions — no wrapper needed.normalizeOp()now discriminates viatypeof op === 'function'(wasArray.isArray)MiddlewareTupletype renamed toMiddlewareOpwith{fn, setPath}shape- All 20 middleware inner functions are now named (
fn.nameprovides trace labels) - Migration:
[myFn(), 'key']→{fn: myFn(), setPath: 'key'}
Fixed
- handler.js JSDoc and
HandlerOptionstype now document thepaginateoption forwarded tosend(). (#118)
[0.4.1]
Added
- Factory-time option key validation with Levenshtein suggestions. (#126)
All 18 middleware factories now validate incoming option keys at factory invocation
time via a shared
lib/validate-options.jsutility. Unknown keys emit a deduplicatedprocess.emitWarningwith{type: 'ErgoWarning'}and a “did you mean?” suggestion when the Levenshtein edit distance is within threshold.handler()validates the union of its own keys andsend()keys;send()validates independently. timingoption onhandler()forX-Response-Timeheader. (#127) Passtiming: truefor defaults ortiming: {header?, precision?}for custom configuration. Measures the full request lifecycle (pipeline + error handling + send) via ares.writeHeadinterception. Zero overhead when disabled (default). Shared primitivelib/response-time.jsavailable for deep import by@centralping/ergo-router.
Changed
- README TypeScript Quick Start updated to reflect shipped type infrastructure. (#131)
Removed the forward-looking caveat about future type inference improvements — all
prerequisite features have shipped (compose overloads #87, typed middleware #108,
ergo-router accumulator inference ergo-router#91). Simplified the TS example by removing
the
AuthResultinterface and explicitIncomingMessage/ServerResponseimports. Replaced the caveat with a factual note explaining whenaccannotations are needed (standalonecompose()with interleaved bare functions) and directing users to@centralping/ergo-router’sdefineGet/definePosthelpers for annotation-free inference.