Skip to content

Commit ab7347f

Browse files
feat: add email providers (#2)
* feat: add comprehensive tests for email providers (http, mailcrab, resend) and utility functions - Implemented tests for the http provider including initialization, email sending, and error handling. - Added tests for the mailcrab provider covering connection, email sending, and credential validation. - Developed tests for the resend provider focusing on API availability, email sending, and error scenarios. - Created utility function tests for error creation, message ID generation, request handling, and retry logic. - Configured TypeScript settings and Vitest for improved testing experience and coverage reporting. * feat: add MailCrab setup to CI workflow and configure Renovate for dependency management * fix: update coverage reporter configuration in vitest setup * feat: add onlyBuiltDependencies configuration for esbuild in pnpm workspace * feat: add badges for npm version, downloads, bundle size, JSDocs, and license in README
1 parent b67dbf6 commit ab7347f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11157
-14
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
AWS_REGION=
2+
AWS_ACCESS_KEY_ID=
3+
AWS_SECRET_ACCESS_KEY=
4+
FROM_EMAIL=
5+
TO_EMAIL=
6+
RESEND_FROM_EMAIL=bounced@resend.dev
7+
RESEND_TO_EMAIL=delivered@resend.dev
8+
RESEND_API_KEY=

.github/workflows/autofix.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: autofix.ci
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
paths:
7+
- '!scripts/**'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
autofix:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- run: corepack enable
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
cache: pnpm
23+
- run: pnpm install
24+
25+
- name: Fix lint issues
26+
run: npm run lint:fix
27+
- uses: autofix-ci/action
28+
with:
29+
commit-message: 'fix: lint issues'

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
on:
12+
push:
13+
branches:
14+
- main
15+
paths-ignore:
16+
- 'docs/**'
17+
18+
pull_request:
19+
branches:
20+
- main
21+
paths-ignore:
22+
- 'docs/**'
23+
24+
jobs:
25+
build-test:
26+
runs-on: ${{ matrix.os }}
27+
28+
permissions:
29+
# Required to checkout the code
30+
contents: read
31+
# Required to put a comment into the pull-request
32+
pull-requests: write
33+
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest]
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- run: corepack enable
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: lts/*
45+
cache: pnpm
46+
47+
- name: 📦 Install dependencies
48+
run: pnpm install --frozen-lockfile
49+
50+
- name: 👀 Lint
51+
run: pnpm lint
52+
53+
- name: 👀 Typecheck
54+
run: pnpm type-check
55+
56+
- name: 🚀 Build
57+
run: pnpm build
58+
59+
- name: 🐳 Setup MailCrab
60+
run: |
61+
docker pull marlonb/mailcrab
62+
docker run -d --name unemail-mailcrab -p 1025:1025 -p 1080:1080 marlonb/mailcrab
63+
64+
- name: 🧪 Test with coverage
65+
run: pnpm test:coverage
66+
env:
67+
MAILCRAB_HOST: localhost
68+
MAILCRAB_SMTP_PORT: 1025
69+
MAILCRAB_UI_PORT: 1080
70+
71+
- name: 📝 Upload coverage
72+
if: always()
73+
uses: davelosert/vitest-coverage-report-action@v2

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
23+
- run: npx changelogithub
24+
env:
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.vscode
2+
node_modules
3+
*.log
4+
.DS_Store
5+
coverage
6+
dist
7+
tmp
8+
/drivers
9+
/test.*
10+
__*
11+
.vercel
12+
.netlify
13+
test/fs-storage/**
14+
.env
15+
.wrangler

0 commit comments

Comments
 (0)