This commit is contained in:
1 parent
9a6ec940f7
commit
fd32419371
114 files changed
+21997
-96
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { readFileSync, readdirSync, existsSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
// TODO(MediaEngine extraction): this audits legacy pre-SvelteKit `<project>/public/*.html`
|
||||
// script tags. MediaEngine's webui/ is SvelteKit-based (no per-service `public/` HTML pages), and
|
||||
// none of the sibling monorepo service directories below live inside this repo anymore (they're
|
||||
// now separate repos: MediaModerator, MediaTools, MediaKiosk, MediaViewer). The existsSync guard
|
||||
// below means this currently no-ops safely (nothing to audit) rather than erroring. Left as-is
|
||||
// rather than guessing at a SvelteKit-equivalent audit — remove or repurpose if useful.
|
||||
const projects = ['MediaModerator', 'MediaTools', 'MediaKiosk', 'MediaViewer'];
|
||||
const scriptSrcRe = /<script[^>]+src="([^"]+)"[^>]*>/g;
|
||||
|
||||
projects.forEach(proj => {
|
||||
const pubDir = join(proj, 'public');
|
||||
if (!existsSync(pubDir)) return;
|
||||
const htmlFiles = readdirSync(pubDir)
|
||||
.filter(f => f.endsWith('.html'))
|
||||
.sort();
|
||||
console.log(`=== ${proj} ===`);
|
||||
htmlFiles.forEach(htmlFile => {
|
||||
const content = readFileSync(join(pubDir, htmlFile), 'utf8');
|
||||
const scripts = [];
|
||||
let m;
|
||||
scriptSrcRe.lastIndex = 0;
|
||||
while ((m = scriptSrcRe.exec(content)) !== null) scripts.push(m[1]);
|
||||
console.log(` ${htmlFile} -> ${scripts.join(', ')}`);
|
||||
});
|
||||
console.log();
|
||||
});
|
||||
Reference in new issue
Block a user