fix: resolve TypeScript and deployment issues

- Add explicit Router type annotations to fix TS2742 errors
- Add @google-cloud/functions-framework dependency for Firebase deployment
- Fix build script to use cross-platform file copy (Windows compatible)
- Exclude pnpm-lock.yaml from Firebase deployment
- Update package-lock.json to sync with package.json
This commit is contained in:
Jonathan Pressnell
2025-11-12 17:08:48 -05:00
parent 8d513fe7ed
commit 192e274fa6
6 changed files with 10 additions and 7 deletions

View File

@@ -20,7 +20,8 @@
".env.bak",
".env.bak*",
"*.env.bak",
"*.env.bak*"
"*.env.bak*",
"pnpm-lock.yaml"
],
"predeploy": [
"npm run build"

View File

@@ -5,7 +5,7 @@
"main": "dist/index.js",
"scripts": {
"dev": "ts-node-dev --respawn --transpile-only --max-old-space-size=8192 --expose-gc src/index.ts",
"build": "tsc && node src/scripts/prepare-dist.js && cp .puppeteerrc.cjs dist/",
"build": "tsc && node src/scripts/prepare-dist.js && node -e \"require('fs').copyFileSync('.puppeteerrc.cjs', 'dist/.puppeteerrc.cjs')\"",
"start": "node --max-old-space-size=8192 --expose-gc dist/index.js",
"test:gcs": "ts-node src/scripts/test-gcs-integration.ts",
"test:staging": "ts-node src/scripts/test-staging-environment.ts",
@@ -66,7 +66,8 @@
"uuid": "^11.1.0",
"winston": "^3.11.0",
"zod": "^3.25.76",
"zod-to-json-schema": "^3.24.6"
"zod-to-json-schema": "^3.24.6",
"@google-cloud/functions-framework": "^3.4.0"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
@@ -82,6 +83,7 @@
"@typescript-eslint/parser": "^6.10.0",
"@vitest/coverage-v8": "^2.1.0",
"eslint": "^8.53.0",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.2.2",
"vitest": "^2.1.0"

View File

@@ -3,7 +3,7 @@ import { getSupabaseServiceClient } from '../config/supabase';
import { logger } from '../utils/logger';
import { addCorrelationId } from '../middleware/validation';
const router = Router();
const router: Router = Router();
router.use(addCorrelationId);
/**

View File

@@ -16,7 +16,7 @@ declare global {
}
}
const router = express.Router();
const router: express.Router = express.Router();
// Apply authentication and correlation ID to all routes
router.use(verifyFirebaseToken);

View File

@@ -3,7 +3,7 @@ import { uploadMonitoringService } from '../services/uploadMonitoringService';
import { addCorrelationId } from '../middleware/validation';
import { logger } from '../utils/logger';
const router = Router();
const router: Router = Router();
// Apply correlation ID middleware to all monitoring routes
router.use(addCorrelationId);

View File

@@ -2,7 +2,7 @@ import { Router } from 'express';
import { VectorDatabaseModel } from '../models/VectorDatabaseModel';
import { logger } from '../utils/logger';
const router = Router();
const router: Router = Router();
/**
* GET /api/vector/document-chunks/:documentId