Skip to content

feat: add @midwayjs/hono component scaffold#4508

Open
czy88840616 wants to merge 4 commits intov4-nextfrom
codex/add-hono-component-similar-to-koa-and-express
Open

feat: add @midwayjs/hono component scaffold#4508
czy88840616 wants to merge 4 commits intov4-nextfrom
codex/add-hono-component-similar-to-koa-and-express

Conversation

@czy88840616
Copy link
Copy Markdown
Member

Motivation

  • Provide a new Hono-based web component for Midway to match existing koa/express scene and allow users to run Hono apps under Midway's lifecycle and router integration.

Description

  • Add a new package packages/web-hono with package metadata, TypeScript build config, Jest config and type augmentation (index.d.ts).
  • Implement MidwayHonoFramework in src/framework.ts that mounts Hono routes from Midway router table, bridges Hono to a Node http server (createServer), and implements lifecycle hooks run, beforeStop, getServer, and getPort.
  • Add HonoConfiguration in src/configuration.ts that registers parameter handlers (e.g., BODY, PARAM, QUERY, HEADERS) to enable controller parameter extraction compatible with Midway's decorators.
  • Provide src/interface.ts types, src/index.ts exports, default config in src/config/config.default.ts, and basic test fixtures and tests under test/ to validate package exports and default config.
  • Update pnpm-lock.yaml to include the new workspace dependencies (hono, @hono/node-server).

Testing

  • Built the package with pnpm -C packages/web-hono build, which completed successfully. (pass)
  • Ran unit tests with pnpm -C packages/web-hono test, which executed the package tests and they passed (2 passed, 0 failed). (pass)

Codex Task

@czy88840616 czy88840616 added the pr: new feature This PR adds a new API or behavior. label Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex pr: new feature This PR adds a new API or behavior.

Development

Successfully merging this pull request may close these issues.

1 participant