Scope
Closes the fourth bullet of #421's acceptance list:
- A `@hono/perry-server`-shaped adapter exists, either inside `perry-stdlib` or as a separate package, and is documented.
Plan
Hono uses runtime-specific adapters (`@hono/node-server`, Bun adapter, Deno adapter, Workers adapter). Perry needs one that hands the listening socket / request stream to Hono's `app.fetch`.
Two viable paths:
1. Inside perry-stdlib (or perry-ext-fastify-style external crate) — re-use the hyper accept loop that perry-ext-fastify already runs. Wraps it with a Hono-shaped `serve({ port, fetch })` API. Bundled by default, no `bun add` needed. Minimal code; same shape as Bun's built-in adapter.
2. Separate `@perryts/hono-perry-server` npm package — pure-TS, uses perry's `net.createServer` directly. Independently versioned, npm-installable.
Lean toward (1) since perry-ext-fastify already has the hyper plumbing — `@hono/perry-server` becomes a thin shim. Path-of-least-surprise is option (1).
Blocked on
#485 must land first (class-field inheritance). Without the dispatch chain firing, the adapter has nothing to dispatch into.
Acceptance
- `import { serve } from '@hono/perry-server'` (or wherever it lands) works
- `serve({ fetch: app.fetch, port: 3000 })` listens on port 3000
- Curl response body + headers diff clean against the Bun-adapter version
- Documented in `docs/src/stdlib/` (or in the package README if external)
Scope
Closes the fourth bullet of #421's acceptance list:
Plan
Hono uses runtime-specific adapters (`@hono/node-server`, Bun adapter, Deno adapter, Workers adapter). Perry needs one that hands the listening socket / request stream to Hono's `app.fetch`.
Two viable paths:
1. Inside perry-stdlib (or perry-ext-fastify-style external crate) — re-use the hyper accept loop that perry-ext-fastify already runs. Wraps it with a Hono-shaped `serve({ port, fetch })` API. Bundled by default, no `bun add` needed. Minimal code; same shape as Bun's built-in adapter.
2. Separate `@perryts/hono-perry-server` npm package — pure-TS, uses perry's `net.createServer` directly. Independently versioned, npm-installable.
Lean toward (1) since perry-ext-fastify already has the hyper plumbing — `@hono/perry-server` becomes a thin shim. Path-of-least-surprise is option (1).
Blocked on
#485 must land first (class-field inheritance). Without the dispatch chain firing, the adapter has nothing to dispatch into.
Acceptance