refactor: 🚚 Organize code into sub-packages, instead of a single large package

This commit is contained in:
Jesse Wierzbinski 2025-06-15 04:38:20 +02:00
parent 79742f47dc
commit a6d3ebbeef
No known key found for this signature in database
366 changed files with 942 additions and 833 deletions

View file

@ -1,10 +1,10 @@
import { afterAll, describe, expect, test } from "bun:test";
import { RolePermission } from "@versia/client/schemas";
import { Application } from "@versia/kit/db";
import { config } from "@versia-server/config";
import { randomUUIDv7 } from "bun";
import { SignJWT } from "jose";
import { randomString } from "@/math";
import { config } from "~/config.ts";
import { fakeRequest, getTestUsers } from "~/tests/utils";
const { deleteUsers, tokens, users } = await getTestUsers(1);

View file

@ -2,10 +2,11 @@ import {
Account as AccountSchema,
RolePermission,
} from "@versia/client/schemas";
import { ApiError } from "@versia/kit";
import { db, Media, Token, User } from "@versia/kit/db";
import { and, eq, isNull, type SQL } from "@versia/kit/drizzle";
import { OpenIdAccounts, Users } from "@versia/kit/tables";
import { randomUUIDv7 } from "bun";
import { and, eq, isNull, type SQL } from "drizzle-orm";
import { setCookie } from "hono/cookie";
import { describeRoute } from "hono-openapi";
import { validator } from "hono-openapi/zod";
@ -13,7 +14,6 @@ import { SignJWT } from "jose";
import { z } from "zod";
import { handleZodError } from "@/api";
import { randomString } from "@/math.ts";
import { ApiError } from "~/classes/errors/api-error.ts";
import type { PluginType } from "../../index.ts";
import { automaticOidcFlow } from "../../utils.ts";

View file

@ -1,6 +1,6 @@
import { db, Token } from "@versia/kit/db";
import { and, eq } from "@versia/kit/drizzle";
import { Tokens } from "@versia/kit/tables";
import { and, eq } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
import { resolver, validator } from "hono-openapi/zod";
import { z } from "zod";

View file

@ -1,6 +1,6 @@
import { Application, Token } from "@versia/kit/db";
import { and, eq } from "@versia/kit/drizzle";
import { Tokens } from "@versia/kit/tables";
import { and, eq } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
import { resolver, validator } from "hono-openapi/zod";
import { z } from "zod";

View file

@ -1,12 +1,12 @@
import { RolePermission } from "@versia/client/schemas";
import { ApiError } from "@versia/kit";
import { db } from "@versia/kit/db";
import { and, eq, type SQL } from "@versia/kit/drizzle";
import { OpenIdAccounts } from "@versia/kit/tables";
import { and, eq, type SQL } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
import { resolver, validator } from "hono-openapi/zod";
import { z } from "zod";
import { auth, handleZodError } from "@/api";
import { ApiError } from "~/classes/errors/api-error";
import type { PluginType } from "~/plugins/openid";
export default (plugin: PluginType): void => {

View file

@ -1,4 +1,5 @@
import { RolePermission } from "@versia/client/schemas";
import { ApiError } from "@versia/kit";
import { Application, db } from "@versia/kit/db";
import { OpenIdLoginFlows } from "@versia/kit/tables";
import { randomUUIDv7 } from "bun";
@ -10,7 +11,6 @@ import {
} from "oauth4webapi";
import { z } from "zod";
import { auth, handleZodError } from "@/api";
import { ApiError } from "~/classes/errors/api-error.ts";
import type { PluginType } from "../../index.ts";
import { oauthDiscoveryRequest, oauthRedirectUri } from "../../utils.ts";