diff --git a/package.json b/package.json index db09612d..17292aa0 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "access": "public" }, "peerDependencies": { - "hono": "^2.2.5" + "hono": "^2.6.1" }, "dependencies": { "toucan-js": "^2.6.1" @@ -52,7 +52,7 @@ "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", - "hono": "^2.2.5", + "hono": "^2.6.1", "jest": "^28.1.2", "jest-environment-miniflare": "^2.6.0", "np": "^7.6.2", @@ -61,4 +61,4 @@ "ts-jest": "^28.0.5", "typescript": "^4.7.4" } -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 2c3f2151..07e99f7e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,15 @@ -import type { Context, Handler } from 'hono' +import type { Context, MiddlewareHandler } from 'hono' import Toucan from 'toucan-js' declare module 'hono' { interface ContextVariableMap { sentry: Toucan } - } interface Bindings { - SENTRY_DSN?: string; - NEXT_PUBLIC_SENTRY_DSN?: string; + SENTRY_DSN?: string + NEXT_PUBLIC_SENTRY_DSN?: string } class MockContext implements ExecutionContext { @@ -35,7 +34,10 @@ export type Options = { release?: string } -export const sentry = (options?: Options, callback?: (sentry: Toucan) => void): Handler => { +export const sentry = ( + options?: Options, + callback?: (sentry: Toucan) => void +): MiddlewareHandler => { return async (c, next) => { let hasExecutionContext = true try { diff --git a/yarn.lock b/yarn.lock index 3c5e9c5a..d9129e68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2874,7 +2874,7 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hono@^2.2.5: +hono@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/hono/-/hono-2.6.1.tgz#9e85b69cff97586eb53db329c52961e8eade943b" integrity sha512-DsJSOkwV2M7TkuRsp8VJrD02ISMsT7BXGUWjPBJS3n1fIx7NQEhat395lo7024w2ibrbmo+5FivUG0vqij9YYg==