fix: parse generated plugin manifest metadata safely

This commit is contained in:
Peter Steinberger
2026-05-02 01:33:45 +01:00
parent 0a3a89810b
commit 644caea8a7

View File

@@ -2,6 +2,7 @@ import { spawnSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";
import { pathToFileURL } from "node:url";
import JSON5 from "json5";
const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA_PATH =
"src/config/bundled-channel-config-metadata.generated.ts";
@@ -33,7 +34,7 @@ function readGeneratedBundledChannelConfigs(repoRoot) {
let entries;
try {
entries = Function(`"use strict"; return (${match[1]});`)();
entries = JSON5.parse(match[1]);
} catch {
return new Map();
}