Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4.4 KiB
4.4 KiB
@suaveplan/api-router-hono — concrete Hono router adapter for the @suaveplan/api plugin system. Implements the abstract Router contract from @suaveplan/api-router on top of a Hono instance, including the HonoBlueGreenSlot atomic-flip primitive and bidirectional Middleware <-> Hono MiddlewareHandler adapters. Passes runRouterConformance.
Stage-4 concrete Hono router adapter for @suaveplan/api. Implements the abstract Router contract from @suaveplan/api-router on top of a Hono Hono instance and provides the matching BlueGreenSlot implementation for hot-reload.
Documentation tree
- adapter —
HonoRouteris The concreteRouteradapter for the API plugin system. It implements every public method…- adapter —
HonoRouteris The concreteRouteradapter for the API plugin system. It implements every public method…
- adapter —
- blue-green-slot —
HonoBlueGreenSlotis the per-plugin atomic flip primitive backing hot-reload for a Hono-backedRouter. It holds at…- blue-green-slot —
HonoBlueGreenSlotis the per-plugin atomic flip primitive backing hot-reload for a Hono-backedRouter. It holds at…
- blue-green-slot —
- error-codes — This module defines the canonical, frozen error-code namespace
ROUTER_HONO.*shared by every production path inside `…- error-codes — This module defines the canonical, frozen error-code namespace
ROUTER_HONO.*shared by every production path inside `…
- error-codes — This module defines the canonical, frozen error-code namespace
- middleware-adapter — This module bidirectionally bridges the onion-model
Middlewaretype from@suaveplan/api-routerand Hono's n…- middleware-adapter — This module bidirectionally bridges the onion-model
Middlewaretype from@suaveplan/api-routerand Hono's n…
- middleware-adapter — This module bidirectionally bridges the onion-model
- pipeline —
@suaveplan/api-host's request pipeline drives its routing through aPipelineRouter-shaped seam — `match(method, url…- pipeline —
@suaveplan/api-host's request pipeline drives its routing through aPipelineRouter-shaped seam — `match(method, url…
- pipeline —
What it ships
HonoRouter/createHonoRouter()— concreteRouteradapter that subclasses the abstract base, mirrors every verb registration onto a private Hono app, and exposesgetHonoApp()for ops integrations.HonoBlueGreenSlot—BlueGreenSlotimpl with atomic flip, in-flight counter, AbortSignal-awaredispose(timeoutMs).toHonoMiddleware/fromHonoMiddleware— bidirectional bridge between the onion-modelMiddlewareand Hono'sMiddlewareHandler.ROUTER_HONO_CODES/RouterHonoError— stable error-code registry (ROUTER_HONO.HONO_INTERNAL_ERROR,ROUTER_HONO.INVALID_HONO_PEER).
Conformance
The package passes runRouterConformance from @suaveplan/api-router/testing — see tests/conformance.test.ts. Adding new behaviours requires re-running the harness against the adapter.
Modules
src/adapter/adapter.md— adapter façade + factory.src/blue-green-slot/blue-green-slot.md— hot-reload primitive.src/middleware-adapter/middleware-adapter.md— middleware bridge.src/error-codes/error-codes.md— error registry.
Usage
import { createHonoRouter, HonoBlueGreenSlot } from "@suaveplan/api-router-hono";
const router = createHonoRouter({ plugin: "billing" });
router.get("/invoices/:id", () => null);
const slot = new HonoBlueGreenSlot("billing", () => "v1");
slot.setShadow(() => "v2");
const draining = slot.flip();
await slot.dispose(draining.slotId, { timeoutMs: 1_000 });
Dependencies
@suaveplan/api-router— abstract contract + conformance harness.@suaveplan/api-types—OtelSpanLike,TenantId,Principal.@suaveplan/error—SuaveplanError+defineCodes.hono(peer ≥4.0.0) — wire-side dispatch.
Version
0.1.0 — initial Stage-4 ship. Graduates to 1.0.0 when the plugin system as a whole is declared production-ready.