domma-cms 1.6.59 → 1.7.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/CHANGELOG.md +4344 -0
- package/README.md +1 -1
- package/admin/dist/domma/domma-tools.css +3 -3
- package/admin/dist/domma/domma-tools.min.js +3 -3
- package/admin/js/api.js +1 -1
- package/admin/js/app.js +2 -2
- package/admin/js/lib/draft-owner.js +1 -0
- package/admin/js/lib/effect-defs.js +1 -1
- package/admin/js/lib/effects-builder.js +2 -2
- package/admin/js/lib/page-editor-reference.js +5 -5
- package/admin/js/lib/shortcode-tags.js +1 -1
- package/admin/js/templates/docs/usage-shortcodes.html +39 -0
- package/admin/js/views/user-editor.js +1 -1
- package/docs/DommaFeatures.md +3005 -0
- package/docs/MultiTenant.md +176 -0
- package/docs/api-reference.md +1667 -0
- package/docs/cache.md +96 -0
- package/docs/configuration.md +1811 -0
- package/docs/editions-and-licences.md +190 -0
- package/docs/getting-started.md +201 -0
- package/docs/guides/form-triggers.md +260 -0
- package/docs/guides/mongodb-storage-adapter.md +282 -0
- package/docs/guides/multi-page-forms.md +121 -0
- package/docs/images/scribe-composer.png +0 -0
- package/docs/markdown-shortcodes.md +1738 -0
- package/docs/pentest-report-2026-04-03.md +181 -0
- package/docs/plans/2026-02-28-admin-topbar-login-forms.md +349 -0
- package/docs/plans/2026-02-28-domma-ui-polish.md +286 -0
- package/docs/plans/2026-02-28-reset-seed-fresh-commands.md +520 -0
- package/docs/plans/2026-03-02-cookie-consent-design.md +86 -0
- package/docs/plans/2026-03-02-cookie-consent-plugin.md +453 -0
- package/docs/plans/2026-03-02-tooltip-sweep-and-back-to-top-plugin-design.md +126 -0
- package/docs/plans/2026-03-02-tooltip-sweep-back-to-top.md +427 -0
- package/docs/plans/2026-03-05-cookie-consent-btt-core.md +115 -0
- package/docs/plans/2026-03-05-custom-css-migrate-to-core-design.md +35 -0
- package/docs/plans/2026-03-05-custom-css-migrate-to-core.md +352 -0
- package/docs/plans/2026-03-05-scribe-script-shortcode.md +373 -0
- package/docs/plans/2026-03-05-user-types-design.md +139 -0
- package/docs/plans/2026-03-05-user-types-implementation.md +1035 -0
- package/docs/plans/2026-03-09-page-editor-view-cta-inserts-design.md +78 -0
- package/docs/plans/2026-03-09-page-editor-view-cta-inserts.md +388 -0
- package/docs/plans/2026-03-09-pro-documentation-design.md +80 -0
- package/docs/plans/2026-03-09-pro-documentation.md +1017 -0
- package/docs/plans/2026-06-10-core-project-design.md +240 -0
- package/docs/plugin-development.md +827 -0
- package/docs/recruitment-recipe.md +501 -0
- package/docs/scaffolding.md +312 -0
- package/docs/screenshots/calculator-floating.png +0 -0
- package/docs/screenshots/calculator-standard.png +0 -0
- package/docs/screenshots/email-settings.png +0 -0
- package/docs/screenshots/messages-count.png +0 -0
- package/docs/structure/user-types.md +107 -0
- package/docs/superpowers/plans/2026-05-25-admin-sidebar-via-menus.md +1112 -0
- package/docs/superpowers/plans/2026-06-08-navbar-mobile-drawer-and-menu-enrichment.md +1161 -0
- package/docs/superpowers/plans/2026-06-25-domma-docs-project.md +695 -0
- package/docs/superpowers/plans/2026-06-26-surveys-HANDOFF.md +68 -0
- package/docs/superpowers/plans/2026-06-26-surveys-pro-plugin.md +1902 -0
- package/docs/superpowers/plans/2026-08-19-collection-context-sort-export.md +1577 -0
- package/docs/superpowers/plans/2026-10-09-content-api.md +1192 -0
- package/docs/superpowers/specs/2026-03-12-form-followup-actions-design.md +152 -0
- package/docs/superpowers/specs/2026-03-12-page-editor-form-insert-and-per-page-theme-design.md +115 -0
- package/docs/superpowers/specs/2026-03-17-nav-hidden-items-design.md +85 -0
- package/docs/superpowers/specs/2026-03-19-accordion-insert-design.md +175 -0
- package/docs/superpowers/specs/2026-03-25-static-block-shortcode-design.md +153 -0
- package/docs/superpowers/specs/2026-03-25-text-shortcode-design.md +168 -0
- package/docs/superpowers/specs/2026-04-05-card-builder-design.md +315 -0
- package/docs/superpowers/specs/2026-04-06-insert-builders-design.md +278 -0
- package/docs/superpowers/specs/2026-04-06-layouts-design.md +226 -0
- package/docs/superpowers/specs/2026-04-07-blog-plugin-design.md +300 -0
- package/docs/superpowers/specs/2026-04-07-calendar-plugin-design.md +538 -0
- package/docs/superpowers/specs/2026-04-17-components-area-design.md +368 -0
- package/docs/superpowers/specs/2026-05-02-effects-slideover-overhaul-design.md +193 -0
- package/docs/superpowers/specs/2026-05-06-dashboard-rebuild-design.md +257 -0
- package/docs/superpowers/specs/2026-05-24-menus-design.md +466 -0
- package/docs/superpowers/specs/2026-05-25-admin-sidebar-via-menus-design.md +358 -0
- package/docs/superpowers/specs/2026-05-25-projects-design.md +380 -0
- package/docs/superpowers/specs/2026-06-08-navbar-mobile-drawer-and-menu-enrichment-design.md +292 -0
- package/docs/superpowers/specs/2026-06-08-sidebar-tools-plugins-folders-design.md +59 -0
- package/docs/superpowers/specs/2026-06-25-domma-docs-project-design.md +192 -0
- package/docs/superpowers/specs/2026-06-26-domma-charts-upstream-proposal.md +44 -0
- package/docs/superpowers/specs/2026-06-26-manager-scheduler-upstream-proposal.md +46 -0
- package/docs/superpowers/specs/2026-06-26-surveys-pro-plugin-design.md +206 -0
- package/docs/superpowers/specs/2026-07-02-shortcode-context-menu-design.md +96 -0
- package/docs/superpowers/specs/2026-08-19-collection-context-sort-export-design.md +330 -0
- package/docs/superpowers/specs/2026-09-22-dcms-marketplace-design.md +1150 -0
- package/docs/superpowers/specs/2026-10-09-content-api-design.md +325 -0
- package/docs/superpowers/specs/plans/2026-03-12-form-followup-actions.md +624 -0
- package/docs/superpowers/specs/plans/2026-03-12-page-editor-form-insert-and-per-page-theme.md +125 -0
- package/docs/superpowers/specs/plans/2026-03-17-nav-hidden-items.md +578 -0
- package/docs/superpowers/specs/plans/2026-03-19-accordion-insert.md +635 -0
- package/docs/superpowers/specs/plans/2026-03-25-text-shortcode.md +545 -0
- package/docs/superpowers/specs/plans/2026-04-05-card-builder.md +1970 -0
- package/docs/superpowers/specs/plans/2026-04-06-insert-builders.md +1049 -0
- package/docs/superpowers/specs/plans/2026-04-06-layouts.md +1015 -0
- package/docs/superpowers/specs/plans/2026-04-07-calendar-plugin.md +1526 -0
- package/docs/superpowers/specs/plans/2026-04-08-plugin-monetisation-split.md +242 -0
- package/docs/superpowers/specs/plans/2026-04-17-components-area.md +2038 -0
- package/docs/superpowers/specs/plans/2026-05-02-effects-slideover-overhaul.md +2335 -0
- package/docs/superpowers/specs/plans/2026-05-06-dashboard-rebuild.md +1999 -0
- package/docs/superpowers/specs/plans/2026-05-17-cache-system.md +1436 -0
- package/docs/superpowers/specs/plans/2026-05-24-menus.md +3096 -0
- package/docs/superpowers/specs/plans/2026-05-25-projects.md +2869 -0
- package/docs/superpowers/specs/plans/2026-09-22-marketplace-step2-consolidation.md +505 -0
- package/docs/superpowers/specs/plans/2026-09-22-marketplace-step3-catalogue-and-key.md +154 -0
- package/docs/superpowers/specs/plans/2026-09-22-tools-promotion.md +260 -0
- package/docs/theming.md +320 -0
- package/package.json +2 -2
- package/plugins/_lib/admin/mail/keyboard.js +49 -0
- package/plugins/_lib/admin/mail/reader-view.js +4 -2
- package/public/js/celebrations/core/canvas.js +1 -1
- package/public/js/celebrations/index.js +1 -1
- package/public/js/celebrations/licenses/ABeeZee-Regular-OFL.txt +93 -0
- package/public/js/celebrations/licenses/Allura-Regular-OFL.txt +93 -0
- package/public/js/celebrations/message-attrs.mjs +1 -0
- package/public/js/celebrations/themes/anniversary.js +1 -0
- package/public/js/celebrations/themes/autumn.js +1 -0
- package/public/js/celebrations/themes/birthday.js +1 -0
- package/public/js/celebrations/themes/butterfly-flight.js +1 -0
- package/public/js/celebrations/themes/calendar.js +1 -0
- package/public/js/celebrations/themes/chinese-new-year-dates.js +1 -0
- package/public/js/celebrations/themes/chinese-new-year.js +1 -0
- package/public/js/celebrations/themes/christmas.js +1 -1
- package/public/js/celebrations/themes/easter.js +1 -0
- package/public/js/celebrations/themes/garden-drawing.js +1 -0
- package/public/js/celebrations/themes/garden.js +1 -0
- package/public/js/celebrations/themes/graduation.js +1 -0
- package/public/js/celebrations/themes/greeting.js +1 -0
- package/public/js/celebrations/themes/make-it-rain.js +1 -0
- package/public/js/celebrations/themes/money-rain.js +1 -0
- package/public/js/celebrations/themes/new-year.js +1 -0
- package/public/js/celebrations/themes/occasion-drawing.js +1 -0
- package/public/js/celebrations/themes/occasions.js +1 -0
- package/public/js/celebrations/themes/rain-control.js +1 -0
- package/public/js/celebrations/themes/sparkler-font-data.js +1 -0
- package/public/js/celebrations/themes/sparkler-font.js +1 -0
- package/public/js/celebrations/themes/sparkler-writing.js +1 -0
- package/public/js/celebrations/themes/summer-garden.js +1 -0
- package/public/js/celebrations/themes/winter.js +1 -0
- package/public/js/celebrations/trait-data.mjs +1 -1
- package/public/js/effects.js +1 -1
- package/scripts/build.js +4 -0
- package/server/services/markdown.js +5 -2
- package/server/templates/page.html +1 -1
package/docs/cache.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Caching
|
|
2
|
+
|
|
3
|
+
Domma CMS caches assembled public page responses so the markdown → shortcode → template pipeline runs only once per (url, file version, viewer roles, origin) until something it depends on changes. The cache is on by default in production (`NODE_ENV=production`) and off in development.
|
|
4
|
+
|
|
5
|
+
## Config
|
|
6
|
+
|
|
7
|
+
`config/cache.json` (optional - absent means use defaults baked into the loader):
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"enabled": true,
|
|
12
|
+
"driver": "memory",
|
|
13
|
+
"memory": { "maxItems": 1000, "defaultTtlSeconds": 3600 },
|
|
14
|
+
"redis": { "url": "redis://localhost:6379", "keyPrefix": "domma:" }
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- `enabled: false` short-circuits every read straight to the producer. Use in development to see fresh renders on every refresh.
|
|
19
|
+
- `driver`:
|
|
20
|
+
- `"memory"` - default, in-process LRU with TTL and a tag index. Zero dependencies.
|
|
21
|
+
- `"none"` - same as `enabled: false` but expressed via the driver name.
|
|
22
|
+
- `"redis"` - optional, requires the `redis` package (in `optionalDependencies` - Pro feature). Loaded dynamically so the free tier never imports it.
|
|
23
|
+
|
|
24
|
+
A template lives at `config/cache.json.example`.
|
|
25
|
+
|
|
26
|
+
## What gets cached
|
|
27
|
+
|
|
28
|
+
The full rendered HTML for each public page response, keyed by:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
page:<urlPath>:m<fileMtime>:role<roles>:o<origin>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `m<fileMtime>` - the page file's modification time, so any change to the file (editor save, script, `git pull`) produces a fresh entry even if no invalidation fired. Stale entries age out via TTL/LRU.
|
|
35
|
+
- `role<roles>` - the sorted set of **all** the viewer's roles (primary plus additional), joined with `+` - e.g. `roleadmin+blog-editor`. Anonymous visitors get `roleanon` and share one entry.
|
|
36
|
+
- `o<origin>` - the site origin (from `site.baseUrl` or the request), so a multi-domain deployment keeps separate entries per host.
|
|
37
|
+
|
|
38
|
+
For example: `page:/about:m1727430000000:roleanon:ohttps://example.com`.
|
|
39
|
+
|
|
40
|
+
Admin API responses, login pages and error pages are not cached. Drafts (including draft previews) are never cached, and a page containing a row-level `[view]` is rendered fresh for each signed-in viewer.
|
|
41
|
+
|
|
42
|
+
Cache keys are versioned with a `v1:` prefix. Bumping the version (in `server/services/cache/index.js`) auto-invalidates the entire cache without needing `clear()` - useful if the cached value shape ever changes.
|
|
43
|
+
|
|
44
|
+
## What invalidates
|
|
45
|
+
|
|
46
|
+
Tag-based. When an admin saves a page, only entries tagged `page:<that-url>` are flushed - not the whole cache. The full tag set:
|
|
47
|
+
|
|
48
|
+
| Tag | Set by | Flushed by |
|
|
49
|
+
|----------------------|-------------------------------------------------------|-------------------------------------------------------|
|
|
50
|
+
| `page:<urlPath>` | the public route, on every cached entry | `content.js`: createPage / updatePage / renamePage / deletePage |
|
|
51
|
+
| `collection:<slug>` | the `[collection]` shortcode processor | `collections.js`: createCollection, updateCollection, deleteCollection, createEntry, updateEntry, deleteEntry, clearEntries, importEntries |
|
|
52
|
+
| `form:<slug>` | the `[form]` shortcode processor | `forms.js`: writeForm, deleteForm |
|
|
53
|
+
| `block:<name>` | the `[block]` shortcode processor | `blocks.js`: saveBlock, deleteBlock |
|
|
54
|
+
| `view:<slug>` | the `[view]` shortcode processor | `views.js`: createView, updateView, deleteView |
|
|
55
|
+
| `nav` | the public route, on every cached entry | `routes/api/navigation.js`: PUT /api/navigation; menu create/update/delete (`routes/api/menus.js`, `services/menus.js`); menu-location changes |
|
|
56
|
+
| `site` | the public route, on every cached entry | `routes/api/settings.js`: PUT /api/settings and PUT /api/settings/custom-css; theme settings changes (`themeSettings.js`); context-menu changes (`contextMenus.js`); menu changes; SEO settings |
|
|
57
|
+
| `sitemap` | `/sitemap.xml` (10-minute TTL) | `content.js`: createPage / updatePage / renamePage / deletePage; SEO sitemap sources (`sitemapChanged`) |
|
|
58
|
+
|
|
59
|
+
The markdown pipeline auto-attaches the appropriate shortcode tags as it processes a page - embedding `[collection slug="faq"]` causes the rendered page to be tagged `collection:faq`, so a FAQ entry edit transparently busts every page that displays the FAQ. There is no central embed-map to maintain.
|
|
60
|
+
|
|
61
|
+
## Manual flush, inspection, and on/off
|
|
62
|
+
|
|
63
|
+
| Endpoint | Behaviour |
|
|
64
|
+
|--------------------------|---------------------------------------------------------------------------|
|
|
65
|
+
| `GET /api/cache/status` | Full stats: `enabled`, `driver`, `size`, `maxItems`, `hits`, `misses`, `writes`, `invalidations`, `hitRate`, `lastClearedAt`, `lastInvalidationAt`, `initialisedAt` |
|
|
66
|
+
| `GET /api/cache/keys` | `{entries: [{key, tags, expiresAt}]}` - keys only, no values (they can be MB of HTML) |
|
|
67
|
+
| `POST /api/cache/clear` | Flush every cached entry. Returns updated stats. |
|
|
68
|
+
| `POST /api/cache/toggle` | `{enabled: boolean}` - flip on/off **and persist to `config/cache.json`** so the choice survives a restart. Returns updated stats. |
|
|
69
|
+
|
|
70
|
+
All endpoints require an admin Bearer token. The dashboard has a cache widget showing the same data plus an on/off switch; the Settings → Cache tab includes a viewer that lists every cached key with its tags.
|
|
71
|
+
|
|
72
|
+
When you toggle the cache **off**, the in-memory data is preserved - toggle back on and your warm entries are still there. When you turn it **off in `config/cache.json`** and restart, the next boot starts with a `NoneDriver` and no data.
|
|
73
|
+
|
|
74
|
+
## Thundering-herd safety
|
|
75
|
+
|
|
76
|
+
If three concurrent requests hit a cold key, the producer runs exactly once - the other two await the first's result via an in-flight promise map. This matters for popular pages on cache cold-start: without coalescing, N parallel requests trigger N parallel renders, each writing the same value back to the cache.
|
|
77
|
+
|
|
78
|
+
## Adding a new shortcode that needs invalidation
|
|
79
|
+
|
|
80
|
+
1. In the shortcode's processor (`server/services/markdown.js`), accept a `tagSet` argument and call `tagSet?.add('<prefix>:' + attrs.slug)` when you process each occurrence.
|
|
81
|
+
2. Add a corresponding call in `parseMarkdown`'s pipeline to forward the `tagSet` you already create.
|
|
82
|
+
3. In the service that owns the data, import `* as cache from './cache/index.js'` and add `await cache.invalidateTags(['<prefix>:' + id])` after every successful write/delete.
|
|
83
|
+
|
|
84
|
+
That's it - no central registry to update. The tag flows from producer to cache to invalidator without any glue code.
|
|
85
|
+
|
|
86
|
+
## Verification
|
|
87
|
+
|
|
88
|
+
Cold/warm performance gap:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
NODE_ENV=production node server/server.js # in one terminal
|
|
92
|
+
curl -s -o /dev/null -w "Cold: %{time_total}s\n" http://localhost:4096/
|
|
93
|
+
curl -s -o /dev/null -w "Warm: %{time_total}s\n" http://localhost:4096/
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Warm should be meaningfully faster (typically 20-50ms cold vs sub-millisecond warm for a non-trivial page).
|