domma-cms 1.27.2 → 1.27.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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.27.3] - 2026-10-31
4
+
5
+ - SEO: the audit no longer keeps every page's HTML in memory while it runs. The facts it reads from each page were slices of the page, so a large site could run out of memory mid-audit and restart every few minutes (domma-cms.com did). SEO Pro's Monitor gets the same copy through `scanHtml`.
6
+
3
7
  ## [1.27.2] - 2026-10-31
4
8
 
5
9
  - Page Editor: move External Images into a collapsed section under Settings > Details, freeing space above the editing area while keeping image scanning and domain permissions available.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.27.2",
3
+ "version": "1.27.3",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -13,6 +13,20 @@ export const AUDIT_UA = 'DommaSEO/1 (audit)';
13
13
  const CONCURRENCY = 3;
14
14
  const MAX_URLS = 1000;
15
15
 
16
+ /**
17
+ * scanHtml, with its strings copied out of the page. V8 keeps a substring as
18
+ * a slice of the string it came from, so a title or a link held after the
19
+ * fetch keeps that page's whole HTML alive (~400KB with the site's CSS
20
+ * inlined). Held for every page of an audit, that ran domma-cms.com out of
21
+ * heap on 2026-10-31.
22
+ *
23
+ * @param {string} html
24
+ * @returns {object} what scanHtml returns
25
+ */
26
+ export function scanDetached(html) {
27
+ return structuredClone(scanHtml(html));
28
+ }
29
+
16
30
  /**
17
31
  * Fetch one page of this site, in-process.
18
32
  *
@@ -55,7 +69,7 @@ export async function auditOne(fastify, entry, {origin, focus = '', limits = {}}
55
69
  row.error = `Not a web page (${r.type || 'no type'}).`;
56
70
  return row;
57
71
  }
58
- const facts = scanHtml(r.html);
72
+ const facts = scanDetached(r.html);
59
73
  const judged = analyse(facts, {urlPath: entry.urlPath, focus, limits, origin});
60
74
  Object.assign(row, {
61
75
  title: facts.title, description: facts.description || '', canonical: facts.canonical,
@@ -26,7 +26,7 @@ import fs from 'node:fs';
26
26
  import path from 'node:path';
27
27
  import fp from 'fastify-plugin';
28
28
  import {createStore} from './store.js';
29
- import {auditAll, auditOne, AUDIT_UA, fetchLocal, hostOf} from './audit.js';
29
+ import {auditAll, auditOne, AUDIT_UA, fetchLocal, hostOf, scanDetached} from './audit.js';
30
30
  import {seoRegistry} from './registry.js';
31
31
  import {analyse, scanHtml, siteIssues} from '../../../admin/js/lib/seo-analyse.js';
32
32
  import {chains, checkRule, matchRedirect, MAX_RULES, normalisePath, onMoved} from '../../../admin/js/lib/seo-redirects.js';
@@ -332,7 +332,8 @@ async function seo(fastify, {enabled = true, getBaseUrl = null, rolesService = n
332
332
  listEntries: (origin) => sitemap.listSitemapEntries(origin, {log}),
333
333
  auditList,
334
334
  fetchPage: (urlPath, origin) => fetchLocal(fastify, urlPath, hostOf(origin)),
335
- scanHtml, analyse,
335
+ // Detached: SEO Pro's Monitor holds every page's facts until its crawl ends.
336
+ scanHtml: scanDetached, analyse,
336
337
  audit: {latest: () => store.audit(), summary: () => summary(), run: (origin) => runAudit(origin)},
337
338
  redirects: {list: () => store.rulesWithHits(), match: (p) => matchRedirect(store.rules(), p), add: (input) => addRule(input)},
338
339
  auditUserAgent: AUDIT_UA