diff --git a/.deploy/api/package.json b/.deploy/api/package.json index 39d6221a3..5656cafe0 100644 --- a/.deploy/api/package.json +++ b/.deploy/api/package.json @@ -23,14 +23,14 @@ "devDependencies": { "@nestjs/schematics": "^10.0.1", "@nestjs/testing": "^10.0.2", - "@nx/jest": "16.6.0", - "@nx/js": "16.6.0", - "@nx/nest": "16.6.0", - "@nx/node": "16.6.0", - "@nx/rollup": "16.6.0", - "@nx/web": "16.6.0", - "@nx/webpack": "16.6.0", - "@nx/workspace": "16.6.0", + "@nx/jest": "17.1.2", + "@nx/js": "17.1.2", + "@nx/nest": "17.1.2", + "@nx/node": "17.1.2", + "@nx/rollup": "17.1.2", + "@nx/web": "17.1.2", + "@nx/webpack": "17.1.2", + "@nx/workspace": "17.1.2", "@swc/cli": "~0.1.62", "@swc/core": "~1.3.51", "@swc/jest": "0.2.20", @@ -41,10 +41,10 @@ "eslint": "8.15.0", "eslint-config-prettier": "8.1.0", "jest": "29.4.3", - "nx": "16.6.0", + "nx": "17.1.2", "ts-jest": "29.1.1", "ts-node": "10.9.1", - "typescript": "5.1.3" + "typescript": "5.2.2" }, "workspaces": [ "apps/*", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index df391b45a..04f5a05d7 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@metad/analytics", - "version": "0.0.1", + "version": "1.18.0", "type": "commonjs", "license": "MIT", "scripts": { @@ -28,7 +28,6 @@ "nestjs-i18n": "^8.1.6", "redis": "^4.0.4", "reflect-metadata": "^0.1.13", - "sharp": "^0.30.5", "socket.io-redis": "6.1.1", "typeorm": "^0.2.37", "xml2js": "^0.4.23" diff --git a/packages/analytics/src/screenshot/screenshot.controller.ts b/packages/analytics/src/screenshot/screenshot.controller.ts index ece6d1812..e2767c9c6 100644 --- a/packages/analytics/src/screenshot/screenshot.controller.ts +++ b/packages/analytics/src/screenshot/screenshot.controller.ts @@ -13,7 +13,7 @@ import { import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger'; import * as path from 'path'; import * as moment from 'moment'; -import * as sharp from 'sharp'; +// import * as sharp from 'sharp'; It's a bug in install sharp in docker image import * as fs from 'fs'; import { FileStorageProviderEnum, IScreenshot, UploadedFile } from '@metad/contracts'; import { Screenshot } from './screenshot.entity'; @@ -68,20 +68,21 @@ export class ScreenshotController extends CrudController { const inputFile = await tempFile('screenshot-thumb'); const outputFile = await tempFile('screenshot-thumb'); await fs.promises.writeFile(inputFile, fileContent); - await new Promise((resolve, reject) => { - sharp(inputFile) - .resize(250, 150) - .toFile(outputFile, (error: any, data: any) => { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - }); + // await new Promise((resolve, reject) => { + // sharp(inputFile) + // .resize(250, 150) + // .toFile(outputFile, (error: any, data: any) => { + // if (error) { + // reject(error); + // } else { + // resolve(data); + // } + // }); + // }); const thumbName = `thumb-${file.filename}`; const thumbDir = path.dirname(file.key); - const data = await fs.promises.readFile(outputFile); + // const data = await fs.promises.readFile(outputFile); + const data = await fs.promises.readFile(inputFile); await fs.promises.unlink(inputFile); await fs.promises.unlink(outputFile);