From 98755d86c835a6c9ef39591a303bc95c38f9da4e Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 8 Jun 2026 13:18:04 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20chore:=20Declare=20runtime=20dep?= =?UTF-8?q?s=20externalized=20by=20tsdown=20in=20`@librechat/api`=20(#1360?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tsdown migration (#13595) externalizes all third-party imports (Rollup inlined them), so several modules the api source imports must be present at runtime. Six were not, causing production (`npm ci --omit=dev`) to crash on boot with `Cannot find module 'get-stream'` (then the next). Fixed following the package's existing convention — packages/api declares runtime libs as `peerDependencies`, and the `/api` app provides them as real `dependencies` (how express/mongoose/sharp already resolve): - `api/package.json` (the prod app, the provider): add the 3 that were missing — `get-stream`, `jszip`, `mongodb`. (`dedent`/`lodash`/`nanoid` were already provided by /api.) - `packages/api/package.json`: add all 6 to `peerDependencies` (the contract) and to `devDependencies` (workspace build/tests), matching the existing `mammoth`/`pdfjs-dist`/`sanitize-html` dev+peer pattern. `jszip`/`mongodb` move out of dev-only (were pruned in production). Pinned to CJS-compatible majors (get-stream@6, nanoid@3). Verified the built bundle has zero undeclared externals and the 3 newly-provided deps are production (non-dev) in the lockfile, so they survive `--omit=dev`. --- api/package.json | 3 +++ package-lock.json | 14 +++++++++++++- packages/api/package.json | 10 ++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/api/package.json b/api/package.json index a2caa8d0a5..02179e38f2 100644 --- a/api/package.json +++ b/api/package.json @@ -82,11 +82,13 @@ "file-type": "^21.3.2", "firebase": "^11.0.2", "form-data": "^4.0.4", + "get-stream": "^6.0.1", "handlebars": "^4.7.9", "https-proxy-agent": "^7.0.6", "ioredis": "^5.3.2", "js-yaml": "^4.1.1", "jsonwebtoken": "^9.0.0", + "jszip": "^3.10.1", "jwks-rsa": "^3.2.0", "keyv": "^5.3.2", "keyv-file": "^5.1.2", @@ -99,6 +101,7 @@ "memorystore": "^1.6.7", "mime": "^3.0.0", "module-alias": "^2.2.3", + "mongodb": "^6.14.2", "mongoose": "^8.23.1", "multer": "^2.1.1", "nanoid": "^3.3.7", diff --git a/package-lock.json b/package-lock.json index 30fa3d2e3d..d8c9c7a604 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,11 +97,13 @@ "file-type": "^21.3.2", "firebase": "^11.0.2", "form-data": "^4.0.4", + "get-stream": "^6.0.1", "handlebars": "^4.7.9", "https-proxy-agent": "^7.0.6", "ioredis": "^5.3.2", "js-yaml": "^4.1.1", "jsonwebtoken": "^9.0.0", + "jszip": "^3.10.1", "jwks-rsa": "^3.2.0", "keyv": "^5.3.2", "keyv-file": "^5.1.2", @@ -114,6 +116,7 @@ "memorystore": "^1.6.7", "mime": "^3.0.0", "module-alias": "^2.2.3", + "mongodb": "^6.14.2", "mongoose": "^8.23.1", "multer": "^2.1.1", "nanoid": "^3.3.7", @@ -27587,7 +27590,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -44247,12 +44249,16 @@ "@types/winston": "^2.4.4", "@types/yauzl": "^2.10.3", "aws-sdk-client-mock": "^4.1.0", + "dedent": "^1.5.3", + "get-stream": "^6.0.1", "jest": "^30.2.0", "jest-junit": "^16.0.0", "jszip": "^3.10.1", "librechat-data-provider": "*", + "lodash": "^4.17.23", "mammoth": "^1.11.0", "mongodb": "^6.14.2", + "nanoid": "^3.3.7", "pdfjs-dist": "^5.4.624", "rimraf": "^6.1.3", "rollup": "^4.34.9", @@ -44294,24 +44300,30 @@ "ai-tokenizer": "^1.0.6", "axios": "^1.16.0", "connect-redis": "^8.1.0", + "dedent": "^1.5.3", "eventsource": "^3.0.2", "express": "^5.1.0", "express-session": "^1.18.2", "firebase": "^11.0.2", "form-data": "^4.0.4", + "get-stream": "^6.0.1", "google-auth-library": "^9.15.1", "https-proxy-agent": "^7.0.6", "ioredis": "^5.3.2", "js-yaml": "^4.1.1", "jsonwebtoken": "^9.0.0", + "jszip": "^3.10.1", "jwks-rsa": "^3.2.0", "keyv": "^5.3.2", "keyv-file": "^5.1.2", "librechat-data-provider": "*", + "lodash": "^4.17.23", "mammoth": "^1.11.0", "mathjs": "^15.2.0", "memorystore": "^1.6.7", + "mongodb": "^6.14.2", "mongoose": "^8.23.1", + "nanoid": "^3.3.7", "node-fetch": "2.7.0", "pdfjs-dist": "^5.4.624", "prom-client": "^15.1.3", diff --git a/packages/api/package.json b/packages/api/package.json index 8bb43c0c9f..e6faab8a17 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -75,12 +75,16 @@ "@types/winston": "^2.4.4", "@types/yauzl": "^2.10.3", "aws-sdk-client-mock": "^4.1.0", + "dedent": "^1.5.3", + "get-stream": "^6.0.1", "jest": "^30.2.0", "jest-junit": "^16.0.0", "jszip": "^3.10.1", "librechat-data-provider": "*", + "lodash": "^4.17.23", "mammoth": "^1.11.0", "mongodb": "^6.14.2", + "nanoid": "^3.3.7", "pdfjs-dist": "^5.4.624", "rimraf": "^6.1.3", "rollup": "^4.34.9", @@ -125,24 +129,30 @@ "ai-tokenizer": "^1.0.6", "axios": "^1.16.0", "connect-redis": "^8.1.0", + "dedent": "^1.5.3", "eventsource": "^3.0.2", "express": "^5.1.0", "express-session": "^1.18.2", "firebase": "^11.0.2", "form-data": "^4.0.4", + "get-stream": "^6.0.1", "google-auth-library": "^9.15.1", "https-proxy-agent": "^7.0.6", "ioredis": "^5.3.2", "js-yaml": "^4.1.1", "jsonwebtoken": "^9.0.0", + "jszip": "^3.10.1", "jwks-rsa": "^3.2.0", "keyv": "^5.3.2", "keyv-file": "^5.1.2", "librechat-data-provider": "*", + "lodash": "^4.17.23", "mammoth": "^1.11.0", "mathjs": "^15.2.0", "memorystore": "^1.6.7", + "mongodb": "^6.14.2", "mongoose": "^8.23.1", + "nanoid": "^3.3.7", "node-fetch": "2.7.0", "pdfjs-dist": "^5.4.624", "prom-client": "^15.1.3",