import { readFileSync } from 'node:fs' import { fileURLToPath } from 'node:url' import { dirname, resolve } from 'node:path' import { JSDOM, VirtualConsole } from 'jsdom' const HERE = dirname(fileURLToPath(import.meta.url)) const portal = resolve(HERE, '../../../release/web/portal') const shell = readFileSync(portal + '/shell.html', 'utf8') const ids = Array.from(shell.matchAll(//g)).map((m) => m[1]) let s = shell for (const id of ids) { const body = readFileSync(portal + '/templates/' + id + '.html', 'utf8') s = s.replace('', '') } const gs = readFileSync(portal + '/governance_sources.json', 'utf8') s = s.replace('', gs.replace(/