react-email 6.6.9 → 6.7.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # react-email
2
2
 
3
+ ## 6.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b448c3b: Enable custom export extensions via --extension/-e (e.g. .blade.php).
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [ba96cfa]
12
+ - Updated dependencies [58d8c08]
13
+ - @react-email/render@2.1.0
14
+
3
15
  ## 6.6.9
4
16
 
5
17
  ### Patch Changes
@@ -6533,7 +6533,7 @@ const getTracingRootDir = async (usersProjectLocation) => {
6533
6533
  //#region package.json
6534
6534
  var package_default = {
6535
6535
  name: "react-email",
6536
- version: "6.6.9",
6536
+ version: "6.7.0",
6537
6537
  description: "A live preview of your emails right in your browser.",
6538
6538
  bin: { "email": "./dist/cli/index.mjs" },
6539
6539
  type: "module",
@@ -6572,7 +6572,7 @@ var package_default = {
6572
6572
  dependencies: {
6573
6573
  "@babel/parser": "catalog:",
6574
6574
  "@babel/traverse": "catalog:",
6575
- "@react-email/render": "workspace:>=2.0.10",
6575
+ "@react-email/render": "workspace:>=2.1.0",
6576
6576
  "chokidar": "^4.0.3",
6577
6577
  "commander": "catalog:",
6578
6578
  "conf": "^15.0.2",
@@ -7541,7 +7541,7 @@ const renderWorkerSource = `
7541
7541
  const { unlinkSync, writeFileSync } = require('node:fs');
7542
7542
  const { parentPort, workerData } = require('node:worker_threads');
7543
7543
 
7544
- const { templates, options } = workerData;
7544
+ const { templates, options, extension } = workerData;
7545
7545
 
7546
7546
  (async () => {
7547
7547
  for (const template of templates) {
@@ -7551,10 +7551,7 @@ const { templates, options } = workerData;
7551
7551
  emailModule.reactEmailCreateReactElement(emailModule.default, {}),
7552
7552
  options,
7553
7553
  );
7554
- const htmlPath = template.replace(
7555
- '.cjs',
7556
- options.plainText ? '.txt' : '.html',
7557
- );
7554
+ const htmlPath = template.replace('.cjs', extension);
7558
7555
  writeFileSync(htmlPath, rendered);
7559
7556
  unlinkSync(template);
7560
7557
  parentPort.postMessage({ type: 'progress', template });
@@ -7616,6 +7613,7 @@ const exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirec
7616
7613
  }
7617
7614
  if (spinner) spinner.succeed();
7618
7615
  const allBuiltTemplates = glob.sync(normalize$1(`${pathToWhereEmailMarkupShouldBeDumped}/**/*.cjs`), { absolute: true });
7616
+ const extension = options.extension && options.extension.length > 0 ? options.extension.startsWith(".") ? options.extension : `.${options.extension}` : options.plainText ? ".txt" : ".html";
7619
7617
  if (spinner && allBuiltTemplates.length > 0) {
7620
7618
  spinner.setText(`rendering ${allBuiltTemplates[0]?.split("/").pop()}`);
7621
7619
  spinner.start();
@@ -7630,7 +7628,8 @@ const exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirec
7630
7628
  eval: true,
7631
7629
  workerData: {
7632
7630
  templates: batch,
7633
- options
7631
+ options,
7632
+ extension
7634
7633
  }
7635
7634
  });
7636
7635
  worker.on("message", (msg) => {
@@ -7786,10 +7785,11 @@ else {
7786
7785
  program.command("dev").description("Starts the preview email development app").option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-p --port <port>", "Port to run dev server on", "3000").option("-c, --clients <clients>", "Comma-separated list of email clients to show compatibility warnings for (overrides COMPATIBILITY_EMAIL_CLIENTS)", parseClientsOption).action(dev);
7787
7786
  program.command("build").description("Copies the preview app for onto .react-email and builds it").option("-d, --dir <path>", "Directory with your email templates", "./emails").addOption(new Option("-p, --packageManager <name>").hideHelp()).action(build$1);
7788
7787
  program.command("start").description("Runs the built preview app that is inside of \".react-email\"").action(start);
7789
- program.command("export").description("Build the templates to the `out` directory").option("--outDir <path>", "Output directory", "out").option("-p, --pretty", "Pretty print the output", false).option("-t, --plainText", "Set output format as plain text", false).option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-s, --silent", "To, or not to show a spinner with process information", false).action(({ outDir, pretty, plainText, silent, dir: srcDir }) => exportTemplates(outDir, srcDir, {
7788
+ program.command("export").description("Build the templates to the `out` directory").option("--outDir <path>", "Output directory", "out").option("-p, --pretty", "Pretty print the output", false).option("-t, --plainText", "Set output format as plain text", false).option("-d, --dir <path>", "Directory with your email templates", "./emails").option("-e, --extension <extension>", "Set a custom file extension for rendered emails (e.g. blade.php)").option("-s, --silent", "To, or not to show a spinner with process information", false).action(({ outDir, pretty, plainText, silent, dir: srcDir, extension }) => exportTemplates(outDir, srcDir, {
7790
7789
  silent,
7791
7790
  plainText,
7792
- pretty
7791
+ pretty,
7792
+ extension
7793
7793
  }));
7794
7794
  const resend = program.command("resend");
7795
7795
  resend.command("setup").description("Sets up the integration between the React Email CLI, and your Resend account through an API Key").action(resendSetup);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-email",
3
- "version": "6.6.9",
3
+ "version": "6.7.0",
4
4
  "description": "A live preview of your emails right in your browser.",
5
5
  "bin": {
6
6
  "email": "./dist/cli/index.mjs"
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@babel/parser": "7.27.0",
39
39
  "@babel/traverse": "7.27.0",
40
- "@react-email/render": ">=2.0.10",
40
+ "@react-email/render": ">=2.1.0",
41
41
  "chokidar": "^4.0.3",
42
42
  "commander": "^13.0.0",
43
43
  "conf": "^15.0.2",
@@ -74,7 +74,7 @@
74
74
  "tsx": "4.21.0",
75
75
  "typescript": "5.9.3",
76
76
  "yalc": "1.0.0-pre.53",
77
- "@react-email/render": "2.0.10"
77
+ "@react-email/render": "2.1.0"
78
78
  },
79
79
  "scripts": {
80
80
  "build": "tsdown",