@postalsys/email-text-tools 2.6.2 → 2.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.6.3](https://github.com/postalsys/email-text-tools/compare/v2.6.2...v2.6.3) (2026-11-04)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * ship jsdom 29 as a CommonJS bundle so parser fixes reach the sanitizer ([c6b5328](https://github.com/postalsys/email-text-tools/commit/c6b5328dc3c5a8af81cd232e5204e163dbc5ea5e))
9
+
3
10
  ## [2.6.2](https://github.com/postalsys/email-text-tools/compare/v2.6.1...v2.6.2) (2026-11-04)
4
11
 
5
12
 
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // jsdom, loaded from the CommonJS bundle scripts/bundle-jsdom.js builds into dist/vendor/jsdom.cjs.
3
+ // jsdom pulls in ES module only packages (parse5 among them), which the CommonJS build must not
4
+ // require(), so the package itself is a devDependency and only its bundle ships. This file compiles
5
+ // to jsdom.cjs in dist/cjs/lib and dist/esm/lib alike, both two levels below dist/vendor.
6
+ //
7
+ // Not part of commonjs.cts on purpose: that module is loaded eagerly (text-to-html reads TLDS from
8
+ // it), and jsdom must only load when mimeHtml is first used.
9
+ //
10
+ // The literal require() path is what @yao-pkg/pkg follows to put the bundle into a binary.
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.JSDOM = void 0;
13
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
14
+ const jsdom = require('../../vendor/jsdom.cjs');
15
+ exports.JSDOM = jsdom.JSDOM;
@@ -0,0 +1,2 @@
1
+ import type * as Jsdom from 'jsdom';
2
+ export declare const JSDOM: typeof Jsdom.JSDOM;
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const dompurify_1 = __importDefault(require("dompurify"));
7
- const jsdom_1 = require("jsdom");
8
7
  // Pinned to juice 11.x: juice 12+ is pure ESM (requires Node >=22.12) and breaks pkg builds.
9
8
  const juice_1 = __importDefault(require("juice"));
10
9
  const he_1 = __importDefault(require("he"));
@@ -13,6 +12,7 @@ const worker_pool_js_1 = __importDefault(require("./worker-pool.js"));
13
12
  const html_guard_js_1 = require("./html-guard.js");
14
13
  const inline_style_js_1 = require("./inline-style.js");
15
14
  const commonjs_cjs_1 = require("./commonjs.cjs");
15
+ const jsdom_cjs_1 = require("./jsdom.cjs");
16
16
  const text_to_html_js_1 = __importDefault(require("./text-to-html.js"));
17
17
  const FORBID_TAGS = [
18
18
  'title',
@@ -102,7 +102,7 @@ const STYLE_TAG = /<style[\s/>]/i;
102
102
  const BODY_STYLES_RULE = styleRule(['width', 'min-width', 'max-width', 'height', 'min-height', 'max-height'], /width|height/i);
103
103
  // One sanitizer for the module. Every sanitize() call passes its full config, so calls do not
104
104
  // leak settings into each other.
105
- const DOMPurify = (0, dompurify_1.default)(new jsdom_1.JSDOM('').window);
105
+ const DOMPurify = (0, dompurify_1.default)(new jsdom_cjs_1.JSDOM('').window);
106
106
  // Global worker pool instance (lazy initialization)
107
107
  let globalWorkerPool = null;
108
108
  function getWorkerPool(options = {}) {
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // jsdom, loaded from the CommonJS bundle scripts/bundle-jsdom.js builds into dist/vendor/jsdom.cjs.
3
+ // jsdom pulls in ES module only packages (parse5 among them), which the CommonJS build must not
4
+ // require(), so the package itself is a devDependency and only its bundle ships. This file compiles
5
+ // to jsdom.cjs in dist/cjs/lib and dist/esm/lib alike, both two levels below dist/vendor.
6
+ //
7
+ // Not part of commonjs.cts on purpose: that module is loaded eagerly (text-to-html reads TLDS from
8
+ // it), and jsdom must only load when mimeHtml is first used.
9
+ //
10
+ // The literal require() path is what @yao-pkg/pkg follows to put the bundle into a binary.
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.JSDOM = void 0;
13
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
14
+ const jsdom = require('../../vendor/jsdom.cjs');
15
+ exports.JSDOM = jsdom.JSDOM;
@@ -0,0 +1,2 @@
1
+ import type * as Jsdom from 'jsdom';
2
+ export declare const JSDOM: typeof Jsdom.JSDOM;
@@ -1,5 +1,4 @@
1
1
  import createDOMPurify from 'dompurify';
2
- import { JSDOM } from 'jsdom';
3
2
  // Pinned to juice 11.x: juice 12+ is pure ESM (requires Node >=22.12) and breaks pkg builds.
4
3
  import juice from 'juice';
5
4
  import he from 'he';
@@ -8,6 +7,7 @@ import WorkerPool from './worker-pool.js';
8
7
  import { MAX_NESTING_DEPTH, exceedsNestingDepth, fallbackText } from './html-guard.js';
9
8
  import { INLINE_STYLE_BLOCK } from './inline-style.js';
10
9
  import { JUICE_WORKER_PATH } from './commonjs.cjs';
10
+ import { JSDOM } from './jsdom.cjs';
11
11
  import textToHtml from './text-to-html.js';
12
12
  const FORBID_TAGS = [
13
13
  'title',