@emailens/engine 0.6.0 → 0.8.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 +162 -7
- package/dist/{chunk-ZQF2XUIJ.js → chunk-2NMEKWO5.js} +2 -13
- package/dist/{chunk-3NDQOTPM.js → chunk-E4QE4WXE.js} +2 -2
- package/dist/{chunk-URZ4XPST.js → chunk-HBKZMR7V.js} +2 -2
- package/dist/{chunk-OY3DGZVU.js → chunk-PW6EUG2G.js} +2 -2
- package/dist/chunk-Z22AD2IU.js +14 -0
- package/dist/{chunk-ZQF2XUIJ.js.map → chunk-Z22AD2IU.js.map} +1 -1
- package/dist/compile/index.d.cts +2 -2
- package/dist/compile/index.d.ts +2 -2
- package/dist/compile/index.js +8 -7
- package/dist/compile/index.js.map +1 -1
- package/dist/index.cjs +3685 -507
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +80 -6
- package/dist/index.d.ts +80 -6
- package/dist/index.js +3678 -507
- package/dist/index.js.map +1 -1
- package/dist/maizzle-KKJF7XY7.js +9 -0
- package/dist/mjml-C46UWTTK.js +9 -0
- package/dist/react-email-C-p8ZL37.d.cts +58 -0
- package/dist/react-email-DcseUoOu.d.ts +58 -0
- package/dist/react-email-QKHRTEJW.js +9 -0
- package/dist/react-email-QKHRTEJW.js.map +1 -0
- package/dist/server.cjs +368 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +80 -0
- package/dist/server.d.ts +80 -0
- package/dist/server.js +342 -0
- package/dist/server.js.map +1 -0
- package/dist/{react-email-BQljgXbo.d.cts → types-4P9AtKm_.d.cts} +65 -54
- package/dist/{react-email-BQljgXbo.d.ts → types-4P9AtKm_.d.ts} +65 -54
- package/package.json +13 -6
- package/dist/maizzle-Y2CLJ7GB.js +0 -8
- package/dist/mjml-D7IOYXXK.js +0 -8
- package/dist/react-email-4TW6IDAA.js +0 -8
- /package/dist/{maizzle-Y2CLJ7GB.js.map → chunk-2NMEKWO5.js.map} +0 -0
- /package/dist/{chunk-3NDQOTPM.js.map → chunk-E4QE4WXE.js.map} +0 -0
- /package/dist/{chunk-URZ4XPST.js.map → chunk-HBKZMR7V.js.map} +0 -0
- /package/dist/{chunk-OY3DGZVU.js.map → chunk-PW6EUG2G.js.map} +0 -0
- /package/dist/{mjml-D7IOYXXK.js.map → maizzle-KKJF7XY7.js.map} +0 -0
- /package/dist/{react-email-4TW6IDAA.js.map → mjml-C46UWTTK.js.map} +0 -0
|
@@ -174,6 +174,8 @@ interface SpamReport {
|
|
|
174
174
|
interface SpamAnalysisOptions {
|
|
175
175
|
/** Value of the List-Unsubscribe header, if present */
|
|
176
176
|
listUnsubscribeHeader?: string;
|
|
177
|
+
/** Value of the List-Unsubscribe-Post header (RFC 8058 one-click unsubscribe) */
|
|
178
|
+
listUnsubscribePostHeader?: string;
|
|
177
179
|
/** Type of email — transactional emails are exempt from unsubscribe requirements */
|
|
178
180
|
emailType?: "marketing" | "transactional";
|
|
179
181
|
}
|
|
@@ -230,60 +232,69 @@ interface ImageReport {
|
|
|
230
232
|
issues: ImageIssue[];
|
|
231
233
|
images: ImageInfo[];
|
|
232
234
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
* Replaces the per-format error classes (ReactEmailCompileError,
|
|
238
|
-
* MjmlCompileError, MaizzleCompileError) with a single class that
|
|
239
|
-
* carries the source format and failure phase.
|
|
240
|
-
*/
|
|
241
|
-
declare class CompileError extends Error {
|
|
242
|
-
name: string;
|
|
243
|
-
readonly format: Exclude<InputFormat, "html">;
|
|
244
|
-
readonly phase: "validation" | "transpile" | "execution" | "render" | "compile";
|
|
245
|
-
constructor(message: string, format: CompileError["format"], phase: CompileError["phase"]);
|
|
235
|
+
interface InboxPreviewIssue {
|
|
236
|
+
rule: string;
|
|
237
|
+
severity: "error" | "warning" | "info";
|
|
238
|
+
message: string;
|
|
246
239
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
240
|
+
interface ClientTruncation {
|
|
241
|
+
client: string;
|
|
242
|
+
subjectLimit: number;
|
|
243
|
+
preheaderLimit: number;
|
|
244
|
+
truncatedSubject: string | null;
|
|
245
|
+
truncatedPreheader: string | null;
|
|
246
|
+
subjectTruncated: boolean;
|
|
247
|
+
preheaderTruncated: boolean;
|
|
248
|
+
}
|
|
249
|
+
interface InboxPreview {
|
|
250
|
+
subject: string | null;
|
|
251
|
+
preheader: string | null;
|
|
252
|
+
subjectLength: number;
|
|
253
|
+
preheaderLength: number;
|
|
254
|
+
truncation: ClientTruncation[];
|
|
255
|
+
issues: InboxPreviewIssue[];
|
|
256
|
+
}
|
|
257
|
+
interface SizeIssue {
|
|
258
|
+
rule: string;
|
|
259
|
+
severity: "error" | "warning" | "info";
|
|
260
|
+
message: string;
|
|
261
|
+
detail?: string;
|
|
262
|
+
}
|
|
263
|
+
interface SizeReport {
|
|
264
|
+
htmlBytes: number;
|
|
265
|
+
humanSize: string;
|
|
266
|
+
clipped: boolean;
|
|
267
|
+
issues: SizeIssue[];
|
|
268
|
+
}
|
|
269
|
+
interface TemplateIssue {
|
|
270
|
+
rule: string;
|
|
271
|
+
severity: "error" | "warning" | "info";
|
|
272
|
+
message: string;
|
|
273
|
+
variable: string;
|
|
274
|
+
location: "text" | "attribute";
|
|
275
|
+
}
|
|
276
|
+
interface TemplateReport {
|
|
277
|
+
unresolvedCount: number;
|
|
278
|
+
issues: TemplateIssue[];
|
|
279
|
+
}
|
|
280
|
+
interface DeliverabilityCheck {
|
|
281
|
+
name: "spf" | "dkim" | "dmarc" | "mx" | "bimi";
|
|
282
|
+
status: "pass" | "fail" | "warn" | "skip";
|
|
283
|
+
message: string;
|
|
284
|
+
detail?: string;
|
|
285
|
+
record?: string;
|
|
286
|
+
}
|
|
287
|
+
interface DeliverabilityReport {
|
|
288
|
+
domain: string;
|
|
289
|
+
checks: DeliverabilityCheck[];
|
|
290
|
+
score: number;
|
|
291
|
+
issues: DeliverabilityIssue[];
|
|
292
|
+
}
|
|
293
|
+
interface DeliverabilityIssue {
|
|
294
|
+
rule: string;
|
|
295
|
+
severity: "error" | "warning" | "info";
|
|
296
|
+
message: string;
|
|
297
|
+
detail?: string;
|
|
272
298
|
}
|
|
273
|
-
/**
|
|
274
|
-
* Compile a React Email JSX/TSX source string into an HTML email string.
|
|
275
|
-
*
|
|
276
|
-
* Pipeline:
|
|
277
|
-
* 1. Validate input (size, basic checks)
|
|
278
|
-
* 2. Transpile JSX/TSX → CommonJS JS using sucrase
|
|
279
|
-
* 3. Execute inside a sandbox (configurable strategy)
|
|
280
|
-
* 4. Render the exported component to a full HTML email string
|
|
281
|
-
*
|
|
282
|
-
* Requires peer dependencies: sucrase, react, @react-email/components,
|
|
283
|
-
* @react-email/render. Additionally:
|
|
284
|
-
* - sandbox "isolated-vm" requires `isolated-vm`
|
|
285
|
-
* - sandbox "quickjs" requires `quickjs-emscripten`
|
|
286
|
-
*/
|
|
287
|
-
declare function compileReactEmail(source: string, options?: CompileReactEmailOptions): Promise<string>;
|
|
288
299
|
|
|
289
|
-
export { type AiProvider as A, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, type ImageReport as I, type LinkReport as L, type PreviewResult as P, type
|
|
300
|
+
export { type AiProvider as A, type TokenEstimateWithWarnings as B, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, estimateAiFixTokens as G, generateFixPrompt as H, type ImageReport as I, heuristicTokenCount as J, type LinkReport as L, type PreviewResult as P, type SupportLevel as S, type TransformResult as T, type CodeFix as a, type ExportPromptOptions as b, type AiFixResult as c, type SpamAnalysisOptions as d, type SpamReport as e, type AccessibilityReport as f, type InboxPreview as g, type SizeReport as h, type TemplateReport as i, type DeliverabilityReport as j, type AccessibilityIssue as k, type ClientTruncation as l, type DeliverabilityCheck as m, type DeliverabilityIssue as n, type EstimateOptions as o, type ExportScope as p, type FixType as q, type ImageInfo as r, type ImageIssue as s, type InboxPreviewIssue as t, type InputFormat as u, type LinkIssue as v, type SizeIssue as w, type SpamIssue as x, type TemplateIssue as y, type TokenEstimate as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emailens/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Email compatibility engine — transforms CSS per email client, scores compatibility, simulates dark mode, suggests fixes, and runs spam, accessibility, link, and image quality analysis.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"types": "./dist/compile/index.d.ts",
|
|
14
14
|
"import": "./dist/compile/index.js",
|
|
15
15
|
"require": "./dist/compile/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"./server": {
|
|
18
|
+
"types": "./dist/server.d.ts",
|
|
19
|
+
"import": "./dist/server.js",
|
|
20
|
+
"require": "./dist/server.cjs"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"types": "./dist/index.d.ts",
|
|
@@ -28,6 +33,7 @@
|
|
|
28
33
|
"build": "tsup",
|
|
29
34
|
"dev": "tsup --watch",
|
|
30
35
|
"typecheck": "tsc --noEmit",
|
|
36
|
+
"sync:caniemail": "bun run scripts/sync-caniemail.ts",
|
|
31
37
|
"test": "bun test",
|
|
32
38
|
"prepublishOnly": "bun run build"
|
|
33
39
|
},
|
|
@@ -36,14 +42,14 @@
|
|
|
36
42
|
"css-tree": "^3.1.0"
|
|
37
43
|
},
|
|
38
44
|
"peerDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
45
|
+
"@maizzle/framework": ">=5.0.0",
|
|
41
46
|
"@react-email/components": ">=0.0.36",
|
|
42
47
|
"@react-email/render": ">=1.0.0",
|
|
43
|
-
"mjml": ">=4.0.0",
|
|
44
|
-
"@maizzle/framework": ">=5.0.0",
|
|
45
48
|
"isolated-vm": ">=5.0.0",
|
|
46
|
-
"
|
|
49
|
+
"mjml": ">=4.0.0",
|
|
50
|
+
"quickjs-emscripten": ">=0.29.0",
|
|
51
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
52
|
+
"sucrase": "^3.35.0"
|
|
47
53
|
},
|
|
48
54
|
"peerDependenciesMeta": {
|
|
49
55
|
"sucrase": {
|
|
@@ -75,6 +81,7 @@
|
|
|
75
81
|
"@maizzle/framework": "^5.0.0",
|
|
76
82
|
"@react-email/components": "^0.0.36",
|
|
77
83
|
"@react-email/render": "^1.0.6",
|
|
84
|
+
"@types/bun": "^1.3.9",
|
|
78
85
|
"@types/css-tree": "^2.3.11",
|
|
79
86
|
"@types/mjml": "^4.7.4",
|
|
80
87
|
"@types/node": "^25.3.0",
|
package/dist/maizzle-Y2CLJ7GB.js
DELETED
package/dist/mjml-D7IOYXXK.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|