From 81f968f8aaeb8cb04240949488f8d140ee764861 Mon Sep 17 00:00:00 2001 From: "yanlong.wang" Date: Tue, 11 Feb 2025 16:52:16 +0800 Subject: [PATCH] fix: build issues --- jina-ai/Dockerfile | 4 ++-- jina-ai/package-lock.json | 8 ++++---- jina-ai/package.json | 4 ++-- src/utils/token-tracker.ts | 2 +- tsconfig.json | 4 +++- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/jina-ai/Dockerfile b/jina-ai/Dockerfile index 933a2b6..a584c18 100644 --- a/jina-ai/Dockerfile +++ b/jina-ai/Dockerfile @@ -19,10 +19,10 @@ WORKDIR /app COPY ./src ./src COPY ./config.json ./ COPY ./tsconfig.json ./tsconfig.json +RUN npm run build + COPY ./jina-ai/src ./jina-ai/src COPY ./jina-ai/tsconfig.json ./jina-ai/tsconfig.json - -RUN npm run build WORKDIR /app/jina-ai RUN npm run build diff --git a/jina-ai/package-lock.json b/jina-ai/package-lock.json index fa8c673..9388069 100644 --- a/jina-ai/package-lock.json +++ b/jina-ai/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/firestore": "^7.11.0", - "civkit": "^0.8.3-3e69606", + "civkit": "^0.8.3-15926cb", "dayjs": "^1.11.13", "lodash": "^4.17.21", "reflect-metadata": "^0.2.2", @@ -851,9 +851,9 @@ } }, "node_modules/civkit": { - "version": "0.8.3-ba2d60a", - "resolved": "https://registry.npmjs.org/civkit/-/civkit-0.8.3-ba2d60a.tgz", - "integrity": "sha512-WnL5yIH8KhbtfvNoUmC69LLjDUhLAcr2ftlZCbuhqYJUlAU4ICaop/ulGAkyYtq0x6mQNG9RPa+NU4g1gyL28Q==", + "version": "0.8.3-15926cb", + "resolved": "https://registry.npmjs.org/civkit/-/civkit-0.8.3-15926cb.tgz", + "integrity": "sha512-RPPYF0MUcxs4TC7j1IreKDpfFPCYpyg5DG5akDPcSqesbY7mp7zgr5poorD8P6rIWD3Wvu4805RswZi/npnWeQ==", "license": "AGPL", "dependencies": { "lodash": "^4.17.21", diff --git a/jina-ai/package.json b/jina-ai/package.json index a2b3275..8107124 100644 --- a/jina-ai/package.json +++ b/jina-ai/package.json @@ -25,7 +25,7 @@ "description": "", "dependencies": { "@google-cloud/firestore": "^7.11.0", - "civkit": "^0.8.3-3e69606", + "civkit": "^0.8.3-15926cb", "dayjs": "^1.11.13", "lodash": "^4.17.21", "reflect-metadata": "^0.2.2", @@ -35,4 +35,4 @@ "@types/lodash": "^4.17.15", "pino-pretty": "^13.0.0" } -} \ No newline at end of file +} diff --git a/src/utils/token-tracker.ts b/src/utils/token-tracker.ts index 1ed0dbd..5168a85 100644 --- a/src/utils/token-tracker.ts +++ b/src/utils/token-tracker.ts @@ -13,7 +13,7 @@ export class TokenTracker extends EventEmitter { if ('asyncLocalContext' in process) { const asyncLocalContext = process.asyncLocalContext as any; this.on('usage', () => { - if (asyncLocalContext.hasContext()) { + if (asyncLocalContext.available()) { asyncLocalContext.ctx.chargeAmount = this.getTotalUsage(); } }); diff --git a/tsconfig.json b/tsconfig.json index 22175ca..def3627 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,7 @@ "experimentalDecorators": true, "emitDecoratorMetadata": true, "resolveJsonModule": true - } + }, + "include": ["src/**/*"], + "exclude": ["jina-ai/**/*", "**/__tests__/**/*"], }