react-email 5.0.2 → 5.0.4

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.4
4
+
5
+ ## 5.0.3
6
+
3
7
  ## 5.0.2
4
8
 
5
9
  ## 5.0.1
package/dist/index.js CHANGED
@@ -87,7 +87,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
87
87
  //#region package.json
88
88
  var package_default = {
89
89
  name: "react-email",
90
- version: "5.0.2",
90
+ version: "5.0.4",
91
91
  description: "A live preview of your emails right in your browser.",
92
92
  bin: { "email": "./dist/index.js" },
93
93
  type: "module",
@@ -218,11 +218,11 @@ const npmInstall = async (builtPreviewAppPath, packageManager) => {
218
218
  };
219
219
  const setNextEnvironmentVariablesForBuild = async (emailsDirRelativePath, builtPreviewAppPath) => {
220
220
  const nextConfigContents = `
221
- const path = require('path');
221
+ import path from 'path';
222
222
  const emailsDirRelativePath = path.normalize('${emailsDirRelativePath}');
223
223
  const userProjectLocation = '${process.cwd().replace(/\\/g, "/")}';
224
224
  /** @type {import('next').NextConfig} */
225
- module.exports = {
225
+ const nextConfig = {
226
226
  env: {
227
227
  NEXT_PUBLIC_IS_BUILDING: 'true',
228
228
  EMAILS_DIR_RELATIVE_PATH: emailsDirRelativePath,
@@ -237,9 +237,10 @@ module.exports = {
237
237
  experimental: {
238
238
  webpackBuildWorker: true
239
239
  },
240
- }`;
241
- await fs.promises.rm(path.resolve(builtPreviewAppPath, "./next.config.ts"));
242
- await fs.promises.writeFile(path.resolve(builtPreviewAppPath, "./next.config.js"), nextConfigContents, "utf8");
240
+ }
241
+
242
+ export default nextConfig`;
243
+ await fs.promises.writeFile(path.resolve(builtPreviewAppPath, "./next.config.mjs"), nextConfigContents, "utf8");
243
244
  };
244
245
  const getEmailSlugsFromEmailDirectory = (emailDirectory, emailsDirectoryAbsolutePath) => {
245
246
  const directoryPathRelativeToEmailsDirectory = emailDirectory.absolutePath.replace(emailsDirectoryAbsolutePath, "").trim();
@@ -271,7 +272,7 @@ const updatePackageJson = async (builtPreviewAppPath) => {
271
272
  packageJson.scripts.start = "next start";
272
273
  delete packageJson.scripts.postbuild;
273
274
  packageJson.name = "preview-server";
274
- for (const [dependency, version$1] of Object.entries(packageJson.dependencies)) packageJson.dependencies[dependency] = version$1.replace("workspace:", "");
275
+ for (const [dependency, version$1] of Object.entries(packageJson.devDependencies)) packageJson.devDependencies[dependency] = version$1.replace("workspace:", "");
275
276
  delete packageJson.devDependencies["@react-email/components"];
276
277
  delete packageJson.scripts.prepare;
277
278
  await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson), "utf8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-email",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "A live preview of your emails right in your browser.",
5
5
  "bin": {
6
6
  "email": "./dist/index.js"
@@ -47,7 +47,7 @@
47
47
  "react": "19.0.0",
48
48
  "react-dom": "19.0.0",
49
49
  "typescript": "5.8.3",
50
- "@react-email/components": "1.0.0"
50
+ "@react-email/components": "1.0.1"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsdown",
@@ -76,11 +76,11 @@ const setNextEnvironmentVariablesForBuild = async (
76
76
  builtPreviewAppPath: string,
77
77
  ) => {
78
78
  const nextConfigContents = `
79
- const path = require('path');
79
+ import path from 'path';
80
80
  const emailsDirRelativePath = path.normalize('${emailsDirRelativePath}');
81
81
  const userProjectLocation = '${process.cwd().replace(/\\/g, '/')}';
82
82
  /** @type {import('next').NextConfig} */
83
- module.exports = {
83
+ const nextConfig = {
84
84
  env: {
85
85
  NEXT_PUBLIC_IS_BUILDING: 'true',
86
86
  EMAILS_DIR_RELATIVE_PATH: emailsDirRelativePath,
@@ -95,12 +95,12 @@ module.exports = {
95
95
  experimental: {
96
96
  webpackBuildWorker: true
97
97
  },
98
- }`;
98
+ }
99
99
 
100
- await fs.promises.rm(path.resolve(builtPreviewAppPath, './next.config.ts'));
100
+ export default nextConfig`;
101
101
 
102
102
  await fs.promises.writeFile(
103
- path.resolve(builtPreviewAppPath, './next.config.js'),
103
+ path.resolve(builtPreviewAppPath, './next.config.mjs'),
104
104
  nextConfigContents,
105
105
  'utf8',
106
106
  );
@@ -198,9 +198,9 @@ const updatePackageJson = async (builtPreviewAppPath: string) => {
198
198
  packageJson.name = 'preview-server';
199
199
 
200
200
  for (const [dependency, version] of Object.entries(
201
- packageJson.dependencies,
201
+ packageJson.devDependencies,
202
202
  )) {
203
- packageJson.dependencies[dependency] = version.replace('workspace:', '');
203
+ packageJson.devDependencies[dependency] = version.replace('workspace:', '');
204
204
  }
205
205
 
206
206
  delete packageJson.devDependencies['@react-email/components'];