Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.

Conversation

@meabed
Copy link
Contributor

@meabed meabed commented Aug 28, 2025

Summary

  • Adds serverless support for AWS Lambda, Vercel Edge, Cloudflare Workers, and more
  • Implements platform-agnostic email validation without Node.js dependencies
  • Provides optimized builds using Rollup for edge environments

Changes

Core Implementation

  • ✅ New serverless core module with EdgeCache for platform-agnostic caching
  • ✅ Support for all validation features except MX/SMTP (which require Node.js APIs)
  • ✅ Full unminified JSON databases for disposable and free email providers
  • ✅ Batch processing support with configurable chunk sizes

Platform Adapters

  • ✅ AWS Lambda adapter with API Gateway and direct invocation support
  • ✅ Vercel Edge Functions adapter for both Edge and Node.js runtimes
  • ✅ Cloudflare Workers adapter with KV storage and Durable Objects support

Build System

  • ✅ TypeScript configuration for serverless builds
  • ✅ Rollup configuration for optimized bundles
  • ✅ Package exports for easy importing

Documentation & Examples

  • ✅ Comprehensive serverless documentation in docs/SERVERLESS.md
  • ✅ Example implementations for each platform
  • ✅ Browser example with mock validation

Testing

  • ✅ Tests for serverless core functionality
  • ✅ EdgeCache tests
  • ✅ Validation tests

Features in Serverless Mode

  • ✅ Syntax validation
  • ✅ Typo detection and domain suggestions
  • ✅ Disposable email detection (full database)
  • ✅ Free email provider detection (full database)
  • ✅ Batch processing
  • ✅ Built-in caching
  • ❌ MX record validation (requires DNS)
  • ❌ SMTP verification (requires TCP sockets)

Test Plan

  • Run existing tests to ensure no regression
  • Test serverless build output
  • Verify examples work correctly
  • Test on actual serverless platforms

meabed added 5 commits August 28, 2025 01:53
- Add serverless core implementation without Node.js dependencies
- Add platform adapters for AWS Lambda, Vercel Edge, and Cloudflare Workers
- Add EdgeCache implementation for platform-agnostic caching
- Add support for batch email validation in serverless environments
- Add comprehensive serverless documentation
- Add examples for all major serverless platforms
- Add tests for serverless core functionality
- Configure TypeScript and Rollup build for serverless modules
- Update package.json with serverless exports and Rollup dependencies
- Use full unminified JSON databases as requested
- Add rollup.config.js for building both CJS and ESM formats
- Update package.json with module field pointing to ESM build
- Configure Rollup with TypeScript, JSON, and CommonJS plugins
- Update build scripts to use Rollup for main build
- Rename rollup.config.js to rollup.config.cjs
- Rename rollup.config.serverless.js to rollup.config.serverless.cjs
- Convert require() statements to dynamic import() syntax
- Use async IIFE pattern for CommonJS compatibility
- Add rollup-plugin-esbuild for consistent TypeScript compilation
- Remove deprecated tsconfig.serverless.json
- Update package.json build scripts to reference .cjs files
- Fix serverless tests to use valid-domain.org instead of example.com
- Add biome lint rule exception for callback returns
- Update dependencies: esbuild, rollup-plugin-esbuild, tslib
- Replace async IIFE with direct module.exports
- Use standard require() for all plugins instead of dynamic imports
- Simplify configuration structure for better readability
- Maintain same build output and functionality
- Add release version and tag extraction from semantic-release output
- Create detailed job summaries with release information
- Include NPM package and GitHub release links
- Add build metadata (workflow, run ID, actor, event)
- Show PR information when triggered by pull requests
- Different summaries for release vs CI workflows
- Helpful messages when no release is created
@meabed meabed merged commit f2cf127 into develop Aug 28, 2025
1 check passed
@meabed meabed deleted the feature/serverless-support branch August 28, 2025 16:04
meabed added a commit that referenced this pull request Aug 28, 2025
… AWS Lambda, Cloudflare, Vercel, and Deno (#525)

* chore: update deps

* chore: update readme

* chore: update ci

* feat: Add comprehensive serverless support (#524)

* feat: add comprehensive serverless support for edge computing platforms

- Add serverless core implementation without Node.js dependencies
- Add platform adapters for AWS Lambda, Vercel Edge, and Cloudflare Workers
- Add EdgeCache implementation for platform-agnostic caching
- Add support for batch email validation in serverless environments
- Add comprehensive serverless documentation
- Add examples for all major serverless platforms
- Add tests for serverless core functionality
- Configure TypeScript and Rollup build for serverless modules
- Update package.json with serverless exports and Rollup dependencies
- Use full unminified JSON databases as requested

* build: add main Rollup configuration for ES module builds

- Add rollup.config.js for building both CJS and ESM formats
- Update package.json with module field pointing to ESM build
- Configure Rollup with TypeScript, JSON, and CommonJS plugins
- Update build scripts to use Rollup for main build

* build: convert rollup configs to .cjs with dynamic imports

- Rename rollup.config.js to rollup.config.cjs
- Rename rollup.config.serverless.js to rollup.config.serverless.cjs
- Convert require() statements to dynamic import() syntax
- Use async IIFE pattern for CommonJS compatibility
- Add rollup-plugin-esbuild for consistent TypeScript compilation
- Remove deprecated tsconfig.serverless.json
- Update package.json build scripts to reference .cjs files
- Fix serverless tests to use valid-domain.org instead of example.com
- Add biome lint rule exception for callback returns
- Update dependencies: esbuild, rollup-plugin-esbuild, tslib

* refactor: simplify rollup configs to use require() syntax

- Replace async IIFE with direct module.exports
- Use standard require() for all plugins instead of dynamic imports
- Simplify configuration structure for better readability
- Maintain same build output and functionality

* ci: add release information to GitHub Actions job summaries

- Add release version and tag extraction from semantic-release output
- Create detailed job summaries with release information
- Include NPM package and GitHub release links
- Add build metadata (workflow, run ID, actor, event)
- Show PR information when triggered by pull requests
- Different summaries for release vs CI workflows
- Helpful messages when no release is created

* fix: Update serverless adapter examples and improve type safety

- Enhanced Deno Deploy example with better error handling and validation
- Fixed type annotations in AWS Lambda and Cloudflare adapters
- Improved code formatting and consistency across serverless implementations

* fix: update npm downloads badge to use correct package name

- Changed badge URL from email-validator-js to @devmehq/email-validator-js
- Ensures accurate download statistics display

* fix: ensure JSON data files are bundled in dist directory

- Updated build script to copy disposable and free email provider JSON files to dist
- Ensures JSON files are included in published npm package
- Files are now accessible in production builds

---------

Co-authored-by: DEV.ME Team <support@dev.me>
github-actions bot pushed a commit that referenced this pull request Aug 28, 2025
# [2.10.0](v2.9.0...v2.10.0) (2025-08-28)

### Features

* add comprehensive serverless platform support with adapters for AWS Lambda, Cloudflare, Vercel, and Deno ([#525](#525)) ([59c2750](59c2750)), closes [#524](#524)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants