refactor: switch from go to bun

This commit is contained in:
Nicolas Meienberger
2025-08-31 17:32:00 +02:00
parent a0be690eb9
commit a16fc37b44
76 changed files with 4283 additions and 4173 deletions

View File

@@ -0,0 +1,25 @@
import { type } from "arktype";
import "dotenv/config";
const envSchema = type({
NODE_ENV: type
.enumerated("development", "production", "test")
.default("development"),
DB_FILE_NAME: "string",
}).pipe((s) => ({
__prod__: s.NODE_ENV === "production",
environment: s.NODE_ENV,
dbFileName: s.DB_FILE_NAME,
}));
const parseConfig = (env: unknown) => {
const result = envSchema(env);
if (result instanceof type.errors) {
throw new Error(`Invalid environment variables: ${result.toString()}`);
}
return result;
};
export const config = parseConfig(process.env);