import { access, readFile, readdir } from "node:fs/promises"; import { join } from "node:path"; const root = new URL("../dist/", import.meta.url); const required = ["index.html", "archive/index.html", "method/index.html", "articles/research-publishing-method/index.html", "rss.xml", "sitemap.xml"]; for (const path of required) await access(new URL(path, root)); async function walk(path) { const entries = await readdir(path, { withFileTypes: true }); const found = []; for (const entry of entries) { const child = join(path, entry.name); if (entry.isDirectory()) found.push(...await walk(child)); else if (/\.(?:html|xml|css|js|svg)$/.test(entry.name)) found.push(child); } return found; } const files = await walk(root.pathname); const forbidden = /(?:git\.n\.xiaomi\.com|coro\.doc|\.codex\/sessions|