feat: pin the official plugins in the docker image

This commit is contained in:
LukeGus committed 2026-10-05 21:46:16 -05:00
1 parent 853615af09
commit 88d7bc5525
6 files changed
+329 -3

No files matched your search

+21
View File
@@ -152,8 +152,29 @@ async function extractArtifact(buffer, outDir, id) {
}
}
/**
* Pins the newest registry version of each wanted plugin. `ids` is the list
* to pin, or null for every plugin in the index.
*/
function pinsFromIndex(index, ids) {
const plugins = Array.isArray(index?.plugins) ? index.plugins : [];
const byId = new Map(plugins.map((plugin) => [plugin.id, plugin]));
const wanted = ids ?? plugins.map((plugin) => plugin.id);
return [...wanted].sort().map((id) => {
const latest = byId.get(id)?.versions?.[0];
if (!latest) throw new Error(`${id} is not in the registry index`);
return {
id,
source: "tmxplug",
url: latest.url,
sha256: latest.sha256,
};
});
}
module.exports = {
parseBundledPlugins,
pinsFromIndex,
loadBundledPlugins,
checkSha256,
fetchArtifact,