* fix(types): `SimplifyDeepArray` should now actually be "deep"
Also now uses `Simplify` instead of inline declare the type
* tests(types): extra tests for `Should have correct types - interfaces`
* style: apply lint&style fixes
* docs: rewording SimplifyDeepArray jsdoc
* fix: type is possibly infinite
* fix: mismatching implementation of interface
* refactor: split JSONRespond return declaration to it's own type
DRY-er code and fixes a weird type is possibly infinite yelling
* fix(client): allow multiple files on the same key in form
* add tests and update `msw`
* fixed import order
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
* 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>
* fix: `ClientResponse` now properly extends fetch's `Response`
Better experience / fix types error when working with functions that expects a fetch's `Response`
* feat(context): switch from `InterfaceToType` to `Simplify` for better performance
Also automatically infer ReturnType for cleaner code
* feat(context): infer `TypedResponse` for `TextRespond`
* feat: improve response types flow with `ResponseFormat`
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
* tests: adjust & add new tests for `TextRespond` & `ResponseFormat`
* tests: improve test of using interface
* chore: denoify
---------
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
Fixes #2509
When a hono client is instantiated in expo and then console.log(client)
is called, an error is thrown:
`TypeError: Cannot determine default value of object`
This is because the hermes javascript engine expects `new String(val)`
to always return a string. But the proxy object would return a
ClientRequestImpl object instead.
This commit makes a string / function returned in the cases where
.toString() and .valueOf() is called on the function.name or function
respectively.
Also see https://github.com/facebook/hermes/issues/205
* feat: Ensure that calls to `c.json()` have a type equivalent to `c.jsonT()`
* refactor: Objects with "response" properties are never returned by the handler
* refactor: "status" is not needed in TypedResponse
* refactor: Revive `c.jsonT()` and add @deprecated label
* refactor: Tweaks commenting on "eslint-disable" broken by `format:fix`
* test: Use `c.json()` instead of `c.jsonT()` to make sure there are no problems
* refactor: allow ambiguous type for `c.json()`
* chore: denoify
* fix: Remove unused TypedResponse from import statement