From ce71983970caa20014e6d4c55deccc697f2a3d93 Mon Sep 17 00:00:00 2001 From: lehuygiang28 Date: Tue, 2 Jul 2024 19:30:37 +0700 Subject: [PATCH] fix(be): :fire: drop support bull board for serverless function --- apps/be/src/app/middlewares/job-queues.middleware.ts | 4 ---- package.json | 1 - serverless/api/index.ts | 5 +++-- yarn.lock | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/be/src/app/middlewares/job-queues.middleware.ts b/apps/be/src/app/middlewares/job-queues.middleware.ts index a338fce..2707458 100644 --- a/apps/be/src/app/middlewares/job-queues.middleware.ts +++ b/apps/be/src/app/middlewares/job-queues.middleware.ts @@ -34,10 +34,6 @@ export function jobQueueUIMiddleware(connection: Redis, basePath = '') { createBullBoard({ queues, serverAdapter, - options: { - uiBasePath: require.resolve(`@bull-board/ui/package.json`).replace('package.json', ''), - uiConfig: {}, - }, }); return serverAdapter.getRouter(); diff --git a/package.json b/package.json index 3a78e68..9ce827a 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "@ant-design/nextjs-registry": "^1.0.0", "@bull-board/api": "^5.20.5", "@bull-board/express": "^5.20.5", - "@bull-board/ui": "^5.20.5", "@faker-js/faker": "^8.4.1", "@hookform/resolvers": "^3.4.2", "@kovalenko/is-cron": "^1.0.10", diff --git a/serverless/api/index.ts b/serverless/api/index.ts index dc00ec1..67f71ac 100644 --- a/serverless/api/index.ts +++ b/serverless/api/index.ts @@ -8,9 +8,10 @@ const tsConfigPaths = require('tsconfig-paths'); const tsConfig = require('./tsconfig.json'); /** - * Import the modules that serverless couldn't find in node_modules + * Import some modules that serverless couldn't find it */ -require('@bull-board/ui/package.json'); + +/* ... */ const baseUrl = tsConfig?.compilerOptions?.baseUrl ?? '../'; diff --git a/yarn.lock b/yarn.lock index a4c95dc..d83db6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1879,7 +1879,7 @@ __metadata: languageName: node linkType: hard -"@bull-board/ui@npm:5.20.5, @bull-board/ui@npm:^5.20.5": +"@bull-board/ui@npm:5.20.5": version: 5.20.5 resolution: "@bull-board/ui@npm:5.20.5" dependencies: @@ -5066,7 +5066,6 @@ __metadata: "@babel/core": "npm:^7.24.6" "@bull-board/api": "npm:^5.20.5" "@bull-board/express": "npm:^5.20.5" - "@bull-board/ui": "npm:^5.20.5" "@compodoc/compodoc": "npm:^1.1.25" "@faker-js/faker": "npm:^8.4.1" "@hookform/resolvers": "npm:^3.4.2"