Code cleanup, refresh lockfile

This commit is contained in:
Jesse Wierzbinski 2024-04-13 22:16:03 -10:00
parent bc051ed043
commit 53fa9ca545
No known key found for this signature in database
8 changed files with 8 additions and 16 deletions

BIN
bun.lockb

Binary file not shown.

4
cli.ts
View file

@ -20,8 +20,8 @@ import {
} from "~database/entities/User"; } from "~database/entities/User";
import { db } from "~drizzle/db"; import { db } from "~drizzle/db";
import { emoji, openIdAccount, status, user } from "~drizzle/schema"; import { emoji, openIdAccount, status, user } from "~drizzle/schema";
import { CliParameterType } from "~packages/cli-parser/cli-builder.type"; import { CliParameterType } from "cli-parser/cli-builder.type";
import { config } from "~packages/config-manager"; import { config } from "config-manager";
const args = process.argv; const args = process.argv;

View file

@ -2,11 +2,7 @@ import { config } from "config-manager";
import { drizzle } from "drizzle-orm/node-postgres"; import { drizzle } from "drizzle-orm/node-postgres";
import { Client } from "pg"; import { Client } from "pg";
import * as schema from "./schema"; import * as schema from "./schema";
import { import { LogLevel, type LogManager, type MultiLogManager } from "log-manager";
LogLevel,
type LogManager,
type MultiLogManager,
} from "~packages/log-manager";
import { migrate } from "drizzle-orm/postgres-js/migrator"; import { migrate } from "drizzle-orm/postgres-js/migrator";
export const client = new Client({ export const client = new Client({

View file

@ -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? // 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 // This is to allow for compilation of the routes, so that we can minify them and
// node_modules in production // node_modules in production
@ -103,7 +99,7 @@ export const routeMatcher = new Bun.FileSystemRouter({
dir: `${process.cwd()}/server/api`, 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); const route = routeMatcher.match(url);
if (!route) return { file: null, matchedRoute: null }; if (!route) return { file: null, matchedRoute: null };

View file

@ -3,7 +3,7 @@ import type { Config } from "config-manager";
import { matches } from "ip-matching"; import { matches } from "ip-matching";
import type { LogManager, MultiLogManager } from "log-manager"; import type { LogManager, MultiLogManager } from "log-manager";
import { LogLevel } from "log-manager"; import { LogLevel } from "log-manager";
import { processRoute } from "~packages/server-handler"; import { processRoute } from "server-handler";
import { matchRoute } from "~routes"; import { matchRoute } from "~routes";
export const createServer = ( export const createServer = (

View file

@ -6,7 +6,7 @@ import { MediaBackendType } from "media-manager";
import { attachmentToAPI, getUrl } from "~database/entities/Attachment"; import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db"; import { db } from "~drizzle/db";
import { attachment } from "~drizzle/schema"; import { attachment } from "~drizzle/schema";
import { LocalMediaBackend, S3MediaBackend } from "~packages/media-manager"; import { LocalMediaBackend, S3MediaBackend } from "media-manager";
export const meta = applyConfig({ export const meta = applyConfig({
allowedMethods: ["GET", "PUT"], allowedMethods: ["GET", "PUT"],

View file

@ -7,7 +7,7 @@ import sharp from "sharp";
import { attachmentToAPI, getUrl } from "~database/entities/Attachment"; import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db"; import { db } from "~drizzle/db";
import { attachment } from "~drizzle/schema"; import { attachment } from "~drizzle/schema";
import { LocalMediaBackend, S3MediaBackend } from "~packages/media-manager"; import { LocalMediaBackend, S3MediaBackend } from "media-manager";
export const meta = applyConfig({ export const meta = applyConfig({
allowedMethods: ["POST"], allowedMethods: ["POST"],

View file

@ -7,7 +7,7 @@ import sharp from "sharp";
import { attachmentToAPI, getUrl } from "~database/entities/Attachment"; import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db"; import { db } from "~drizzle/db";
import { attachment } from "~drizzle/schema"; import { attachment } from "~drizzle/schema";
import { LocalMediaBackend, S3MediaBackend } from "~packages/media-manager"; import { LocalMediaBackend, S3MediaBackend } from "media-manager";
export const meta = applyConfig({ export const meta = applyConfig({
allowedMethods: ["POST"], allowedMethods: ["POST"],