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

364 Commits

Author SHA1 Message Date
Yusuke Wada
4fde03e22f
fix(preset): fix constructor args (#1113)
* fix(preset): fix constructor args

* chore: denoify
2023-05-18 14:18:55 +09:00
Yusuke Wada
a2d22807e4
feat: app.mount() (#1104)
* feat: `mount()`

* update tests

* check header values

* chore: denoify

* make it as `app.mount()`

* denoify

* Generate new URL more simply. (#1112)

* Generate new URL more simply.

* chore: denoify

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-05-18 14:03:50 +09:00
Yusuke Wada
390d05b006
feat(app): app.routerName() (#1105)
* feat(context): `c.routerName()`

* chore: denoify

* Enable to get router name via `app.routerName`. (#1110)

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-05-18 00:05:28 +09:00
Yusuke Wada
a538d4ad81
fix(app): export fire() correctly (#1106) 2023-05-17 06:55:30 +09:00
Yusuke Wada
9a4af5ea00
feat(deno): export cookie middleware (#1103)
* feat(deno): export cookie middleware

* chore: denoify
2023-05-14 12:52:55 +09:00
Yusuke Wada
39bf73841f docs: update readme 2023-05-14 12:37:21 +09:00
Yusuke Wada
ccc4308871
fix(types): set / for generics basePath (#1083)
* fix(types): set `/` for generics `basePath`

* denoify

* fix `MergePath`

* tweak

* denoify
2023-05-14 08:18:45 +09:00
Yusuke Wada
e785fe8d81
feat(app): onError() supports async (#1090)
Co-authored-by: Ali Kaan Tunçel <alikaan.net@hotmail.com>
2023-05-14 08:16:28 +09:00
Yusuke Wada
220c956272 Merge branch 'main' into next 2023-05-11 17:53:05 +09:00
Taku Amano
c25745c6fa
fix(context): Fix typo in charset, again. (#1086)
* fix(context): Fix typo in charset.

* chore: denoify
2023-05-10 08:27:40 +09:00
Taku Amano
b15638c37c
fix(getQueryParam): Fixed a bug in getQueryParam when a partial matching key was found. (#1085)
* fix(getQueryParam): Fixed a bug in getQueryParam when a partial matching key was found.

* chore: denoify
2023-05-10 08:26:17 +09:00
Yusuke Wada
f26630a61b
fix: remove type.ts (#1082)
* fix: remove not used `type.ts`

* denoify
2023-05-09 22:22:12 +09:00
Yusuke Wada
187cb7ed5b chore: denoify 2023-05-09 22:15:10 +09:00
Yusuke Wada
bcc08081ef
fix(context): enable extending ContextVarableMap (#1080)
* fix(context): enable extending `ContextVarableMap`

* denoify
2023-05-09 21:55:40 +09:00
Yusuke Wada
d9aca261a1
fix: enable specifying router from args (#1079)
* fix: enable specifying router from args

* add tests

* denoify
2023-05-09 21:50:43 +09:00
Yusuke Wada
116aea542d Merge branch 'main' into next 2023-05-05 17:46:30 +09:00
Yusuke Wada
a73f0d23f0
feat: Cookie Middleware and deprecate c.req.cookie() / c.cookie() (#1066)
* feat: add Cookie Middleware and deprecate `c.req.cookie()` / `c.cookie()`

* chore: denoify
2023-05-05 11:08:03 +09:00
Yusuke Wada
c50dcf03bb
fix(jsx): fix a jsx-runtime bug (#1070)
* fix(jsx): fix a `jsx-runtime`

* fixed for Bun

* denoify
2023-05-05 10:46:49 +09:00
Yusuke Wada
21f4c196e7
feat(serve-static): rewriteRequestPath option for Workers/Deno/Bun (#1065) 2023-05-03 23:05:21 +09:00
Yusuke Wada
55684f4b9f chore: denoify 2023-05-03 22:19:24 +09:00
Taku Amano
b253a8735b
feat: Allow getPath to be replaced. (#1064)
* feat: Allow getPath to be replaced.

* chore: denoify
2023-05-03 22:13:23 +09:00
Yusuke Wada
95195801c4 Merge branch 'main' into next 2023-05-02 20:20:57 +09:00
Yusuke Wada
e066719aa1
fix(deno): export HTTPException from mod.ts (#1058)
* fix(deno): export `HTTPException` from `mod.ts`

* denoify
2023-05-02 16:37:24 +09:00
Yusuke Wada
d06a3123e7 Merge branch 'main' into next 2023-05-02 16:30:24 +09:00
Yusuke Wada
85528398c3
fix: check global.fastly instead of require('fastly:env') (#1057)
* fix: use `global.fastly` instead of `require('fastly:env')`

* denoify
2023-05-02 16:26:39 +09:00
Alex Errant
7c6ebe8f4e
fix: empty string is a valid header value (#1056)
* empty string is a valid header value

* yarn denoify
2023-05-02 15:56:17 +09:00
Yusuke Wada
64ddf093d6
perf: use === instead of startsWith and endsWith (#1053) 2023-04-30 21:18:32 +09:00
Yusuke Wada
0a19deaa5b
perf: shorten code (#1051) 2023-04-30 21:07:00 +09:00
Taku Amano
1a1de75296 feat: Introduce LinearRouter. (#1043)
* feat: Introduce LinearRouter.

* chore: Add benchmark script.

* chore: denoify
2023-04-28 12:10:20 +09:00
Yusuke Wada
03df736763 feat(utils): remove HTTP status messages from http-status.ts (#1037)
* feat(utils): remove HTTP status messages from `http-status.ts`

* denoify
2023-04-28 12:10:20 +09:00
Yusuke Wada
677b572fd5 feat: introduce PatternRouter and hono/tiny (#1036)
* wip

* Use RegExp instead of URLPattern. (#1039)

* Use RegExp instead of URLPattern.

* refactor(url-pattern-router): tidy up.

* refactor(url-pattern-router): Tweaks type for mangling.

* refactor: Rename URLPatternRouter to PatternRouter.

* chore: denoify.

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-04-28 12:10:20 +09:00
Taku Amano
ac7eeda87f
fix(context): Fix typo in charset. (#1046) 2023-04-28 12:06:23 +09:00
Yusuke Wada
ea7ece39eb docs(readme): fixed readme for Deno 2023-04-17 08:51:53 +09:00
Yusuke Wada
e6669f7779
feat(jwt): support for getting payload from c.get('jwtPayload') (#1025) 2023-03-31 18:39:26 +09:00
Yusuke Wada
c503436276
feat(deno): denoify (#1024) 2023-03-31 18:17:45 +09:00
Taku Amano
0560f27bde
fix(utils/url): Fix behavior when parameters with no value specified are mixed. (#1023)
* refactor(utils/url): Reduce a few characters.

* fix(utils/url): Fix behavior when parameters with no value specified are mixed.

* chore: denoify
2023-03-31 17:57:24 +09:00
Taku Amano
91c04ac073
refactor(utils/url): Decode parameters more accurately without performance degradation. (#1015)
* refactor(utils/url): Decode parameters more accurately without performance degradation.

* Add tests about getQueryParam and getQueryParams.

* chore(bench): add query param bench

* chore: denoify
2023-03-29 23:03:00 +09:00
Yusuke Wada
813984edca denoify 2023-03-26 22:14:33 +09:00
Yusuke Wada
282e18596b
fix(app): don't remove slash form / if strict is false (#1004)
* fix(app): don't remove slash form `/` if strict is `false`

* fixed test

* denoify
2023-03-20 23:30:41 +09:00
Kei Kamikawa
95602a18d7
feat: support issued_at validation for JWT (#1001)
* added issued at validation

* yarn denoify
2023-03-20 23:29:32 +09:00
Yusuke Wada
309c38a69a denoify 2023-03-19 18:19:01 +09:00
Taku Amano
c0af3d0726
feat: Enable to add subApp with basePath. (#998)
* feat: Enable to add subApp with basePath.

* chore: denoify.
2023-03-19 12:39:07 +09:00
Yusuke Wada
e0cead6100
fix(context): fixed a bug for c.header() with a append option (#997)
* fix(context): fixed a bug for `c.header()` with a `append` option

* denoify
2023-03-19 12:08:17 +09:00
Yusuke Wada
0238dc6b91
feat(req): introduce c.req.path (#988)
* feat(req): introduce `c.req.path`

* denoify

* we don't have to handle fragments

* fixed the test

* denoify
2023-03-17 16:32:19 +09:00
Yusuke Wada
cadb6eab41
feat(validator): query supports array params (#984)
* feat(validator): `query` supports array params

* denoify
2023-03-16 21:49:28 +09:00
Taku Amano
287498bdec
feat(validator): Allow validator to apply validation to path param. (#982)
* Allow validator to apply validation to path param.

* chore: denoify

* feat(validator): Enable passing the path to ValidationFunction as a template parameter.

* chore: denoify

Co-authored-by: yusukebe <yusuke@kamawada.com>
2023-03-15 22:20:50 +09:00
Yusuke Wada
e2a174b8ac
fix(types): infer types correctly (#983)
* v3.1.0-rc.2

* fix(types): infer path param types correctly

* denoify

* fix: infer the value type in the validation funtion

* denoify
2023-03-14 23:43:33 +09:00
Yusuke Wada
014acdc081
fix(client): removeIndexString supports /sub/index (#978)
* fix(client): `removeIndexString` supports `/sub/index`

* denoify
2023-03-13 22:37:17 +09:00
Yusuke Wada
3bb918b27c
fix(types): make MergePath<'/api', '/'> work well (#971)
* fix(types): make `MergePath<'/api', '/'>` work well

* denoify and remove some lines
2023-03-13 22:21:03 +09:00
Yusuke Wada
ea7a1b2d95
refactor: remove lint warnings (#976) 2023-03-13 22:08:16 +09:00
Yusuke Wada
418941d01b Merge branch 'main' into next 2023-03-13 22:00:00 +09:00
Yusuke Wada
948ca6a3b5
fix(route): support a root-level optional parameter (#975)
* fix(route): support a root level optional parameter

* denoify
2023-03-13 21:55:01 +09:00
Yusuke Wada
5cb8bf12fd Merge branch 'main' into next 2023-03-13 09:54:55 +09:00
Yusuke Wada
4414e63246
fix(etag): returns correct headers (#973)
* fix(etag): returns correct headers

* denoify

* `Etag` to `ETag`
2023-03-13 09:48:44 +09:00
Yusuke Wada
9c4197a772
feat(validator): support type transformation (#969)
* feat(validator): support type transformation

* denoify

* create `ValidationFunction` and add a test

* denoify

* rename

* denoify
2023-03-11 22:17:08 +09:00
Yusuke Wada
7548eaa0f6
feat(context): allow passing RequestInit to c.json() etc. (#959)
* feat(context): allow passing `RequestInit` to `c.json()` etc.

* denoify

resolve #952
2023-03-09 23:54:47 +09:00
Yusuke Wada
95f6470d5b
fix(type): add forgotten BasePath (#967)
* fix(type): add forgotten `BasePath`

* denoify
2023-03-09 10:52:22 +09:00
Taku Amano
55baf9d2d3
feat: route() with one argument is renamed basePath(). (#964)
* feat: `route()` with one argument is renamed `basePath()`.

* chore: denoify.

* refactor: Use `private` instead of hard private fields.

* refactor: The `route()` with one argument has reverted and deprecated.

* chore: denoify
2023-03-09 09:41:11 +09:00
Yusuke Wada
ad880dba43
feat: env support enviroment variables for multi runtimes (#949)
* feat: `env` support enviroment variables for multi runtimes

* typo

* denoify

* fixed ci settings

* fixed deno command

* comment out lagon test

* remove warnings
2023-03-06 21:12:22 +09:00
Yusuke Wada
b8c92e42ed Merge branch 'main' into next 2023-03-06 20:42:43 +09:00
Yusuke Wada
fea78f29bd
docs(readme): add creator name of RegExpRouter and SmartRouter (#956)
* docs(readme): add creator name of RegExpRouter and SmartRouter

* denoify
2023-03-06 20:42:05 +09:00
Yusuke Wada
c996f2d542 denoify 2023-03-05 23:40:14 +09:00
Yusuke Wada
4fb8151663
feat(context): allow passing unknown to executionCtx.waitUntil (#957)
* feat(context): allow passing `Promise<unknown>` to `executionCtx.waitUntil`

* denoify
2023-03-05 23:37:02 +09:00
Yusuke Wada
cd1d4530a3 docs(readme): denoify
[skip ci]
2023-03-02 21:52:25 +09:00
Yusuke Wada
46c233e463
fix(client): show type error if $get() needs args (#937)
* fix(client): show type error if `$get()` needs args

* denoify
2023-03-02 21:40:53 +09:00
Yusuke Wada
b1c5059708
feat(jsonT): check JSON type (#939)
* feat(`jsonT`): check JSON type

* denoify

* use `JSONValue`

* create `TrueAndFalseToBoolean` and add a comment
2023-03-02 08:56:13 +09:00
tangye
73860a1595
fix: let the app.request behave the same as fetch (#933)
* fix: let the app.request behave the same as fetch

* fix: add deno dist files

---------

Co-authored-by: 唐烨 <tangye@xinpianchang.com>
2023-02-27 20:01:04 +09:00
Yusuke Wada
7ba91208b9
fix: add missing MergePath (#936)
* fix: add missing `MergePath`

* denoify
2023-02-27 19:10:16 +09:00
Taku Amano
b0501e03cd
feat: Improve route() (#929)
* feat: return a sub app cloning itself from route()

* feat: Add extra type parameter BasePath.

* refactor: The type of hono.basePath may simply be a string.

* refactor: first argument of route is required, default value is not required

* chore: denoify
2023-02-27 18:38:27 +09:00
Yusuke Wada
e035e289ee
feat(deno): export HonoRequest type in Deno (#927) 2023-02-25 02:48:18 +09:00
Yusuke Wada
b788fe619f
fix(validator): clone Request object if json or form (#926) 2023-02-25 02:36:11 +09:00
Yusuke Wada
b9227b890c
refactor(util): remove using Buffer from encode.ts (#925) 2023-02-25 01:53:18 +09:00
Yusuke Wada
b3868d1075
fix(types): app.route with multiple endpoints returns types correctly (#919)
* fix(types): `app.route` with multiple endpoints returns types correctly

* fix `OnHandlerInterface` patterns too.

* denoify

* fix type mismatch of Env

* remove unnecessary assert
2023-02-24 09:07:25 +09:00
hagishi
14ed9f7368
feat: allow pathname argument (#921)
* feat: allow pathname argument

* fix: add control input argument

* denoify
2023-02-23 23:41:50 +09:00
Jonas Hiltl
17755d8167
feat: Custom fetch method for Hono Client options (#920)
* Allow setting custom fetch method for hono client

* Run yarn denoify
2023-02-23 16:26:25 +09:00
Yusuke Wada
4c4bf2b85e docs(readme): add "quick start" 2023-02-23 05:49:16 +09:00
Yusuke Wada
2c5b9891bd
feat(types): keep schema info with app.route() (#909) 2023-02-20 08:56:29 +09:00
hagishi
7ffb5b547e
feat(client): Inject common headers (#908)
* feat(client): Inject common headers

* feat: Accept a RequestOptions object as argument.

* refactor: Rename RequestOption to RequestOptions

* denoify
2023-02-20 08:22:01 +09:00
Yusuke Wada
02e3786016
docs(readme): update for v3 (#902)
* docs(readme): update for v3

* denoify
2023-02-18 08:27:54 +09:00
Yusuke Wada
c98f71610a
fix(jsx): declare types for JSX correctly (#901) 2023-02-18 06:50:52 +09:00
Yusuke Wada
6d8bd62d23
chore: honojs.dev to hono.dev (#900) 2023-02-16 23:18:34 +09:00
Yusuke Wada
d4e3728881 chore: denoify 2023-02-16 18:08:50 +09:00
Yusuke Wada
79759a81ed
feat(client): introduce Fetch type (#898)
* feat(client): introduce `Fetch` type

* denoify
2023-02-16 16:12:21 +09:00
Yusuke Wada
94df5fce68 feat(hc): add InferRequestType (#894)
* feat(hc): add `InferRequestType`

* denoify
2023-02-15 08:47:40 +09:00
Yusuke Wada
05ee837f78
feat: change the arg InferResponseType receives (#893)
* feat: change the arg `InferResponseType` receives

* denoify
2023-02-15 07:05:39 +09:00
Yusuke Wada
733854f6cb
docs(readme): add bundlephobia badges (#891) 2023-02-14 22:50:58 +09:00
Yusuke Wada
68cbbbcde7
refactor: rename ValidationTypes to ValidationTargets (#890)
* refactor: rename `ValidationTypes` to `ValidationTargets`

* denoify
2023-02-14 06:21:30 +09:00
Yusuke Wada
5b29d4235e
refactor: rename to TypedResponse (#889)
* refactor: rename to `TypedResponse`

* denoify
2023-02-13 21:57:12 +09:00
Yusuke Wada
60c0903a1c
fix(req): query return type as string | undefined (#888)
* fix(req): return type as `string | undefined`

* denoify
2023-02-13 21:40:51 +09:00
Yusuke Wada
0b2ac1678e Merge branch 'main' into next 2023-02-13 06:47:05 +09:00
Alex Errant
d2abad3b34
header may return undefined (#884)
* header may return undefined

* fixed broken tests

* yarn denoify

* update CONTRIBUTING
2023-02-13 06:30:57 +09:00
Yusuke Wada
e0059916e9
fix(deno): allow {} for app.fetch fo compatibility (#887) 2023-02-12 16:46:47 +09:00
Yusuke Wada
23b05425da fix(deno): export deno adapter (#886) 2023-02-12 16:35:22 +09:00
Yusuke Wada
39e855f0a4
feat: move http-exception out of utils (#883) 2023-02-11 18:05:50 +09:00
Yusuke Wada
ff7b225620
feat(app): support multiple methods with app.on() (#882)
* feat(`app`): support multiple methods with `app.on()`

* use `flat()`

* denoify
2023-02-11 16:20:11 +09:00
Yusuke Wada
17af727d49
feat(validator): moved validator outside of middleware (#879) 2023-02-11 01:18:27 +09:00
Yusuke Wada
6f729895a7 merge main into next 2023-02-09 19:49:27 +09:00
Yusuke Wada
3f1de47f8f chore(denoify): update buffer 2023-02-09 18:24:14 +09:00
Taku Amano
c169a413bd
feat: use added app's errorHandler with comose() (#874)
* refactor(compose): Swapped the order of onNotFound and onError in the compose() argument.

* feat: use added app's errorHandler

* chore: denoify
2023-02-09 18:13:27 +09:00
Yusuke Wada
9391278911
feat(router) [breaking]: StaticRouter obsolete (#873)
Co-authored-by: Taku Amano <taku@taaas.jp>
2023-02-09 16:58:28 +09:00