refactor: bump up Hono to `v2.6.1` (#10)

pull/31/head
Yusuke Wada 2022-12-13 06:51:37 +09:00 committed by GitHub
parent 857700f6b7
commit 29d9d29378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -33,7 +33,7 @@
"access": "public" "access": "public"
}, },
"peerDependencies": { "peerDependencies": {
"hono": "^2.2.5" "hono": "^2.6.1"
}, },
"dependencies": { "dependencies": {
"toucan-js": "^2.6.1" "toucan-js": "^2.6.1"
@ -52,7 +52,7 @@
"eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"hono": "^2.2.5", "hono": "^2.6.1",
"jest": "^28.1.2", "jest": "^28.1.2",
"jest-environment-miniflare": "^2.6.0", "jest-environment-miniflare": "^2.6.0",
"np": "^7.6.2", "np": "^7.6.2",

View File

@ -1,16 +1,15 @@
import type { Context, Handler } from 'hono' import type { Context, MiddlewareHandler } from 'hono'
import Toucan from 'toucan-js' import Toucan from 'toucan-js'
declare module 'hono' { declare module 'hono' {
interface ContextVariableMap { interface ContextVariableMap {
sentry: Toucan sentry: Toucan
} }
} }
interface Bindings { interface Bindings {
SENTRY_DSN?: string; SENTRY_DSN?: string
NEXT_PUBLIC_SENTRY_DSN?: string; NEXT_PUBLIC_SENTRY_DSN?: string
} }
class MockContext implements ExecutionContext { class MockContext implements ExecutionContext {
@ -35,7 +34,10 @@ export type Options = {
release?: string release?: string
} }
export const sentry = (options?: Options, callback?: (sentry: Toucan) => void): Handler<string, { Bindings: Bindings }> => { export const sentry = (
options?: Options,
callback?: (sentry: Toucan) => void
): MiddlewareHandler<string, { Bindings: Bindings }> => {
return async (c, next) => { return async (c, next) => {
let hasExecutionContext = true let hasExecutionContext = true
try { try {

View File

@ -2874,7 +2874,7 @@ has@^1.0.3:
dependencies: dependencies:
function-bind "^1.1.1" function-bind "^1.1.1"
hono@^2.2.5: hono@^2.6.1:
version "2.6.1" version "2.6.1"
resolved "https://registry.yarnpkg.com/hono/-/hono-2.6.1.tgz#9e85b69cff97586eb53db329c52961e8eade943b" resolved "https://registry.yarnpkg.com/hono/-/hono-2.6.1.tgz#9e85b69cff97586eb53db329c52961e8eade943b"
integrity sha512-DsJSOkwV2M7TkuRsp8VJrD02ISMsT7BXGUWjPBJS3n1fIx7NQEhat395lo7024w2ibrbmo+5FivUG0vqij9YYg== integrity sha512-DsJSOkwV2M7TkuRsp8VJrD02ISMsT7BXGUWjPBJS3n1fIx7NQEhat395lo7024w2ibrbmo+5FivUG0vqij9YYg==