@emailens/cli 0.13.17 → 0.14.0

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 CHANGED
@@ -1,188 +1,273 @@
1
- <div align="center">
2
-
3
- <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="./docs/wordmark-dark.svg">
5
- <img src="./docs/wordmark-light.svg" alt="emailens / cli" width="444">
6
- </picture>
7
-
8
- **The email rendering linter for terminal and CI**
9
-
10
- [![CI](https://github.com/emailens/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/emailens/cli/actions/workflows/ci.yml)
11
- [![npm](https://badgen.net/npm/v/@emailens/cli)](https://www.npmjs.com/package/@emailens/cli)
12
- [![MCP](https://badgen.net/badge/MCP/Server/blue)](https://github.com/emailens/mcp)
13
-
14
- </div>
15
-
16
- ```text
17
- $ emailens lint emails/welcome.html --fail-on-warning
18
- emails/welcome.html
19
- warn 7:10 outlook-windows-legacy display:flex Outlook Classic receives this flex box. The MSO branch needs a table.
20
- warn 7:25 outlook-windows-legacy,yahoo-mail,yahoo-mail-android+2 gap Outlook Classic does not support "gap".
21
- warn 8:32 gmail-web,outlook-windows-legacy,yahoo-mail-android+2 box-shadow Gmail does not support "box-shadow".
22
- warn 14:5 yahoo-mail font-family Yahoo Mail drops an inline font-family that names a quoted font, like 'Courier New': that text shows in Yahoo's own font instead.
23
- warn inboxPreview preheader-too-short Preheader is only 21 characters, so email clients may backfill with body text (recommended: 30+).
24
- 12 info: safe fallbacks, not problems. --info lists them.
25
-
26
- 1 file | 5 warnings
27
-
28
- Failed: 5 warnings found (--failOnWarning)
29
- See it rendered in Gmail, Outlook and Apple Mail, no signup: https://app.emailens.dev/try?utm_source=cli&utm_medium=lint
30
- ```
31
-
32
- That is a welcome email with a flex row and a card shadow, checked against 21
33
- email clients. Each finding has its line:column, and the exit code (here 2)
34
- fails the build. The card's rounded corners are among the 12 info findings:
35
- Outlook Classic draws them square, a safe fallback rather than a problem. The
36
- last line appears only when the check fails; `--quiet` drops it, and `--json`
37
- never has it.
38
-
39
- ## Install
40
-
41
- ```bash
42
- npm install -g @emailens/cli
43
- ```
44
-
45
- ## Run
46
-
47
- ```bash
48
- emailens lint 'emails/*.html'
49
- ```
50
-
51
- Or without installing: `npx @emailens/cli lint email.html`. HTML, React Email
52
- (`.tsx`/`.jsx`), MJML and Maizzle are detected from the extension and compiled
53
- first, so the check runs on the HTML that would be sent. No account and no
54
- network: the analysis runs locally.
55
-
56
- Exit codes: `0` clean, `1` errors, `2` warnings with `--fail-on-warning`, or
57
- more than `--max-warnings`.
58
-
59
- ## Why not caniemail, or React Email's own checker?
60
-
61
- [Can I email](https://www.caniemail.com) is the support table: one feature,
62
- every client. It does not read your email. This CLI's support data is generated
63
- from caniemail's (synced 2026-10-27), plus the cells a real-device screenshot
64
- contradicted, each marked "Observed" with its date. What the CLI adds is the
65
- reading: it finds the features your file uses, points at the line, scores each
66
- client, and exits non-zero.
67
-
68
- [React Email 4](https://resend.com/blog/react-email-4) added a compatibility
69
- checker, also powered by Can I email, to its preview. Its CLI (`email dev`,
70
- `build`, `start`, `export`) has no check command and no exit code for CI, per
71
- [its docs](https://react.email/docs/cli). This CLI reads React Email files as
72
- well as MJML, Maizzle and plain HTML, and fails the build.
73
-
74
- Beyond CSS support, `lint` checks what neither covers: spam signals, links,
75
- accessibility, images, the inbox preview text, size, template variables,
76
- overflow, dark-mode and mobile contrast, Outlook VML, styles a client drops, and
77
- client-targeting hacks.
78
-
79
- ## Extras
80
-
81
- ### `lint` options
82
-
83
- | Flag | Alias | Description |
84
- |------|-------|-------------|
85
- | `--format` | `-f` | Input format: `html`, `jsx`, `mjml`, `maizzle`. `.vue` is `maizzle`. A pasted Vue file with no flag is detected. |
86
- | `--json` | | Output as JSON, one line, every finding including info |
87
- | `--info` | | List info findings too. By default they are counted, not listed: they are safe fallbacks, not problems |
88
- | `--fail-on-warning` | | Exit 2 if warnings found |
89
- | `--max-warnings` | | Fail if more than n warnings |
90
- | `--reporter github` | | Also print GitHub Actions annotations, so each finding shows on its line in the pull request. Not with `--json` |
91
- | `--quiet` | `-q` | No line about the hosted preview after a failure |
92
- | `--skip` | | Comma-separated checks to skip: `spam,links,accessibility,images,compatibility,inboxPreview,size,templateVariables,overflow,visual,darkContrast,mobileContrast,design,vml,styleSurvival,targeting` |
93
- | `--targeting-policy` | | `progressive` (default), `strict`, or `lenient` |
94
-
95
- A `.emailensrc` in the project, the file the VS Code extension reads, can set
96
- rule severities and skips; `--skip` on the command line wins.
97
-
98
- Maizzle HTML needs `@maizzle/framework@5` installed beside the CLI. A `.vue`
99
- file needs `@maizzle/framework@6`. One install is one major.
100
-
101
- ### Other commands
102
-
103
- ```bash
104
- emailens analyze email.html # score per client, findings by client
105
- emailens analyze email.html --clients gmail-web,outlook-windows --json
106
- emailens audit email.html # compatibility plus every other check
107
- emailens preview email.html --dark-mode # transforms, analysis, dark mode simulation
108
- emailens preview email.html --screenshots --out ./shots # needs BROWSERLESS_URL and playwright-core
109
- emailens export email.html -o ./report # self-contained HTML report (--json for JSON)
110
- emailens fix email.html -o fixed.html # AI fix, needs ANTHROPIC_API_KEY (--estimate: tokens only)
111
- emailens clients # the 21 clients
112
- cat email.html | emailens analyze - # stdin
113
- ```
114
-
115
- ### `emailens inbox wait`
116
-
117
- The CI step for what your app actually sends. Make your app send a real email
118
- (sign-up, reset, receipt) to your Emailens test inbox, then wait for it. It
119
- fails when the email is no longer the one you checked in Emailens, or changed
120
- since it last arrived: a link moved to staging, an emptied variable, a new
121
- line, an image gone, a size jump, signing that stopped passing. Codes, tokens
122
- and tracking ids differ on every send and do not count. It needs an API key.
123
-
124
- ```bash
125
- export EMAILENS_API_KEY=... # app.emailens.dev/dashboard/api
126
- SINCE=$(date +%s000) # before the send
127
- npm run send-signup-email # your app sends it
128
- emailens inbox wait --subject "Welcome" --since "$SINCE"
129
- ```
130
-
131
- Options: `--subject`, `--sender`, `--inbox <id>`, `--since` (ISO time, epoch
132
- ms, or a duration such as `5m`; default 2 minutes back), `--timeout` (seconds,
133
- default 60, at most 600), `--fail-on all|check|drift|none` (default `all`),
134
- `--json`. Exit codes: `0` pass, `1` changed, `2` nothing arrived or Emailens
135
- could not be reached.
136
-
137
- ### In your tests
138
-
139
- The same check as `lint`, as an assertion. It throws with every failing
140
- finding and its line, reads your `.emailensrc`, and works in Vitest, Jest and
141
- bun:test.
142
-
143
- ```ts
144
- import { render } from "@react-email/render";
145
- import { expectEmailToPass } from "@emailens/cli/test";
146
-
147
- test("welcome email passes", async () => {
148
- expectEmailToPass(await render(<Welcome name="Ada" />));
149
- });
150
- ```
151
-
152
- Options: `failOnWarning`, `skip` (the `--skip` names), `framework`.
153
-
154
- ### In GitHub Actions
155
-
156
- ```yaml
157
- - uses: actions/setup-node@v4
158
- with:
159
- node-version: 22
160
- - run: npx -y @emailens/cli lint 'emails/*.html' --fail-on-warning --reporter github
161
- ```
162
-
163
- `--reporter github` puts each finding on its line in the pull request's
164
- changed files.
165
-
166
- `**` globs are not supported: use a single-level wildcard or list the files.
167
- For scores per client in a pull request comment, use the
168
- [Action](https://github.com/emailens/action).
169
-
170
- ### Hosted
171
-
172
- [app.emailens.dev/try](https://app.emailens.dev/try?utm_source=cli&utm_medium=readme)
173
- renders the email per client: five clients with no account, all 21 with a free
174
- one. The + Real plans add real-device screenshots: Outlook on Windows and Mac,
175
- Apple Mail on Mac and iPad, and Gmail, Yahoo and Proton on the web.
176
-
177
- ## Ecosystem
178
-
179
- | Project | What it is |
180
- |---|---|
181
- | [@emailens/engine](https://github.com/emailens/engine) | The analysis engine this CLI runs, as a library |
182
- | [@emailens/mcp](https://github.com/emailens/mcp) | The same checks for coding agents: `claude mcp add emailens -- npx -y @emailens/mcp` |
183
- | [emailens/action](https://github.com/emailens/action) | GitHub Action: fails the build, and can comment the scores per client on the pull request |
184
- | [emailens/vscode](https://github.com/emailens/vscode) | VS Code extension: findings and preview in the editor |
185
-
186
- ## License
187
-
188
- MIT
1
+ <div align="center">
2
+
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="./docs/wordmark-dark.svg">
5
+ <img src="./docs/wordmark-light.svg" alt="emailens / cli" width="444">
6
+ </picture>
7
+
8
+ **The email rendering linter for terminal and CI**
9
+
10
+ [![CI](https://github.com/emailens/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/emailens/cli/actions/workflows/ci.yml)
11
+ [![npm](https://badgen.net/npm/v/@emailens/cli)](https://www.npmjs.com/package/@emailens/cli)
12
+ [![MCP](https://badgen.net/badge/MCP/Server/blue)](https://github.com/emailens/mcp)
13
+
14
+ </div>
15
+
16
+ ```text
17
+ $ emailens lint emails/welcome.html --fail-on-warning
18
+ emails/welcome.html
19
+ warn 7:10 outlook-windows-legacy display:flex Outlook Classic receives this flex box. The MSO branch needs a table.
20
+ warn 7:25 outlook-windows-legacy,yahoo-mail,yahoo-mail-android+2 gap Outlook Classic does not support "gap".
21
+ warn 8:32 gmail-web,outlook-windows-legacy,yahoo-mail-android+2 box-shadow Gmail does not support "box-shadow".
22
+ warn 14:5 yahoo-mail font-family Yahoo Mail drops an inline font-family that names a quoted font, like 'Courier New': that text shows in Yahoo's own font instead.
23
+ warn inboxPreview preheader-too-short Preheader is only 21 characters, so email clients may backfill with body text (recommended: 30+).
24
+ 12 info: safe fallbacks, not problems. --info lists them.
25
+
26
+ 1 file | 5 warnings
27
+
28
+ Failed: 5 warnings found (--failOnWarning)
29
+ See it rendered in Gmail, Outlook and Apple Mail, no signup: https://app.emailens.dev/try?utm_source=cli&utm_medium=lint
30
+ ```
31
+
32
+ That is a welcome email with a flex row and a card shadow, checked against 21
33
+ email clients. Each finding has its line:column, and the exit code (here 2)
34
+ fails the build. The card's rounded corners are among the 12 info findings:
35
+ Outlook Classic draws them square, a safe fallback rather than a problem. The
36
+ last line appears only when the check fails; `--quiet` drops it, and `--json`
37
+ never has it.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ npm install -g @emailens/cli
43
+ ```
44
+
45
+ ## Run
46
+
47
+ ```bash
48
+ emailens lint 'emails/*.html'
49
+ ```
50
+
51
+ Or without installing: `npx @emailens/cli lint email.html`. HTML, React Email
52
+ (`.tsx`/`.jsx`), MJML and Maizzle are detected from the extension and compiled
53
+ first, so the check runs on the HTML that would be sent. No account and no
54
+ network: the analysis runs locally.
55
+
56
+ Exit codes: `0` clean, `1` errors, `2` warnings with `--fail-on-warning`, or
57
+ more than `--max-warnings`.
58
+
59
+ ### In a React Email project
60
+
61
+ ```bash
62
+ npx @emailens/cli react-email
63
+ ```
64
+
65
+ Finds the emails folder `email dev` uses (`emails/`, `src/emails/`), renders
66
+ every template with your project's own React Email, `PreviewProps` included,
67
+ and checks the HTML. Local imports, any npm package and tsconfig paths work,
68
+ subfolders are included, and `_components`-style folders and files without a
69
+ default export are skipped. No export step. `--watch` re-checks on save.
70
+
71
+ Pass `--email-type transactional` (or set `"emailType": "transactional"` in
72
+ `.emailensrc`) when the folder holds sign-in, receipt and alert emails, which
73
+ need no unsubscribe link. `emailens lint emails/` does the same as the command
74
+ above on a folder you name.
75
+
76
+ ## Why not caniemail, or React Email's own checker?
77
+
78
+ [Can I email](https://www.caniemail.com) is the support table: one feature,
79
+ every client. It does not read your email. This CLI's support data is generated
80
+ from caniemail's (synced 2026-10-27), plus the cells a real-device screenshot
81
+ contradicted, each marked "Observed" with its date. What the CLI adds is the
82
+ reading: it finds the features your file uses, points at the line, scores each
83
+ client, and exits non-zero.
84
+
85
+ [React Email 4](https://resend.com/blog/react-email-4) added a compatibility
86
+ checker, also powered by Can I email, to its preview. Its CLI (`email dev`,
87
+ `build`, `start`, `export`) has no check command and no exit code for CI, per
88
+ [its docs](https://react.email/docs/cli). This CLI reads React Email files as
89
+ well as MJML, Maizzle and plain HTML, and fails the build.
90
+
91
+ Beyond CSS support, `lint` checks what neither covers: spam signals, links,
92
+ accessibility, images, the inbox preview text, size, template variables,
93
+ overflow, dark-mode and mobile contrast, Outlook VML, styles a client drops, and
94
+ client-targeting hacks.
95
+
96
+ ## Extras
97
+
98
+ ### `lint` options
99
+
100
+ | Flag | Alias | Description |
101
+ |------|-------|-------------|
102
+ | `--format` | `-f` | Input format: `html`, `jsx`, `mjml`, `maizzle`. `.vue` is `maizzle`. A pasted Vue file with no flag is detected. |
103
+ | `--json` | | Output as JSON, one line, every finding including info |
104
+ | `--info` | | List info findings too. By default they are counted, not listed: they are safe fallbacks, not problems |
105
+ | `--fail-on-warning` | | Exit 2 if warnings found |
106
+ | `--max-warnings` | | Fail if more than n warnings |
107
+ | `--reporter github` | | Also print GitHub Actions annotations, so each finding shows on its line in the pull request. Not with `--json` |
108
+ | `--quiet` | `-q` | No line about the hosted preview after a failure |
109
+ | `--skip` | | Comma-separated checks to skip: `spam,links,accessibility,images,compatibility,inboxPreview,size,templateVariables,overflow,visual,darkContrast,mobileContrast,design,vml,styleSurvival,targeting` |
110
+ | `--targeting-policy` | | `progressive` (default), `strict`, or `lenient` |
111
+ | `--email-type` | | `transactional` drops the unsubscribe requirement; `marketing` keeps it. Default: `emailType` in `.emailensrc` |
112
+ | `--gate` | | Also send each email to the hosted pre-send gate, which fails on a regression against the last version of that file that passed. Pro plan, needs `EMAILENS_API_KEY` |
113
+
114
+ A `.emailensrc` in the project, the file the VS Code extension reads, can set
115
+ rule severities and skips; `--skip` on the command line wins.
116
+
117
+ Maizzle HTML needs `@maizzle/framework@5` installed beside the CLI. A `.vue`
118
+ file needs `@maizzle/framework@6`. One install is one major.
119
+
120
+ ### `emailens design`: does it still look like your design?
121
+
122
+ `lint` reads the code. `design` reads the render: it draws the email as each
123
+ client's live preview shows it and as you designed it, then compares the two
124
+ layouts element by element. Every element is compared on its position, size,
125
+ colours, corners, fonts and spacing. It gives the verdict the Emailens email
126
+ page shows: **Ready**, **Needs work** or **Broken**, with the reasons.
127
+
128
+ ```text
129
+ $ emailens design emails/welcome.html --clients outlook-windows-legacy,gmail-web
130
+ ✗ Outlook Classic Broken
131
+ Outlook Classic breaks your design.
132
+ - Columns that sit side by side in your design stack on top of each other.
133
+ - The email is drawn at a very different width from your design (54% of it).
134
+ - “Track your parcel” is moved (centre at 25% → 50% across the email) and 1107px wide instead of 300px.
135
+ - “Manage your order” is moved (centre at 75% → 50% across the email) and 1107px wide instead of 300px.
136
+ - Layout differs in 4 places. For example, “Hello, your order has shipped.” has width 600px instead of 552px.
137
+ and 1 more
138
+ ✓ Gmail Ready
139
+ ```
140
+
141
+ That email puts two buttons side by side with `display:flex`. Classic Outlook
142
+ has no flexbox, so the buttons stack at full width. Gmail sets its own line
143
+ height and text colour, but the screenshots of the two pages differ by under
144
+ 2.5% of their pixels, so the design reads as kept.
145
+
146
+ Layout needs a browser, so this command needs one too. `sharp` adds the pixel
147
+ comparison:
148
+
149
+ ```bash
150
+ npm install -g @emailens/cli playwright-core sharp
151
+ npx playwright-core install chromium # a local Chromium, or:
152
+ export BROWSERLESS_URL=wss://... # your Browserless instance
153
+ emailens design email.html
154
+ ```
155
+
156
+ Or without installing: `npx -p @emailens/cli -p playwright-core -p sharp emailens design email.html`.
157
+
158
+ | Flag | Alias | Description |
159
+ |------|-------|-------------|
160
+ | `--clients` | `-c` | Comma-separated client IDs. Default: all 21 |
161
+ | `--format` | `-f` | Input format: `html`, `jsx`, `mjml`, `maizzle` |
162
+ | `--strict` | | Fail on Needs work too, not only on Broken |
163
+ | `--json` | | Output as JSON |
164
+ | `--quiet` | `-q` | No spinner |
165
+
166
+ Exit codes: `0` when no client breaks the design, `1` when one does (or, with
167
+ `--strict`, when one changes it).
168
+
169
+ **What it covers and what it doesn't:**
170
+ - It runs in light mode, against our live preview of each client. It doesn't
171
+ screenshot real inboxes: real-device screenshots are on the hosted plans.
172
+ - With `sharp` installed, it also screenshots both pages and compares them
173
+ pixel by pixel, as the hosted check on saved emails does. That agrees more
174
+ often with a human reviewer. Without `sharp`, it compares page structure
175
+ only, as the email page in your browser does, and the JSON has no `diff`.
176
+ - On Browserless, the session has to stay open for the whole run. A short
177
+ session timeout closes the browser midway: raise its `TIMEOUT`, or pass
178
+ fewer `--clients`.
179
+ - Scripts are off in both pages. The email's own images and fonts load from
180
+ their addresses.
181
+ - The font stand-ins the previews use (Segoe, Aptos, the Apple and Android
182
+ system fonts) are downloaded once from app.emailens.dev into
183
+ `~/.cache/emailens/fonts`.
184
+
185
+ ### Other commands
186
+
187
+ ```bash
188
+ emailens analyze email.html # score per client, findings by client
189
+ emailens analyze email.html --clients gmail-web,outlook-windows --json
190
+ emailens audit email.html # compatibility plus every other check
191
+ emailens preview email.html --dark-mode # transforms, analysis, dark mode simulation
192
+ emailens preview email.html --screenshots --out ./shots # needs BROWSERLESS_URL and playwright-core
193
+ emailens design email.html --clients gmail-web # still looks like the design? needs playwright-core (+ sharp)
194
+ emailens export email.html -o ./report # self-contained HTML report (--json for JSON)
195
+ emailens fix email.html -o fixed.html # AI fix, needs ANTHROPIC_API_KEY (--estimate: tokens only)
196
+ emailens clients # the 21 clients
197
+ cat email.html | emailens analyze - # stdin
198
+ ```
199
+
200
+ ### `emailens inbox wait`
201
+
202
+ The CI step for what your app actually sends. Make your app send a real email
203
+ (sign-up, reset, receipt) to your Emailens test inbox, then wait for it. It
204
+ fails when the email is no longer the one you checked in Emailens, or changed
205
+ since it last arrived: a link moved to staging, an emptied variable, a new
206
+ line, an image gone, a size jump, signing that stopped passing. Codes, tokens
207
+ and tracking ids differ on every send and do not count. It needs an API key.
208
+
209
+ ```bash
210
+ export EMAILENS_API_KEY=... # app.emailens.dev/dashboard/api
211
+ SINCE=$(date +%s000) # before the send
212
+ npm run send-signup-email # your app sends it
213
+ emailens inbox wait --subject "Welcome" --since "$SINCE"
214
+ ```
215
+
216
+ Options: `--subject`, `--sender`, `--inbox <id>`, `--since` (ISO time, epoch
217
+ ms, or a duration such as `5m`; default 2 minutes back), `--timeout` (seconds,
218
+ default 60, at most 600), `--fail-on all|check|drift|none` (default `all`),
219
+ `--json`. Exit codes: `0` pass, `1` changed, `2` nothing arrived or Emailens
220
+ could not be reached.
221
+
222
+ ### In your tests
223
+
224
+ The same check as `lint`, as an assertion. It throws with every failing
225
+ finding and its line, reads your `.emailensrc`, and works in Vitest, Jest and
226
+ bun:test.
227
+
228
+ ```ts
229
+ import { render } from "@react-email/render";
230
+ import { expectEmailToPass } from "@emailens/cli/test";
231
+
232
+ test("welcome email passes", async () => {
233
+ expectEmailToPass(await render(<Welcome name="Ada" />));
234
+ });
235
+ ```
236
+
237
+ Options: `failOnWarning`, `skip` (the `--skip` names), `framework`.
238
+
239
+ ### In GitHub Actions
240
+
241
+ ```yaml
242
+ - uses: actions/setup-node@v4
243
+ with:
244
+ node-version: 22
245
+ - run: npx -y @emailens/cli lint 'emails/*.html' --fail-on-warning --reporter github
246
+ ```
247
+
248
+ `--reporter github` puts each finding on its line in the pull request's
249
+ changed files.
250
+
251
+ `**` globs are not supported: use a single-level wildcard or list the files.
252
+ For scores per client in a pull request comment, use the
253
+ [Action](https://github.com/emailens/action).
254
+
255
+ ### Hosted
256
+
257
+ [app.emailens.dev/try](https://app.emailens.dev/try?utm_source=cli&utm_medium=readme)
258
+ renders the email per client: five clients with no account, all 21 with a free
259
+ one. The + Real plans add real-device screenshots: Outlook on Windows and Mac,
260
+ Apple Mail on Mac and iPad, and Gmail, Yahoo and Proton on the web.
261
+
262
+ ## Ecosystem
263
+
264
+ | Project | What it is |
265
+ |---|---|
266
+ | [@emailens/engine](https://github.com/emailens/engine) | The analysis engine this CLI runs, as a library |
267
+ | [@emailens/mcp](https://github.com/emailens/mcp) | The same checks for coding agents: `claude mcp add emailens -- npx -y @emailens/mcp` |
268
+ | [emailens/action](https://github.com/emailens/action) | GitHub Action: fails the build, and can comment the scores per client on the pull request |
269
+ | [emailens/vscode](https://github.com/emailens/vscode) | VS Code extension: findings and preview in the editor |
270
+
271
+ ## License
272
+
273
+ MIT
@@ -2,7 +2,7 @@ import { createRequire as __cr } from "node:module";
2
2
  const require = __cr(import.meta.url);
3
3
  import {
4
4
  CompileError
5
- } from "./chunk-TQGPCAMW.js";
5
+ } from "./chunk-WAXESPJE.js";
6
6
 
7
7
  // node_modules/@emailens/engine/dist/chunk-IFRUM6GJ.js
8
8
  import { mkdtempSync } from "fs";
@@ -1,16 +1,6 @@
1
1
  import { createRequire as __cr } from "node:module";
2
2
  const require = __cr(import.meta.url);
3
3
 
4
- // node_modules/@emailens/engine/dist/chunk-Z22AD2IU.js
5
- var CompileError = class extends Error {
6
- constructor(message, format, phase) {
7
- super(message);
8
- this.name = "CompileError";
9
- this.format = format;
10
- this.phase = phase;
11
- }
12
- };
13
-
14
4
  // node_modules/@emailens/engine/dist/chunk-2NMEKWO5.js
15
5
  var __defProp = Object.defineProperty;
16
6
  var __defProps = Object.defineProperties;
@@ -45,7 +35,6 @@ var __objRest = (source, exclude) => {
45
35
  };
46
36
 
47
37
  export {
48
- CompileError,
49
38
  __spreadValues,
50
39
  __spreadProps,
51
40
  __objRest
@@ -2,9 +2,9 @@ import { createRequire as __cr } from "node:module";
2
2
  const require = __cr(import.meta.url);
3
3
  import {
4
4
  CompileError
5
- } from "./chunk-TQGPCAMW.js";
5
+ } from "./chunk-WAXESPJE.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}