Block registry api

This commit is contained in:
2026-11-12 20:41:13 -03:00
parent e7fe663746
commit 76802ed430
39 changed files with 499 additions and 100 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ const seen = globalThis as unknown as Record<string, unknown>;
// packs testrecipes from dir, which it then removes, and loads it on a client like one joining would
async function load_client(dir: string) {
const mod = load_and_check(dir).find((m) => m.id === "testrecipes")!;
const mod = (await load_and_check(dir)).find((m) => m.id === "testrecipes")!;
assertEquals(mod.report.errors, []);
const packed = read_mod(await pack_mod(mod), "testrecipes.cubi");
Deno.removeSync(dir, { recursive: true });
@@ -222,7 +222,7 @@ Deno.test("recipes can only be registered while shared scripts set up", async ()
});
Deno.test("every mod's recipe types are registered on a client too, so it loads them", async () => {
const mods = load_order(load_and_check("mods"));
const mods = load_order(await load_and_check("mods"));
const packed = await Promise.all(mods.map(async (mod) => read_mod(await pack_mod(mod), `${mod.id}.cubi`)));
const listings = mods.map((mod): ModListing => ({
id: mod.id,