@ahmedbaset/adminjs-hono 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahmedbaset/adminjs-hono",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AdminJS adapter for Hono web framework",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import AdminJS, { Router as AdminRouter } from 'adminjs'
2
- import type { Hono } from 'hono'
2
+ import { Hono } from 'hono'
3
3
  import { withLogin } from './authentication/login.handler.js'
4
4
  import { withLogout } from './authentication/logout.handler.js'
5
5
  import { withProtectedRoutesHandler } from './authentication/protected-routes.handler.js'
@@ -43,10 +43,7 @@ export function buildAuthenticatedRouter(
43
43
  throw new WrongArgumentError(INVALID_AUTH_CONFIG_ERROR)
44
44
  }
45
45
 
46
- // Use provided app or create new Hono instance
47
- // eslint-disable-next-line @typescript-eslint/no-var-requires
48
- const { Hono: HonoClass } = require('hono')
49
- const app = predefinedApp ?? new HonoClass()
46
+ const app = predefinedApp ?? new Hono()
50
47
 
51
48
  // Get routes and assets from AdminJS
52
49
  const { routes, assets } = AdminRouter
@@ -1,5 +1,6 @@
1
1
  import AdminJS, { Router as AdminRouter } from 'adminjs'
2
- import type { Hono, Handler, Context } from 'hono'
2
+ import {Hono} from "hono"
3
+ import type { Handler, Context } from 'hono'
3
4
  import { WrongArgumentError, INVALID_ADMINJS_INSTANCE } from './errors.js'
4
5
  import { log } from './logger.js'
5
6
  import { convertToHonoRoute } from './convertRoutes.js'
@@ -206,9 +207,7 @@ export function buildRouter(
206
207
  initializeAdmin(admin)
207
208
 
208
209
  // Use provided app or create new Hono instance
209
- // eslint-disable-next-line @typescript-eslint/no-var-requires
210
- const { Hono: HonoClass } = require('hono')
211
- const app = predefinedApp ?? new HonoClass()
210
+ const app = predefinedApp ?? new Hono()
212
211
 
213
212
  // Get routes and assets from AdminJS
214
213
  const { routes, assets } = AdminRouter