From ae2fe2d4e5b81ce37b3ba8f6062f08de2f3a3a5a Mon Sep 17 00:00:00 2001 From: anuragmerndev Date: Tue, 30 Apr 2024 01:59:40 +0530 Subject: [PATCH 1/2] feat: supporting esm import add the exports in package.json to support esm import for js and ts --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 2d99ff715..ba93ebd6f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,12 @@ "type": "git", "url": "git+https://github.com/supertokens/supertokens-node.git" }, + "exports": { + "./recipe/*": { + "types": "./recipe/*/index.d.ts", + "default": "./recipe/*/index.js" + } + }, "author": "rishabhpoddar", "license": "Apache-2.0", "bugs": { From 0a4894b361bc47002183d14739cd61265c559b39 Mon Sep 17 00:00:00 2001 From: anuragMern Date: Mon, 3 Jun 2024 23:03:16 +0530 Subject: [PATCH 2/2] feat: support for .js module export adding the support for .js module exports and support for types, nextjs, framework and recipe module exports --- package.json | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/package.json b/package.json index ba93ebd6f..5d5c3df8d 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,49 @@ "url": "git+https://github.com/supertokens/supertokens-node.git" }, "exports": { + ".": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "./framework/*": { + "types": "./framework/*/index.d.ts", + "default": "./framework/*/index.js" + }, + "./framework/*/index.js": { + "types": "./framework/*/index.d.ts", + "default": "./framework/*/index.js" + }, + "./nextjs": { + "types": "./nextjs/index.d.ts", + "default": "./nextjs/index.js" + }, + "./nextjs/index.js": { + "types": "./nextjs/index.d.ts", + "default": "./nextjs/index.js" + }, + "./types": { + "types": "./types/index.d.ts", + "default": "./types/index.js" + }, + "./types/index.js": { + "types": "./types/index.d.ts", + "default": "./types/index.js" + }, + "./lib/*": { + "types": "./lib/*/index.d.ts", + "default": "./lib/*/index.js" + }, + "./lib/*.js": { + "types": "./lib/*.d.ts", + "default": "./lib/*.js" + }, "./recipe/*": { "types": "./recipe/*/index.d.ts", "default": "./recipe/*/index.js" + }, + "./recipe/*/index.js": { + "types": "./recipe/*/index.d.ts", + "default": "./recipe/*/index.js" } }, "author": "rishabhpoddar",