tosuke / artifact-viewer

artifact-viewer.vercel.app
MIT License
1 stars 0 forks source link

fix(deps): update dependency hono to v2.7.8 - autoclosed #43

Closed renovate[bot] closed 11 months ago

renovate[bot] commented 2 years ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
hono (source) 2.2.1 -> 2.7.8 age adoption passing confidence

Release Notes

honojs/hono (hono) ### [`v2.7.8`](https://togithub.com/honojs/hono/releases/tag/v2.7.8) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.7...v2.7.8) ##### Summary This is a patch release. The type definition returned by `c.req.header()` was `string`, but it has been corrected to `string | undefined`. ##### What's Changed - header may return undefined by [@​AlexErrant](https://togithub.com/AlexErrant) in [https://github.com/honojs/hono/pull/884](https://togithub.com/honojs/hono/pull/884) ##### New Contributors - [@​AlexErrant](https://togithub.com/AlexErrant) made their first contribution in [https://github.com/honojs/hono/pull/884](https://togithub.com/honojs/hono/pull/884) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.7...v2.7.8 ### [`v2.7.7`](https://togithub.com/honojs/hono/releases/tag/v2.7.7) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.6...v2.7.7) ##### Summary Since it only includes a slight change in the feature, released as a patch-release. ##### Enable `onError` of sub instances This release enables `onError` of sub instances attached by `app.route()`. ```ts const app = new Hono() const sub = new Hono() sub.get('/ok', async (c) => { return c.text('ok') }) sub.get('/error', () => { throw new Error('This is Error') }) sub.onError((_, c) => { return c.text('onError by sub', 500) }) app.route('/sub', sub) ``` If you access `GET /sub/error`, it will return `onError by sub`. ##### What's Changed - feat: use added app's errorHandler by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/871](https://togithub.com/honojs/hono/pull/871) - Revert "feat: use added app's errorHandler ([#​871](https://togithub.com/honojs/hono/issues/871))" by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/872](https://togithub.com/honojs/hono/pull/872) - feat: use added app's errorHandler with comose() by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/874](https://togithub.com/honojs/hono/pull/874) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.6...v2.7.7 ### [`v2.7.6`](https://togithub.com/honojs/hono/releases/tag/v2.7.6) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.5...v2.7.6) ##### Summary This is a patch release. ##### What's Changed - Missing mime types by [@​Hoodgail](https://togithub.com/Hoodgail) in [https://github.com/honojs/hono/pull/827](https://togithub.com/honojs/hono/pull/827) - Fix 404 error on Serve Static Middleware by [@​BioniCosmos](https://togithub.com/BioniCosmos) in [https://github.com/honojs/hono/pull/863](https://togithub.com/honojs/hono/pull/863) - fix(serve-static): decode url pathname by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/864](https://togithub.com/honojs/hono/pull/864) - chore: denoify by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/865](https://togithub.com/honojs/hono/pull/865) ##### New Contributors - [@​Hoodgail](https://togithub.com/Hoodgail) made their first contribution in [https://github.com/honojs/hono/pull/827](https://togithub.com/honojs/hono/pull/827) - [@​BioniCosmos](https://togithub.com/BioniCosmos) made their first contribution in [https://github.com/honojs/hono/pull/863](https://togithub.com/honojs/hono/pull/863) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.5...v2.7.6 ### [`v2.7.5`](https://togithub.com/honojs/hono/releases/tag/v2.7.5) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.4...v2.7.5) ##### Summary This is a patch release. ##### What's Changed - fix(context): fixed bug raw `Response` content-type is overwritten by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/836](https://togithub.com/honojs/hono/pull/836) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.4...v2.7.5 ### [`v2.7.4`](https://togithub.com/honojs/hono/releases/tag/v2.7.4) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.3...v2.7.4) ##### Summary This is a patch release. ##### What's Changed - build: validate package exports after build by [@​yudai-nkt](https://togithub.com/yudai-nkt) in [https://github.com/honojs/hono/pull/824](https://togithub.com/honojs/hono/pull/824) - fix(request): make optional param type correct by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/826](https://togithub.com/honojs/hono/pull/826) - fix(context): set the header values of already set by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/834](https://togithub.com/honojs/hono/pull/834) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.3...v2.7.4 ### [`v2.7.3`](https://togithub.com/honojs/hono/releases/tag/v2.7.3) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.2...v2.7.3) ##### Summary This is a patch release. ##### What's Changed - remove unnecessary individual strict mode family options by [@​hclj37](https://togithub.com/hclj37) in [https://github.com/honojs/hono/pull/805](https://togithub.com/honojs/hono/pull/805) - fix(context): enable destruction such `json` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/813](https://togithub.com/honojs/hono/pull/813) - fix: fixed type error for optional parameters by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/814](https://togithub.com/honojs/hono/pull/814) ##### New Contributors - [@​hclj37](https://togithub.com/hclj37) made their first contribution in [https://github.com/honojs/hono/pull/805](https://togithub.com/honojs/hono/pull/805) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.2...v2.7.3 ### [`v2.7.2`](https://togithub.com/honojs/hono/releases/tag/v2.7.2) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.1...v2.7.2) ##### Summary This is a patch release. ##### What's Changed - chore: update license, contributors as the copyright holders by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/769](https://togithub.com/honojs/hono/pull/769) - fix(package.json): typo exports static-router by [@​taishinaritomi](https://togithub.com/taishinaritomi) in [https://github.com/honojs/hono/pull/776](https://togithub.com/honojs/hono/pull/776) - fix(cors): fix bugs handling pre-flight by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/792](https://togithub.com/honojs/hono/pull/792) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.1...v2.7.2 ### [`v2.7.1`](https://togithub.com/honojs/hono/releases/tag/v2.7.1) [Compare Source](https://togithub.com/honojs/hono/compare/v2.7.0...v2.7.1) ##### Summary Nothing has changed in this version-up. But, the current Validator Middleware has been deprecated. See the migration guide: https://github.com/honojs/hono/blob/main/docs/MIGRATION.md ##### What's Changed - docs(migration): write about validator middleware by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/759](https://togithub.com/honojs/hono/pull/759) - chore(validator): show warnings about the breaking changes by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/760](https://togithub.com/honojs/hono/pull/760) **Full Changelog**: https://github.com/honojs/hono/compare/v2.7.0...v2.7.1 ### [`v2.7.0`](https://togithub.com/honojs/hono/releases/tag/v2.7.0) [Compare Source](https://togithub.com/honojs/hono/compare/v2.6.2...v2.7.0) ##### Summary [Lagon](https://lagon.app) is another serverless edge function runtime like Cloudflare Workers or Deno Deploy. Hono was already running on Lagon but added tests/CI for Lagon, and now generally supported! Thanks [@​QuiiBz](https://togithub.com/QuiiBz) ! And fix the bug that occurred when we set `"moduleResolution": "NodeNext"` in tsconfig.json. Thanks [@​taishinaritomi](https://togithub.com/taishinaritomi) ! ##### What's Changed - feat: Lagon support with runtime detection & tests by [@​QuiiBz](https://togithub.com/QuiiBz) in [https://github.com/honojs/hono/pull/742](https://togithub.com/honojs/hono/pull/742) - fix: Support tsconfig.json "moduleResolution" : "NodeNext" by [@​taishinaritomi](https://togithub.com/taishinaritomi) in [https://github.com/honojs/hono/pull/747](https://togithub.com/honojs/hono/pull/747) ##### New Contributors - [@​QuiiBz](https://togithub.com/QuiiBz) made their first contribution in [https://github.com/honojs/hono/pull/742](https://togithub.com/honojs/hono/pull/742) **Full Changelog**: https://github.com/honojs/hono/compare/v2.6.2...v2.7.0 ### [`v2.6.2`](https://togithub.com/honojs/hono/releases/tag/v2.6.2) [Compare Source](https://togithub.com/honojs/hono/compare/v2.6.1...v2.6.2) ##### Summary This release includes a performance improvement and some bug fixes. ##### What's Changed - Log a more detailed error stack. by [@​renhiyama](https://togithub.com/renhiyama) in [https://github.com/honojs/hono/pull/719](https://togithub.com/honojs/hono/pull/719) - fix(type): make `SchemaToProp` work correctly by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/720](https://togithub.com/honojs/hono/pull/720) - fix(request): `c.req.param()` should return `undefined` not "undefined" by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/721](https://togithub.com/honojs/hono/pull/721) - perf(context): `c.text()` returns a response immediately if header is empty by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/722](https://togithub.com/honojs/hono/pull/722) ##### New Contributors - [@​renhiyama](https://togithub.com/renhiyama) made their first contribution in [https://github.com/honojs/hono/pull/719](https://togithub.com/honojs/hono/pull/719) **Full Changelog**: https://github.com/honojs/hono/compare/v2.6.1...v2.6.2 ### [`v2.6.1`](https://togithub.com/honojs/hono/releases/tag/v2.6.1) [Compare Source](https://togithub.com/honojs/hono/compare/v2.6.0...v2.6.1) ##### Summary This is a patch release. ##### What's Changed - fix(type): fix the type mismatch if using `Handler` as middleware by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/714](https://togithub.com/honojs/hono/pull/714) - fix(type): infer types correctly by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/715](https://togithub.com/honojs/hono/pull/715) **Full Changelog**: https://github.com/honojs/hono/compare/v2.6.0...v2.6.1 ### [`v2.6.0`](https://togithub.com/honojs/hono/releases/tag/v2.6.0) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.10...v2.6.0) ##### Summary This release includes the new feature for adavanced users, it will be important in the future!! ##### BREAKING CHANGE `c.req.cookie()` now returns `string | undefined`. This may cause a Type error. ##### You can use 3rd party libs for the validation It become to allow normal types, instead of only allowing `Schema` in the Handler. ```ts type User = { id: string name: string age: number } const handler: Handler = (c) => { const user = c.req.valid() // <--- user is User // ... } ``` This change also makes it possible to use the 3rd party library such as "[Zod](https://zod.dev)" for validation. ```ts import { Hono } from 'hono' import type { Handler } from 'hono' import { z } from 'zod' import type { ZodType } from 'zod' const app = new Hono() const schema = z.object({ id: z.string(), name: z.string(), age: z.number(), }) // You can write a custom validator with Zod: const zValidtor = (schema: T): Handler> => { return async (c, next) => { const parsed = schema.safeParse(await c.req.json()) if (!parsed.success) { return c.text('Invalid!', 400) } c.req.valid(parsed.data) await next() } } app.post('/post', zValidtor(schema), (c) => { const user = c.req.valid() // <--- user will be `User` return c.json(user) }) ``` Builtin Validator is recommended, but if developers want to use Zod, they can. And this feature will be important in the future!! ##### What's Changed - `cookie` should return `string | undefined` by [@​unworthyEnzyme](https://togithub.com/unworthyEnzyme) in [https://github.com/honojs/hono/pull/709](https://togithub.com/honojs/hono/pull/709) - feat(handler): "schema" allow normal types by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/700](https://togithub.com/honojs/hono/pull/700) ##### New Contributors - [@​unworthyEnzyme](https://togithub.com/unworthyEnzyme) made their first contribution in [https://github.com/honojs/hono/pull/709](https://togithub.com/honojs/hono/pull/709) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.10...v2.6.0 ### [`v2.5.10`](https://togithub.com/honojs/hono/releases/tag/v2.5.10) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.9...v2.5.10) ##### Summary This is a patch release. ##### What's Changed - fix(reg-exp-router): bug of "star and all" routing by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/707](https://togithub.com/honojs/hono/pull/707) - fix(validator): enable checking `undefined` in rules by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/708](https://togithub.com/honojs/hono/pull/708) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.9...v2.5.10 ### [`v2.5.9`](https://togithub.com/honojs/hono/releases/tag/v2.5.9) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.8...v2.5.9) ##### Summary This is a patch release. ##### What's Changed - fix(trie-router): bug for routing orders with named param by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/704](https://togithub.com/honojs/hono/pull/704) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.8...v2.5.9 ### [`v2.5.8`](https://togithub.com/honojs/hono/releases/tag/v2.5.8) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.7...v2.5.8) ##### Summary This is a patch release. ##### What's Changed - chore: fix lint warnings by [@​dario-piotrowicz](https://togithub.com/dario-piotrowicz) in [https://github.com/honojs/hono/pull/694](https://togithub.com/honojs/hono/pull/694) - chore: remove unnecessary config testPathIgnorePatterns by [@​is2ei](https://togithub.com/is2ei) in [https://github.com/honojs/hono/pull/697](https://togithub.com/honojs/hono/pull/697) - Fix detecting node runtime by [@​yujong-lee](https://togithub.com/yujong-lee) in [https://github.com/honojs/hono/pull/696](https://togithub.com/honojs/hono/pull/696) ##### New Contributors - [@​is2ei](https://togithub.com/is2ei) made their first contribution in [https://github.com/honojs/hono/pull/697](https://togithub.com/honojs/hono/pull/697) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.7...v2.5.8 ### [`v2.5.7`](https://togithub.com/honojs/hono/releases/tag/v2.5.7) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.6...v2.5.7) ##### Security update This release includes **SECURITY UPDATE**. Target: "CORS Middleware". Vulnerability detail: The handler is called even if it's a preflight request. All users using CORS middleware should update it. ##### Other bug fixes And including other bug fixes for Validator middleware and the router. ##### What's Changed - fix(validator): fix jsons validation after arrays by [@​dario-piotrowicz](https://togithub.com/dario-piotrowicz) in [https://github.com/honojs/hono/pull/680](https://togithub.com/honojs/hono/pull/680) - fix(reg-exp-router): Allows registering a star after a long prefix. by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/684](https://togithub.com/honojs/hono/pull/684) - fix(validator): fix subsequent nested objects names by [@​dario-piotrowicz](https://togithub.com/dario-piotrowicz) in [https://github.com/honojs/hono/pull/683](https://togithub.com/honojs/hono/pull/683) - fix(reg-exp-router): Copy from METHOD_NAME_ALL for new methods by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/691](https://togithub.com/honojs/hono/pull/691) - Fix Validation of optional empty/undefined arrays by [@​dario-piotrowicz](https://togithub.com/dario-piotrowicz) in [https://github.com/honojs/hono/pull/690](https://togithub.com/honojs/hono/pull/690) - Updated CORS by [@​dagnelies](https://togithub.com/dagnelies) in [https://github.com/honojs/hono/pull/693](https://togithub.com/honojs/hono/pull/693) ##### New Contributors - [@​dario-piotrowicz](https://togithub.com/dario-piotrowicz) made their first contribution in [https://github.com/honojs/hono/pull/680](https://togithub.com/honojs/hono/pull/680) - [@​dagnelies](https://togithub.com/dagnelies) made their first contribution in [https://github.com/honojs/hono/pull/693](https://togithub.com/honojs/hono/pull/693) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.6...v2.5.7 ### [`v2.5.6`](https://togithub.com/honojs/hono/releases/tag/v2.5.6) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.5...v2.5.6) #### Summary This is a patch release. Fixed that is not supporting ESM. #### What's Changed - fix(package.json): add "type": "module" by [@​taishinaritomi](https://togithub.com/taishinaritomi) in [https://github.com/honojs/hono/pull/679](https://togithub.com/honojs/hono/pull/679) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.5...v2.5.6 ### [`v2.5.5`](https://togithub.com/honojs/hono/releases/tag/v2.5.5) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.4...v2.5.5) #### Summary This is released to support the new version `v4` of [`@cloudflare/workers-types`](https://togithub.com/cloudflare/workers-types). #### What's Changed - refactor: support new `@cloudflare/worker-types` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/673](https://togithub.com/honojs/hono/pull/673) - refactor(context): refactor `context.ts` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/674](https://togithub.com/honojs/hono/pull/674) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.4...v2.5.5 ### [`v2.5.4`](https://togithub.com/honojs/hono/releases/tag/v2.5.4) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.3...v2.5.4) ##### Summary This is a patch release. ##### What's Changed - fix(package.json): add `typesVersions` section by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/670](https://togithub.com/honojs/hono/pull/670) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.3...v2.5.4 ### [`v2.5.3`](https://togithub.com/honojs/hono/releases/tag/v2.5.3) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.2...v2.5.3) ##### Summary This is a patch release. ##### What's Changed - Update MIGRATION.md by [@​oscaryu](https://togithub.com/oscaryu) in [https://github.com/honojs/hono/pull/665](https://togithub.com/honojs/hono/pull/665) - fix(types): `app.use` return correct types [`05f2f6e`](https://togithub.com/honojs/hono/commit/05f2f6e) - fix(package.json): exports types correctly by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/669](https://togithub.com/honojs/hono/pull/669) ##### New Contributors - [@​oscaryu](https://togithub.com/oscaryu) made their first contribution in [https://github.com/honojs/hono/pull/665](https://togithub.com/honojs/hono/pull/665) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.2...v2.5.3 ### [`v2.5.2`](https://togithub.com/honojs/hono/releases/tag/v2.5.2) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.1...v2.5.2) ##### Summary This is a patch release. ##### What's Changed - fix(param): Decode context.param by [@​yujong-lee](https://togithub.com/yujong-lee) in [https://github.com/honojs/hono/pull/662](https://togithub.com/honojs/hono/pull/662) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.1...v2.5.2 ### [`v2.5.1`](https://togithub.com/honojs/hono/releases/tag/v2.5.1) [Compare Source](https://togithub.com/honojs/hono/compare/v2.5.0...v2.5.1) ##### Summary This is a patch release. ##### What's Changed - fix(type): change the type definition of `req` in Context by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/658](https://togithub.com/honojs/hono/pull/658) - fix(sanitizer) by [@​yujong-lee](https://togithub.com/yujong-lee) in [https://github.com/honojs/hono/pull/661](https://togithub.com/honojs/hono/pull/661) **Full Changelog**: https://github.com/honojs/hono/compare/v2.5.0...v2.5.1 ### [`v2.5.0`](https://togithub.com/honojs/hono/releases/tag/v2.5.0) [Compare Source](https://togithub.com/honojs/hono/compare/v2.4.1...v2.5.0) ##### Summary There are three new features. All of them are useful to you. ##### 1. `c.runtime` You can know which runtime the code is running on with `c.runtime`. This is implemented by [@​yujong-lee](https://togithub.com/yujong-lee). Thanks! ```ts app.get('/which-runtime/*', (c) => { return c.text(`You are on ${c.runtime}!`) }) ``` ##### 2. `app.showRoutes()` The `app.showRoutes()` shows the routes which are registered. SS ##### 3. `app.on()` The `app.on()` function will enable us set the custom HTTP method as we like: ```ts app.on('PURGE', '/foo', async (c) => { await purgeCache('foo') return c.redirect('/') }) ``` ##### What's Changed - feat(context): Introducing c.runtime by [@​yujong-lee](https://togithub.com/yujong-lee) in [https://github.com/honojs/hono/pull/644](https://togithub.com/honojs/hono/pull/644) - fix(type): make compatibility with `@cloudflare/workers-types` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/645](https://togithub.com/honojs/hono/pull/645) - refactor(types): reduce type definitions by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/649](https://togithub.com/honojs/hono/pull/649) - fix(context): check cloudflare before checking node in `c.runtime` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/651](https://togithub.com/honojs/hono/pull/651) - fix(error): make `notFound()` enables to catch errors correctly by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/652](https://togithub.com/honojs/hono/pull/652) - feat(app): introduce `app.showRoutes()` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/650](https://togithub.com/honojs/hono/pull/650) - feat(app): introduce `app.on(method, path, handler)` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/653](https://togithub.com/honojs/hono/pull/653) - fix(types): export `ErrorHandler` and `NotFoundHandler` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/656](https://togithub.com/honojs/hono/pull/656) **Full Changelog**: https://github.com/honojs/hono/compare/v2.4.1...v2.5.0 ### [`v2.4.1`](https://togithub.com/honojs/hono/releases/tag/v2.4.1) [Compare Source](https://togithub.com/honojs/hono/compare/v2.4.0...v2.4.1) ##### Summary This is a patch release. ##### What's Changed - fix(jsx): export fragment by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/642](https://togithub.com/honojs/hono/pull/642) **Full Changelog**: https://github.com/honojs/hono/compare/v2.4.0...v2.4.1 ### [`v2.4.0`](https://togithub.com/honojs/hono/releases/tag/v2.4.0) [Compare Source](https://togithub.com/honojs/hono/compare/v2.3.2...v2.4.0) ##### Summary This release includes the fix for the ESM support, `v.queries()` feature in Validator middleware, and `CustomHandler` that is exported as `Handler` interface. ##### Fixing ESM support Previously, if we use Hono package in Node.js directly, the error would throw. This release has enabled proper support for both ESM and CommonJS (However, this isn't easy to test and may not work well in your environment. If there is a problem, please let me know. We will fix it). ##### "Handler" interface If we want to declare a handler outside of `app.get()`, we write it like this: ```ts const handler: Handler = (c) => { return c.text('Hi!') } ``` Then, in this `handler`, how can we make `c.env` or `c.get('foo')` have a type? Pass `string` as the first argument of the Generics for `Handler` and write the following: ```ts type Env = { Bindings: { TOKEN: string } Variables: { post: Post } } const handler: Handler = (c) => { // <--- const post = c.get('post') return c.json(post) } ``` This is redundant to write `string` on purpose. So, in this release, we can write just like this: ```ts const handler: Handler = (c) => { const post = c.get('post') return c.json(post) } ``` Of course, it keeps to have the types: SS Actually, we can do something similar for Validator schema: ```ts const schema = (v: Validator) => ({ query: v.query('q'), }) type Schema = ReturnType const handler: Handler = (c) => { const { query } = c.req.valid() return c.json({ query: query }) } ``` SS ##### What's Changed - fix(build): fix ESM support in Node.js / use `esbuild` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/631](https://togithub.com/honojs/hono/pull/631) - test(bun): JWT middleware works on Bun v0.2.2 by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/633](https://togithub.com/honojs/hono/pull/633) - fix(typo) package.cjs.json target to type by [@​taishinaritomi](https://togithub.com/taishinaritomi) in [https://github.com/honojs/hono/pull/634](https://togithub.com/honojs/hono/pull/634) - fix(validator): enable handling "Bad Request" in validator by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/635](https://togithub.com/honojs/hono/pull/635) - feat(types): introduce `CustomHandler` interface by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/637](https://togithub.com/honojs/hono/pull/637) - feat(validator): support `v.queries` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/636](https://togithub.com/honojs/hono/pull/636) - fix(types): improve custom handler by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/641](https://togithub.com/honojs/hono/pull/641) - test(routing): add test cases for route grouping order by [@​yujong-lee](https://togithub.com/yujong-lee) in [https://github.com/honojs/hono/pull/640](https://togithub.com/honojs/hono/pull/640) ##### New Contributors - [@​taishinaritomi](https://togithub.com/taishinaritomi) made their first contribution in [https://github.com/honojs/hono/pull/634](https://togithub.com/honojs/hono/pull/634) - [@​yujong-lee](https://togithub.com/yujong-lee) made their first contribution in [https://github.com/honojs/hono/pull/640](https://togithub.com/honojs/hono/pull/640) **Full Changelog**: https://github.com/honojs/hono/compare/v2.3.2...v2.4.0 ### [`v2.3.2`](https://togithub.com/honojs/hono/releases/tag/v2.3.2) [Compare Source](https://togithub.com/honojs/hono/compare/v2.3.1...v2.3.2) ##### Summary Fixed a bug related to the Validator and added a minor feature. The `Validator` type is exported. You can write your schema definition outside the middleware handler as follows: ```ts import type { Validator } from 'hono' import { validator } from 'hono/validator' const schema = (v: Validator) => ({ query: v.query('query').isRequired(), page: v.query('page').isNumeric().isOptional(), }) app.get('/search', validator(schema), (c) => { const { query, page } = c.req.valid() //... return c.text('Result!!') }) ``` `Validator` and `validator` are similar and confusing, but if you don't like it, just use an alias. ##### What's Changed - fix(validator): make "isOptional" work correctly with "value" validation by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/613](https://togithub.com/honojs/hono/pull/613) - docs(migration): add `v2.2.5 to v2.3.0` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/617](https://togithub.com/honojs/hono/pull/617) - docs(contribution): update about 3rd-party middleware by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/619](https://togithub.com/honojs/hono/pull/619) - refactor(types): refactor and add tests for checking Types by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/615](https://togithub.com/honojs/hono/pull/615) - test(validator): add test for custom rules by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/620](https://togithub.com/honojs/hono/pull/620) - fix(deno): export static-router and smart-router by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/626](https://togithub.com/honojs/hono/pull/626) - feat(validator): export `Validator` from 'hono' by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/627](https://togithub.com/honojs/hono/pull/627) **Full Changelog**: https://github.com/honojs/hono/compare/v2.3.1...v2.3.2 ### [`v2.3.1`](https://togithub.com/honojs/hono/releases/tag/v2.3.1) [Compare Source](https://togithub.com/honojs/hono/compare/v2.3.0...v2.3.1) This is a patch release. #### What's Changed - fix(validator): show "type" error messages if does not have "value" errors by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/612](https://togithub.com/honojs/hono/pull/612) **Full Changelog**: https://github.com/honojs/hono/compare/v2.3.0...v2.3.1 ### [`v2.3.0`](https://togithub.com/honojs/hono/releases/tag/v2.3.0) [Compare Source](https://togithub.com/honojs/hono/compare/v2.2.5...v2.3.0) #### Security update & Breaking change This release includes **SECURITY UPDATE** and associated **BREAKING CHANGES**. - Targets: "Basic Auth Middleware" and "Bearer Auth Middleware". - Vulnerability detail: Even if "unauthorized", the Handler will be executed. If you are using an older version of Basic Auth Middleware and Bearer Auth Middleware, please use this version. See [the release notes on GitHub](https://togithub.com/honojs/hono/releases) for version updates. With it, there is Breaking Change. If you are using Basic Auth and Bearer Auth in your Handler (nested), change as follows: ```ts app.use('/auth/*', async (c, next) => { const auth = basicAuth({ username: c.env.USERNAME, password: c.env.PASSWORD }) return auth(c, next) // Older: `await auth(c, next)` }) ``` #### New features ##### Validator Middleware supports nested validation For example, there is a nested object like below: ```ts const data = { posts: [ { id: 123, title: 'JavaScript', tags: ['Workers', 'Deno', 'Bun'], }, ], pager: { prev: true, next: false, }, } ``` It will be validated with `v.array()` and `v.object()`: ```ts app.post( '/posts', validator((v) => ({ posts: v.array('posts', (v) => ({ id: v.json('id').asNumber().isRequired(), title: v.json('title'), tags: v.json('tags').asArray(), })), pager: v.object('pager', (v) => ({ prev: v.json('prev').asBoolean(), next: v.json('next').asBoolean(), })), })), (c) => { return c.text('Valid!') } ) ``` And it also has types: SS Isn't it cool? ##### Validator Middleware supports friendly error messages For example, an error message will become more friendly. 'Invalid Value: the request body "title" is invalid - abcdefg' will be: 'Invalid Value [abcdef]: the request body "title" is invalid - isLength' #### All updates - perf: remove unrequired cloning of ctx.res by [@​JakeChampion](https://togithub.com/JakeChampion) in [https://github.com/honojs/hono/pull/589](https://togithub.com/honojs/hono/pull/589) - fix(deno): fixed the bug calling `next()` multiple times in Serve Static by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/594](https://togithub.com/honojs/hono/pull/594) - test(bun): add more tests for serve static middleware by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/595](https://togithub.com/honojs/hono/pull/595) - perf(serve-static): return immediately if `c.finalized` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/596](https://togithub.com/honojs/hono/pull/596) - feat(validator): introduce nested validation by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/592](https://togithub.com/honojs/hono/pull/592) - feat(validator): has the error message per rule by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/603](https://togithub.com/honojs/hono/pull/603) - fix(bearer-auth, basic-auth): handler should not be executed when unauthorized by [@​NOBLES5E](https://togithub.com/NOBLES5E) in [https://github.com/honojs/hono/pull/608](https://togithub.com/honojs/hono/pull/608) - fix(basic/bearer): support "nested" middleware by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/610](https://togithub.com/honojs/hono/pull/610) - refactor(jwt): refactor code and add more tests by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/611](https://togithub.com/honojs/hono/pull/611) #### New Contributors - [@​JakeChampion](https://togithub.com/JakeChampion) made their first contribution in [https://github.com/honojs/hono/pull/589](https://togithub.com/honojs/hono/pull/589) - [@​NOBLES5E](https://togithub.com/NOBLES5E) made their first contribution in [https://github.com/honojs/hono/pull/608](https://togithub.com/honojs/hono/pull/608) **Full Changelog**: https://github.com/honojs/hono/compare/v2.2.5...v2.3.0 ### [`v2.2.5`](https://togithub.com/honojs/hono/releases/tag/v2.2.5) [Compare Source](https://togithub.com/honojs/hono/compare/v2.2.4...v2.2.5) #### Summary This is a patch release. #### What's Changed - fix(compose): fix for error handling with `async` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/583](https://togithub.com/honojs/hono/pull/583) **Full Changelog**: https://github.com/honojs/hono/compare/v2.2.4...v2.2.5 ### [`v2.2.4`](https://togithub.com/honojs/hono/releases/tag/v2.2.4) [Compare Source](https://togithub.com/honojs/hono/compare/v2.2.3...v2.2.4) #### Summary ##### Error handling **This release includes a small breaking change**: Prior to this release, if an error occurred in the Handler, it would throw an Error object. In this release, the error response is assigned to `c.res` without throwing Error. ```ts app.use('*', async (c, next) => { await next() // c.res is error reponse }) app.get('/error', () => { throw new Error('Test error') }) ``` Then you can access the original Error object with `c.error`. ```ts app.use('*', async (c, next) => { await next() const originalMessage = c.error.message //... }) ``` For more information, See: [https://github.com/honojs/hono/pull/576](https://togithub.com/honojs/hono/pull/576) ##### JSON array path validation This is a pretty new feature. Support for array paths in JSON Path for use with Validator Middleware. If there is a JSON request body as follows: ```json { "posts": [ { "title": "Good Morning", "tags": ["Bar", true] }, { "title": "Good Night", "tags": ["Bar", false] } ] } ``` We can validate with the following rules: ```ts app.post( '/posts', validator((v) => ({ title: v.json('posts[*].title').asArray().isRequired(), secondTag: v.json('posts[*].tags[1]').asArray().asBoolean(), })), (c) => { return c.text('Valid') } ) ``` #### Bug fixes And some bug fixes. #### What's Changed - feat(validator): add support for JSON array path validation by [@​ThatOneBro](https://togithub.com/ThatOneBro) in [https://github.com/honojs/hono/pull/563](https://togithub.com/honojs/hono/pull/563) - Fix Trie router multiple matching path parameters by [@​gatesn](https://togithub.com/gatesn) in [https://github.com/honojs/hono/pull/571](https://togithub.com/honojs/hono/pull/571) - refactor(bun/serve-static): don't check `c.res` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/572](https://togithub.com/honojs/hono/pull/572) - fix(cache): export cache middleware for Deno by [@​ThatOneBro](https://togithub.com/ThatOneBro) in [https://github.com/honojs/hono/pull/573](https://togithub.com/honojs/hono/pull/573) - fix(compose): don't throw Error; set error response into `c.res` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/576](https://togithub.com/honojs/hono/pull/576) - fix(reg-exp-router): Register path for all the methods if method === METHOD_NAME_ALL. by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/580](https://togithub.com/honojs/hono/pull/580) - fix(validator): return HTTP 400 on malformed JSON request by [@​ThatOneBro](https://togithub.com/ThatOneBro) in [https://github.com/honojs/hono/pull/579](https://togithub.com/honojs/hono/pull/579) #### New Contributors - [@​ThatOneBro](https://togithub.com/ThatOneBro) made their first contribution in [https://github.com/honojs/hono/pull/563](https://togithub.com/honojs/hono/pull/563) - [@​gatesn](https://togithub.com/gatesn) made their first contribution in [https://github.com/honojs/hono/pull/571](https://togithub.com/honojs/hono/pull/571) **Full Changelog**: https://github.com/honojs/hono/compare/v2.2.3...v2.2.4 ### [`v2.2.3`](https://togithub.com/honojs/hono/releases/tag/v2.2.3) [Compare Source](https://togithub.com/honojs/hono/compare/v2.2.2...v2.2.3) #### Summary This is a patch release. Fixed bugs for Cache Middleware. #### What's Changed - fix(handleEvent): use `dispatch` instead of `fetch` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/568](https://togithub.com/honojs/hono/pull/568) **Full Changelog**: https://github.com/honojs/hono/compare/v2.2.2...v2.2.3 ### [`v2.2.2`](https://togithub.com/honojs/hono/releases/tag/v2.2.2) [Compare Source](https://togithub.com/honojs/hono/compare/v2.2.1...v2.2.2) #### Summary Bug fixes, friendly error messages, and performance tuning. It will be about 16% faster!! on Bun with a single handler that does not use async such as "Hello World". #### What's Changed - perf: remove `async` from dispatch; will be 16% faster by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/550](https://togithub.com/honojs/hono/pull/550) - fix(types): enable types for `c.env` when using validator by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/553](https://togithub.com/honojs/hono/pull/553) - use console.trace to improve error handler by [@​mishra-prabhakar](https://togithub.com/mishra-prabhakar) in [https://github.com/honojs/hono/pull/556](https://togithub.com/honojs/hono/pull/556) - fix(validator): make `isOptional` rule works correctly by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/555](https://togithub.com/honojs/hono/pull/555) - refactor(serve-static): use context/next instead of MiddlewareHandler by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/559](https://togithub.com/honojs/hono/pull/559) #### New Contributors - [@​mishra-prabhakar](https://togithub.com/mishra-prabhakar) made their first contribution in [https://github.com/honojs/hono/pull/556](https://togithub.com/honojs/hono/pull/556) **Full Changelog**: https://github.com/honojs/hono/compare/v2.2.1...v2.2.2

Configuration

πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated
artifact-viewer ❌ Failed (Inspect) Mar 24, 2023 at 11:10PM (UTC)
renovate[bot] commented 1 year ago

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

β™» Renovate will retry this branch, including artifacts, only when one of the following happens:

The artifact failure details are included below:

File name: pnpm-lock.yaml
Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit