react-email 6.0.0-canary.0 → 6.0.0-canary.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/CHANGELOG.md +9 -0
- package/dist/cli/index.mjs +19 -20
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/cli/index.mjs
CHANGED
|
@@ -6362,7 +6362,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
|
|
|
6362
6362
|
//#region package.json
|
|
6363
6363
|
var package_default = {
|
|
6364
6364
|
name: "react-email",
|
|
6365
|
-
version: "6.0.0-canary.
|
|
6365
|
+
version: "6.0.0-canary.2",
|
|
6366
6366
|
description: "A live preview of your emails right in your browser.",
|
|
6367
6367
|
bin: { "email": "./dist/cli/index.mjs" },
|
|
6368
6368
|
type: "module",
|
|
@@ -6395,7 +6395,7 @@ var package_default = {
|
|
|
6395
6395
|
dependencies: {
|
|
6396
6396
|
"@babel/parser": "catalog:",
|
|
6397
6397
|
"@babel/traverse": "catalog:",
|
|
6398
|
-
"@react-email/render": "workspace:>=0",
|
|
6398
|
+
"@react-email/render": "workspace:>=2.0.7-canary.0",
|
|
6399
6399
|
"chokidar": "^4.0.3",
|
|
6400
6400
|
"commander": "catalog:",
|
|
6401
6401
|
"conf": "^15.0.2",
|
|
@@ -6434,7 +6434,7 @@ var package_default = {
|
|
|
6434
6434
|
};
|
|
6435
6435
|
|
|
6436
6436
|
//#endregion
|
|
6437
|
-
//#region src/cli/utils/get-
|
|
6437
|
+
//#region src/cli/utils/get-ui-location.ts
|
|
6438
6438
|
const ensurePreviewServerInstalled = async (message) => {
|
|
6439
6439
|
if ((await prompts({
|
|
6440
6440
|
type: "confirm",
|
|
@@ -6442,21 +6442,21 @@ const ensurePreviewServerInstalled = async (message) => {
|
|
|
6442
6442
|
message,
|
|
6443
6443
|
initial: true
|
|
6444
6444
|
})).installPreviewServer) {
|
|
6445
|
-
console.log("Installing \"@react-email/
|
|
6446
|
-
await addDevDependency(`@react-email/
|
|
6445
|
+
console.log("Installing \"@react-email/ui\"");
|
|
6446
|
+
await addDevDependency(`@react-email/ui@${package_default.version}`);
|
|
6447
6447
|
process.exit(0);
|
|
6448
6448
|
} else process.exit(0);
|
|
6449
6449
|
};
|
|
6450
|
-
const
|
|
6450
|
+
const getUiLocation = async () => {
|
|
6451
6451
|
const usersProject = createJiti(process.cwd());
|
|
6452
6452
|
let previewServerLocation;
|
|
6453
6453
|
try {
|
|
6454
|
-
previewServerLocation = path.dirname(url.fileURLToPath(usersProject.esmResolve("@react-email/
|
|
6454
|
+
previewServerLocation = path.dirname(url.fileURLToPath(usersProject.esmResolve("@react-email/ui")));
|
|
6455
6455
|
} catch (_exception) {
|
|
6456
|
-
await ensurePreviewServerInstalled("To run the preview server, the package \"@react-email/
|
|
6456
|
+
await ensurePreviewServerInstalled("To run the preview server, the package \"@react-email/ui\" must be installed. Would you like to install it?");
|
|
6457
6457
|
}
|
|
6458
|
-
const { version: version$1 } = await usersProject.import("@react-email/
|
|
6459
|
-
if (version$1 !== package_default.version) await ensurePreviewServerInstalled(`To run the preview server, the version of "@react-email/
|
|
6458
|
+
const { version: version$1 } = await usersProject.import("@react-email/ui");
|
|
6459
|
+
if (version$1 !== package_default.version) await ensurePreviewServerInstalled(`To run the preview server, the version of "@react-email/ui" must match the version of "react-email" (${package_default.version}). Would you like to install it?`);
|
|
6460
6460
|
return previewServerLocation;
|
|
6461
6461
|
};
|
|
6462
6462
|
|
|
@@ -6535,22 +6535,20 @@ export function generateStaticParams() {
|
|
|
6535
6535
|
);
|
|
6536
6536
|
}`, "utf8");
|
|
6537
6537
|
};
|
|
6538
|
-
const updatePackageJson = async (
|
|
6539
|
-
const packageJsonPath = path.resolve(
|
|
6538
|
+
const updatePackageJson = async (builtUiPath) => {
|
|
6539
|
+
const packageJsonPath = path.resolve(builtUiPath, "./package.json");
|
|
6540
6540
|
const packageJson = JSON.parse(await fs.promises.readFile(packageJsonPath, "utf8"));
|
|
6541
6541
|
packageJson.scripts.build = "cross-env NODE_OPTIONS=\"--experimental-vm-modules --disable-warning=ExperimentalWarning\" next build";
|
|
6542
6542
|
packageJson.scripts.start = "cross-env NODE_OPTIONS=\"--experimental-vm-modules --disable-warning=ExperimentalWarning\" next start";
|
|
6543
6543
|
delete packageJson.scripts.postbuild;
|
|
6544
|
-
packageJson.name = "
|
|
6544
|
+
packageJson.name = "ui";
|
|
6545
6545
|
for (const [dependency, version$1] of Object.entries(packageJson.devDependencies)) packageJson.devDependencies[dependency] = version$1.replace("workspace:", "");
|
|
6546
|
-
delete packageJson.devDependencies["@react-email/components"];
|
|
6547
|
-
delete packageJson.scripts.prepare;
|
|
6548
6546
|
await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson), "utf8");
|
|
6549
6547
|
};
|
|
6550
6548
|
const build$1 = async ({ dir: emailsDirRelativePath, packageManager }) => {
|
|
6551
6549
|
try {
|
|
6552
6550
|
const usersProjectLocation = process.cwd();
|
|
6553
|
-
const previewServerLocation = await
|
|
6551
|
+
const previewServerLocation = await getUiLocation();
|
|
6554
6552
|
const spinner = ora({
|
|
6555
6553
|
text: "Starting build process...",
|
|
6556
6554
|
prefixText: " "
|
|
@@ -6947,7 +6945,7 @@ const startDevServer = async (emailsDirRelativePath, staticBaseDirRelativePath,
|
|
|
6947
6945
|
console.error(` ${logSymbols.error} Node ${majorNodeVersion} is not supported. Please upgrade to Node 20 or higher.`);
|
|
6948
6946
|
process.exit(1);
|
|
6949
6947
|
}
|
|
6950
|
-
const previewServerLocation = await
|
|
6948
|
+
const previewServerLocation = await getUiLocation();
|
|
6951
6949
|
const previewServer = createJiti(previewServerLocation);
|
|
6952
6950
|
devServer = http.createServer((req, res) => {
|
|
6953
6951
|
if (!req.url) {
|
|
@@ -7168,7 +7166,6 @@ const getEmailTemplatesFromDirectory = (emailDirectory) => {
|
|
|
7168
7166
|
};
|
|
7169
7167
|
const require$1 = createRequire(url.fileURLToPath(import.meta.url));
|
|
7170
7168
|
const exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirectoryPath, options) => {
|
|
7171
|
-
if (fs.existsSync(pathToWhereEmailMarkupShouldBeDumped)) fs.rmSync(pathToWhereEmailMarkupShouldBeDumped, { recursive: true });
|
|
7172
7169
|
let spinner;
|
|
7173
7170
|
if (!options.silent) {
|
|
7174
7171
|
spinner = ora("Preparing files...\n").start();
|
|
@@ -7180,8 +7177,10 @@ const exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirec
|
|
|
7180
7177
|
symbol: logSymbols.error,
|
|
7181
7178
|
text: `Could not find the directory at ${emailsDirectoryPath}`
|
|
7182
7179
|
});
|
|
7183
|
-
|
|
7180
|
+
else console.error(`Could not find the directory at ${emailsDirectoryPath}`);
|
|
7181
|
+
process.exit(1);
|
|
7184
7182
|
}
|
|
7183
|
+
if (fs.existsSync(pathToWhereEmailMarkupShouldBeDumped)) fs.rmSync(pathToWhereEmailMarkupShouldBeDumped, { recursive: true });
|
|
7185
7184
|
const allTemplates = getEmailTemplatesFromDirectory(emailsDirectoryMetadata);
|
|
7186
7185
|
try {
|
|
7187
7186
|
await build({
|
|
@@ -7287,7 +7286,7 @@ async function resendSetup() {
|
|
|
7287
7286
|
//#region src/cli/commands/start.ts
|
|
7288
7287
|
const start = async () => {
|
|
7289
7288
|
try {
|
|
7290
|
-
const previewServerLocation = await
|
|
7289
|
+
const previewServerLocation = await getUiLocation();
|
|
7291
7290
|
const usersProjectLocation = process.cwd();
|
|
7292
7291
|
const builtPreviewPath = path.resolve(usersProjectLocation, "./.react-email");
|
|
7293
7292
|
if (!fs.existsSync(builtPreviewPath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-email",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2",
|
|
4
4
|
"description": "A live preview of your emails right in your browser.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"email": "./dist/cli/index.mjs"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/parser": "7.27.0",
|
|
34
34
|
"@babel/traverse": "7.27.0",
|
|
35
|
-
"@react-email/render": ">=0",
|
|
35
|
+
"@react-email/render": ">=2.0.7-canary.0",
|
|
36
36
|
"chokidar": "^4.0.3",
|
|
37
37
|
"commander": "^13.0.0",
|
|
38
38
|
"conf": "^15.0.2",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"shlex": "3.0.0",
|
|
67
67
|
"tsx": "4.21.0",
|
|
68
68
|
"typescript": "5.9.3",
|
|
69
|
-
"@react-email/render": "2.0.
|
|
69
|
+
"@react-email/render": "2.0.7-canary.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsdown",
|