From 509d18aaae1452b5c821eed6de664171918c35e1 Mon Sep 17 00:00:00 2001 From: David Crowe Date: Thu, 23 Jul 2026 10:56:47 -0700 Subject: [PATCH] fix(explicabl): drop undeclared node-fetch import; use Node 18+ global fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit health.ts imported `node-fetch` but the package declared only express and express-rate-limit. Because dist/index.js re-exports health.js, the published @gatewaystack/explicabl@0.0.8 threw ERR_MODULE_NOT_FOUND on ANY import from a fresh install — including createConsoleLogger, which has nothing to do with the health route. Same defect class as the proxyabl-core/jose break (PR #35). The two call sites use only standard WHATWG fetch semantics (.ok/.status, {method,headers,body}), so Node 18+'s global fetch is a drop-in. Removing the import also makes the README's 'zero dependencies beyond Express' claim true. Add engines.node >=18 to make the global-fetch requirement explicit; bump to 0.0.9. Verified: packed tarball installs into an empty project and imports with all 5 exports; full suite (159 tests) green. --- packages/explicabl/package.json | 5 ++++- packages/explicabl/src/health.ts | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/explicabl/package.json b/packages/explicabl/package.json index 4a360ce..efd17e7 100644 --- a/packages/explicabl/package.json +++ b/packages/explicabl/package.json @@ -1,6 +1,6 @@ { "name": "@gatewaystack/explicabl", - "version": "0.0.8", + "version": "0.0.9", "private": false, "license": "MIT", "type": "module", @@ -18,6 +18,9 @@ "build": "tsc -p tsconfig.json", "prepublishOnly": "npm run build" }, + "engines": { + "node": ">=18" + }, "dependencies": { "express": "^4.22.0", "express-rate-limit": "^8.2.2" diff --git a/packages/explicabl/src/health.ts b/packages/explicabl/src/health.ts index e4a4654..91aee1d 100644 --- a/packages/explicabl/src/health.ts +++ b/packages/explicabl/src/health.ts @@ -1,5 +1,4 @@ import { Router, type Request, type RequestHandler } from "express"; -import fetch from "node-fetch"; import rateLimit from "express-rate-limit"; import { timingSafeEqual } from "node:crypto";