From e65fe300698a8e29677126bd2c7d84015d0b0ee3 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Thu, 27 Jun 2024 14:11:16 -0700 Subject: [PATCH] chore(root): remove old maildev package --- pending-packages/plugin-maildev/.npmignore | 5 -- pending-packages/plugin-maildev/package.json | 24 ---------- pending-packages/plugin-maildev/src/index.ts | 48 ------------------- pending-packages/plugin-maildev/tsconfig.json | 21 -------- 4 files changed, 98 deletions(-) delete mode 100644 pending-packages/plugin-maildev/.npmignore delete mode 100644 pending-packages/plugin-maildev/package.json delete mode 100644 pending-packages/plugin-maildev/src/index.ts delete mode 100644 pending-packages/plugin-maildev/tsconfig.json diff --git a/pending-packages/plugin-maildev/.npmignore b/pending-packages/plugin-maildev/.npmignore deleted file mode 100644 index d1589c83..00000000 --- a/pending-packages/plugin-maildev/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.ts -!package.json -!readme.md -!LICENSE.md \ No newline at end of file diff --git a/pending-packages/plugin-maildev/package.json b/pending-packages/plugin-maildev/package.json deleted file mode 100644 index 935fa2a0..00000000 --- a/pending-packages/plugin-maildev/package.json +++ /dev/null @@ -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" - } -} diff --git a/pending-packages/plugin-maildev/src/index.ts b/pending-packages/plugin-maildev/src/index.ts deleted file mode 100644 index 67ee6b29..00000000 --- a/pending-packages/plugin-maildev/src/index.ts +++ /dev/null @@ -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 diff --git a/pending-packages/plugin-maildev/tsconfig.json b/pending-packages/plugin-maildev/tsconfig.json deleted file mode 100644 index 0f098a71..00000000 --- a/pending-packages/plugin-maildev/tsconfig.json +++ /dev/null @@ -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/**/*"] -}