mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Code cleanup, refresh lockfile
This commit is contained in:
parent
bc051ed043
commit
53fa9ca545
4
cli.ts
4
cli.ts
|
|
@ -20,8 +20,8 @@ import {
|
|||
} from "~database/entities/User";
|
||||
import { db } from "~drizzle/db";
|
||||
import { emoji, openIdAccount, status, user } from "~drizzle/schema";
|
||||
import { CliParameterType } from "~packages/cli-parser/cli-builder.type";
|
||||
import { config } from "~packages/config-manager";
|
||||
import { CliParameterType } from "cli-parser/cli-builder.type";
|
||||
import { config } from "config-manager";
|
||||
|
||||
const args = process.argv;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ import { config } from "config-manager";
|
|||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
import { Client } from "pg";
|
||||
import * as schema from "./schema";
|
||||
import {
|
||||
LogLevel,
|
||||
type LogManager,
|
||||
type MultiLogManager,
|
||||
} from "~packages/log-manager";
|
||||
import { LogLevel, type LogManager, type MultiLogManager } from "log-manager";
|
||||
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
||||
|
||||
export const client = new Client({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
import type { APIRouteExports } from "~packages/server-handler";
|
||||
import type { RouteHandler } from "./server/api/routes.type";
|
||||
import type { APIRouteMeta } from "./types/api";
|
||||
|
||||
// Why are these routes specified manually instead of using Bun's FileSystemRouter?
|
||||
// This is to allow for compilation of the routes, so that we can minify them and
|
||||
// node_modules in production
|
||||
|
|
@ -103,7 +99,7 @@ export const routeMatcher = new Bun.FileSystemRouter({
|
|||
dir: `${process.cwd()}/server/api`,
|
||||
});
|
||||
|
||||
export const matchRoute = async <T = Record<string, never>>(url: string) => {
|
||||
export const matchRoute = async (url: string) => {
|
||||
const route = routeMatcher.match(url);
|
||||
if (!route) return { file: null, matchedRoute: null };
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Config } from "config-manager";
|
|||
import { matches } from "ip-matching";
|
||||
import type { LogManager, MultiLogManager } from "log-manager";
|
||||
import { LogLevel } from "log-manager";
|
||||
import { processRoute } from "~packages/server-handler";
|
||||
import { processRoute } from "server-handler";
|
||||
import { matchRoute } from "~routes";
|
||||
|
||||
export const createServer = (
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { MediaBackendType } from "media-manager";
|
|||
import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
|
||||
import { db } from "~drizzle/db";
|
||||
import { attachment } from "~drizzle/schema";
|
||||
import { LocalMediaBackend, S3MediaBackend } from "~packages/media-manager";
|
||||
import { LocalMediaBackend, S3MediaBackend } from "media-manager";
|
||||
|
||||
export const meta = applyConfig({
|
||||
allowedMethods: ["GET", "PUT"],
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import sharp from "sharp";
|
|||
import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
|
||||
import { db } from "~drizzle/db";
|
||||
import { attachment } from "~drizzle/schema";
|
||||
import { LocalMediaBackend, S3MediaBackend } from "~packages/media-manager";
|
||||
import { LocalMediaBackend, S3MediaBackend } from "media-manager";
|
||||
|
||||
export const meta = applyConfig({
|
||||
allowedMethods: ["POST"],
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import sharp from "sharp";
|
|||
import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
|
||||
import { db } from "~drizzle/db";
|
||||
import { attachment } from "~drizzle/schema";
|
||||
import { LocalMediaBackend, S3MediaBackend } from "~packages/media-manager";
|
||||
import { LocalMediaBackend, S3MediaBackend } from "media-manager";
|
||||
|
||||
export const meta = applyConfig({
|
||||
allowedMethods: ["POST"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue