Add some informational logs to the manifest preparation

This commit is contained in:
Oliver 2025-11-17 22:08:14 -07:00
parent d7db9cb2df
commit d018aea4f1

View file

@ -16,26 +16,30 @@ const {
let manifest; let manifest;
try { try {
manifest = JSON.parse(await readFile(MANIFEST_PATH, `utf-8`)); manifest = JSON.parse(await readFile(MANIFEST_PATH, `utf-8`));
console.log(`Manifest loaded from disk`);
} catch { } catch {
console.error(`Failed to parse manifest file.`); console.error(`Failed to parse manifest file.`);
process.exit(1); process.exit(1);
}; };
// Update download / manifest URLs console.log(`Updating download/manifest URLs`)
manifest.download = DOWNLOAD_URL; manifest.download = DOWNLOAD_URL;
manifest.manifest = LATEST_URL; manifest.manifest = LATEST_URL;
// Filter out dev-only resources // Filter out dev-only resources
if (manifest.esmodules) { if (manifest.esmodules) {
console.log(`Removing dev-only esmodules`);
manifest.esmodules = manifest.esmodules.filter( manifest.esmodules = manifest.esmodules.filter(
filepath => !filepath.startsWith(`dev/`) filepath => !filepath.startsWith(`dev/`)
); );
}; };
// Remove dev flags // Remove dev flags
console.log(`Cleaning up flags`);
delete manifest.flags?.hotReload; delete manifest.flags?.hotReload;
if (Object.keys(manifest.flags).length === 0) { if (Object.keys(manifest.flags).length === 0) {
delete manifest.flags; delete manifest.flags;
}; };
await writeFile(MANIFEST_PATH, JSON.stringify(manifest, undefined, `\t`)); await writeFile(MANIFEST_PATH, JSON.stringify(manifest, undefined, `\t`));
console.log(`Manifest written back to disk`);