From 92fac156ae82c5de494d2aad8aed2bf8f588425b Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Thu, 17 Sep 2026 20:05:26 +0200 Subject: [PATCH 1/3] test: repair the extension-tests suite broken by the test/ rename #119 renamed test/ to extension-tests/ (and flattened test/helpers/ into extension-tests/) but left several things pointing at the old layout: package.json's test script still globbed test/*.test.js (so npm test silently ran zero tests, in CI too), latest-alias.test.js / next-alias.test.js / static-files.test.js still required ./helpers/latest-versions, and latest-versions.js itself still walked up two directories to find content/ instead of one. Net effect: most of this suite has been dead since #119, always green because nothing ran. Signed-off-by: Lukas Hirt --- AGENTS.md | 3 ++- extension-tests/latest-alias.test.js | 2 +- extension-tests/latest-versions.js | 2 +- extension-tests/next-alias.test.js | 2 +- extension-tests/static-files.test.js | 2 +- package.json | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 12ebea3..82dfef7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,8 @@ This is the consolidated documentation **monorepo**. It supersedes the previous - `ui/supplemental/` -- supplemental files layered onto the stock Antora default UI - `global-attributes.yml` -- site-wide AsciiDoc attributes - `sync/` -- the retired upstream import tooling (`manifest.yml`, `patches/`); kept for provenance -- `test/` -- Node test suite +- `extension-tests/` -- Node test suite +- `scripts/` -- one-off build helpers (e.g. `sync-vendor-assets.js`, wired as `preantora`/`preantora-local`) - `package.json` -- npm scripts ## Development Conventions diff --git a/extension-tests/latest-alias.test.js b/extension-tests/latest-alias.test.js index fe2a97e..bbef299 100644 --- a/extension-tests/latest-alias.test.js +++ b/extension-tests/latest-alias.test.js @@ -10,7 +10,7 @@ const assert = require('node:assert/strict') const fs = require('node:fs') const path = require('node:path') -const { latestByComponent } = require('./helpers/latest-versions') +const { latestByComponent } = require('./latest-versions') const PUBLIC = path.join(__dirname, '..', 'public') diff --git a/extension-tests/latest-versions.js b/extension-tests/latest-versions.js index 2ca17da..d0c4496 100644 --- a/extension-tests/latest-versions.js +++ b/extension-tests/latest-versions.js @@ -15,7 +15,7 @@ const fs = require('node:fs') const path = require('node:path') -const CONTENT = path.join(__dirname, '..', '..', 'content') +const CONTENT = path.join(__dirname, '..', 'content') // Numeric, segment-wise ascending compare ('10.16' > '10.9', not the string order). function compareVersions (a, b) { diff --git a/extension-tests/next-alias.test.js b/extension-tests/next-alias.test.js index bb45647..ecb6b1d 100644 --- a/extension-tests/next-alias.test.js +++ b/extension-tests/next-alias.test.js @@ -16,7 +16,7 @@ const assert = require('node:assert/strict') const fs = require('node:fs') const path = require('node:path') -const { latestByComponent, nextTargetByComponent } = require('./helpers/latest-versions') +const { latestByComponent, nextTargetByComponent } = require('./latest-versions') const PUBLIC = path.join(__dirname, '..', 'public') diff --git a/extension-tests/static-files.test.js b/extension-tests/static-files.test.js index 5581417..ad531dd 100644 --- a/extension-tests/static-files.test.js +++ b/extension-tests/static-files.test.js @@ -14,7 +14,7 @@ const assert = require('node:assert/strict') const fs = require('node:fs') const path = require('node:path') -const { latestByComponent } = require('./helpers/latest-versions') +const { latestByComponent } = require('./latest-versions') const ROOT = path.join(__dirname, '..') const PUBLIC = path.join(ROOT, 'public') diff --git a/package.json b/package.json index 6b7755c..213a16b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "antora-local": "antora --stacktrace --url http://localhost:8080 site.yml", "pagefind": "pagefind --site public", "build": "npm run antora && npm run pagefind", - "test": "node --test test/*.test.js", + "test": "node --test extension-tests/*.test.js", "serve": "http-server public/ -d -i" }, "dependencies": { From 7bf3ff6cf1b96785df7753a3dea79973c8fe3a4b Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Thu, 17 Sep 2026 20:05:26 +0200 Subject: [PATCH 2/3] test: don't flag unrendered content/ocis/8.0 as a broken page alias Restoring npm test above turned this test back on, which surfaces it: content/ocis/8.0 has a page-aliases entry but isn't in site.yml's ocis source list (only 8.1-8.3 render; site.yml's own comment says an unnamed version folder "could safely be deleted if outdated"). The test walks the whole content/ tree, so it flagged that stale, never- published version as a dangling alias. Skip versions this build doesn't publish, matching the builtOrSkip pattern the rest of the suite already uses; verified it still fails when a real published stub (8.1) is removed. Signed-off-by: Lukas Hirt --- extension-tests/page-aliases.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extension-tests/page-aliases.test.js b/extension-tests/page-aliases.test.js index e656325..9da671f 100644 --- a/extension-tests/page-aliases.test.js +++ b/extension-tests/page-aliases.test.js @@ -80,6 +80,12 @@ test('the relocated ocis security page keeps its old URL alive', (t) => { const broken = [] for (const { file } of aliased) { const version = file.split('/')[2] + // site.yml names rendered ocis versions explicitly (not a `content/ocis/*` + // glob) and its own comment says an unlisted version folder "could safely be + // deleted if outdated" -- content/ocis/8.0 is exactly that: on disk, never + // rendered. Skip versions this build didn't publish at all instead of + // flagging them as a broken alias. + if (!fs.existsSync(path.join(PUBLIC, 'ocis', version))) continue const stub = path.join(PUBLIC, 'ocis', version, 'security', 'security.html') if (!fs.existsSync(stub)) { broken.push(`ocis/${version}/security/security.html is missing`) From 23bc472e09134c6d9da02b7281b74d937daa58f7 Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Fri, 18 Sep 2026 15:57:02 +0200 Subject: [PATCH 3/3] feat: re-add mediumzoom as a tracked npm dependency (#133) * feat: re-add mediumzoom as a tracked npm dependency The previous vendored copy of medium-zoom.min.js was reverted (#131) for missing dependency management. Install medium-zoom via npm so it is tracked in package.json/package-lock.json (and covered by Dependabot), and copy its prebuilt browser bundle into ui/supplemental/js/vendor/ via a preantora/preantora-local script, since the site has no client-side bundler of its own. Signed-off-by: Lukas Hirt * refactor: make sync-vendor-assets.js data-driven Replace the two hardcoded copyFileSync calls with a VENDOR_FILES list, so vendoring another package's browser build later means adding an entry instead of writing a new script. Signed-off-by: Lukas Hirt * fix: address review on the medium-zoom vendoring approach - Add a build-output guard (extension-tests/static-files.test.js) that fails loudly if ui/supplemental/js/vendor/ wasn't repopulated before the build (e.g. npx antora run directly, bypassing the preantora hook): today it publishes green with a 404'ing +{{!-- Click-to-zoom for images. `defer` on both (not `async`) because the init + script needs the global the vendored library defines, and deferred external + scripts run in document order. --}} + + diff --git a/ui/supplemental/partials/head-styles.hbs b/ui/supplemental/partials/head-styles.hbs index 81a5081..36d97e8 100644 --- a/ui/supplemental/partials/head-styles.hbs +++ b/ui/supplemental/partials/head-styles.hbs @@ -2,3 +2,4 @@ +