-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3351461
Showing
24 changed files
with
7,107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[{package.json,*.yml,*.cjson}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: autofix.ci # needed to securely identify the workflow | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: ["main"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
autofix: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
- run: pnpm install --no-frozen-lockfile | ||
- run: pnpm format | ||
- run: pnpm lint:fix | ||
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c | ||
with: | ||
commit-message: "chore: apply automated updates" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
- run: pnpm install --no-frozen-lockfile | ||
- run: pnpm format | ||
- run: pnpm lint | ||
- run: pnpm test:types | ||
- run: pnpm build | ||
- run: pnpm vitest --coverage | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
coverage | ||
dist | ||
.vscode | ||
.DS_Store | ||
.eslintcache | ||
*.log* | ||
*.env* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Changelog | ||
|
||
## v0.0.1 | ||
|
||
## v0.0.7 | ||
|
||
[compare changes](https://github.com/SupersaasHQ/useEmail/compare/v0.0.6...v0.0.7) | ||
|
||
## v0.0.6 | ||
|
||
[compare changes](https://github.com/SupersaasHQ/useEmail/compare/v0.0.5...v0.0.6) | ||
|
||
## v0.0.5 | ||
|
||
### 🤖 CI | ||
|
||
- Test corepack pnpm lock ([5aeda4a](https://github.com/SupersaasHQ/use-email/commit/5aeda4a)) | ||
|
||
### ❤️ Contributors | ||
|
||
- Fayaz Ahmed ([@fayazara](http://github.com/fayazara)) | ||
|
||
## v0.0.4 | ||
|
||
[compare changes](https://github.com/SupersaasHQ/use-email/compare/v0.0.3...v0.0.4) | ||
|
||
## v0.0.3 | ||
|
||
[compare changes](https://github.com/SupersaasHQ/use-email/compare/v0.0.2...v0.0.3) | ||
|
||
## v0.0.2 | ||
|
||
[compare changes](https://github.com/SupersaasHQ/use-email/compare/v0.0.1...v0.0.2) | ||
|
||
## v0.0.1 | ||
|
||
### 🏡 Chore | ||
|
||
- Remove resend package and make requests directly ([ef03cc2](https://github.com/SupersaasHQ/use-email/commit/ef03cc2)) | ||
- More robust ([a476da2](https://github.com/SupersaasHQ/use-email/commit/a476da2)) | ||
- Format before test and release ([e08fffe](https://github.com/SupersaasHQ/use-email/commit/e08fffe)) | ||
|
||
### ✅ Tests | ||
|
||
- Write test for Resend ([36de728](https://github.com/SupersaasHQ/use-email/commit/36de728)) | ||
|
||
### 🤖 CI | ||
|
||
- Fix the lockfile issue ([ed34590](https://github.com/SupersaasHQ/use-email/commit/ed34590)) | ||
|
||
### ❤️ Contributors | ||
|
||
- Fayaz Ahmed ([@fayazara](http://github.com/fayazara)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Supersaas/UseEmail | ||
|
||
A Unified hook for sending emails, bring your own provider and use this package to send emails. Works on Node.js, Bun, Deno and Cloudflare Workers. Typesafe and supports modern email providers. | ||
|
||
Supported Providers | ||
|
||
1. Resend | ||
2. Sendgrid | ||
3. Postmark | ||
4. Plunk | ||
5. Mailgun | ||
|
||
<!-- automd:badges color=yellow --> | ||
|
||
[![npm version](https://img.shields.io/npm/v/packageName?color=yellow)](https://npmjs.com/package/packageName) | ||
[![npm downloads](https://img.shields.io/npm/dm/packageName?color=yellow)](https://npmjs.com/package/packageName) | ||
|
||
<!-- /automd --> | ||
|
||
This is my package description. | ||
|
||
## Usage | ||
|
||
Install package: | ||
|
||
<!-- automd:pm-install --> | ||
|
||
```sh | ||
# ✨ Auto-detect | ||
npx nypm install supersaas | ||
|
||
# npm | ||
npm install packageName | ||
|
||
# yarn | ||
yarn add packageName | ||
|
||
# pnpm | ||
pnpm install packageName | ||
|
||
# bun | ||
bun install packageName | ||
``` | ||
|
||
<!-- /automd --> | ||
|
||
Import: | ||
|
||
<!-- automd:jsimport cjs cdn name="pkg" --> | ||
|
||
**ESM** (Node.js, Bun) | ||
|
||
```js | ||
import {} from "pkg"; | ||
``` | ||
|
||
**CommonJS** (Legacy Node.js) | ||
|
||
```js | ||
const {} = require("pkg"); | ||
``` | ||
|
||
**CDN** (Deno, Bun and Browsers) | ||
|
||
```js | ||
import {} from "https://esm.sh/pkg"; | ||
``` | ||
|
||
<!-- /automd --> | ||
|
||
## Development | ||
|
||
<details> | ||
|
||
<summary>local development</summary> | ||
|
||
- Clone this repository | ||
- Install latest LTS version of [Node.js](https://nodejs.org/en/) | ||
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` | ||
- Install dependencies using `pnpm install` | ||
- Run interactive tests using `pnpm dev` | ||
|
||
</details> | ||
|
||
## License | ||
|
||
<!-- automd:contributors license=MIT --> | ||
|
||
Published under the [MIT](https://github.com/unjs/packageName/blob/main/LICENSE) license. | ||
Made by [community](https://github.com/unjs/packageName/graphs/contributors) 💛 | ||
<br><br> | ||
<a href="https://github.com/unjs/packageName/graphs/contributors"> | ||
<img src="https://contrib.rocks/image?repo=unjs/packageName" /> | ||
</a> | ||
|
||
<!-- /automd --> | ||
|
||
<!-- automd:with-automd --> | ||
|
||
--- | ||
|
||
_🤖 auto updated with [automd](https://automd.unjs.io)_ | ||
|
||
<!-- /automd --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import unjs from "eslint-config-unjs"; | ||
|
||
export default unjs({ | ||
ignores: [ | ||
// ignore paths | ||
], | ||
rules: { | ||
// rule overrides | ||
}, | ||
markdown: { | ||
rules: { | ||
// markdown rule overrides | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "supersaas-useemail", | ||
"version": "0.0.1", | ||
"description": "", | ||
"repository": "SupersaasHQ/useEmail", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "vitest dev", | ||
"lint": "eslint . && prettier -c .", | ||
"lint:fix": "automd && eslint . --fix && prettier -w .", | ||
"prepack": "pnpm build", | ||
"play": "jiti playground", | ||
"format": "prettier --write .", | ||
"release": "pnpm format && pnpm test && changelogen --release && npm publish && git push --follow-tags", | ||
"test": "pnpm format && pnpm lint && pnpm test:types && vitest run --coverage", | ||
"test:types": "tsc --noEmit --skipLibCheck" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^22.1.0", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"automd": "^0.3.8", | ||
"changelogen": "^0.5.5", | ||
"eslint": "^9.8.0", | ||
"eslint-config-unjs": "^0.3.2", | ||
"jiti": "^2.0.0-beta.3", | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.5.4", | ||
"unbuild": "^3.0.0-rc.7", | ||
"vitest": "^2.0.5" | ||
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"ofetch": "^1.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useEmail } from "../src"; | ||
|
||
console.log( | ||
useEmail("resend").send({ | ||
to: "[email protected]", | ||
from: "[email protected]", | ||
subject: "Test", | ||
text: "Test", | ||
}), | ||
); |
Oops, something went wrong.