@emailens/cli 0.13.16 → 0.13.19
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/README.md +207 -188
- package/dist/{chunk-FFVMVESX.js → chunk-J4YQYM4C.js} +703 -226
- package/dist/{chunk-ABDTBRVK.js → chunk-UN26YQF6.js} +6 -5
- package/dist/index.js +483 -156
- package/dist/{react-email-4EWH2SB4-CUKHMPBB.js → react-email-QQA75STN-LT3O7SQP.js} +1 -1
- package/dist/test.js +2 -2
- package/package.json +6 -2
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CompileError
|
|
5
5
|
} from "./chunk-TQGPCAMW.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/@emailens/engine/dist/chunk-
|
|
7
|
+
// node_modules/@emailens/engine/dist/chunk-OXUZ6PJX.js
|
|
8
8
|
var MAX_SOURCE_SIZE = 256e3;
|
|
9
9
|
var EXECUTION_TIMEOUT_MS = 5e3;
|
|
10
10
|
async function compileReactEmail(source, options) {
|
|
@@ -113,7 +113,8 @@ async function executeInVm(code, React, ReactEmailComponents) {
|
|
|
113
113
|
const { createContext, Script } = await import("vm");
|
|
114
114
|
const ALLOWED_MODULES = {
|
|
115
115
|
react: React,
|
|
116
|
-
"@react-email/components": ReactEmailComponents
|
|
116
|
+
"@react-email/components": ReactEmailComponents,
|
|
117
|
+
"react-email": ReactEmailComponents
|
|
117
118
|
};
|
|
118
119
|
const moduleExports = {};
|
|
119
120
|
const moduleObj = { exports: moduleExports };
|
|
@@ -122,7 +123,7 @@ async function executeInVm(code, React, ReactEmailComponents) {
|
|
|
122
123
|
return ALLOWED_MODULES[moduleName];
|
|
123
124
|
}
|
|
124
125
|
throw new Error(
|
|
125
|
-
`Import of "${moduleName}" is not allowed. Only "react" and "@react-email/components" can be imported.`
|
|
126
|
+
`Import of "${moduleName}" is not allowed. Only "react", "react-email" and "@react-email/components" can be imported.`
|
|
126
127
|
);
|
|
127
128
|
};
|
|
128
129
|
const sandbox = {
|
|
@@ -234,8 +235,8 @@ async function executeInIsolatedVm(code, React, ReactEmailComponents) {
|
|
|
234
235
|
});
|
|
235
236
|
function require(name) {
|
|
236
237
|
if (name === "react") return React;
|
|
237
|
-
if (name === "@react-email/components") return componentsProxy;
|
|
238
|
-
throw new Error('Import of "' + name + '" is not allowed. Only "react" and "@react-email/components" can be imported.');
|
|
238
|
+
if (name === "@react-email/components" || name === "react-email") return componentsProxy;
|
|
239
|
+
throw new Error('Import of "' + name + '" is not allowed. Only "react", "react-email" and "@react-email/components" can be imported.');
|
|
239
240
|
}
|
|
240
241
|
try {
|
|
241
242
|
${code}
|