refactor: bump up Hono to `v2.6.1` (#10)
parent
857700f6b7
commit
29d9d29378
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
12
src/index.ts
12
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<string, { Bindings: Bindings }> => {
|
||||
export const sentry = (
|
||||
options?: Options,
|
||||
callback?: (sentry: Toucan) => void
|
||||
): MiddlewareHandler<string, { Bindings: Bindings }> => {
|
||||
return async (c, next) => {
|
||||
let hasExecutionContext = true
|
||||
try {
|
||||
|
|
|
@ -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==
|
||||
|
|
Loading…
Reference in New Issue