From 87ad0db3154a4c3a4de96250246b41b11e473670 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Wed, 23 Jul 2025 13:14:13 +0400 Subject: [PATCH 1/5] feat: enhance package configuration with module exports and TypeScript settings --- package.json | 9 +++++++++ tsconfig.json | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d6edd2e..fbf3488 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,15 @@ ], "license": "MIT", "main": "dist/index.js", + "module": "dist/index.js", + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "peerDependencies": { "@types/nodemailer": "^6.4.9", "nodemailer": "^6.9.4" diff --git a/tsconfig.json b/tsconfig.json index 3f5ecf7..8d71216 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,11 @@ "declaration": true, "outDir": "./dist", "skipLibCheck": true, - "esModuleInterop": true + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "declarationMap": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": false }, "include": ["src"], "exclude": ["node_modules", "examples"] From 6c35f7e24c40df3d82ee9870ead25fd93289173d Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Thu, 24 Jul 2025 12:30:35 +0400 Subject: [PATCH 2/5] chore: remove module entry from package.json exports for cleaner configuration --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index fbf3488..19dff12 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,8 @@ ], "license": "MIT", "main": "dist/index.js", - "module": "dist/index.js", "exports": { ".": { - "import": "./dist/index.js", "require": "./dist/index.js", "types": "./dist/index.d.ts" }, From 715a0a43955b5f37b20d044c8f33ef3e6984b191 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Thu, 24 Jul 2025 21:40:11 +0400 Subject: [PATCH 3/5] chore: remove isolatedModules setting from tsconfig.json for cleaner TypeScript configuration --- tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 8d71216..ef6d79f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,8 +10,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "declarationMap": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": false + "forceConsistentCasingInFileNames": true }, "include": ["src"], "exclude": ["node_modules", "examples"] From 21317ff6f4482e9a4c88f6d9147e946dd6952973 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Thu, 31 Jul 2025 10:31:23 +0400 Subject: [PATCH 4/5] fix: import MailMessage in transport.ts for proper type usage --- src/lib/transport.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/transport.ts b/src/lib/transport.ts index bfe64de..f9ac4bf 100644 --- a/src/lib/transport.ts +++ b/src/lib/transport.ts @@ -1,5 +1,4 @@ import { Transport } from "nodemailer"; -import MailMessage from "nodemailer/lib/mailer/mail-message"; import MailtrapClient from "./MailtrapClient"; import normalizeCallback from "./normalizer"; @@ -11,6 +10,7 @@ import { MailtrapResponse, MailtrapTransporter, NormalizeCallback, + MailMessage, } from "../types/transport"; const { TRANSPORT_SETTINGS } = CONFIG; From 1d55982afceff8f3e6979decbd074ce8b4f9feac Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Thu, 31 Jul 2025 10:31:30 +0400 Subject: [PATCH 5/5] fix: update transport.ts to include Transport type and define MailMessage for improved type safety --- src/types/transport.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/transport.ts b/src/types/transport.ts index 5c83062..0522c23 100644 --- a/src/types/transport.ts +++ b/src/types/transport.ts @@ -1,6 +1,6 @@ import NodemailerMail = require("nodemailer/lib/mailer"); -import { Transporter } from "nodemailer"; +import { Transport, Transporter } from "nodemailer"; import { SendResponse, SendError, @@ -51,3 +51,5 @@ export interface MailtrapTransporter extends Transporter { mailOptions: MailtrapMailOptions | MailtrapMailOptionsSandbox ): Promise; } + +export type MailMessage = Parameters["send"]>[0];