neondatabase / serverless

Connect to Neon PostgreSQL from serverless/worker/edge functions
https://www.npmjs.com/package/@neondatabase/serverless
MIT License
321 stars 13 forks source link

fix `package.json` exports field #25

Closed alexanderniebuhr closed 1 year ago

alexanderniebuhr commented 1 year ago

can you make sure the top-level types field, does als get added to the exports field, like so once published to npm?

diff --git a/package.json b/package.json
index 4dd03e2c75620af7c15e464fb5ff5385ea314f25..9761af21f3aa240966b56c42a8d86a3902ef0e8c 100644
--- a/package.json
+++ b/package.json
@@ -4,6 +4,7 @@
   "author": "Neon",
   "description": "node-postgres via WebSockets from neon.tech",
   "exports": {
+    "types": "./index.d.ts",
     "require": "./index.js",
     "import": "./index.mjs"
   },
RichiCoder1 commented 1 year ago

https://arethetypeswrong.github.io/ for more details and to validate.

jawj commented 1 year ago

Absolutely, I hadn't clocked that I'd failed to do this until now.

alexanderniebuhr commented 1 year ago

@jawj thanks for the fix, not sure if it is relevant, but according to typescript docs, types need to come as first property entry and it seems you added it last.

jawj commented 1 year ago

Good catch! Just fixed that too.