fix(mail/delivery): Centralize runtime/plugin imports and switch modules to use plugins exports; unify EventEmitter usage; update Deno dependencies and small path/server refactors

This commit is contained in:
2025-10-24 10:00:25 +00:00
parent d4778d15fc
commit 27b6bb779e
17 changed files with 87 additions and 62 deletions

View File

@@ -10,19 +10,7 @@ export * as cli from '@std/cli';
export { serveDir } from '@std/http/file-server';
export * as crypto from '@std/crypto';
// Cloudflare API client
import * as cloudflareImport from '@apiclient.xyz/cloudflare';
export const cloudflare = cloudflareImport;
// Email libraries
import * as smartmail from '@push.rocks/smartmail';
import * as mailauth from 'mailauth';
import * as uuid from 'uuid';
export { smartmail, mailauth, uuid };
// Node.js compatibility - needed for SMTP and email processing
// We import these as npm: specifiers for Node.js modules that don't have Deno equivalents
// Node.js built-in modules (needed for SMTP and email processing)
import { EventEmitter } from 'node:events';
import * as net from 'node:net';
import * as tls from 'node:tls';
@@ -31,9 +19,32 @@ import * as fs from 'node:fs';
import * as os from 'node:os';
import * as process from 'node:process';
import * as buffer from 'node:buffer';
import * as util from 'node:util';
export { EventEmitter };
export { net, tls, dns, fs, os, process, buffer };
// Re-export Buffer for convenience
export { EventEmitter, net, tls, dns, fs, os, process, buffer, util };
export const Buffer = buffer.Buffer;
// Cloudflare API client
import * as cloudflareImport from '@apiclient.xyz/cloudflare';
export const cloudflare = cloudflareImport;
// @push.rocks packages
import * as smartfile from '@push.rocks/smartfile';
import * as smartdns from '@push.rocks/smartdns';
import * as smartmail from '@push.rocks/smartmail';
export { smartfile, smartdns, smartmail };
// @tsclass packages
import * as tsclass from '@tsclass/tsclass';
export { tsclass };
// Third-party libraries
import * as mailauth from 'mailauth';
import { dkimSign } from 'mailauth/lib/dkim/sign.js';
import * as uuid from 'uuid';
import * as ip from 'ip';
import { LRUCache } from 'lru-cache';
export { mailauth, dkimSign, uuid, ip, LRUCache };