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

169 Commits

Author SHA1 Message Date
Yusuke Wada
e52e9ab463 fix(types): specify values of ValidationTypes (#766)
* fix(types): specify values of `ValidationTypes`

* export `ValidationTypes`
2023-01-19 22:44:37 +09:00
Yusuke Wada
6c55b629ec fix(types): fixed type structure (#764) 2023-01-19 22:44:37 +09:00
Yusuke Wada
d8abec9291 fix(jsonT): undefined if it is not object (#758)
* v3.0.0-0

* fix(jsonT): `undefined` if it is not object
2023-01-19 22:44:37 +09:00
Yusuke Wada
397c12e181 refactor: refactor and fix Types (#748)
* wip

* refactor: refactor and fix Types
2023-01-19 22:44:34 +09:00
Yusuke Wada
85e3c6a275 feat: new validator middleware using 3rd-party & current middleware obsolete (#745)
* feat: introduce HonoRequest with "wrapper pattern" (#733)

* feat: HonoRequest

* avoid `awaits`

* use `raw` instead of `original`

* feat: types for "RPC" support & build-in validator obsolete

* feat: introduce HonoRequest with "wrapper pattern" (#733)

* feat: HonoRequest

* avoid `awaits`

* use `raw` instead of `original`

* create generic middleare for 3rd-party validator

* indent

* support multiple validators and refactor

* remove unsed lines

* denoify
2023-01-19 22:40:13 +09:00
Yusuke Wada
a6d54dbff3 feat: introduce HonoRequest with "wrapper pattern" (#733)
* feat: HonoRequest

* avoid `awaits`

* use `raw` instead of `original`
2023-01-19 22:40:13 +09:00
Yusuke Wada
3e0f5dae31
fix: fixed type error for optional parameters (#814) 2023-01-18 09:25:37 +09:00
Yusuke Wada
da0a7ce55c
fix(context): enable destruction such json (#813)
This will fix #812
2023-01-18 08:23:58 +09:00
Yusuke Wada
4298f8266a
fix(cors): fix bugs handling pre-flight (#792) 2023-01-09 00:30:53 +09:00
Yusuke Wada
c6969533a7
chore: update license, contributors as the copyright holders (#769) 2023-01-02 19:18:59 +09:00
Yusuke Wada
90de083e1d chore: denoify 2022-12-30 10:01:46 +09:00
Tom Lienard
884b287f3d
feat: Lagon support with runtime detection & tests (#742)
* feat: Lagon support with runtime detection & tests

* ci: build before running test:lagon

* refactor: remove mentions of Lagon since it's still in dev

* test: enable ETag test
2022-12-25 01:42:59 +09:00
Yusuke Wada
4f772ddb44 docs(readme): fixed shields.io badage image url 2022-12-21 06:42:27 +09:00
Yusuke Wada
9a6e4c1802
perf(context): c.text() returns a response immediately if headers is empty (#722) 2022-12-14 22:03:02 +09:00
Yusuke Wada
d755ed50b5
fix(request): req.param() should return undefined not "undefined" (#721) 2022-12-14 01:07:07 +09:00
Yusuke Wada
c6b434addd refactor: shorten 2022-12-13 20:36:30 +09:00
Yusuke Wada
b1973d0c7f
fix(type): make SchemaToProp work correctly (#720) 2022-12-13 17:22:33 +09:00
Yusuke Wada
e6635e9997 chore: denoify 2022-12-12 22:10:14 +09:00
Yusuke Wada
fdea3b1cc6
fix(type): infer types correctly (#715) 2022-12-11 11:05:30 +09:00
Yusuke Wada
3def9b12c0
fix(type): fix the type mismatch if using Handler as middleware (#714)
* fix(type): fix the type mismatch if using `Handler` as middleware

* remove a line
2022-12-10 23:11:27 +09:00
Yusuke Wada
023d1738f0 chore: denoify 2022-12-10 17:16:04 +09:00
Yusuke Wada
59bb0b1a40
feat(handler): "schema" allow normal types (#700)
* feat(handler): "schema" allow normal types

* check types for handler+validator+handler pattern

* denoify

* improve type definitions
2022-12-10 16:37:14 +09:00
unworthyEnzyme
34231435a6
fix: cookie should return string | undefined (#709)
* `cookie` should return `string | undefined`

* update the tests
2022-12-10 01:09:18 +09:00
Yusuke Wada
a5b8b44793
fix(validator): enable checking undefined in rules (#708) 2022-12-08 21:45:54 +09:00
Taku Amano
6d5de04743
fix(reg-exp-router): bug of "star and all" routing (#707)
* fix(reg-exp-router): Comparisons between middleware must be checked in both orientations.

* refactor(reg-exp-router): Simplify the conditions.

* chore: denoify

* fix(reg-exp-router): Copy middleware if the method of new middleware is METHOD_NAME_ALL.

* chore: denoify
2022-12-08 20:11:08 +09:00
Yusuke Wada
cf73de1344
fix(trie-router): bug for routing orders with named param (#704) 2022-12-08 00:54:55 +09:00
Jayden
760ae30251
Fix detecting node runtime (#696)
* Fix

* Denoify

* Avoid error in other runtime

* chore: remove unnecessary config testPathIgnorePatterns (#697)

* Fix vercel

Co-authored-by: Horie Issei <issei.horie@is2ei.com>
2022-12-02 11:28:49 +09:00
Arnaud Dagnelies
9af95c886e
fix: Updated CORS (#693)
* Updated CORS

Do not call `next` for OPTIONS pre-flight requests to avoid side effects and more sensible defaults.

* restoring default cors headers

* restoring cors default allowed methods to avoid breaking change

* Deno dist stuff
2022-12-01 00:11:06 +09:00
Dario Piotrowicz
1f43164da5
Fix Validation of optional empty/undefined arrays (#690)
* * fix(validator): allow empty and undefined optional arrays

fix the bug of empty and undefined array causing a validation fail
when those are anyways optional

resolves #677

* denonify changes
2022-11-30 19:48:43 +09:00
Taku Amano
86699c1868
fix(reg-exp-router): Copy from METHOD_NAME_ALL for new methods (#691)
* fix(reg-exp-router): Copy from METHOD_NAME_ALL for new methods

* chore: denoify

* fix(reg-exp-router): Initialize both middleware and routes.

* chore: denoify

* fix(reg-exp-router):Fix middleware search routine.

* chore: denoify
2022-11-30 10:08:28 +09:00
Dario Piotrowicz
07efdb5103
fix(validator): fix subsequent nested objects names (#683)
* fix(validator): fix subsequent nested objects names

fix the bug of having subsequent objects inside a nested structure
causing the validator to forget the previous keys in the scheme's path

fixes point 1 of #677

* deonify changes
2022-11-29 22:02:20 +09:00
Taku Amano
e9a54bb8fc
fix(reg-exp-router): Allows registering a star after a long prefix. (#684)
* fix(reg-exp-router): Allows registering a star after a long prefix.

* fix(reg-exp-router): It now works even if a short GET is registered after a long ALL.

* chore: denoify
2022-11-28 22:20:40 +09:00
Yusuke Wada
9f7b5de9aa chore: denoify 2022-11-28 08:45:57 +09:00
Yusuke Wada
8fcc9e6e3b chore: donoify 2022-11-26 15:59:50 +09:00
Yusuke Wada
a3e0eb2cc1
refactor(context): refactor context.ts (#674) 2022-11-23 18:42:24 +09:00
Yusuke Wada
1eb49b8d96
refactor: support new @cloudflare/worker-types (#673)
* refactor: support new `@cloudflare/worker-types`

* do not attach crypto to global

* denoify ignore serve-static for cloudlfare

* ignore the utility for cloudflare

* import types
2022-11-23 07:27:42 +09:00
Yusuke Wada
05f2f6eb10 fix(types): app.use return correct types
Fix #666
2022-11-19 15:49:22 +09:00
Yusuke Wada
1674bbba32 chore(denoify): update Buffer 2022-11-17 15:11:36 +09:00
Jayden
06cecbd1e2
fix(param): Decode context.param (#662)
* Decode url param

* Denoify
2022-11-14 09:10:03 +09:00
Jayden
e92dbe9558
fix(sanitizer) (#661)
* Add test for #660

* Implement sanitizeValue

* Mark sanitizeValue private
2022-11-12 20:33:18 +09:00
Yusuke Wada
d3a6f80d7c
fix(type): change the type definition of req in Context (#658) 2022-11-11 15:23:05 +09:00
Yusuke Wada
58ef70f0cf
fix(types): export ErrorHandler and NotFoundHandler (#656) 2022-11-08 07:02:54 +09:00
Yusuke Wada
b963d6e7cb
feat(app): introduce app.on(method, path, handler) (#653)
* feat(app): introduce `app.on(method, path, handler)`

* Refactoring of feat/on branche (#655)

* refactor(reg-exp-router): Use `includes` instead of `find` to check if an element is in an array.

* fix(static-router): Copy middleware from METHOD_NAME_ALL for new method.

* chore: denoify

Co-authored-by: Taku Amano <taku@taaas.jp>
2022-11-08 03:17:34 +09:00
Yusuke Wada
15a5119bac
feat(app): introduce app.showRoutes() (#650) 2022-11-05 19:04:01 +09:00
Yusuke Wada
edfb31ee94
fix(error): make notFound() enables to catch errors correctly (#652) 2022-11-05 19:02:19 +09:00
Yusuke Wada
888e04ded1
fix(context): check cloudflare before checking node in c.runtime (#651)
* fix(context): check cloudflare before checking node in `c.runtime`

* denoify
2022-11-04 07:14:57 +09:00
Yusuke Wada
4a9cd272f8
refactor(types): reduce type definitions (#649)
* refactor(types): reduce type definitions

* fixed tests for Deno and Bun
2022-11-03 15:53:41 +09:00
Yusuke Wada
8e9b1c8099
fix(type): make compatibility with @cloudflare/workers-types (#645) 2022-11-03 15:39:25 +09:00
Jayden
451d6fe117
feat(context): Introducing c.runtime (#644)
* Add context.platform getter

* Remove assumption on fastly

* Add Vercel support

* denoify

* Replace .platform with .runtime
2022-11-03 15:35:23 +09:00
Yusuke Wada
c3031a418c
fix(jsx): export fragment (#642) 2022-11-01 21:41:27 +09:00