Files
processor/package.json
T
julian 4a9f55cdf0 Copy SQL migration files into dist/ as part of build
tsc only emits .ts -> .js; non-TypeScript assets like SQL migration
files don't make it into dist/ by default. The migration runner reads
*.sql from dist/db/migrations/ at runtime in production (relative to
the compiled migrate.js), so the missing files surface as a fatal
ENOENT on container startup.

Fix: small node script (scripts/copy-assets.mjs) using fs.cpSync,
invoked after tsc in the build script. Cross-platform, no new
dependencies. The script is in the Docker build context but not
copied into the runtime stage, so it doesn't bloat the final image.

Verified: pnpm build now produces dist/db/migrations/0001_positions.sql.
2026-05-01 10:49:59 +02:00

44 lines
1.2 KiB
JSON

{
"name": "processor",
"version": "0.1.0",
"description": "Worker service that consumes Position records from Redis Streams and writes durable state to Postgres/TimescaleDB",
"type": "module",
"engines": {
"node": ">=22"
},
"scripts": {
"build": "tsc --project tsconfig.json && node scripts/copy-assets.mjs",
"dev": "tsx watch src/main.ts",
"start": "node dist/main.js",
"test": "vitest run",
"test:watch": "vitest",
"test:integration": "vitest run --config vitest.integration.config.ts",
"lint": "eslint .",
"format": "prettier --write .",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"ioredis": "^5.3.2",
"pg": "^8.13.0",
"pino": "^9.5.0",
"prom-client": "^15.1.3",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/node": "^22.10.0",
"@types/pg": "^8.11.10",
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.19.0",
"@vitest/coverage-v8": "^2.1.8",
"eslint": "^9.17.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.31.0",
"pino-pretty": "^13.0.0",
"prettier": "^3.4.2",
"testcontainers": "^11.14.0",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
}
}