From 0eae64904d83beade16f5fd112575585b9bc471b Mon Sep 17 00:00:00 2001 From: robertsLando Date: Mon, 9 Mar 2026 09:16:48 +0100 Subject: [PATCH] fix: add types condition to package.json exports field When using TypeScript with moduleResolution set to "node16", "nodenext", or "bundler", the compiler resolves types through the exports field and ignores the top-level "types" entry. This caused TS2305 errors like: Module '"aedes"' has no exported member 'Aedes'. Adding the "types" condition inside the exports map fixes resolution for all moduleResolution strategies. Closes #1080 Co-Authored-By: Claude Opus 4.6 --- package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a4a3373..ce3232aa 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,12 @@ "name": "aedes", "version": "1.0.0", "description": "Stream-based MQTT broker", - "exports": "./aedes.js", + "exports": { + ".": { + "types": "./aedes.d.ts", + "default": "./aedes.js" + } + }, "type": "module", "types": "aedes.d.ts", "scripts": {