Single module modding

This commit is contained in:
2026-11-14 12:18:41 -03:00
parent 605008f584
commit 313098892e
134 changed files with 919 additions and 924 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import type { WorldSave } from "@/server/game/saves.ts";
// a mod that uses every part of the server api worth testing, and writes down what happened in its storage
const SERVER_SCRIPT = `
import type { BlockRef, ServerContext } from "cubi/server";
export function setup(ctx: ServerContext) {
export function server(ctx: ServerContext) {
const log = (key: string, value: unknown = 1) => {
const all = ctx.storage.get<Record<string, unknown[]>>("log") ?? {};
(all[key] ??= []).push(value);
@@ -153,7 +153,7 @@ function test_mods() {
name: "Test",
version: "1.0.0",
dependencies: [{ id: "bworld", version: "*" }],
scripts: { server: "scripts/server.ts" },
main: "scripts/server.ts",
}),
);
Deno.writeTextFileSync(