Skip to content

Conversation

@productdevbook
Copy link
Owner

Summary

  • Refactored provider architecture to match unstorage patterns
  • Switched from zero-dependency implementations to optional peer dependencies
  • Removed FeatureFlags from Provider interface for cleaner API

Changes

External Libraries as Peer Dependencies

Provider Package Required
SMTP nodemailer pnpm add nodemailer
Resend resend pnpm add resend
AWS SES @aws-sdk/client-ses pnpm add @aws-sdk/client-ses
HTTP ofetch pnpm add ofetch
Zeptomail - No external deps

Architecture Alignment

src/
├── _providers.ts          # Auto-generated metadata
├── email.ts               # Core module (like storage.ts)
├── index.ts
├── types.ts
├── utils.ts
└── providers/
    ├── utils/index.ts     # defineProvider, createError
    ├── aws-ses.ts         # Flat provider files
    ├── http.ts
    ├── resend.ts
    ├── smtp.ts
    └── zeptomail.ts

Test Updates

  • Updated all tests to mock external libraries using vi.hoisted()
  • Removed FeatureFlags related tests

Test plan

  • All 100 tests pass
  • Build succeeds (52.36 kB)
  • Type check passes
  • Lint passes

🤖 Generated with Claude Code

- Use external libraries as optional peer dependencies:
  - nodemailer for SMTP
  - resend for Resend
  - @aws-sdk/client-ses for AWS SES
  - ofetch for HTTP
- Remove FeatureFlags from Provider interface (unstorage style)
- Update all provider implementations to use external SDKs
- Update tests to properly mock external libraries using vi.hoisted
- Fix playground tsconfig to include src directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/productdevbook/unemail@22

commit: f8ad5f2

@socket-security
Copy link

socket-security bot commented Jan 21, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​nodemailer@​7.0.51001007689100
Addedofetch@​2.0.0-alpha.310010010090100
Addednodemailer@​7.0.12981009791100
Addedzeptomail@​7.0.09210010091100
Added@​aws-sdk/​client-ses@​3.972.09810010098100
Addedresend@​6.8.099100100100100

View full report

- Refactor zeptomail provider to use official zeptomail SDK
- Add zeptomail as optional peer dependency
- Update GitHub Actions to latest versions:
  - actions/checkout v4 → v6
  - actions/setup-node v4 → v6
  - pnpm/action-setup v4
  - autofix-ci/action v1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@productdevbook productdevbook force-pushed the refactor/unstorage-architecture branch from 02a9d51 to 76d7d00 Compare January 21, 2026 10:45
productdevbook and others added 5 commits January 21, 2026 13:45
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove zeptomail from peerDependencies (now bundled via noExternal)
- Update tsconfig paths to resolve zeptomail types from node_modules
- Delete custom zeptomail.d.ts in favor of package types
- Update gen-providers script to generate lint-compliant code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 63.79% 363 / 569
🔵 Statements 63.9% 370 / 579
🔵 Functions 65.62% 63 / 96
🔵 Branches 56.5% 226 / 400
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/_providers.ts 100% 100% 100% 100%
src/types.ts 100% 100% 100% 100%
src/providers/aws-ses.ts 95.6% 86.66% 100% 95.55% 83, 92, 139, 147-151
src/providers/http.ts 94.36% 89.47% 90.9% 94.36% 92, 117, 125-129, 229
src/providers/resend.ts 95.89% 86.44% 100% 95.77% 66, 94, 252-259
src/providers/smtp.ts 92.64% 71.42% 90.9% 92.53% 95, 99, 172, 210-215, 220-223
src/providers/zeptomail.ts 0% 0% 0% 0% 27-224
src/providers/utils/index.ts 11.11% 0% 25% 11.11% 56-77
Generated in workflow #73 for commit f8ad5f2 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants