-
Notifications
You must be signed in to change notification settings - Fork 30.6k
[nodemailer] Remove AWS SDK from dependencies, use structural types #74249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nodemailer] Remove AWS SDK from dependencies, use structural types #74249
Conversation
Move @aws-sdk/client-sesv2 (v7) and @aws-sdk/client-ses (v6) from dependencies to devDependencies so users who install @types/nodemailer don't pull in the large AWS SDK dependency tree. Replace AWS SDK type imports with structural "like" types that match the shape nodemailer actually needs. This works because TypeScript uses structural typing - the real AWS SDK types will still be accepted when users install the SDK themselves for SES transport. Fixes discussion DefinitelyTyped#74080 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@benjaminpjones Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74249,
"author": "benjaminpjones",
"headCommitOid": "3519f3c8e13bd26f74468311e11c0747c0533a65",
"mergeBaseOid": "2d215e38ab25e0588d9d59d329ec7562f9869fed",
"lastPushDate": "2025-12-21T02:30:29.000Z",
"lastActivityDate": "2026-01-26T19:16:22.000Z",
"mergeOfferDate": "2026-01-26T18:42:12.000Z",
"mergeRequestDate": "2026-01-26T19:16:22.000Z",
"mergeRequestUser": "benjaminpjones",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "nodemailer",
"kind": "edit",
"files": [
{
"path": "types/nodemailer/lib/ses-transport/index.d.ts",
"kind": "definition"
},
{
"path": "types/nodemailer/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/nodemailer/v6/lib/ses-transport/index.d.ts",
"kind": "definition"
},
{
"path": "types/nodemailer/v6/package.json",
"kind": "package-meta-ok"
}
],
"owners": [
"rogierschouten",
"dex4er",
"bioball"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "weswigham",
"date": "2026-01-26T18:41:31.000Z",
"isMaintainer": true
}
],
"mainBotCommentID": 3678375124,
"ciResult": "pass"
} |
|
Hey @benjaminpjones, 😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you! |
|
🔔 @rogierschouten @dex4er @bioball — please review this PR in the next few days. Be sure to explicitly select |
This PR fixes dependency bloat - there's not a great test for it. I did intentionally leave existing tests the same so to ensure this is still compatible with the |
|
Re-ping @rogierschouten, @dex4er, @bioball: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
|
It has been more than two weeks and this PR still has no reviews. I'll bump it to the DT maintainer queue. Thank you for your patience, @benjaminpjones. (Ping @rogierschouten, @dex4er, @bioball.) |
|
Do you have a way to cross reference the types here to what nodemailer uses under the hood? |
|
@jakebailey thank you for taking a look.
I took a second pass at manually cross-referencing against the
There's no automated way to verify these structural types match. Is there a standard approach in DT for cross-referencing structural types against an underlying implementation? Or is manual review the expectation here? |
weswigham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, manual review to ensure it matches the package's internal uses is all you can do if you're looking to structurally match those uses. Means the types might shift based on minor/internal changes, or you loosen them a bunch, but that's not so bad.
|
@benjaminpjones: Everything looks good here. I am ready to merge this PR (at 3519f3c) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@rogierschouten, @dex4er, @bioball: you can do this too.) |
|
Ready to merge |
Move @aws-sdk/client-sesv2 (v7) and @aws-sdk/client-ses (v6) from dependencies to devDependencies so users who install @types/nodemailer don't pull in the large AWS SDK dependency tree.
Replace AWS SDK type imports with structural "like" types that match the shape nodemailer actually needs. This works because TypeScript uses structural typing - the real AWS SDK types will still be accepted when users install the SDK themselves for SES transport.
Fixes discussion #74080
Note: this is largely in line with how
nodemaileritself treats aws-sdk - it's not a direct dep. See docs:Template:
pnpm test nodemailer.Changing an existing definition:
package.json. (N/A)