From f4c7d8192d909d737eb64cc3b7a91f26831ac12e Mon Sep 17 00:00:00 2001 From: rubicon2 <41235563+rubicon2@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:59:42 +0000 Subject: [PATCH 1/3] Fix broken esm import As per typescript docs: "...libraries that need to ship as CommonJS should use 'export =' for modules that have a single main export..." This fixes esm imports not working, but commonjs imports will have to drop '.default' that was previously necessary, e.g. in the test file. So a breaking change. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 179f429..ff85e2c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ import { Client } from './Client'; -export default Client; +export = Client; From 0754609d6f2eba64ba449169358eedbe11d49d9f Mon Sep 17 00:00:00 2001 From: rubicon2 <41235563+rubicon2@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:09:47 +0000 Subject: [PATCH 2/3] Run npm build script --- dist/index.d.ts | 2 +- dist/index.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 2b0375b..80d80c5 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,2 +1,2 @@ import { Client } from './Client'; -export default Client; +export = Client; diff --git a/dist/index.js b/dist/index.js index 604b2b8..080a035 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,3 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); const Client_1 = require("./Client"); -exports.default = Client_1.Client; +module.exports = Client_1.Client; From 686b826b3e1eb39a75d8e99e5a8ef026ccbde65d Mon Sep 17 00:00:00 2001 From: rubicon2 <41235563+rubicon2@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:11:03 +0000 Subject: [PATCH 3/3] Fix test broken by esm import fix --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 958d9ed..e4f1716 100644 --- a/test/test.js +++ b/test/test.js @@ -1,5 +1,5 @@ 'use strict'; -const guardian = require('../dist').default; +const guardian = require('../dist'); let api = new guardian('test_api_key', false);