diff --git a/.gitignore b/.gitignore index 60a2b6a8..b378a2e4 100644 --- a/.gitignore +++ b/.gitignore @@ -182,3 +182,4 @@ glitch-dev *.pem oclif.manifest.json .direnv/ +tsconfig.tsbuildinfo \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 0ccf0537..10be65b8 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 0e54ef68..86dd283d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,8 @@ "cloc": "cloc . --exclude-dir node_modules,dist,.output,.nuxt,meta,logs,glitch,glitch-dev --exclude-ext sql,log,pem", "wc": "find server database *.ts docs packages types utils drizzle tests -type f -print0 | wc -m --files0-from=-", "cli": "bun run cli/index.ts", - "prune": "ts-prune | grep -v server/ | grep -v dist/ | grep -v '(used in module)'" + "prune": "ts-prune | grep -v server/ | grep -v dist/ | grep -v '(used in module)'", + "check": "bunx tsc -p ." }, "trustedDependencies": [ "@biomejs/biome", @@ -87,7 +88,7 @@ "drizzle-kit": "^0.21.1", "oclif": "^4.10.4", "ts-prune": "^0.10.3", - "typescript": "latest" + "typescript": "^5.4.5" }, "peerDependencies": { "typescript": "^5.3.2" diff --git a/packages/config-manager/config.type.ts b/packages/config-manager/config.type.ts index b85e532b..fafa637e 100644 --- a/packages/config-manager/config.type.ts +++ b/packages/config-manager/config.type.ts @@ -90,7 +90,7 @@ export const configValidator = z.object({ }), ) .default([]), - jwt_key: z.string().min(3).includes(";").default("").optional(), + jwt_key: z.string().min(3).includes(";").default(""), }), http: z.object({ base_url: z.string().min(1).default("http://lysand.social"), @@ -217,7 +217,14 @@ export const configValidator = z.object({ bucket_name: z.string().min(1).default("lysand"), public_url: z.string().min(1).url(), }) - .optional(), + .default({ + endpoint: "", + access_key: "", + secret_access_key: "", + region: undefined, + bucket_name: "lysand", + public_url: "", + }), validation: z .object({ max_displayname_size: z.number().int().default(50), diff --git a/server/api/api/v1/instance/extended_description.ts b/server/api/api/v1/instance/extended_description.ts index 8e6b4a47..6c37853c 100644 --- a/server/api/api/v1/instance/extended_description.ts +++ b/server/api/api/v1/instance/extended_description.ts @@ -26,7 +26,7 @@ export default (app: Hono) => let lastModified = new Date(2024, 0, 0); const extended_description_file = Bun.file( - config.instance.extended_description_path, + config.instance.extended_description_path || "", ); if (await extended_description_file.exists()) { diff --git a/utils/content_types.ts b/utils/content_types.ts index 41bbf0c2..3899c42f 100644 --- a/utils/content_types.ts +++ b/utils/content_types.ts @@ -22,7 +22,7 @@ export const getBestContentType = ( }; export const urlToContentFormat = ( - url: string, + url?: string, ): typeof EntityValidator.$ContentFormat | null => { if (!url) return null; if (url.startsWith("https://api.dicebear.com/")) { diff --git a/utils/response.ts b/utils/response.ts index c75ccbbf..a8e755c5 100644 --- a/utils/response.ts +++ b/utils/response.ts @@ -72,7 +72,7 @@ export const redirect = (url: string | URL, status = 302) => { }); }; -export const proxyUrl = (url: string | null) => { +export const proxyUrl = (url: string | null = null) => { const urlAsBase64Url = Buffer.from(url || "").toString("base64url"); return url ? new URL(