@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.
@@ -4,7 +4,7 @@ import {
4
4
  CompileError
5
5
  } from "./chunk-TQGPCAMW.js";
6
6
 
7
- // node_modules/@emailens/engine/dist/chunk-OXR2HGQV.js
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}