feat(image): complete reviewed generation delivery
Memind CI / Test, build, and release guards (pull_request) Successful in 2m47s

This commit is contained in:
john
2026-07-20 20:04:44 +08:00
parent fc3d27aae0
commit 4b15610aa8
42 changed files with 1764 additions and 97 deletions
+28
View File
@@ -0,0 +1,28 @@
import fs from 'node:fs';
import path from 'node:path';
export const RUN_PUBLIC_HTML_LOOKBACK_MS = 0;
export function listRecentlyModifiedPublicHtmlRelativePaths(
publishDir,
{ sinceMs = null, lookbackMs = RUN_PUBLIC_HTML_LOOKBACK_MS } = {},
) {
const startedAt = Number(sinceMs);
if (!Number.isFinite(startedAt) || startedAt <= 0) return [];
const publicDir = path.join(path.resolve(String(publishDir ?? '')), 'public');
if (!fs.existsSync(publicDir) || !fs.statSync(publicDir).isDirectory()) return [];
const cutoff = Math.max(0, startedAt - Math.max(0, Number(lookbackMs) || 0));
return fs.readdirSync(publicDir)
.filter((name) => name.toLowerCase().endsWith('.html'))
.filter((name) => {
try {
return fs.statSync(path.join(publicDir, name)).mtimeMs >= cutoff;
} catch {
return false;
}
})
.map((name) => `public/${name}`)
.sort();
}