refactor/match_collector: change folder structure
Some checks are pending
pipeline / lint-and-format (push) Successful in 4m51s
pipeline / build-and-push-images (push) Has started running

This commit is contained in:
2026-04-23 18:35:37 +02:00
parent 360be86c10
commit c976f340e6
9 changed files with 12 additions and 10 deletions

View File

@@ -390,12 +390,11 @@ async function generateChampionStats() {
MONGO_HOST: 'localhost'
};
// Run the match collector directly with tsx (TypeScript executor) instead of docker compose
const matchCollectorPath = path.join(__dirname, '../../match_collector/index.ts');
execSync(`npx tsx ${matchCollectorPath}`, {
// Run the match collector
execSync(`npm run dev`, {
stdio: 'inherit',
env: env,
cwd: path.join(__dirname, '../..')
cwd: path.join(__dirname, '../../match_collector')
});
console.log('✅ Champion stats generated');

View File

@@ -5,4 +5,4 @@ USER node
COPY --chown=node:node package*.json ./
RUN npm install
COPY --chown=node:node . .
CMD /bin/sh -c "node --import=tsx index.ts; sleep 20h"
CMD ["/bin/sh", "-c", "node --import=tsx src/index.ts; sleep 20h"]

View File

@@ -8,7 +8,8 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"format": "prettier --write .",
"format:check": "prettier --check ."
"format:check": "prettier --check .",
"dev": "node --import=tsx src/index.ts"
},
"author": "",
"license": "ISC",

View File

@@ -1,11 +1,12 @@
import {
PlatformCounts,
REGION_KEYS,
initPlatformCounts,
mergePlatformCounts,
singlePlatformCount
} from './platform'
import type { PlatformCounts } from './platform'
type GoldAdvantageTag = 'ahead' | 'behind' | 'even'
// Item tags that can be derived from purchase patterns

View File

@@ -14,7 +14,7 @@ const PLATFORMS: Record<string, string> = {
}
// Platform counts for tracking item purchases per region
type PlatformCounts = {
interface PlatformCounts {
euw: number
eun: number
na: number
@@ -91,9 +91,9 @@ function getPlatformKey(platform: string): keyof PlatformCounts | undefined {
export {
PLATFORMS,
PlatformCounts,
PLATFORM_KEYS,
REGION_KEYS,
PlatformCounts,
getPlatformBaseUrl,
getRegionalBaseUrl,
getRegionForPlatform,

View File

@@ -1,5 +1,6 @@
{
"compilerOptions": {
"types": ["node"]
"types": ["node"],
"declaration": true
}
}