diff --git a/api/api/auth/login/index.ts b/api/api/auth/login/index.ts index 25924c86..790689ff 100644 --- a/api/api/auth/login/index.ts +++ b/api/api/auth/login/index.ts @@ -1,10 +1,10 @@ import { apiRoute, applyConfig } from "@/api"; -import type { Context } from "@hono/hono"; -import { setCookie } from "@hono/hono/cookie"; import { createRoute } from "@hono/zod-openapi"; import { Application, User } from "@versia/kit/db"; import { Users } from "@versia/kit/tables"; import { eq, or } from "drizzle-orm"; +import type { Context } from "hono"; +import { setCookie } from "hono/cookie"; import { SignJWT } from "jose"; import { z } from "zod"; import { config } from "~/packages/config-manager"; diff --git a/app.ts b/app.ts index bec323c6..f73a9439 100644 --- a/app.ts +++ b/app.ts @@ -3,15 +3,15 @@ import { handleZodError } from "@/api"; import { applyToHono } from "@/bull-board.ts"; import { configureLoggers } from "@/loggers"; import { sentry } from "@/sentry"; -import { cors } from "@hono/hono/cors"; -import { createMiddleware } from "@hono/hono/factory"; -import { prettyJSON } from "@hono/hono/pretty-json"; -import { secureHeaders } from "@hono/hono/secure-headers"; import { swaggerUI } from "@hono/swagger-ui"; import { OpenAPIHono } from "@hono/zod-openapi"; /* import { prometheus } from "@hono/prometheus"; */ import { getLogger } from "@logtape/logtape"; import chalk from "chalk"; +import { cors } from "hono/cors"; +import { createMiddleware } from "hono/factory"; +import { prettyJSON } from "hono/pretty-json"; +import { secureHeaders } from "hono/secure-headers"; import pkg from "~/package.json" with { type: "application/json" }; import { config } from "~/packages/config-manager/index.ts"; import { PluginLoader } from "./classes/plugin/loader.ts"; diff --git a/bun.lockb b/bun.lockb index 07e0ae79..9c03408c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/middlewares/agent-bans.ts b/middlewares/agent-bans.ts index f82a4180..9baf5ce4 100644 --- a/middlewares/agent-bans.ts +++ b/middlewares/agent-bans.ts @@ -1,4 +1,4 @@ -import { createMiddleware } from "@hono/hono/factory"; +import { createMiddleware } from "hono/factory"; import { config } from "~/packages/config-manager"; export const agentBans = createMiddleware(async (context, next) => { diff --git a/middlewares/bait.ts b/middlewares/bait.ts index c292e64a..fa2bc03f 100644 --- a/middlewares/bait.ts +++ b/middlewares/bait.ts @@ -1,6 +1,6 @@ -import { createMiddleware } from "@hono/hono/factory"; import { getLogger } from "@logtape/logtape"; import type { BunFile, SocketAddress } from "bun"; +import { createMiddleware } from "hono/factory"; import { matches } from "ip-matching"; import { config } from "~/packages/config-manager"; diff --git a/middlewares/boundary-check.ts b/middlewares/boundary-check.ts index 63fbf59c..b994360e 100644 --- a/middlewares/boundary-check.ts +++ b/middlewares/boundary-check.ts @@ -1,4 +1,4 @@ -import { createMiddleware } from "@hono/hono/factory"; +import { createMiddleware } from "hono/factory"; export const boundaryCheck = createMiddleware(async (context, next) => { // Checks that FormData boundary is present diff --git a/middlewares/ip-bans.ts b/middlewares/ip-bans.ts index 8ee07fd1..9fbc2a5b 100644 --- a/middlewares/ip-bans.ts +++ b/middlewares/ip-bans.ts @@ -1,7 +1,7 @@ import { sentry } from "@/sentry"; -import { createMiddleware } from "@hono/hono/factory"; import { getLogger } from "@logtape/logtape"; import type { SocketAddress } from "bun"; +import { createMiddleware } from "hono/factory"; import { matches } from "ip-matching"; import { config } from "~/packages/config-manager"; diff --git a/middlewares/logger.ts b/middlewares/logger.ts index c7dc1a54..43937afd 100644 --- a/middlewares/logger.ts +++ b/middlewares/logger.ts @@ -1,6 +1,6 @@ -import { createMiddleware } from "@hono/hono/factory"; import { getLogger } from "@logtape/logtape"; import chalk from "chalk"; +import { createMiddleware } from "hono/factory"; import { config } from "~/packages/config-manager"; export const logger = createMiddleware(async (context, next) => { diff --git a/middlewares/url-check.ts b/middlewares/url-check.ts index 06a55e72..42602766 100644 --- a/middlewares/url-check.ts +++ b/middlewares/url-check.ts @@ -1,4 +1,4 @@ -import { createMiddleware } from "@hono/hono/factory"; +import { createMiddleware } from "hono/factory"; import { config } from "~/packages/config-manager"; export const urlCheck = createMiddleware(async (context, next) => { diff --git a/package.json b/package.json index 63a86b48..4bc6d236 100644 --- a/package.json +++ b/package.json @@ -91,17 +91,17 @@ "@types/mime-types": "^2.1.4", "@types/pg": "^8.11.10", "@types/qs": "^6.9.17", - "drizzle-kit": "^0.29.1", + "drizzle-kit": "^0.30.1", "markdown-it-image-figures": "^2.1.1", "markdown-it-mathjax3": "^4.3.2", - "oclif": "^4.16.0", + "oclif": "^4.17.0", "ts-prune": "^0.10.3", "typescript": "^5.7.2", "vitepress": "^1.5.0", "vitepress-plugin-tabs": "^0.5.0", "vitepress-sidebar": "^1.30.2", "vue": "^3.5.13", - "zod-to-json-schema": "^3.23.5" + "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "typescript": "^5.3.2" @@ -111,31 +111,30 @@ "@bull-board/api": "^6.5.3", "@bull-board/hono": "^6.5.3", "@hackmd/markdown-it-task-lists": "^2.1.4", - "@hono/hono": "npm:@jsr/hono__hono@4.6.13", "@hono/prometheus": "^1.0.1", "@hono/swagger-ui": "^0.5.0", - "@hono/zod-openapi": "^0.16.4", + "@hono/zod-openapi": "0.16.3", "@inquirer/confirm": "^5.1.0", "@inquirer/input": "^4.1.0", "@json2csv/plainjs": "^7.0.6", "@logtape/logtape": "npm:@jsr/logtape__logtape@0.9.0-dev.114+327c9473", - "@oclif/core": "^4.0.36", - "@sentry/bun": "^8.42.0", + "@oclif/core": "^4.1.0", + "@sentry/bun": "^8.47.0", "@tufjs/canonical-json": "^2.0.0", "@versia/client": "^0.1.4", "@versia/federation": "^0.1.4", "@versia/kit": "workspace:*", "altcha-lib": "^1.1.1", "blurhash": "^2.0.5", - "bullmq": "^5.33.0", + "bullmq": "^5.34.3", "c12": "^2.0.1", - "chalk": "^5.3.0", + "chalk": "^5.4.0", "cli-progress": "^3.12.0", "cli-table": "^0.3.11", "confbox": "^0.1.8", - "drizzle-orm": "^0.37.0", + "drizzle-orm": "^0.38.2", "extract-zip": "^2.0.1", - "hono": "npm:@jsr/hono__hono@4.6.13", + "hono": "^4.6.14", "html-to-text": "^9.0.5", "ioredis": "^5.4.1", "ip-matching": "^2.1.2", @@ -150,7 +149,7 @@ "markdown-it-container": "^4.0.0", "markdown-it-toc-done-right": "^4.2.0", "mime-types": "^2.1.35", - "mitata": "^1.0.20", + "mitata": "^1.0.21", "oauth4webapi": "^3.1.4", "ora": "^8.1.1", "pg": "^8.13.1", @@ -165,9 +164,12 @@ "unzipit": "^1.4.3", "uqr": "^0.1.2", "xss": "^1.0.15", - "zod": "^3.23.8", + "zod": "^3.24.1", "zod-validation-error": "^3.4.0" }, + "overrides": { + "zod": "^3.24.1" + }, "patchedDependencies": { "@bull-board/api@6.5.3": "patches/@bull-board%2Fapi@6.5.3.patch" } diff --git a/packages/plugin-kit/plugin.ts b/packages/plugin-kit/plugin.ts index 1f028fb7..65c24fca 100644 --- a/packages/plugin-kit/plugin.ts +++ b/packages/plugin-kit/plugin.ts @@ -1,6 +1,6 @@ -import { createMiddleware } from "@hono/hono/factory"; import type { OpenAPIHono } from "@hono/zod-openapi"; import type { MiddlewareHandler } from "hono"; +import { createMiddleware } from "hono/factory"; import type { z } from "zod"; import { type ZodError, fromZodError } from "zod-validation-error"; import type { HonoEnv } from "~/types/api"; diff --git a/plugins/openid/index.ts b/plugins/openid/index.ts index 96eed0c8..bf29ef52 100644 --- a/plugins/openid/index.ts +++ b/plugins/openid/index.ts @@ -1,7 +1,7 @@ -import { getCookie } from "@hono/hono/cookie"; import { Hooks, Plugin } from "@versia/kit"; import { User } from "@versia/kit/db"; import chalk from "chalk"; +import { getCookie } from "hono/cookie"; import { jwtVerify } from "jose"; import { JOSEError, JWTExpired } from "jose/errors"; import { z } from "zod"; diff --git a/plugins/openid/routes/oauth/callback.ts b/plugins/openid/routes/oauth/callback.ts index 9014fba0..1e160eed 100644 --- a/plugins/openid/routes/oauth/callback.ts +++ b/plugins/openid/routes/oauth/callback.ts @@ -1,10 +1,10 @@ import { mimeLookup } from "@/content_types.ts"; import { randomString } from "@/math.ts"; -import { setCookie } from "@hono/hono/cookie"; import { createRoute, z } from "@hono/zod-openapi"; import { Token, User, db } from "@versia/kit/db"; import { type SQL, and, eq, isNull } from "@versia/kit/drizzle"; import { OpenIdAccounts, RolePermissions, Users } from "@versia/kit/tables"; +import { setCookie } from "hono/cookie"; import { SignJWT } from "jose"; import type { PluginType } from "../../index.ts"; import { automaticOidcFlow } from "../../utils.ts"; diff --git a/types/api.ts b/types/api.ts index daeecb7c..0f2fe001 100644 --- a/types/api.ts +++ b/types/api.ts @@ -1,4 +1,3 @@ -import type { RouterRoute } from "@hono/hono/types"; import type { OpenAPIHono } from "@hono/zod-openapi"; import type { Delete, @@ -13,6 +12,7 @@ import type { } from "@versia/federation/types"; import type { RolePermissions } from "@versia/kit/tables"; import type { SocketAddress } from "bun"; +import type { RouterRoute } from "hono/types"; import { z } from "zod"; import type { AuthData } from "~/classes/functions/user"; import type { Config } from "~/packages/config-manager"; diff --git a/utils/api.ts b/utils/api.ts index 15a62484..3842cb1f 100644 --- a/utils/api.ts +++ b/utils/api.ts @@ -1,5 +1,3 @@ -import type { Context, MiddlewareHandler } from "@hono/hono"; -import { createMiddleware } from "@hono/hono/factory"; import type { OpenAPIHono } from "@hono/zod-openapi"; import { getLogger } from "@logtape/logtape"; import { Application, Token, db } from "@versia/kit/db"; @@ -7,6 +5,8 @@ import { Challenges } from "@versia/kit/tables"; import { extractParams, verifySolution } from "altcha-lib"; import chalk from "chalk"; import { type SQL, eq } from "drizzle-orm"; +import type { Context, MiddlewareHandler } from "hono"; +import { createMiddleware } from "hono/factory"; import { anyOf, caseInsensitive, @@ -429,7 +429,7 @@ export const setContextFormDataToObject = ( * Add it to random Hono routes and hope it works * @returns */ -export const jsonOrForm = (): MiddlewareHandler => { +export const jsonOrForm = (): MiddlewareHandler => { return createMiddleware(async (context, next) => { const contentType = context.req.header("content-type"); diff --git a/utils/bull-board.ts b/utils/bull-board.ts index 36154856..4416a21a 100644 --- a/utils/bull-board.ts +++ b/utils/bull-board.ts @@ -1,8 +1,8 @@ import { createBullBoard } from "@bull-board/api"; import { BullMQAdapter } from "@bull-board/api/bullMQAdapter"; import { HonoAdapter } from "@bull-board/hono"; -import { serveStatic } from "@hono/hono/bun"; import type { OpenAPIHono } from "@hono/zod-openapi"; +import { serveStatic } from "hono/bun"; import { deliveryQueue } from "~/classes/queues/delivery"; import { fetchQueue } from "~/classes/queues/fetch"; import { inboxQueue } from "~/classes/queues/inbox"; @@ -37,6 +37,5 @@ export const applyToHono = (app: OpenAPIHono): void => { }); serverAdapter.setBasePath("/admin/queues"); - // @ts-expect-error idk why this is not working app.route("/admin/queues", serverAdapter.registerPlugin()); };