mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-05 21:56:48 +00:00
chore(root): remove old maildev package
This commit is contained in:
parent
1e5321b253
commit
e65fe30069
@ -1,5 +0,0 @@
|
|||||||
*
|
|
||||||
!**/*.ts
|
|
||||||
!package.json
|
|
||||||
!readme.md
|
|
||||||
!LICENSE.md
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@pockethost/plugin-maildev",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"description": "",
|
|
||||||
"main": "src/index.ts",
|
|
||||||
"module": "src/index.ts",
|
|
||||||
"types": "src/index.ts",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"check-types": "tsc --noEmit "
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/maildev": "^0.0.7",
|
|
||||||
"@types/node": "^20.8.10",
|
|
||||||
"maildev": "^2.1.0",
|
|
||||||
"pockethost": "workspace:^"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"typescript": "^5.4.5"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
import MailDev from 'maildev'
|
|
||||||
import {
|
|
||||||
APEX_DOMAIN,
|
|
||||||
Command,
|
|
||||||
IS_DEV,
|
|
||||||
LoggerService,
|
|
||||||
PocketHostFilter,
|
|
||||||
PocketHostPlugin,
|
|
||||||
} from 'pockethost/core'
|
|
||||||
|
|
||||||
const maildev = new MailDev({})
|
|
||||||
|
|
||||||
const plugin: PocketHostPlugin = async ({ registerAction, registerFilter }) => {
|
|
||||||
if (!IS_DEV()) return
|
|
||||||
const logger = LoggerService().create('MailDevPlugin')
|
|
||||||
const { dbg } = logger
|
|
||||||
|
|
||||||
registerFilter(PocketHostFilter.Firewall_HostnameRoutes, async (routes) => {
|
|
||||||
return {
|
|
||||||
...routes,
|
|
||||||
[`mail.${APEX_DOMAIN()}`]: `http://localhost:${1080}`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
registerFilter(PocketHostFilter.Core_CliCommands, async (commands) => {
|
|
||||||
return [...commands, MailDevCommand()]
|
|
||||||
})
|
|
||||||
|
|
||||||
const MailDevCommand = () => {
|
|
||||||
const cmd = new Command(`maildev`)
|
|
||||||
.description(`maildev commands`)
|
|
||||||
.addCommand(
|
|
||||||
new Command(`serve`)
|
|
||||||
.description(`Run a local mail server for development purposes`)
|
|
||||||
.action(async (options) => {
|
|
||||||
maildev.listen()
|
|
||||||
|
|
||||||
maildev.on('new', function (email) {
|
|
||||||
dbg(email)
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default plugin
|
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"lib": ["ES2021.String"],
|
|
||||||
"allowJs": true,
|
|
||||||
"checkJs": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"strict": true,
|
|
||||||
"target": "ESNext",
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"noUncheckedIndexedAccess": true,
|
|
||||||
"strictNullChecks": true,
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"include": ["**/*.ts"],
|
|
||||||
"exclude": ["./src/mothership-app/**/*", "./src/instance-app/**/*"]
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user