mirror of https://github.com/eleith/emailjs.git
chore: use extensions in module specifiers
This commit is contained in:
parent
652684486c
commit
79a81538aa
|
@ -6,9 +6,6 @@ export default {
|
|||
NODE_TLS_REJECT_UNAUTHORIZED: '0',
|
||||
},
|
||||
files: ['test/*.ts'],
|
||||
nodeArguments: [
|
||||
'--loader=ts-node/esm',
|
||||
'--experimental-specifier-resolution=node',
|
||||
],
|
||||
nodeArguments: ['--loader=ts-node/esm'],
|
||||
workerThreads: false, // makes tests far slower
|
||||
};
|
||||
|
|
16
email.ts
16
email.ts
|
@ -1,8 +1,8 @@
|
|||
export * from './smtp/address';
|
||||
export * from './smtp/client';
|
||||
export * from './smtp/connection';
|
||||
export * from './smtp/date';
|
||||
export * from './smtp/error';
|
||||
export * from './smtp/message';
|
||||
export * from './smtp/mime';
|
||||
export * from './smtp/response';
|
||||
export * from './smtp/address.js';
|
||||
export * from './smtp/client.js';
|
||||
export * from './smtp/connection.js';
|
||||
export * from './smtp/date.js';
|
||||
export * from './smtp/error.js';
|
||||
export * from './smtp/message.js';
|
||||
export * from './smtp/mime.js';
|
||||
export * from './smtp/response.js';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { addressparser } from './address';
|
||||
import type { MessageAttachment, MessageHeaders } from './message';
|
||||
import { Message } from './message';
|
||||
import type { SMTPConnectionOptions } from './connection';
|
||||
import { SMTPConnection, SMTPState } from './connection';
|
||||
import { addressparser } from './address.js';
|
||||
import type { MessageAttachment, MessageHeaders } from './message.js';
|
||||
import { Message } from './message.js';
|
||||
import type { SMTPConnectionOptions } from './connection.js';
|
||||
import { SMTPConnection, SMTPState } from './connection.js';
|
||||
|
||||
export type MessageCallback<T = Message | MessageHeaders> = <
|
||||
U extends Error | null,
|
||||
|
|
|
@ -5,8 +5,8 @@ import { hostname } from 'os';
|
|||
import { connect, createSecureContext, TLSSocket } from 'tls';
|
||||
import type { ConnectionOptions } from 'tls';
|
||||
|
||||
import { SMTPError, SMTPErrorStates } from './error';
|
||||
import { SMTPResponseMonitor } from './response';
|
||||
import { SMTPError, SMTPErrorStates } from './error.js';
|
||||
import { SMTPResponseMonitor } from './response.js';
|
||||
|
||||
/**
|
||||
* @readonly
|
||||
|
|
|
@ -10,9 +10,9 @@ import { hostname } from 'os';
|
|||
import { Stream } from 'stream';
|
||||
import type { Readable } from 'stream';
|
||||
|
||||
import { addressparser } from './address';
|
||||
import { getRFC2822Date } from './date';
|
||||
import { mimeWordEncode } from './mime';
|
||||
import { addressparser } from './address.js';
|
||||
import { getRFC2822Date } from './date.js';
|
||||
import { mimeWordEncode } from './mime.js';
|
||||
|
||||
const CRLF = '\r\n' as const;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { SMTPError, SMTPErrorStates } from './error';
|
||||
import { SMTPError, SMTPErrorStates } from './error.js';
|
||||
import type { Socket } from 'net';
|
||||
import type { TLSSocket } from 'tls';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import test from 'ava';
|
||||
import { addressparser } from '../email';
|
||||
import { addressparser } from '../email.js';
|
||||
|
||||
test('addressparser should handle single address correctly', async (t) => {
|
||||
t.deepEqual(addressparser('andris@tr.ee'), [
|
||||
|
|
|
@ -4,7 +4,7 @@ import { simpleParser } from 'mailparser';
|
|||
import type { AddressObject } from 'mailparser';
|
||||
import { SMTPServer } from 'smtp-server';
|
||||
|
||||
import { AUTH_METHODS, SMTPClient, Message } from '../email';
|
||||
import { AUTH_METHODS, SMTPClient, Message } from '../email.js';
|
||||
|
||||
let port = 2000;
|
||||
|
||||
|
|
|
@ -5,8 +5,13 @@ import { simpleParser } from 'mailparser';
|
|||
import type { ParsedMail, AddressObject } from 'mailparser';
|
||||
import { SMTPServer } from 'smtp-server';
|
||||
|
||||
import type { MessageHeaders } from '../email';
|
||||
import { DEFAULT_TIMEOUT, SMTPClient, Message, isRFC2822Date } from '../email';
|
||||
import type { MessageHeaders } from '../email.js';
|
||||
import {
|
||||
DEFAULT_TIMEOUT,
|
||||
SMTPClient,
|
||||
Message,
|
||||
isRFC2822Date,
|
||||
} from '../email.js';
|
||||
|
||||
const parseMap = new Map<string, ParsedMail>();
|
||||
const port = 3333;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import test from 'ava';
|
||||
import { getRFC2822Date, getRFC2822DateUTC, isRFC2822Date } from '../email';
|
||||
import { getRFC2822Date, getRFC2822DateUTC, isRFC2822Date } from '../email.js';
|
||||
|
||||
const toD_utc = (dt: number) => getRFC2822DateUTC(new Date(dt));
|
||||
const toD = (dt: number, utc = false) => getRFC2822Date(new Date(dt), utc);
|
||||
|
|
|
@ -5,8 +5,8 @@ import { simpleParser } from 'mailparser';
|
|||
import type { AddressObject, ParsedMail } from 'mailparser';
|
||||
import { SMTPServer } from 'smtp-server';
|
||||
|
||||
import { SMTPClient, Message } from '../email';
|
||||
import type { MessageAttachment, MessageHeaders } from '../email';
|
||||
import { SMTPClient, Message } from '../email.js';
|
||||
import type { MessageAttachment, MessageHeaders } from '../email.js';
|
||||
|
||||
/**
|
||||
* \@types/mailparser@3.0.2 breaks our code
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// adapted from https://github.com/emailjs/emailjs-mime-codec/blob/6909c706b9f09bc0e5c3faf48f723cca53e5b352/src/mimecodec-unit.js
|
||||
import test from 'ava';
|
||||
import { mimeEncode, mimeWordEncode } from '../email';
|
||||
import { mimeEncode, mimeWordEncode } from '../email.js';
|
||||
|
||||
test('mimeEncode should encode UTF-8', async (t) => {
|
||||
t.is(mimeEncode('tere ÕÄÖÕ'), 'tere =C3=95=C3=84=C3=96=C3=95');
|
||||
|
|
Loading…
Reference in New Issue