domma-cms 1.27.1 → 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,13 @@
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
+
7
+ ## [1.27.2] - 2026-10-31
8
+
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.
10
+
3
11
  ## [1.27.1] - 2026-10-31
4
12
 
5
13
  - Forms: the site's Reduce motion switch now stops form animations, as the device setting already did. A form's entrance and fields that show and hide appear straight away for a visitor who turned motion off on the site; before, only the device's reduced-motion setting was honoured, and the fade, slide and scale field transitions ignored even that.
@@ -118,30 +118,6 @@
118
118
  <div class="pe-stage" hidden data-bind-hidden="!active.value">
119
119
  <!-- On a block's or a component's tab the Markdown tools step aside; the layout buttons and fullscreen stay. -->
120
120
  <div class="editor-toolbar" id="editor-toolbar" data-bind-class="(blockTab.value || compTab.value) && 'pe-toolbar--block'"></div>
121
- <details class="card" id="page-image-permissions" style="flex:none;max-height:30vh;overflow:auto;margin:0">
122
- <summary class="p-2">External images <span data-bind-text="imagePolicyReady.value && imageScanned.value ? (imageBlocked.value ? '(' + imageBlocked.value + ' blocked)' : (imageHosts.value.length ? '(all allowed)' : '(none found)')) : ''"></span></summary>
123
- <div class="card-body">
124
- <p class="form-hint">Checks the current rendered page, including blocks, shortcodes and inline backgrounds. Allowing a domain lets images from it appear anywhere on this site.</p>
125
- <button type="button" class="btn btn-secondary btn-sm" data-on-click="scanImages" data-bind-disabled="imageScanning.value"
126
- data-bind-text="imageScanning.value ? 'Scanning...' : 'Scan images'">Scan images</button>
127
- <p role="status" hidden data-bind-hidden="!imageError.value" data-bind-text="imageError.value"></p>
128
- <p hidden data-bind-hidden="!imageScanned.value || imageHosts.value.length">No external images found in the rendered markup.</p>
129
- <p hidden data-bind-hidden="!imagePolicyReady.value || imageCanAllow.value">Permission to update site settings is required to allow a domain.</p>
130
- <div data-each="imageHosts.value key=origin">
131
- <div class="mt-2" style="display:flex;flex-wrap:wrap;align-items:center;gap:.5rem">
132
- <code style="overflow-wrap:anywhere" data-bind-text="origin"></code>
133
- <span data-bind-text="$root.imagePolicyReady.value ? status : 'Checking permissions...'"></span>
134
- <button type="button" class="btn btn-secondary btn-sm"
135
- hidden data-bind-hidden="allowed || !eligible || !$root.imageCanAllow.value || !$root.imagePolicyReady.value"
136
- data-bind-disabled="$root.imageAllowing.value"
137
- data-on-click="$root.allowImageHost(host)">Allow images from this domain</button>
138
- </div>
139
- </div>
140
- <p hidden data-bind-hidden="!imageReload.value" role="status">The domain is allowed. Reload this editor to refresh its preview policy. Unsaved changes are kept as a draft.
141
- <button type="button" class="btn btn-ghost btn-sm" data-on-click="reloadImagePolicy">Reload editor</button>
142
- </p>
143
- </div>
144
- </details>
145
121
  <div class="editor-body" id="editor-body" data-bind-class="'editor-mode-' + viewMode.value">
146
122
  <div class="editor-pane editor-pane--write">
147
123
  <!-- The body is not a data-model: the folding manager owns what the textarea shows. -->
@@ -393,6 +369,30 @@
393
369
  <label class="form-check-label" title="Included in fresh installs via the seed script"><input id="field-bundled" type="checkbox" class="form-check" data-model="bundled.value"> Bundled
394
370
  <span data-help="Included when a fresh site is seeded. Leave off for pages that belong to this site only."></span></label>
395
371
  </div>
372
+ <details class="card" id="page-image-permissions">
373
+ <summary class="p-2">External images <span data-bind-text="imagePolicyReady.value && imageScanned.value ? (imageBlocked.value ? '(' + imageBlocked.value + ' blocked)' : (imageHosts.value.length ? '(all allowed)' : '(none found)')) : ''"></span></summary>
374
+ <div class="card-body">
375
+ <p class="form-hint">Checks the current rendered page, including blocks, shortcodes and inline backgrounds. Allowing a domain lets images from it appear anywhere on this site.</p>
376
+ <button type="button" class="btn btn-secondary btn-sm" data-on-click="scanImages" data-bind-disabled="imageScanning.value"
377
+ data-bind-text="imageScanning.value ? 'Scanning...' : 'Scan images'">Scan images</button>
378
+ <p role="status" hidden data-bind-hidden="!imageError.value" data-bind-text="imageError.value"></p>
379
+ <p hidden data-bind-hidden="!imageScanned.value || imageHosts.value.length">No external images found in the rendered markup.</p>
380
+ <p hidden data-bind-hidden="!imagePolicyReady.value || imageCanAllow.value">Permission to update site settings is required to allow a domain.</p>
381
+ <div data-each="imageHosts.value key=origin">
382
+ <div class="mt-2" style="display:flex;flex-wrap:wrap;align-items:center;gap:.5rem">
383
+ <code style="overflow-wrap:anywhere" data-bind-text="origin"></code>
384
+ <span data-bind-text="$root.imagePolicyReady.value ? status : 'Checking permissions...'"></span>
385
+ <button type="button" class="btn btn-secondary btn-sm"
386
+ hidden data-bind-hidden="allowed || !eligible || !$root.imageCanAllow.value || !$root.imagePolicyReady.value"
387
+ data-bind-disabled="$root.imageAllowing.value"
388
+ data-on-click="$root.allowImageHost(host)">Allow images from this domain</button>
389
+ </div>
390
+ </div>
391
+ <p hidden data-bind-hidden="!imageReload.value" role="status">The domain is allowed. Reload this editor to refresh its preview policy. Unsaved changes are kept as a draft.
392
+ <button type="button" class="btn btn-ghost btn-sm" data-on-click="reloadImagePolicy">Reload editor</button>
393
+ </p>
394
+ </div>
395
+ </details>
396
396
  </div>
397
397
 
398
398
  <!-- SEO -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.27.1",
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