@emailens/engine 0.9.1 → 0.9.3

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
@@ -2,8 +2,9 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@emailens/engine)](https://www.npmjs.com/package/@emailens/engine)
4
4
  [![license](https://img.shields.io/npm/l/@emailens/engine)](./LICENSE)
5
- [![tests](https://img.shields.io/badge/tests-574%20passing-brightgreen)]()
5
+ [![tests](https://img.shields.io/badge/tests-653%20passing-brightgreen)]()
6
6
  [![node](https://img.shields.io/node/v/@emailens/engine)](https://nodejs.org/)
7
+ [![MCP](https://img.shields.io/badge/MCP-Server-blue)](https://github.com/emailens/mcp)
7
8
 
8
9
  **Your email looks perfect in Apple Mail. Gmail strips half the CSS. Outlook renders it in Word.**
9
10
 
@@ -119,6 +120,21 @@ Three entry points:
119
120
  | AI auto-fix | Yes | No | No | No |
120
121
  | Open source | MIT | No | No | Yes (data) |
121
122
 
123
+ ### vs other email libraries
124
+
125
+ `@emailens/engine` sits in the **QA / lint / scoring** slot — it analyzes finished HTML. It's complementary to (not a replacement for) composition and inlining libraries.
126
+
127
+ | | @emailens/engine | [juice](https://github.com/automattic/juice) | [email-comb](https://github.com/codsen/email-comb) | [mjml](https://mjml.io/) | [maizzle](https://maizzle.com/) |
128
+ |---|---|---|---|---|---|
129
+ | Purpose | QA / lint / score | CSS inliner | Unused CSS pruner | MJML → HTML | Tailwind → HTML |
130
+ | Per-client compatibility scoring | Yes | No | No | No | No |
131
+ | Spam / a11y / link / image analysis | Yes | No | No | No | No |
132
+ | AI-powered fix generation | Yes | No | No | No | No |
133
+ | Compose emails | Reads only | Reads only | Reads only | Yes | Yes |
134
+ | CSS inlining | No (pair with juice) | Yes | No | Yes (built-in) | Yes (built-in) |
135
+
136
+ A typical pipeline: write in **mjml** or **maizzle** → inline with **juice** → audit with **@emailens/engine** → ship.
137
+
122
138
  ## Supported Email Clients
123
139
 
124
140
  | Client | ID | Category | Engine | Dark Mode |
@@ -129,6 +145,8 @@ Three entry points:
129
145
  | Outlook 365 | `outlook-web` | Webmail | Outlook Web | Yes |
130
146
  | Outlook (New) | `outlook-windows` | Desktop | Outlook Web | Yes |
131
147
  | Outlook Classic | `outlook-windows-legacy` | Desktop | Microsoft Word | Yes |
148
+ | Outlook iOS | `outlook-ios` | Mobile | Outlook Mobile | Yes |
149
+ | Outlook Android | `outlook-android` | Mobile | Outlook Mobile | Yes |
132
150
  | Apple Mail | `apple-mail-macos` | Desktop | WebKit | Yes |
133
151
  | Apple Mail iOS | `apple-mail-ios` | Mobile | WebKit | Yes |
134
152
  | Yahoo Mail | `yahoo-mail` | Webmail | Yahoo | Yes |
@@ -154,19 +172,20 @@ Covers:
154
172
 
155
173
  ## Roadmap
156
174
 
157
- - [ ] Outlook VML auto-generation
158
- - [ ] GitHub Actions integration (score thresholds in CI)
159
- - [x] Automated caniemail.com data sync
160
- - [ ] Real-time rendering previews
161
- - [ ] MJML/Maizzle source-level linting
162
- - [ ] Plugin system for custom analyzers
175
+ See [ROADMAP.md](./ROADMAP.md) for the full picture (shipped items + items under consideration with rationale).
176
+
177
+ **Shipped:** automated caniemail.com data sync · GitHub Actions integration via `@emailens/cli` and the [Marketplace Action](https://github.com/marketplace/actions/emailens-email-preview-check) · AI-powered fix generation · compile module for JSX/MJML/Maizzle.
178
+
179
+ **Considering:** Outlook VML auto-generation · plugin system for custom analyzers · MJML/Maizzle source-level linting · ESLint plugin · spam corpus tuning · dark-mode accuracy tests.
180
+
181
+ Concrete bugs go in [Issues](https://github.com/emailens/engine/issues). Open-ended ideas live in the roadmap.
163
182
 
164
183
  ## Contributing
165
184
 
166
185
  Contributions are welcome! See **[CONTRIBUTING.md](./CONTRIBUTING.md)** for architecture overview, setup instructions, and PR guidelines.
167
186
 
168
187
  ```bash
169
- bun install && bun test # 580 tests
188
+ bun install && bun test # 653 tests
170
189
  ```
171
190
 
172
191
  ### Data Maintenance
package/dist/index.cjs CHANGED
@@ -8872,8 +8872,9 @@ var PREHEADER_ACCESSORY_PATTERNS = [
8872
8872
  /color\s*:\s*transparent/,
8873
8873
  /line-height\s*:\s*0/
8874
8874
  ];
8875
+ var INVISIBLE_CHARS = /[​-‏⁠᠎­]/g;
8875
8876
  function isLikelyPreheader(style, text) {
8876
- if (text.length > 200) return false;
8877
+ if (text.replace(INVISIBLE_CHARS, "").trim().length > 200) return false;
8877
8878
  return PREHEADER_ACCESSORY_PATTERNS.some((p) => p.test(style));
8878
8879
  }
8879
8880
  function checkHiddenText($) {
@@ -10189,7 +10190,11 @@ function toPlainText(html) {
10189
10190
  return;
10190
10191
  }
10191
10192
  const isBlock = BLOCK_TAGS.has(tag);
10192
- if (isBlock) flushLine();
10193
+ if (isBlock) {
10194
+ flushLine();
10195
+ } else if (currentLine && !currentLine.endsWith(" ")) {
10196
+ currentLine += " ";
10197
+ }
10193
10198
  if (tag === "li") {
10194
10199
  currentLine = "- ";
10195
10200
  }