react-email 5.0.0-canary.4 → 5.0.0-canary.6

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # react-email
2
2
 
3
+ ## 5.0.0-canary.6
4
+
5
+ ## 5.0.0-canary.5
6
+
3
7
  ## 5.0.0-canary.4
4
8
 
5
9
  ## 5.0.0-canary.3
package/dist/index.js CHANGED
@@ -86,7 +86,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
86
86
  //#region package.json
87
87
  var package_default = {
88
88
  name: "react-email",
89
- version: "5.0.0-canary.4",
89
+ version: "5.0.0-canary.6",
90
90
  description: "A live preview of your emails right in your browser.",
91
91
  bin: { "email": "./dist/index.js" },
92
92
  type: "module",
@@ -242,10 +242,8 @@ module.exports = {
242
242
  const getEmailSlugsFromEmailDirectory = (emailDirectory, emailsDirectoryAbsolutePath) => {
243
243
  const directoryPathRelativeToEmailsDirectory = emailDirectory.absolutePath.replace(emailsDirectoryAbsolutePath, "").trim();
244
244
  const slugs = [];
245
- emailDirectory.emailFilenames.forEach((filename) => slugs.push(path.join(directoryPathRelativeToEmailsDirectory, filename).split(path.sep).filter((segment) => segment.length > 0)));
246
- emailDirectory.subDirectories.forEach((directory) => {
247
- slugs.push(...getEmailSlugsFromEmailDirectory(directory, emailsDirectoryAbsolutePath));
248
- });
245
+ for (const filename of emailDirectory.emailFilenames) slugs.push(path.join(directoryPathRelativeToEmailsDirectory, filename).split(path.sep).filter((segment) => segment.length > 0));
246
+ for (const directory of emailDirectory.subDirectories) slugs.push(...getEmailSlugsFromEmailDirectory(directory, emailsDirectoryAbsolutePath));
249
247
  return slugs;
250
248
  };
251
249
  const forceSSGForEmailPreviews = async (emailsDirPath, builtPreviewAppPath) => {
@@ -648,7 +646,7 @@ const safeAsyncServerListen = (server, port) => {
648
646
  };
649
647
  const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath, port) => {
650
648
  const [majorNodeVersion] = process.versions.node.split(".");
651
- if (majorNodeVersion && Number.parseInt(majorNodeVersion) < 20) {
649
+ if (majorNodeVersion && Number.parseInt(majorNodeVersion, 10) < 20) {
652
650
  console.error(` ${logSymbols.error} Node ${majorNodeVersion} is not supported. Please upgrade to Node 20 or higher.`);
653
651
  process.exit(1);
654
652
  }
@@ -803,7 +801,7 @@ const dev = async ({ dir: emailsDirRelativePath, port }) => {
803
801
  console.error(`Missing ${emailsDirRelativePath} folder`);
804
802
  process.exit(1);
805
803
  }
806
- await setupHotreloading(await startDevServer(emailsDirRelativePath, emailsDirRelativePath, Number.parseInt(port)), emailsDirRelativePath);
804
+ await setupHotreloading(await startDevServer(emailsDirRelativePath, emailsDirRelativePath, Number.parseInt(port, 10)), emailsDirRelativePath);
807
805
  } catch (error) {
808
806
  console.log(error);
809
807
  process.exit(1);
@@ -861,10 +859,8 @@ const renderingUtilitiesExporter = (emailTemplates) => ({
861
859
  //#region src/commands/export.ts
862
860
  const getEmailTemplatesFromDirectory = (emailDirectory) => {
863
861
  const templatePaths = [];
864
- emailDirectory.emailFilenames.forEach((filename) => templatePaths.push(path.join(emailDirectory.absolutePath, filename)));
865
- emailDirectory.subDirectories.forEach((directory) => {
866
- templatePaths.push(...getEmailTemplatesFromDirectory(directory));
867
- });
862
+ for (const filename of emailDirectory.emailFilenames) templatePaths.push(path.join(emailDirectory.absolutePath, filename));
863
+ for (const directory of emailDirectory.subDirectories) templatePaths.push(...getEmailTemplatesFromDirectory(directory));
868
864
  return templatePaths;
869
865
  };
870
866
  const require = createRequire(url.fileURLToPath(import.meta.url));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-email",
3
- "version": "5.0.0-canary.4",
3
+ "version": "5.0.0-canary.6",
4
4
  "description": "A live preview of your emails right in your browser.",
5
5
  "bin": {
6
6
  "email": "./dist/index.js"
@@ -46,7 +46,7 @@
46
46
  "react": "19.0.0",
47
47
  "react-dom": "19.0.0",
48
48
  "typescript": "5.8.3",
49
- "@react-email/components": "1.0.0-canary.3"
49
+ "@react-email/components": "1.0.0-canary.7"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsdown",
@@ -115,23 +115,23 @@ const getEmailSlugsFromEmailDirectory = (
115
115
  .trim();
116
116
 
117
117
  const slugs = [] as Array<string>[];
118
- emailDirectory.emailFilenames.forEach((filename) =>
118
+ for (const filename of emailDirectory.emailFilenames) {
119
119
  slugs.push(
120
120
  path
121
121
  .join(directoryPathRelativeToEmailsDirectory, filename)
122
122
  .split(path.sep)
123
123
  // sometimes it gets empty segments due to trailing slashes
124
124
  .filter((segment) => segment.length > 0),
125
- ),
126
- );
127
- emailDirectory.subDirectories.forEach((directory) => {
125
+ );
126
+ }
127
+ for (const directory of emailDirectory.subDirectories) {
128
128
  slugs.push(
129
129
  ...getEmailSlugsFromEmailDirectory(
130
130
  directory,
131
131
  emailsDirectoryAbsolutePath,
132
132
  ),
133
133
  );
134
- });
134
+ }
135
135
 
136
136
  return slugs;
137
137
  };
@@ -16,7 +16,7 @@ export const dev = async ({ dir: emailsDirRelativePath, port }: Args) => {
16
16
  const devServer = await startDevServer(
17
17
  emailsDirRelativePath,
18
18
  emailsDirRelativePath, // defaults to ./emails/static for the static files that are served to the preview
19
- Number.parseInt(port),
19
+ Number.parseInt(port, 10),
20
20
  );
21
21
 
22
22
  await setupHotreloading(devServer, emailsDirRelativePath);
@@ -19,12 +19,12 @@ import { registerSpinnerAutostopping } from '../utils/register-spinner-autostopp
19
19
 
20
20
  const getEmailTemplatesFromDirectory = (emailDirectory: EmailsDirectory) => {
21
21
  const templatePaths = [] as string[];
22
- emailDirectory.emailFilenames.forEach((filename) =>
23
- templatePaths.push(path.join(emailDirectory.absolutePath, filename)),
24
- );
25
- emailDirectory.subDirectories.forEach((directory) => {
22
+ for (const filename of emailDirectory.emailFilenames) {
23
+ templatePaths.push(path.join(emailDirectory.absolutePath, filename));
24
+ }
25
+ for (const directory of emailDirectory.subDirectories) {
26
26
  templatePaths.push(...getEmailTemplatesFromDirectory(directory));
27
- });
27
+ }
28
28
 
29
29
  return templatePaths;
30
30
  };
@@ -33,7 +33,7 @@ export const startDevServer = async (
33
33
  port: number,
34
34
  ): Promise<http.Server> => {
35
35
  const [majorNodeVersion] = process.versions.node.split('.');
36
- if (majorNodeVersion && Number.parseInt(majorNodeVersion) < 20) {
36
+ if (majorNodeVersion && Number.parseInt(majorNodeVersion, 10) < 20) {
37
37
  console.error(
38
38
  ` ${logSymbols.error} Node ${majorNodeVersion} is not supported. Please upgrade to Node 20 or higher.`,
39
39
  );