@emailens/engine 0.9.4 → 0.9.6

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.
@@ -1,4 +1,4 @@
1
- import { u as InputFormat } from './types-Duj14jTL.cjs';
1
+ import { u as InputFormat } from './types-WvVf2OXX.cjs';
2
2
 
3
3
  /**
4
4
  * Unified error class for all email compilation failures.
@@ -1,4 +1,4 @@
1
- import { u as InputFormat } from './types-Duj14jTL.js';
1
+ import { u as InputFormat } from './types-WvVf2OXX.js';
2
2
 
3
3
  /**
4
4
  * Unified error class for all email compilation failures.
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'node:dns';
2
- import { j as DeliverabilityReport } from './types-Duj14jTL.cjs';
2
+ import { j as DeliverabilityReport } from './types-WvVf2OXX.cjs';
3
3
 
4
4
  /**
5
5
  * DNS-based email deliverability checker.
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'node:dns';
2
- import { j as DeliverabilityReport } from './types-Duj14jTL.js';
2
+ import { j as DeliverabilityReport } from './types-WvVf2OXX.js';
3
3
 
4
4
  /**
5
5
  * DNS-based email deliverability checker.
@@ -11,6 +11,8 @@ interface ExportPromptOptions {
11
11
  scope: ExportScope;
12
12
  selectedClientId?: string;
13
13
  format?: "html" | "jsx" | "mjml" | "maizzle";
14
+ /** Optional user goal for the fix (e.g. "keep the gradient header"). */
15
+ intent?: string;
14
16
  }
15
17
  declare function generateFixPrompt(options: ExportPromptOptions): string;
16
18
 
@@ -104,6 +106,13 @@ interface EmailClient {
104
106
  icon: string;
105
107
  deprecated?: string;
106
108
  }
109
+ type Severity = "error" | "warning" | "info";
110
+ /** Shared shape for every analyzer's issue objects. */
111
+ interface BaseIssue {
112
+ rule: string;
113
+ severity: Severity;
114
+ message: string;
115
+ }
107
116
  interface CodeFix {
108
117
  before: string;
109
118
  after: string;
@@ -112,7 +121,7 @@ interface CodeFix {
112
121
  }
113
122
  type FixType = "css" | "structural";
114
123
  interface CSSWarning {
115
- severity: "error" | "warning" | "info";
124
+ severity: Severity;
116
125
  client: string;
117
126
  property: string;
118
127
  message: string;
@@ -161,10 +170,7 @@ interface DiffResult {
161
170
  introduced: CSSWarning[];
162
171
  unchanged: CSSWarning[];
163
172
  }
164
- interface SpamIssue {
165
- rule: string;
166
- severity: "error" | "warning" | "info";
167
- message: string;
173
+ interface SpamIssue extends BaseIssue {
168
174
  detail?: string;
169
175
  }
170
176
  interface SpamReport {
@@ -180,10 +186,7 @@ interface SpamAnalysisOptions {
180
186
  /** Type of email — transactional emails are exempt from unsubscribe requirements */
181
187
  emailType?: "marketing" | "transactional";
182
188
  }
183
- interface LinkIssue {
184
- severity: "error" | "warning" | "info";
185
- rule: string;
186
- message: string;
189
+ interface LinkIssue extends BaseIssue {
187
190
  href?: string;
188
191
  text?: string;
189
192
  }
@@ -201,10 +204,7 @@ interface LinkReport {
201
204
  other: number;
202
205
  };
203
206
  }
204
- interface AccessibilityIssue {
205
- severity: "error" | "warning" | "info";
206
- rule: string;
207
- message: string;
207
+ interface AccessibilityIssue extends BaseIssue {
208
208
  element?: string;
209
209
  details?: string;
210
210
  }
@@ -212,10 +212,7 @@ interface AccessibilityReport {
212
212
  score: number;
213
213
  issues: AccessibilityIssue[];
214
214
  }
215
- interface ImageIssue {
216
- rule: string;
217
- severity: "error" | "warning" | "info";
218
- message: string;
215
+ interface ImageIssue extends BaseIssue {
219
216
  src?: string;
220
217
  }
221
218
  interface ImageInfo {
@@ -233,10 +230,7 @@ interface ImageReport {
233
230
  issues: ImageIssue[];
234
231
  images: ImageInfo[];
235
232
  }
236
- interface InboxPreviewIssue {
237
- rule: string;
238
- severity: "error" | "warning" | "info";
239
- message: string;
233
+ interface InboxPreviewIssue extends BaseIssue {
240
234
  }
241
235
  interface ClientTruncation {
242
236
  client: string;
@@ -255,10 +249,7 @@ interface InboxPreview {
255
249
  truncation: ClientTruncation[];
256
250
  issues: InboxPreviewIssue[];
257
251
  }
258
- interface SizeIssue {
259
- rule: string;
260
- severity: "error" | "warning" | "info";
261
- message: string;
252
+ interface SizeIssue extends BaseIssue {
262
253
  detail?: string;
263
254
  }
264
255
  interface SizeReport {
@@ -267,10 +258,7 @@ interface SizeReport {
267
258
  clipped: boolean;
268
259
  issues: SizeIssue[];
269
260
  }
270
- interface TemplateIssue {
271
- rule: string;
272
- severity: "error" | "warning" | "info";
273
- message: string;
261
+ interface TemplateIssue extends BaseIssue {
274
262
  variable: string;
275
263
  location: "text" | "attribute";
276
264
  }
@@ -291,11 +279,8 @@ interface DeliverabilityReport {
291
279
  score: number;
292
280
  issues: DeliverabilityIssue[];
293
281
  }
294
- interface DeliverabilityIssue {
295
- rule: string;
296
- severity: "error" | "warning" | "info";
297
- message: string;
282
+ interface DeliverabilityIssue extends BaseIssue {
298
283
  detail?: string;
299
284
  }
300
285
 
301
- 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 };
286
+ export { type AiProvider as A, type BaseIssue as B, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, type TokenEstimate as G, type TokenEstimateWithWarnings as H, type ImageReport as I, estimateAiFixTokens as J, generateFixPrompt as K, type LinkReport as L, heuristicTokenCount as M, 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 Severity as w, type SizeIssue as x, type SpamIssue as y, type TemplateIssue as z };
@@ -11,6 +11,8 @@ interface ExportPromptOptions {
11
11
  scope: ExportScope;
12
12
  selectedClientId?: string;
13
13
  format?: "html" | "jsx" | "mjml" | "maizzle";
14
+ /** Optional user goal for the fix (e.g. "keep the gradient header"). */
15
+ intent?: string;
14
16
  }
15
17
  declare function generateFixPrompt(options: ExportPromptOptions): string;
16
18
 
@@ -104,6 +106,13 @@ interface EmailClient {
104
106
  icon: string;
105
107
  deprecated?: string;
106
108
  }
109
+ type Severity = "error" | "warning" | "info";
110
+ /** Shared shape for every analyzer's issue objects. */
111
+ interface BaseIssue {
112
+ rule: string;
113
+ severity: Severity;
114
+ message: string;
115
+ }
107
116
  interface CodeFix {
108
117
  before: string;
109
118
  after: string;
@@ -112,7 +121,7 @@ interface CodeFix {
112
121
  }
113
122
  type FixType = "css" | "structural";
114
123
  interface CSSWarning {
115
- severity: "error" | "warning" | "info";
124
+ severity: Severity;
116
125
  client: string;
117
126
  property: string;
118
127
  message: string;
@@ -161,10 +170,7 @@ interface DiffResult {
161
170
  introduced: CSSWarning[];
162
171
  unchanged: CSSWarning[];
163
172
  }
164
- interface SpamIssue {
165
- rule: string;
166
- severity: "error" | "warning" | "info";
167
- message: string;
173
+ interface SpamIssue extends BaseIssue {
168
174
  detail?: string;
169
175
  }
170
176
  interface SpamReport {
@@ -180,10 +186,7 @@ interface SpamAnalysisOptions {
180
186
  /** Type of email — transactional emails are exempt from unsubscribe requirements */
181
187
  emailType?: "marketing" | "transactional";
182
188
  }
183
- interface LinkIssue {
184
- severity: "error" | "warning" | "info";
185
- rule: string;
186
- message: string;
189
+ interface LinkIssue extends BaseIssue {
187
190
  href?: string;
188
191
  text?: string;
189
192
  }
@@ -201,10 +204,7 @@ interface LinkReport {
201
204
  other: number;
202
205
  };
203
206
  }
204
- interface AccessibilityIssue {
205
- severity: "error" | "warning" | "info";
206
- rule: string;
207
- message: string;
207
+ interface AccessibilityIssue extends BaseIssue {
208
208
  element?: string;
209
209
  details?: string;
210
210
  }
@@ -212,10 +212,7 @@ interface AccessibilityReport {
212
212
  score: number;
213
213
  issues: AccessibilityIssue[];
214
214
  }
215
- interface ImageIssue {
216
- rule: string;
217
- severity: "error" | "warning" | "info";
218
- message: string;
215
+ interface ImageIssue extends BaseIssue {
219
216
  src?: string;
220
217
  }
221
218
  interface ImageInfo {
@@ -233,10 +230,7 @@ interface ImageReport {
233
230
  issues: ImageIssue[];
234
231
  images: ImageInfo[];
235
232
  }
236
- interface InboxPreviewIssue {
237
- rule: string;
238
- severity: "error" | "warning" | "info";
239
- message: string;
233
+ interface InboxPreviewIssue extends BaseIssue {
240
234
  }
241
235
  interface ClientTruncation {
242
236
  client: string;
@@ -255,10 +249,7 @@ interface InboxPreview {
255
249
  truncation: ClientTruncation[];
256
250
  issues: InboxPreviewIssue[];
257
251
  }
258
- interface SizeIssue {
259
- rule: string;
260
- severity: "error" | "warning" | "info";
261
- message: string;
252
+ interface SizeIssue extends BaseIssue {
262
253
  detail?: string;
263
254
  }
264
255
  interface SizeReport {
@@ -267,10 +258,7 @@ interface SizeReport {
267
258
  clipped: boolean;
268
259
  issues: SizeIssue[];
269
260
  }
270
- interface TemplateIssue {
271
- rule: string;
272
- severity: "error" | "warning" | "info";
273
- message: string;
261
+ interface TemplateIssue extends BaseIssue {
274
262
  variable: string;
275
263
  location: "text" | "attribute";
276
264
  }
@@ -291,11 +279,8 @@ interface DeliverabilityReport {
291
279
  score: number;
292
280
  issues: DeliverabilityIssue[];
293
281
  }
294
- interface DeliverabilityIssue {
295
- rule: string;
296
- severity: "error" | "warning" | "info";
297
- message: string;
282
+ interface DeliverabilityIssue extends BaseIssue {
298
283
  detail?: string;
299
284
  }
300
285
 
301
- 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 };
286
+ export { type AiProvider as A, type BaseIssue as B, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, type TokenEstimate as G, type TokenEstimateWithWarnings as H, type ImageReport as I, estimateAiFixTokens as J, generateFixPrompt as K, type LinkReport as L, heuristicTokenCount as M, 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 Severity as w, type SizeIssue as x, type SpamIssue as y, type TemplateIssue as z };
package/package.json CHANGED
@@ -1,121 +1,121 @@
1
- {
2
- "name": "@emailens/engine",
3
- "version": "0.9.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
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.js",
10
- "require": "./dist/index.cjs"
11
- },
12
- "./compile": {
13
- "types": "./dist/compile/index.d.ts",
14
- "import": "./dist/compile/index.js",
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"
21
- }
22
- },
23
- "types": "./dist/index.d.ts",
24
- "sideEffects": false,
25
- "engines": {
26
- "node": ">=18"
27
- },
28
- "files": [
29
- "dist",
30
- "LICENSE"
31
- ],
32
- "scripts": {
33
- "build": "tsup",
34
- "dev": "tsup --watch",
35
- "typecheck": "tsc --noEmit",
36
- "sync:caniemail": "bun run scripts/sync-caniemail.ts",
37
- "check:freshness": "bun run scripts/check-data-freshness.ts",
38
- "test": "bun test",
39
- "prepublishOnly": "bun run build"
40
- },
41
- "dependencies": {
42
- "cheerio": "^1.2.0",
43
- "css-tree": "^3.1.0"
44
- },
45
- "peerDependencies": {
46
- "@maizzle/framework": ">=5.0.0",
47
- "@react-email/components": ">=0.0.36",
48
- "@react-email/render": ">=1.0.0",
49
- "isolated-vm": ">=5.0.0",
50
- "mjml": ">=4.0.0",
51
- "quickjs-emscripten": ">=0.29.0",
52
- "react": "^18.0.0 || ^19.0.0",
53
- "sucrase": "^3.35.0"
54
- },
55
- "peerDependenciesMeta": {
56
- "sucrase": {
57
- "optional": true
58
- },
59
- "react": {
60
- "optional": true
61
- },
62
- "@react-email/components": {
63
- "optional": true
64
- },
65
- "@react-email/render": {
66
- "optional": true
67
- },
68
- "mjml": {
69
- "optional": true
70
- },
71
- "@maizzle/framework": {
72
- "optional": true
73
- },
74
- "isolated-vm": {
75
- "optional": true
76
- },
77
- "quickjs-emscripten": {
78
- "optional": true
79
- }
80
- },
81
- "devDependencies": {
82
- "@maizzle/framework": "^5.0.0",
83
- "@react-email/components": "^0.0.36",
84
- "@react-email/render": "^1.0.6",
85
- "@types/bun": "^1.3.9",
86
- "@types/css-tree": "^2.3.11",
87
- "@types/mjml": "^4.7.4",
88
- "@types/node": "^25.3.0",
89
- "@types/react": "^19.2.14",
90
- "bun-types": "^1.3.9",
91
- "mjml": "^4.15.0",
92
- "react": "^19.0.0",
93
- "sucrase": "^3.35.0",
94
- "tsup": "^8.4.0",
95
- "typescript": "^5.9.3"
96
- },
97
- "keywords": [
98
- "email",
99
- "html-email",
100
- "css",
101
- "compatibility",
102
- "gmail",
103
- "outlook",
104
- "apple-mail",
105
- "dark-mode",
106
- "email-testing",
107
- "spam-scoring",
108
- "accessibility",
109
- "link-validation",
110
- "image-analysis"
111
- ],
112
- "license": "MIT",
113
- "repository": {
114
- "type": "git",
115
- "url": "git+https://github.com/emailens/engine.git"
116
- },
117
- "homepage": "https://github.com/emailens/engine#readme",
118
- "bugs": {
119
- "url": "https://github.com/emailens/engine/issues"
120
- }
121
- }
1
+ {
2
+ "name": "@emailens/engine",
3
+ "version": "0.9.6",
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
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js",
10
+ "require": "./dist/index.cjs"
11
+ },
12
+ "./compile": {
13
+ "types": "./dist/compile/index.d.ts",
14
+ "import": "./dist/compile/index.js",
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"
21
+ }
22
+ },
23
+ "types": "./dist/index.d.ts",
24
+ "sideEffects": false,
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "LICENSE"
31
+ ],
32
+ "scripts": {
33
+ "build": "tsup",
34
+ "dev": "tsup --watch",
35
+ "typecheck": "tsc --noEmit",
36
+ "sync:caniemail": "bun run scripts/sync-caniemail.ts",
37
+ "check:freshness": "bun run scripts/check-data-freshness.ts",
38
+ "test": "bun test",
39
+ "prepublishOnly": "bun run build"
40
+ },
41
+ "dependencies": {
42
+ "cheerio": "^1.2.0",
43
+ "css-tree": "^3.1.0"
44
+ },
45
+ "peerDependencies": {
46
+ "@maizzle/framework": ">=5.0.0",
47
+ "@react-email/components": ">=0.0.36",
48
+ "@react-email/render": ">=1.0.0",
49
+ "isolated-vm": ">=5.0.0",
50
+ "mjml": ">=4.0.0",
51
+ "quickjs-emscripten": ">=0.29.0",
52
+ "react": "^18.0.0 || ^19.0.0",
53
+ "sucrase": "^3.35.0"
54
+ },
55
+ "peerDependenciesMeta": {
56
+ "sucrase": {
57
+ "optional": true
58
+ },
59
+ "react": {
60
+ "optional": true
61
+ },
62
+ "@react-email/components": {
63
+ "optional": true
64
+ },
65
+ "@react-email/render": {
66
+ "optional": true
67
+ },
68
+ "mjml": {
69
+ "optional": true
70
+ },
71
+ "@maizzle/framework": {
72
+ "optional": true
73
+ },
74
+ "isolated-vm": {
75
+ "optional": true
76
+ },
77
+ "quickjs-emscripten": {
78
+ "optional": true
79
+ }
80
+ },
81
+ "devDependencies": {
82
+ "@maizzle/framework": "^5.0.0",
83
+ "@react-email/components": "^0.0.36",
84
+ "@react-email/render": "^1.0.6",
85
+ "@types/bun": "^1.3.9",
86
+ "@types/css-tree": "^2.3.11",
87
+ "@types/mjml": "^4.7.4",
88
+ "@types/node": "^25.3.0",
89
+ "@types/react": "^19.2.14",
90
+ "bun-types": "^1.3.9",
91
+ "mjml": "^4.15.0",
92
+ "react": "^19.0.0",
93
+ "sucrase": "^3.35.0",
94
+ "tsup": "^8.4.0",
95
+ "typescript": "^5.9.3"
96
+ },
97
+ "keywords": [
98
+ "email",
99
+ "html-email",
100
+ "css",
101
+ "compatibility",
102
+ "gmail",
103
+ "outlook",
104
+ "apple-mail",
105
+ "dark-mode",
106
+ "email-testing",
107
+ "spam-scoring",
108
+ "accessibility",
109
+ "link-validation",
110
+ "image-analysis"
111
+ ],
112
+ "license": "MIT",
113
+ "repository": {
114
+ "type": "git",
115
+ "url": "git+https://github.com/emailens/engine.git"
116
+ },
117
+ "homepage": "https://github.com/emailens/engine#readme",
118
+ "bugs": {
119
+ "url": "https://github.com/emailens/engine/issues"
120
+ }
121
+ }