From dd8fa2a6c4088917c7642979b3ceba7847d1c4aa Mon Sep 17 00:00:00 2001 From: Torben Sorensen Date: Sat, 22 Nov 2025 18:45:42 -0800 Subject: [PATCH] more unit testing --- ecosystem.config.cjs | 9 ++++----- package.json | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index 8264a777..507c295f 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -8,11 +8,10 @@ module.exports = { name: 'flyer-crawler-api', // The name of our application in PM2 // Explicitly set the working directory. This is crucial for reliability. cwd: '/var/www/flyer-crawler.projectium.com', - // --- The Definitive Fix --- - // Instead of `npm run start`, we call `node` directly on the `tsx` CLI script. - // This bypasses any PATH issues within the PM2 daemon's environment. - script: 'node', - args: './node_modules/tsx/dist/cli.mjs --env-file .env server.ts', + // Use `tsx` directly as the interpreter. PM2 will find it in node_modules/.bin. + // This is more robust than calling `node` on the script path. + script: 'tsx', + args: '--env-file .env server.ts', env_production: { NODE_ENV: 'production', // Set the Node.js environment to production }, diff --git a/package.json b/package.json index 36188649..f58c49b5 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test": "vitest run --coverage", "test:integration": "vitest run --coverage -c vitest.config.integration.ts", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "seed": "ts-node-dev scripts/seed.ts", + "seed": "tsx src/db/seed.ts", "start:server": "tsx --env-file .env.test server.ts", "start:server:dev": "tsx --env-file .env server.ts" }, @@ -37,7 +37,7 @@ "react-dom": "^19.2.0", "react-hot-toast": "^2.6.0", "react-router-dom": "^7.9.6", - "recharts": "^3.4.1", + "recharts": "^3.4.1", "tsx": "^4.20.6", "zxcvbn": "^4.4.2" }, @@ -68,7 +68,6 @@ "bcrypt": "^6.0.0", "concurrently": "^9.2.1", "dotenv": "^17.2.3", - "nyc": "^17.1.0", "eslint": "9.39.1", "eslint-plugin-react": "7.37.5", "eslint-plugin-react-hooks": "^7.0.1", @@ -76,6 +75,7 @@ "glob": "^13.0.0", "globals": "16.5.0", "jsdom": "^27.2.0", + "nyc": "^17.1.0", "postcss": "^8.5.6", "tailwindcss": "^4.1.17", "testcontainers": "^11.8.1",