From a18d9e2e9bfa2a6d48d53cbf69c05804d3964332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Emre=20Kabakc=C4=B1?= Date: Fri, 15 May 2026 02:55:22 +0100 Subject: [PATCH] fix(server): bundle build copies connectors next to server.bundle.mjs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In prod Docker the server runs as /app/packages/server/dist/server.bundle.mjs, so connector-catalog's first candidate dir (/connectors) didn't exist — the CLI build copies it for `lobu run`, but the server bundle build didn't. The scanner then fell through to /app/packages/connectors (package root, copied wholesale by the Dockerfile) which contains no top-level .ts files, so the catalog came back empty and app.lobu.ai//connectors rendered "No connectors found". Copy packages/connectors/src to packages/server/dist/connectors after both bundles build, mirroring packages/cli/scripts/build.cjs. The server bundle is now self-contained the same way `lobu run` already is. --- packages/server/scripts/build-server-bundle.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/server/scripts/build-server-bundle.mjs b/packages/server/scripts/build-server-bundle.mjs index 946394cf0..303111b52 100644 --- a/packages/server/scripts/build-server-bundle.mjs +++ b/packages/server/scripts/build-server-bundle.mjs @@ -22,6 +22,7 @@ */ import esbuild from 'esbuild'; +import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; import { dirname, join } from 'node:path'; @@ -82,3 +83,14 @@ async function buildBundle(entryPoint, outfile) { await buildBundle('src/server.ts', 'dist/server.bundle.mjs'); await buildBundle('src/start-local.ts', 'dist/start-local.bundle.mjs'); + +const connectorsSrc = join(pkgDir, '..', 'connectors', 'src'); +const connectorsDest = join(pkgDir, 'dist', 'connectors'); +if (existsSync(connectorsSrc)) { + if (existsSync(connectorsDest)) { + rmSync(connectorsDest, { recursive: true, force: true }); + } + mkdirSync(dirname(connectorsDest), { recursive: true }); + cpSync(connectorsSrc, connectorsDest, { recursive: true }); + console.log(`\n=== copied connectors: ${connectorsDest}`); +}