@emailens/cli 0.13.19 → 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
@@ -117,6 +117,71 @@ rule severities and skips; `--skip` on the command line wins.
117
117
  Maizzle HTML needs `@maizzle/framework@5` installed beside the CLI. A `.vue`
118
118
  file needs `@maizzle/framework@6`. One install is one major.
119
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
+
120
185
  ### Other commands
121
186
 
122
187
  ```bash
@@ -125,6 +190,7 @@ emailens analyze email.html --clients gmail-web,outlook-windows --json
125
190
  emailens audit email.html # compatibility plus every other check
126
191
  emailens preview email.html --dark-mode # transforms, analysis, dark mode simulation
127
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)
128
194
  emailens export email.html -o ./report # self-contained HTML report (--json for JSON)
129
195
  emailens fix email.html -o fixed.html # AI fix, needs ANTHROPIC_API_KEY (--estimate: tokens only)
130
196
  emailens clients # the 21 clients
@@ -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,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-OXUZ6PJX.js
8
8
  var MAX_SOURCE_SIZE = 256e3;