0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-22 11:17:33 +01:00
Commit Graph

128 Commits

Author SHA1 Message Date
hayatosc
6f69bf04b7
feat(websocket): Add generics type to WSContext (#3337)
* Extends WSContext's types

* Add new generics on UpgradeWebSocket types

* fix with linter

* revert createWSContext types

* prettier fix
2024-09-08 15:49:09 +09:00
Yusuke Wada
8e56989cde
feat(cloudflare-pages): enable c.env.eventContext in handleMiddleware (#3332) 2024-09-08 15:45:53 +09:00
Yusuke Wada
7a254bc0c7
fix(serve-static):supports directory contains . and not ends / (#3256) 2024-08-11 13:01:29 +09:00
Yusuke Wada
f0b012ddf7
fix(service-worker): refer to self.fetch correctly (#3200) 2024-07-29 22:34:10 +09:00
Shotaro Nakamura
c2698fa2e0
feat: Introduce Service Worker Adapter (#3062)
* feat: Intoroduce service worker adapter

* test: add test

* chore: format code

* refactor: handler.ts

* chore: remove unused import

* fix: add webworker to jsr.json

* fix: triple slash directives to tsconfig.json

* feat: add types.ts to define worker types
2024-07-11 17:16:52 +09:00
yasuaki640
4a4e851d50
feat(lambda-edge): add getConnInfo helper for Lambda@Edge (#3099)
* add conninfo helper for lambda@edge

* export getConnInfo
2024-07-11 17:08:36 +09:00
ryu
74310f469b
fix(vercel): remove deprecated address type (#3115) 2024-07-09 06:57:42 +09:00
promer94
ce1c8172d9
feat(vercel): add getConnInfo for vercel adapter (#3085) 2024-07-08 23:46:56 +09:00
Yusuke Wada
58f421fa27 Merge branch 'main' into next 2024-07-08 22:10:10 +09:00
Trung Dang
1e3e58bb45
fix(aws-lambda): set cookies with comma is bugged (#3084)
* fix(aws-lambda): setting cookies with comma is bugged

* style: apply lint & format fixes
2024-07-04 14:54:49 +09:00
Jonathan Haines
f393730d44
fix(cloudflare-pages): Expose Cloudflare Pages type parameters (#3065) 2024-07-01 16:23:22 +09:00
Jonathan Haines
204e10b7ce
feat(cloudflare-pages): Add Cloudflare Pages middleware handler (#3028)
* Add Cloudflare Pages middleware handler

* fix: handle HTTPException

* fix: handle context.error

* fix: remove HonoRequest from conninfo test
2024-06-29 17:35:20 +09:00
Yusuke Wada
cb79f2302b
test(adapter/bun): fixed conninfo.test.ts (#3059) 2024-06-29 17:20:06 +09:00
Yusuke Wada
5201c9fe31 Merge branch 'main' into next 2024-06-27 21:59:59 +09:00
yasuaki640
afa44e9707
feat(adaptor): Remove unknown from AddressType (#2958)
* fix(typo): Fix typo in request.test.ts

* fix: remove 'unknown' string from AddressType

* fix: return undefined when addressType is invalid string

* fix: change addressType in getConnInfo function to undefined

* fix: change addressType in getConnInfo function to undefined

* fix: remove unused "unknown" string
2024-06-27 11:23:36 +09:00
Yusuke Wada
ae3a67beb1
perf(context): improve initializing Context (#3046)
* perf(context): improve initializing `Context`

* update to pass tests and CI

* removed not used module

* remove not used module
2024-06-27 10:44:37 +09:00
Ame_x
d383e49ed8
fix(websocket): change to allow use of websocket options (#2999)
* fix: change to allow use of websocket options

* fix types

* change args

* fix

* add tests

* change to any

* add ignore any comment

* merge into mian

* Revert "add ignore any comment"

This reverts commit 8b3a34f212.

* Revert "merge into mian"

This reverts commit bf82da8d90.

* add ignore any comment
2024-06-21 22:08:58 +09:00
Markus Wolf
a2a04a98a1
fix(aws-lambda): handle multiple cookies in streaming responses (#2926)
* fix: handle multiple cookies in streaming responses

This fix does address that cookies have to be handled
specially in lambda responses.

Fixes #2921

* test: check cookie handling
2024-06-12 19:25:37 +09:00
ryu
0d851b689c
fix(cloudflare-workers): export getConnInfo() (#2906)
* fix(cloudflare-workers): export getConnInfo()

* format
2024-06-05 10:05:34 +09:00
TATSUNO “Taz” Yasuhiro
ec3648d0c3
refactor(aws-lambda): merge custom-context into types (#2889)
* refactor(aws-lambda): merge custom-context into types so they are excluded from coverage

* refactor: custom-context.ts is not needed since it is hidden by reexport
2024-06-03 00:16:07 +09:00
Ron Keiser
eb3d85674f
fix(cloudflare-workers): Update websocket.ts to return 101 status code (#2886)
Closes #2883
2024-06-02 22:28:31 +09:00
JetLu
320b945eff
fix(websocket): the onopen event cannot be triggered during delayed operations in deno (#2864)
* fix: The onopen event cannot be triggered during delayed operations

* fix: The onopen event cannot be triggered during delayed operations

* chore: delete test

* chore: tidy
2024-06-02 17:56:31 +09:00
Ame_x
4bf923746e
refactor: removed unnecessary line (#2869) 2024-05-31 17:51:46 +09:00
Ame_x
a852327059
fix: add return types of void function (#2870)
* fix

* chore: format
2024-05-31 08:11:31 +09:00
TATSUNO “Taz” Yasuhiro
0735e0cc56
refactor(aws-lambda): remove unused setHeadersToResult (#2828) 2024-05-29 23:14:38 +09:00
Shotaro Nakamura
3d0fbfb7a8
feat(bun): WebSocket helper supports that env be { server: server } (#2812)
* feat: WebSocket helper supports `{ server }`

* test: add test

* chore: format code

* fix: test

* chore: format code

* fix: format code with new rule

* chore: format code

Fixes #2645
Fixes #2696
2024-05-29 03:01:14 +09:00
fzn0x
a3d9cc7d95
refactor(websocket): remove unused condition (#2839) 2024-05-29 02:47:54 +09:00
TATSUNO “Taz” Yasuhiro
029cf71303
refactor(aws-lambda): Object.hasOwn is recommended (#2831)
Refer.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
2024-05-28 13:01:24 +09:00
Tshepo Mgaga
dfbc6c4764
fix(aws-lambda): Update handler.ts getQueryString (#2782)
Updated the getQueryString function to handle the case when both queryStringParameters and multiValueQueryStringParameters properties exists.
2024-05-28 07:08:35 +09:00
Yusuke Wada
6d9f1f09a9
docs: add module doc (#2796) 2024-05-26 14:16:25 +09:00
Yusuke Wada
cc4b2b3c7f
chore(lint): update eslint rules (#2790)
* chore(lint): update eslint rules

* fix formats
2024-05-26 05:17:45 +09:00
Yusuke Wada
1b2a4c0800
feat(jsr): support JSR (#2662)
* feat(jsr): reduce slow types (#2369)

* feat(jsr): reduce slow types

* fix: use allow function

* chore: format code

* chore: denoify

* add `deno.json`

* add `jsr-dry-run` command for CI

* don't put `JSX` on `global`

* fix test settings for deno

* don't use `dynamicClass`

* don't declare `ExecutionContext` in `global`

* goodbye denoify

* exports `./middleware`

* exports `./helper`

* exports each helper and middleware

* remove the `awslambda` implementation which is not enough

* feat(jsr): remove helper.ts and middleware.ts (#2667)

* feat(jsr): remove helper.ts and middleware.ts

* fix: fix test

* dont' use `SuperClass`

Co-authored-by: Taku Amano <taku@taaas.jp>

* feat(jsr): delete `mod.ts` (#2669)

* rename `deno.json` to `jsr.json`

* lint

* remove slow type in lambda adapter

* fixed runtime test for deno

* export all utils

* add a GitHub action to publish the package to JSR

* fixed declaring `ContextVariableMap`

* fixed the type error

* include `jsr.json` in `jsr.json`

* update `jsr.json`

---------

Co-authored-by: Shotaro Nakamura <79000684+nakasyou@users.noreply.github.com>
Co-authored-by: Taku Amano <taku@taaas.jp>
2024-05-24 17:47:28 +09:00
Yusuke Wada
ab7144871b
refactor(cloudflare-workers): remove @cloudflare/workers-types (#2773)
* refactor(cloudflare-workers): remove `@cloudflare/workers-types`

* add `@denoify-ignore`

* add missing comment
2024-05-24 06:01:12 +09:00
Shotaro Nakamura
a8a5fb97ca
feat: Introduce ConnInfo helper/adapter (#2595)
* feat: Introduce ConnInfo helper/adapter

* chore: format code

* chore: run ESLint and add `// @denoify-ignore`

* chore: denoify

* feat: export conninfo types

* fix: fix test

* feat(conninfo/bun): support that env be {server: server}

* chore: eslint

* chore: `lint:fix`

* fix(conninfo/bun): English syntax for error message

* fix: don't use singleQuote in string
2024-05-23 05:39:18 +09:00
Ilias YAHIA
a437161c2b
feat(aws-lambda): add support for alb multiValueQueryStringParameters (#2751) 2024-05-21 08:59:31 +09:00
Ilias YAHIA
e1257f14e6
feat(aws-lambda): add alb event processor (#2657)
* feat(aws-lambda): add alb event processor

* fix: formatting issue
2024-05-13 14:41:57 +09:00
Aluisio Amorim
c95e1355cf
fix(aws-lambda): avoid duplicating already set headers (#2585)
* fix: avoid duplicating already set headers

* test: add missing content-type header
2024-05-07 05:44:26 +09:00
Yusuke Wada
36f508eb39
feat(cloudflare-workers): deprecate serveStatic (#2583) 2024-05-01 23:45:48 +09:00
Hyeseong Kim
33a7707439
feat(serve-static): expose serve-static builder (#2515)
* feat: allow to use serve-static builder

* typo

* add stricter type requirement as it is public interface

* allow specifying content-type (and others) from user code

* fix type

* rename the export the `serve-static`

* add a test
2024-05-01 07:03:07 +09:00
Hyeseong Kim
d091c6a180
fix(cloudflare-workers): do not buffer content (#2545) 2024-04-24 06:32:34 +09:00
TATSUNO “Taz” Yasuhiro
c83d80f17b
refactor(aws-lambda): replace conditional logics with polymorphism (#2521) 2024-04-19 09:31:33 +09:00
TATSUNO “Taz” Yasuhiro
acb56b8d30
fix(adapter): handle multi value headers in AWS Lambda (#2494)
* Headers can be undefined on ALB

* Delegate headers from multiValueHeaders

* Add test

* Assert header values

* format

* Make multiValueHeaders optional so it can be omitted

* Avoid Object.entries when undefined

* Write tests in runtime_tests
2024-04-18 08:13:37 +09:00
TATSUNO “Taz” Yasuhiro
c2c76a8f34
refactor(cloudflare-workers): Suppress eslint noise (#2504) 2024-04-13 17:03:31 +09:00
TATSUNO “Taz” Yasuhiro
fb31c8aaac
refactor: Remove redundant initializer (#2502) 2024-04-13 16:59:57 +09:00
Markus Wolf
f590d0f6fc
fix(aws-lambda): handle response without body (#2401) (#2413)
In case of a streaming lambda, the response should still contain metadata
like status and content type, even if no body is given.
This could be for example a redirect response.
2024-03-28 05:29:49 +09:00
trkbt10
72f86509f7
fix(lambda-edge): Lambda@Edge GET/HEAD body error. (#2351)
* Fix: Return undefined body for GET/HEAD methods

* Convert to arrow function

* Remove redundant data check
2024-03-16 21:08:49 +09:00
Shotaro Nakamura
47f5c545f2
feat: Introduce WebSocket Helper / Adapter (#2265)
* feat: Add WebSocket API

* chore: format code

* chore: denoify

* feat: remove `bun-types`

* fix(ws): Cloudflare workers

* feat(ws): Add Deno Adapter

* fix(ws): Add Deno exports to package.json

* feat: test code

* chore: denoify

* chore: format code

* fix: eslint

* chore: createBunWebSocket to createWebSocket

* chore: able to import from index.ts

* feat: add workers test

* feat: add deno test

* typo: `normalizedReceiveData`

* refactor: change way to discrimination client type

* fix: bypass test

* fix: format code and bypass test

* fix: forget to delete `console.log` for debug

* feat(ws): remove `hono/ws/{adapter}` import
2024-03-05 22:04:04 +09:00
Yusuke Wada
f8371ab356
fix(serve-static): support extensionless files and refactor (#2260) 2024-02-24 22:38:39 +09:00
Taku Amano
0623c21e58 Merge branch 'main' into v4 2024-02-04 06:06:38 +09:00
Yasha
60e85b31cf
fix(bun): replace fs.existsSync() with Bun.file().exists() (#2115) 2024-01-30 03:51:00 +09:00