docs(web): refresh v0.8.32 site state

This commit is contained in:
Hunter Bown
2026-05-12 14:04:17 -05:00
parent b25450728e
commit 190eb6b162
10 changed files with 155 additions and 264 deletions
+8 -3
View File
@@ -14,10 +14,15 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
const cfgPath = join(__dirname, "..", "wrangler.jsonc");
const raw = readFileSync(cfgPath, "utf-8");
// Parse JSONC (strip comments, trailing commas)
// Parse JSONC (strip comments, trailing commas).
// Use a two-pass approach to avoid mangling URLs: first strip
// line comments that look like comments (preceded by whitespace
// or comma, not part of ://), then strip block comments.
const stripped = raw
.replace(/\/\/.*$/gm, "") // line comments
.replace(/\/\*[\s\S]*?\*\//g, ""); // block comments
.replace(/(^|[,\s])\/\/[^\n]*/gm, "$1") // line comments (skips :// in URLs)
.replace(/\/\*[\s\S]*?\*\//g, "") // block comments
.replace(/,\s*}/g, "}") // trailing commas
.replace(/,\s*]/g, "]");
const cfg = JSON.parse(stripped);
const nss = cfg.kv_namespaces;