create-volt 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/addons/mailer/files/lib/mailer.js +19 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ All notable changes to `create-volt` are documented here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/), and this project adheres to
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.52.0] - 2026-07-04
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Mailer accepts discrete SMTP vars.** The mailer add-on builds its transport
|
|
11
|
+
from `SMTP_HOST`/`SMTP_PORT`/`SMTP_SECURE`/`SMTP_USER`/`SMTP_PASS` when
|
|
12
|
+
`SMTP_URL` is not set (secure defaults on for port 465), and resolves the From
|
|
13
|
+
address as `MAIL_FROM` → `SMTP_FROM` → `SMTP_USER`. So a plain host/port/user/pass
|
|
14
|
+
config works without composing a URL.
|
|
15
|
+
|
|
7
16
|
## [0.51.0] - 2026-06-30
|
|
8
17
|
|
|
9
18
|
### Added
|
|
@@ -675,6 +684,7 @@ All notable changes to `create-volt` are documented here. The format follows
|
|
|
675
684
|
watching and full-page hot reload. Supports `--skip-install` and `--force`,
|
|
676
685
|
and auto-detects npm / pnpm / yarn / bun for the install step.
|
|
677
686
|
|
|
687
|
+
[0.52.0]: https://github.com/MIR-2025/volt/releases/tag/v0.52.0
|
|
678
688
|
[0.51.0]: https://github.com/MIR-2025/volt/releases/tag/v0.51.0
|
|
679
689
|
[0.50.0]: https://github.com/MIR-2025/volt/releases/tag/v0.50.0
|
|
680
690
|
[0.49.0]: https://github.com/MIR-2025/volt/releases/tag/v0.49.0
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
// mailer.js — sends email. In dev (no
|
|
2
|
-
// console so you can see them; in production it uses nodemailer when
|
|
3
|
-
//
|
|
1
|
+
// mailer.js — sends email. In dev (no SMTP config) it prints messages to the
|
|
2
|
+
// console so you can see them; in production it uses nodemailer when SMTP is
|
|
3
|
+
// configured — either a single SMTP_URL, or discrete SMTP_HOST/SMTP_PORT/
|
|
4
|
+
// SMTP_SECURE/SMTP_USER/SMTP_PASS vars — and the package is installed.
|
|
4
5
|
|
|
5
6
|
export async function createMailer() {
|
|
6
|
-
|
|
7
|
-
const
|
|
7
|
+
// transport: SMTP_URL wins; otherwise build it from discrete host/port vars.
|
|
8
|
+
const transportConfig = process.env.SMTP_URL
|
|
9
|
+
? process.env.SMTP_URL
|
|
10
|
+
: process.env.SMTP_HOST
|
|
11
|
+
? {
|
|
12
|
+
host: process.env.SMTP_HOST,
|
|
13
|
+
port: Number(process.env.SMTP_PORT) || 587,
|
|
14
|
+
secure: /^(1|true|yes|on)$/i.test(process.env.SMTP_SECURE || "") || Number(process.env.SMTP_PORT) === 465,
|
|
15
|
+
auth: process.env.SMTP_USER ? { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS } : undefined,
|
|
16
|
+
}
|
|
17
|
+
: null;
|
|
18
|
+
const from = process.env.MAIL_FROM || process.env.SMTP_FROM || process.env.SMTP_USER || "App <no-reply@example.com>";
|
|
8
19
|
|
|
9
|
-
if (
|
|
20
|
+
if (transportConfig) {
|
|
10
21
|
let nodemailer;
|
|
11
22
|
try {
|
|
12
23
|
nodemailer = (await import("nodemailer")).default;
|
|
13
24
|
} catch {
|
|
14
|
-
console.warn("[mailer]
|
|
25
|
+
console.warn("[mailer] SMTP configured but 'nodemailer' isn't installed — using console. Run: npm install nodemailer");
|
|
15
26
|
}
|
|
16
27
|
if (nodemailer) {
|
|
17
|
-
const transport = nodemailer.createTransport(
|
|
28
|
+
const transport = nodemailer.createTransport(transportConfig);
|
|
18
29
|
return {
|
|
19
30
|
name: "smtp",
|
|
20
31
|
async send({ to, subject, text, html }) {
|