From fc3f5436d50cffd083b6019d33a40689c1e895c7 Mon Sep 17 00:00:00 2001 From: purexo <5005154+Purexo@users.noreply.github.com> Date: Fri, 25 Jul 2025 17:06:12 +0200 Subject: [PATCH] build: fix prod build new ts config broke runtime with `.d.ts` into src/cron dir --- tests/cron/EpicGames.spec.ts | 17 ++++++++--------- tsconfig.json | 3 +++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/cron/EpicGames.spec.ts b/tests/cron/EpicGames.spec.ts index a74ecf3..e44fae4 100644 --- a/tests/cron/EpicGames.spec.ts +++ b/tests/cron/EpicGames.spec.ts @@ -15,13 +15,12 @@ test('getOfferedGames', async () => { if (!games) continue; - if (lastGames) { - if ( - lastGames.length >= games.length && - lastGames.every((g) => games.some((gg) => g.title === gg.title)) - ) { - continue; - } + if ( + lastGames && + lastGames.length >= games.length && + lastGames.every((g) => games.some((gg) => g.title === gg.title)) + ) { + continue; } lastGames = games; @@ -50,9 +49,9 @@ test('getOfferedGames', async () => { function generateDate(now = new Date()) { const nowMs = now.getTime(); - return Array(7) + return Array.from({ length: 7 }) .fill(0) - .map((v, i) => -i) // days + .map((v, index) => -index) // days .map((d) => d * oneDay) // days in ms .map((deltaMs) => new Date(nowMs + deltaMs)); } diff --git a/tsconfig.json b/tsconfig.json index 9c741c7..687b284 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,9 @@ "include": ["src", "tests"], "compilerOptions": { "outDir": "build", + // need build src clean of .d.ts files because of auto import src/crons files + "declaration": false, + "declarationMap": false, "allowJs": true, "useUnknownInCatchVariables": false, "noUncheckedIndexedAccess": false