create-craftjs 1.0.1 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-craftjs",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A starter kit backend framework powered by Express, TypeScript, EJS Engine, and Prisma — designed for rapid development, simplicity, and scalability.",
5
5
  "bin": {
6
6
  "create-craftjs": "bin/index.js"
@@ -1,5 +1,6 @@
1
1
  import { v2 as cloudinary } from "cloudinary";
2
2
  import { env } from "./env";
3
+ import { logger } from "./logger";
3
4
 
4
5
  if (
5
6
  env.CLOUDINARY_CLOUD_NAME &&
@@ -12,7 +13,7 @@ if (
12
13
  api_secret: env.CLOUDINARY_API_SECRET,
13
14
  });
14
15
  } else {
15
- console.warn(
16
+ logger.warn(
16
17
  "⚠️ Cloudinary config is incomplete. Skipping Cloudinary configuration."
17
18
  );
18
19
  }
@@ -2,33 +2,22 @@ import nodemailer from "nodemailer";
2
2
  import { logger } from "../config/logger";
3
3
  import { env } from "../config/env";
4
4
 
5
- let transporter;
5
+ const transporter = nodemailer.createTransport({
6
+ host: env.MAIL_HOST,
7
+ port: Number(env.MAIL_PORT),
8
+ auth: {
9
+ user: env.MAIL_USER,
10
+ pass: env.MAIL_PASS,
11
+ },
12
+ // logger: true
13
+ });
6
14
 
7
- const isMailConfigComplete =
8
- env.MAIL_HOST!.trim() !== "" &&
9
- env.MAIL_PORT!.trim() !== "" &&
10
- env.MAIL_USER!.trim() !== "" &&
11
- env.MAIL_PASS!.trim() !== "";
12
-
13
- if (isMailConfigComplete) {
14
- transporter = nodemailer.createTransport({
15
- host: env.MAIL_HOST,
16
- port: Number(env.MAIL_PORT),
17
- auth: {
18
- user: env.MAIL_USER,
19
- pass: env.MAIL_PASS,
20
- },
21
- });
22
-
23
- transporter.verify((error, success) => {
24
- if (error) {
25
- logger.error("❌ Failed Connect To Nodemailer", error);
26
- } else {
27
- logger.info("✅ Connected To Nodemailer", success);
28
- }
29
- });
30
- } else {
31
- logger.warn("⚠️ Nodemailer config is incomplete, skipping mail setup");
32
- }
15
+ transporter.verify((error, success) => {
16
+ if (error) {
17
+ logger.error("❌ Failed Connect To Nodemailer", error);
18
+ } else {
19
+ logger.info("✅ Connected To Nodemailer", success);
20
+ }
21
+ });
33
22
 
34
23
  export default transporter;