feat: Hono framework support for all providers#15
Merged
Conversation
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15 +/- ##
==========================================
- Coverage 93.17% 92.68% -0.50%
==========================================
Files 13 13
Lines 293 328 +35
Branches 59 72 +13
==========================================
+ Hits 273 304 +31
- Misses 15 17 +2
- Partials 5 7 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…noHandler Covers Array.isArray(value) branch (line 24) and hasBody=true path. Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Hono framework support to serverless-adapter. Hono uses Web API Request/Response (not Node.js http streams), so a new
honoHandlerbridges ServerlessRequest → Web API Request →app.fetch()→ Web API Response → ServerlessResponse.Changes
Core Implementation
src/framework.ts: AddedhonoHandler()function and.fetchduck-type detection before existing Koa/Express checkssrc/index.ts: Widenedapptype to acceptHonoApp;HandlerResultincludesmultiValueHeaderssrc/types/index.ts: AddedHonoApptype;ServerlessResponseandServerlessAdapterincludemultiValueHeadersProvider Response Pipeline (multiValueHeaders)
src/types/aliyun.ts,src/types/tencent.ts,src/types/volcengine.ts: AddedmultiValueHeadersto response typessrc/providers/aliyun.ts,src/providers/tencent.ts,src/providers/volcengine.ts:formatResponse()now passes throughmultiValueHeaderssrc/transport.ts:sanitizeHeaderskeeps multi-value set-cookie inmultiValueHeadersonly (RFC 6265 compliance)Testing
Documentation
Key Design Decisions
typeof app.fetch === "function"getSetCookie()used on Node 20+;Headers.forEachfallback on Node 18headersas string; multiple →multiValueHeadersas array (RFC-compliant)Fixes #14