refactor(bun-transpiler): enable isolated declarations (#1193)
parent
471cf0580d
commit
1adca4c918
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/bun-transpiler': patch
|
||||
---
|
||||
|
||||
Add explicit `MiddlewareHandler` return type
|
|
@ -1,4 +1,5 @@
|
|||
import Bun from 'bun'
|
||||
import type { MiddlewareHandler } from 'hono'
|
||||
import { createMiddleware } from 'hono/factory'
|
||||
|
||||
type BunTranspilerOptions = {
|
||||
|
@ -16,7 +17,7 @@ export const defaultOptions: Required<BunTranspilerOptions> = {
|
|||
},
|
||||
}
|
||||
|
||||
export const bunTranspiler = (options?: BunTranspilerOptions) => {
|
||||
export const bunTranspiler = (options?: BunTranspilerOptions): MiddlewareHandler => {
|
||||
return createMiddleware(async (c, next) => {
|
||||
await next()
|
||||
const url = new URL(c.req.url)
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
||||
"emitDeclarationOnly": false
|
||||
"emitDeclarationOnly": false,
|
||||
"isolatedDeclarations": true
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["**/*.test.ts"],
|
||||
|
|
Loading…
Reference in New Issue