Remove unused dependencies and dead code, refresh AGENTS.md
- Drop unused email module and media text extraction path - Remove 12 unused dependencies - Remove unused imports in server.ts - Add typecheck and test scripts - Rewrite AGENTS.md to describe this project Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -17,7 +17,6 @@ import BunSQLite from "@moduletrace/bun-sqlite";
|
||||
import { existsSync, mkdirSync } from "fs";
|
||||
import path from "path";
|
||||
import sharp from "sharp";
|
||||
import fileToText from "./file-to-text";
|
||||
import MediaDataToArrayBuffer from "./media-data-to-array-buffer";
|
||||
import sniffMediaExtension from "./sniff-media-ext";
|
||||
import mediaDataToSharpInput from "./meida-data-to-sharp-input";
|
||||
@@ -31,7 +30,6 @@ type Params = {
|
||||
data?: MediaDataType;
|
||||
is_primary?: boolean;
|
||||
update_on_duplicate?: boolean;
|
||||
extract_media_text_content?: boolean;
|
||||
media?: BUN_SQLITE_WGUI_MEDIA;
|
||||
media_name?: string;
|
||||
media_mime_type?: string;
|
||||
@@ -50,7 +48,6 @@ export default async function uploadAndRecordMedia({
|
||||
media_type,
|
||||
is_primary,
|
||||
update_on_duplicate,
|
||||
extract_media_text_content,
|
||||
media,
|
||||
media_mime_type,
|
||||
media_name,
|
||||
@@ -189,17 +186,6 @@ export default async function uploadAndRecordMedia({
|
||||
await Bun.write(media_write_path_full, media_array_buffer, {
|
||||
mode: 1,
|
||||
});
|
||||
|
||||
if (extract_media_text_content) {
|
||||
const media_text = await fileToText({
|
||||
file_type: media_ext,
|
||||
file_stream: Buffer.from(media_array_buffer),
|
||||
});
|
||||
|
||||
if (media_text) {
|
||||
media_text_content = media_text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (existsSync(media_write_path_full)) {
|
||||
|
||||
@@ -41,7 +41,6 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async (
|
||||
is_media_primary,
|
||||
update_on_duplicate,
|
||||
reauth,
|
||||
return_media_text_content,
|
||||
media,
|
||||
is_media_private,
|
||||
media_name,
|
||||
@@ -61,7 +60,6 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async (
|
||||
media_type,
|
||||
is_primary: is_media_primary,
|
||||
update_on_duplicate,
|
||||
extract_media_text_content: return_media_text_content,
|
||||
media,
|
||||
media_mime_type: ext,
|
||||
user: { id: twuiNumberfy(user_id) },
|
||||
|
||||
@@ -2,10 +2,6 @@ import bunext from "@moduletrace/bunext";
|
||||
import syncWireguardHosts from "./functions/backend/setup/sync-wireguard-hosts";
|
||||
import handleMediaServer from "./functions/server/media/handle-media-server";
|
||||
import { SiteData } from "./data/site-data";
|
||||
import { execFile, execSync } from "node:child_process";
|
||||
import path from "node:path";
|
||||
|
||||
declare global {}
|
||||
|
||||
const development = process.env.NODE_ENV == "development";
|
||||
const port = SiteData["ServerPort"];
|
||||
|
||||
Reference in New Issue
Block a user