Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://www.schemastore.org/package.json",
"name": "@kirchdev/duxt",
"version": "0.3.4",
"description": "Nuxt documentation layer on Content v3 — multi-repo, versioned docs from one compact source list.",
"description": "duxt is a Nuxt layer: extend it and your docs/ folder becomes a site, with theme, search, API reference and llms.txt included. Point it at other repositories, or at tags of the same one, and each becomes a version.",
"keywords": [
"content-v3",
"docs",
Expand Down
32 changes: 32 additions & 0 deletions scripts/check-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,38 @@ async function viewer(browser: Browser): Promise<string[]> {

await dialog.waitFor({ state: 'visible' });

// MEASURE A LOADED IMAGE. The viewer's picture is sized by its own pixels
// (`w-auto h-auto` inside a max box), so until the file arrives it is a 0px
// box — and measuring it straight after the dialog opens made this check a
// race: green on one CI run, "the 0px viewer image" on the next, with no
// change to either. A file that never loads is a failure of its own.
const loaded = await viewed.evaluate(
(image: HTMLImageElement) =>
new Promise<string | null>((resolve) => {
if (image.complete)
return resolve(image.naturalWidth > 0 ? null : 'broken');
const timer = setTimeout(() => resolve('timeout'), 30_000);
image.addEventListener(
'load',
() => (clearTimeout(timer), resolve(null)),
{ once: true }
);
image.addEventListener(
'error',
() => (clearTimeout(timer), resolve('broken')),
{ once: true }
);
})
);

if (loaded) {
return [
loaded === 'timeout'
? 'the viewer image did not load within 30 seconds'
: `the viewer image failed to load (${await viewed.getAttribute('src')})`
];
}

const [imageBox, closeBox] = await Promise.all([
viewed.boundingBox(),
close.boundingBox()
Expand Down
5 changes: 2 additions & 3 deletions www/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ const DUXT_DOCS = {
tag: 'deprecated'
},
refs: [
{ branch: 'main' },
{ tag: 'latest', default: true },
// Hidden while `latest` resolves to v0.2.0. The resolver retains it
// automatically as deprecated when v0.3.1 is cut.
{ tag: 'v0.3.4' },
{ tag: 'v0.2.0' },
{ branch: 'main' },
{ tag: 'v0.1.0' }
],

Expand Down