Merge branch 'dev' into 'main'

Try number idk how much

See merge request illegitimate/illegitimate-bot!356
This commit is contained in:
2025-08-10 23:36:09 +02:00
5 changed files with 11 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ RUN bun install --frozen-lockfile
COPY . .
ENV NODE_ENV=prod
ENV DOCKER=1
RUN bun bundle
FROM oven/bun

View File

@@ -21,6 +21,11 @@ const files = [
eventFiles.map(f => `src/events/${f}`)
].flat()
const banner = [
"process.env.BUILD = 'true'",
process.env.DOCKER === "1" ? "process.env.DOCKER = '1'" : null
].filter(v => typeof v === "string").join("\n")
await Bun.build({
entrypoints: ["src/index.ts", ...files],
outdir: "dist",
@@ -32,5 +37,5 @@ await Bun.build({
asset: "asset/[name]-[hash].[ext]"
},
root: "src",
banner: "process.env.BUILD = 'true'"
banner
})

2
src/enviroment.d.ts vendored
View File

@@ -3,6 +3,8 @@ declare global {
interface ProcessEnv {
NODE_ENV?: "dev" | "prod"
TYPESCRIPT?: "true"
BUILD?: "true"
DOCKER?: "1"
}
}
}

View File

@@ -1,4 +1,4 @@
export type LoadEventsOptions = {
ft: "ts" | "js"
dir: "src" | "dist"
dir: "src" | "dist" | ""
}

View File

@@ -8,7 +8,7 @@ const client = new Client()
const redis = new RedisClient(env.prod.REDISURI)
const ft = process.env.BUILD !== "true" ? "ts" : "js"
const dir = process.env.BUILD !== "true" ? "src" : "dist"
const dir = process.env.DOCKER !== "1" ? process.env.BUILD !== "true" ? "src" : "dist" : ""
class Illegitimate {
async start() {