From fb84db3ea7c1a07e28f99e16b39f2dcd025615f6 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 25 Nov 2024 13:24:14 +0100 Subject: [PATCH] fix: :bug: Correctly include bull-board UI package in dist --- build.ts | 6 +++++- patches/@bull-board%2Fapi@6.5.3.patch | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.ts b/build.ts index 2fa0ed8f..f3f6b28f 100644 --- a/build.ts +++ b/build.ts @@ -25,7 +25,7 @@ await Bun.build({ target: "bun", splitting: true, minify: false, - external: ["unzipit", "acorn"], + external: ["unzipit", "acorn", "@bull-board/ui"], }).then((output) => { if (!output.success) { console.error(output.logs); @@ -57,6 +57,10 @@ await $`cp -r node_modules/uzip-module dist/node_modules/uzip-module`; // Copy acorn to dist await $`cp -r node_modules/acorn dist/node_modules/acorn`; +// Copy bull-board to dist +await $`mkdir -p dist/node_modules/@bull-board`; +await $`cp -r node_modules/@bull-board/ui dist/node_modules/@bull-board/ui`; + // Copy the Bee Movie script from pages await $`cp beemovie.txt dist/beemovie.txt`; diff --git a/patches/@bull-board%2Fapi@6.5.3.patch b/patches/@bull-board%2Fapi@6.5.3.patch index 81b87d71..7cfee761 100644 --- a/patches/@bull-board%2Fapi@6.5.3.patch +++ b/patches/@bull-board%2Fapi@6.5.3.patch @@ -7,7 +7,7 @@ index b7fa76b4861aefc96e27b3167b1511c3723ad318..c56d37721672b9ede3c85c84cb40c91c function createBullBoard({ queues, serverAdapter, options = { uiConfig: {} }, }) { const { bullBoardQueues, setQueues, replaceQueues, addQueue, removeQueue } = (0, queuesApi_1.getQueuesApi)(queues); - const uiBasePath = options.uiBasePath || path_1.default.dirname(eval(`require.resolve('@bull-board/ui/package.json')`)); -+ const uiBasePath = options.uiBasePath || path_1.default.dirname(import.meta.require.resolve('@bull-board/ui/package.json')); ++ const uiBasePath = options.uiBasePath || path_1.default.dirname(import.meta.resolve('@bull-board/ui/package.json')); serverAdapter .setQueues(bullBoardQueues) .setViewsPath(path_1.default.join(uiBasePath, 'dist'))