fix(build): modernize package configuration, dependencies, and test setup for current toolchain compatibility
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"@ship.zone/szci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmRegistryUrl": "registry.npmjs.org"
|
||||||
|
},
|
||||||
|
"@git.zone/cli": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "code.foss.global",
|
||||||
|
"gitscope": "push.rocks",
|
||||||
|
"gitrepo": "smartsmtp",
|
||||||
|
"shortDescription": "SMTP mail transport utilities",
|
||||||
|
"description": "A module for handling SMTP operations such as sending emails via SMTP or sendmail transport.",
|
||||||
|
"npmPackagename": "@push.rocks/smartsmtp",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"SMTP",
|
||||||
|
"email",
|
||||||
|
"nodemailer",
|
||||||
|
"sendmail",
|
||||||
|
"smartmail integration",
|
||||||
|
"TypeScript",
|
||||||
|
"email sending",
|
||||||
|
"email templates",
|
||||||
|
"programming"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@git.zone/tsdoc": {
|
||||||
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-05-01 - 3.0.4 - fix(build)
|
||||||
|
modernize package configuration, dependencies, and test setup for current toolchain compatibility
|
||||||
|
|
||||||
|
- adds package exports and includes project metadata files in published artifacts
|
||||||
|
- updates build and test tooling to the current @git.zone and @push.rocks package namespaces
|
||||||
|
- replaces the previous test file with node-specific tests that gate SMTP and sendmail integration runs behind environment flags
|
||||||
|
- tightens TypeScript settings and typing in sendSmartMail while returning transport errors directly instead of swallowing them
|
||||||
|
|
||||||
|
## 2026-03-01 - 3.0.3 - maintenance
|
||||||
|
Project maintenance updates and repository metadata cleanup.
|
||||||
|
|
||||||
|
- Removed `.gitlab-ci.yml`
|
||||||
|
- Includes summarized non-functional updates across 2024 for project description, TypeScript configuration, and `npmextra.json` git host settings
|
||||||
|
|
||||||
|
## 2022-08-07 - 3.0.2 - core
|
||||||
|
Bugfix release for core updates.
|
||||||
|
|
||||||
|
- Applied a core update fix
|
||||||
|
|
||||||
|
## 2022-08-07 - 3.0.1 - core
|
||||||
|
Bugfix release for core updates.
|
||||||
|
|
||||||
|
- Applied a core update fix
|
||||||
|
|
||||||
|
## 2022-08-07 - 3.0.0 - core
|
||||||
|
Bugfix release for core updates following the major release.
|
||||||
|
|
||||||
|
- Applied a core update fix
|
||||||
|
|
||||||
|
## 2022-08-07 - 2.0.0 - core
|
||||||
|
Major runtime modernization release.
|
||||||
|
|
||||||
|
- **Breaking change:** switched the core package to ESM
|
||||||
|
|
||||||
|
## 2021-06-15 - 1.0.8 - smartsmtp
|
||||||
|
Expanded mail delivery support.
|
||||||
|
|
||||||
|
- **Breaking change:** `smartsmtp` now supports sending mails with `sendmail`
|
||||||
|
|
||||||
|
## 2020-08-15 - 1.0.7 - core
|
||||||
|
Bugfix release for core updates.
|
||||||
|
|
||||||
|
- Applied a core update fix
|
||||||
|
|
||||||
|
## 2020-08-12 - 1.0.6 - core
|
||||||
|
Maintenance bugfix release.
|
||||||
|
|
||||||
|
- Applied a core update fix
|
||||||
|
|
||||||
|
## 2020-08-12 - 1.0.1 - 1.0.5 - core
|
||||||
|
Summarized range of trivial core patch releases.
|
||||||
|
|
||||||
|
- Versions `1.0.1` through `1.0.5` consist of repeated minor core update fixes with no distinct functional changes called out in commit history
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2020 Lossless GmbH (hello@lossless.com)
|
Copyright (c) 2026 Task Venture Capital GmbH <hello@task.vc>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
+14
-7
@@ -1,14 +1,18 @@
|
|||||||
{
|
{
|
||||||
"gitzone": {
|
"@ship.zone/szci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmRegistryUrl": "registry.npmjs.org"
|
||||||
|
},
|
||||||
|
"@git.zone/cli": {
|
||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "code.foss.global",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "smartsmtp",
|
"gitrepo": "smartsmtp",
|
||||||
|
"shortDescription": "SMTP mail transport utilities",
|
||||||
"description": "A module for handling SMTP operations such as sending emails via SMTP or sendmail transport.",
|
"description": "A module for handling SMTP operations such as sending emails via SMTP or sendmail transport.",
|
||||||
"npmPackagename": "@push.rocks/smartsmtp",
|
"npmPackagename": "@push.rocks/smartsmtp",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"projectDomain": "push.rocks",
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"SMTP",
|
"SMTP",
|
||||||
"email",
|
"email",
|
||||||
@@ -20,13 +24,16 @@
|
|||||||
"email templates",
|
"email templates",
|
||||||
"programming"
|
"programming"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmci": {
|
"@git.zone/tsdoc": {
|
||||||
"npmGlobalTools": [],
|
|
||||||
"npmAccessLevel": "public"
|
|
||||||
},
|
|
||||||
"tsdoc": {
|
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+15
-11
@@ -3,27 +3,29 @@
|
|||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A module for handling SMTP operations such as sending emails via SMTP or sendmail transport.",
|
"description": "A module for handling SMTP operations such as sending emails via SMTP or sendmail transport.",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist_ts/index.js"
|
||||||
|
},
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "Lossless GmbH",
|
"author": "Task Venture Capital GmbH <hello@task.vc>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "tstest test/",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "tsbuild",
|
||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.65",
|
"@git.zone/tsbuild": "^4.4.0",
|
||||||
"@gitzone/tstest": "^1.0.73",
|
"@git.zone/tstest": "^3.6.3",
|
||||||
"@pushrocks/qenv": "^5.0.2",
|
"@push.rocks/qenv": "^6.1.4",
|
||||||
"@pushrocks/tapbundle": "^5.0.4",
|
"@types/node": "^25.6.0"
|
||||||
"@types/node": "^18.6.4"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartmail": "^1.0.21",
|
"@push.rocks/smartmail": "^2.2.1",
|
||||||
"@types/nodemailer": "^6.4.5",
|
"@types/nodemailer": "^8.0.0",
|
||||||
"nodemailer": "^6.7.7"
|
"nodemailer": "^8.0.7"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 1 chrome versions"
|
"last 1 chrome versions"
|
||||||
@@ -37,6 +39,8 @@
|
|||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
|
".smartconfig.json",
|
||||||
|
"license",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
],
|
],
|
||||||
|
|||||||
Generated
+7575
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
|||||||
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||||
|
import * as smartsmtp from '../ts/index.js';
|
||||||
|
|
||||||
|
import { Qenv } from '@push.rocks/qenv';
|
||||||
|
import * as smartmail from '@push.rocks/smartmail';
|
||||||
|
|
||||||
|
const testQenv = new Qenv('./', './.nogit');
|
||||||
|
|
||||||
|
let testSmartsmtp: smartsmtp.Smartsmtp;
|
||||||
|
|
||||||
|
const requireEnv = async (envNameArg: string): Promise<string> => {
|
||||||
|
const envValue = await testQenv.getEnvVarOnDemand(envNameArg);
|
||||||
|
if (!envValue) {
|
||||||
|
throw new Error(`Missing required environment variable: ${envNameArg}`);
|
||||||
|
}
|
||||||
|
return envValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
tap.test('should create a direct smartsmtp transport', async () => {
|
||||||
|
const smartsmtpInstance = await smartsmtp.Smartsmtp.createSmartsmtpSendmail();
|
||||||
|
expect(smartsmtpInstance).toBeInstanceOf(smartsmtp.Smartsmtp);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should run SMTP integration flow', async () => {
|
||||||
|
if (process.env.SMARTSMTP_RUN_INTEGRATION_TESTS !== 'true') {
|
||||||
|
console.log('Skipping SMTP integration test. Set SMARTSMTP_RUN_INTEGRATION_TESTS=true to run it.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
testSmartsmtp = await smartsmtp.Smartsmtp.createSmartsmtpWithRelay({
|
||||||
|
smtpServer: await requireEnv('SMTP_SERVER'),
|
||||||
|
smtpUser: await requireEnv('SMTP_USER'),
|
||||||
|
smtpPassword: await requireEnv('SMTP_PASSWORD'),
|
||||||
|
});
|
||||||
|
expect(testSmartsmtp).toBeInstanceOf(smartsmtp.Smartsmtp);
|
||||||
|
|
||||||
|
const result = await testSmartsmtp.sendSmartMail(
|
||||||
|
new smartmail.Smartmail({
|
||||||
|
body: '',
|
||||||
|
from: 'smartsmtp@mail.lossless.one',
|
||||||
|
subject: 'this is a test message',
|
||||||
|
}),
|
||||||
|
'sandbox@mail.git.zone'
|
||||||
|
);
|
||||||
|
console.log(result);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should run sendmail integration flow', async () => {
|
||||||
|
if (process.env.SMARTSMTP_RUN_SENDMAIL_TESTS !== 'true') {
|
||||||
|
console.log('Skipping sendmail integration test. Set SMARTSMTP_RUN_SENDMAIL_TESTS=true to run it.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const smartsmtpInstance = await smartsmtp.Smartsmtp.createSmartsmtpSendmail();
|
||||||
|
const result = await smartsmtpInstance.sendSmartMail(
|
||||||
|
new smartmail.Smartmail({
|
||||||
|
body: 'hi there',
|
||||||
|
from: 'phil@lossless.com',
|
||||||
|
subject: 'this is a sendmail test message',
|
||||||
|
}),
|
||||||
|
'phil@kunz.io'
|
||||||
|
);
|
||||||
|
console.log(result);
|
||||||
|
});
|
||||||
|
|
||||||
|
export default tap.start();
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
|
||||||
import * as smartsmtp from '../ts/index.js';
|
|
||||||
|
|
||||||
import { Qenv } from '@pushrocks/qenv';
|
|
||||||
import * as smartmail from '@pushrocks/smartmail';
|
|
||||||
|
|
||||||
const testQenv = new Qenv('./', './.nogit');
|
|
||||||
|
|
||||||
let testSmartsmtp: smartsmtp.Smartsmtp;
|
|
||||||
|
|
||||||
tap.test('should create a valid instance of Smartsmtp', async () => {
|
|
||||||
testSmartsmtp = await smartsmtp.Smartsmtp.createSmartsmtpWithRelay({
|
|
||||||
smtpServer: testQenv.getEnvVarOnDemand('SMTP_SERVER'),
|
|
||||||
smtpUser: testQenv.getEnvVarOnDemand('SMTP_USER'),
|
|
||||||
smtpPassword: testQenv.getEnvVarOnDemand('SMTP_PASSWORD'),
|
|
||||||
});
|
|
||||||
expect(testSmartsmtp).toBeInstanceOf(smartsmtp.Smartsmtp);
|
|
||||||
});
|
|
||||||
|
|
||||||
tap.test('should send a message with empty body', async () => {
|
|
||||||
const result = await testSmartsmtp.sendSmartMail(
|
|
||||||
new smartmail.Smartmail({
|
|
||||||
body: '',
|
|
||||||
from: 'smartsmtp@mail.lossless.one',
|
|
||||||
subject: 'this is a test message',
|
|
||||||
}),
|
|
||||||
'sandbox@mail.git.zone'
|
|
||||||
);
|
|
||||||
console.log(result);
|
|
||||||
});
|
|
||||||
|
|
||||||
tap.test('should create a direct smartsmtp transport', async () => {
|
|
||||||
const smartsmtpInstance = await smartsmtp.Smartsmtp.createSmartsmtpSendmail();
|
|
||||||
const result = await smartsmtpInstance.sendSmartMail(
|
|
||||||
new smartmail.Smartmail({
|
|
||||||
body: 'hi there',
|
|
||||||
from: 'phil@lossless.com',
|
|
||||||
subject: 'this is a sendmail test message',
|
|
||||||
}),
|
|
||||||
'phil@kunz.io'
|
|
||||||
);
|
|
||||||
console.log(result);
|
|
||||||
});
|
|
||||||
|
|
||||||
tap.start();
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* autocreated commitinfo by @pushrocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartsmtp',
|
name: '@push.rocks/smartsmtp',
|
||||||
version: '3.0.3',
|
version: '3.0.4',
|
||||||
description: 'a module for handling smtp stuff'
|
description: 'A module for handling SMTP operations such as sending emails via SMTP or sendmail transport.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ export class Smartsmtp {
|
|||||||
* sends a SmartMail
|
* sends a SmartMail
|
||||||
*/
|
*/
|
||||||
public async sendSmartMail(
|
public async sendSmartMail(
|
||||||
smartmailArg: plugins.smartmail.Smartmail<any>,
|
smartmailArg: plugins.smartmail.Smartmail<Record<string, unknown>>,
|
||||||
toArg: string,
|
toArg: string,
|
||||||
dataArg = {}
|
dataArg: Record<string, unknown> = {},
|
||||||
) {
|
) {
|
||||||
const message: plugins.nodemailer.SendMailOptions = {
|
const message: plugins.nodemailer.SendMailOptions = {
|
||||||
from: smartmailArg.options.from,
|
from: smartmailArg.options.from,
|
||||||
@@ -55,15 +55,12 @@ export class Smartsmtp {
|
|||||||
|
|
||||||
// lets add attachments from smartmailArg
|
// lets add attachments from smartmailArg
|
||||||
for (const attachment of smartmailArg.attachments) {
|
for (const attachment of smartmailArg.attachments) {
|
||||||
message.attachments.push({
|
message.attachments!.push({
|
||||||
filename: attachment.parsedPath.base,
|
filename: attachment.parsedPath.base,
|
||||||
content: attachment.contentBuffer,
|
content: attachment.contentBuffer,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await this.nodemailerTransport.sendMail(message).catch((err) => {
|
return this.nodemailerTransport.sendMail(message);
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @pushrocks scope
|
// @push.rocks scope
|
||||||
import * as smartmail from '@pushrocks/smartmail';
|
import * as smartmail from '@push.rocks/smartmail';
|
||||||
|
|
||||||
export { smartmail };
|
export { smartmail };
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -5,8 +5,10 @@
|
|||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
|
"noImplicitAny": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true
|
"verbatimModuleSyntax": true,
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"dist_*/**/*.d.ts"
|
"dist_*/**/*.d.ts"
|
||||||
|
|||||||
Reference in New Issue
Block a user