react-email 4.2.2 → 4.2.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
package/dist/index.js
CHANGED
|
@@ -106,7 +106,7 @@ import prompts from "prompts";
|
|
|
106
106
|
// package.json
|
|
107
107
|
var package_default = {
|
|
108
108
|
name: "react-email",
|
|
109
|
-
version: "4.2.
|
|
109
|
+
version: "4.2.4",
|
|
110
110
|
description: "A live preview of your emails right in your browser.",
|
|
111
111
|
bin: {
|
|
112
112
|
email: "./dist/index.js"
|
|
@@ -556,9 +556,10 @@ var readAllFilesInsideDirectory = async (directory) => {
|
|
|
556
556
|
}
|
|
557
557
|
return allFilePaths;
|
|
558
558
|
};
|
|
559
|
+
var javascriptExtensions = [".js", ".ts", ".jsx", ".tsx", ".mjs", ".cjs"];
|
|
559
560
|
var isJavascriptModule = (filePath) => {
|
|
560
561
|
const extensionName = path5.extname(filePath);
|
|
561
|
-
return
|
|
562
|
+
return javascriptExtensions.includes(extensionName);
|
|
562
563
|
};
|
|
563
564
|
var checkFileExtensionsUntilItExists = (pathWithoutExtension) => {
|
|
564
565
|
if (existsSync(`${pathWithoutExtension}.ts`)) {
|
|
@@ -634,11 +635,16 @@ var createDependencyGraph = async (directory) => {
|
|
|
634
635
|
}
|
|
635
636
|
const extension = path5.extname(pathToDependencyFromDirectory);
|
|
636
637
|
const pathWithEnsuredExtension = (() => {
|
|
637
|
-
if (extension.length > 0 &&
|
|
638
|
-
|
|
638
|
+
if (extension.length > 0 && javascriptExtensions.includes(extension)) {
|
|
639
|
+
if (existsSync(pathToDependencyFromDirectory)) {
|
|
640
|
+
return pathToDependencyFromDirectory;
|
|
641
|
+
}
|
|
642
|
+
return checkFileExtensionsUntilItExists(
|
|
643
|
+
pathToDependencyFromDirectory.replace(extension, "")
|
|
644
|
+
);
|
|
639
645
|
}
|
|
640
646
|
return checkFileExtensionsUntilItExists(
|
|
641
|
-
pathToDependencyFromDirectory
|
|
647
|
+
pathToDependencyFromDirectory
|
|
642
648
|
);
|
|
643
649
|
})();
|
|
644
650
|
if (pathWithEnsuredExtension) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-email",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"description": "A live preview of your emails right in your browser.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"email": "./dist/index.js"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"react-dom": "19.0.0",
|
|
49
49
|
"tsup": "8.4.0",
|
|
50
50
|
"typescript": "5.8.3",
|
|
51
|
-
"@react-email/components": "0.3.
|
|
51
|
+
"@react-email/components": "0.3.2"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsup-node",
|
|
@@ -34,10 +34,12 @@ const readAllFilesInsideDirectory = async (directory: string) => {
|
|
|
34
34
|
return allFilePaths;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
const javascriptExtensions = ['.js', '.ts', '.jsx', '.tsx', '.mjs', '.cjs'];
|
|
38
|
+
|
|
37
39
|
const isJavascriptModule = (filePath: string) => {
|
|
38
40
|
const extensionName = path.extname(filePath);
|
|
39
41
|
|
|
40
|
-
return
|
|
42
|
+
return javascriptExtensions.includes(extensionName);
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
const checkFileExtensionsUntilItExists = (
|
|
@@ -144,12 +146,17 @@ export const createDependencyGraph = async (directory: string) => {
|
|
|
144
146
|
const pathWithEnsuredExtension = (() => {
|
|
145
147
|
if (
|
|
146
148
|
extension.length > 0 &&
|
|
147
|
-
|
|
149
|
+
javascriptExtensions.includes(extension)
|
|
148
150
|
) {
|
|
149
|
-
|
|
151
|
+
if (existsSync(pathToDependencyFromDirectory)) {
|
|
152
|
+
return pathToDependencyFromDirectory;
|
|
153
|
+
}
|
|
154
|
+
return checkFileExtensionsUntilItExists(
|
|
155
|
+
pathToDependencyFromDirectory.replace(extension, ''),
|
|
156
|
+
);
|
|
150
157
|
}
|
|
151
158
|
return checkFileExtensionsUntilItExists(
|
|
152
|
-
pathToDependencyFromDirectory
|
|
159
|
+
pathToDependencyFromDirectory,
|
|
153
160
|
);
|
|
154
161
|
})();
|
|
155
162
|
|