Publish portable C# fields contracts

This commit is contained in:
Meta Vens 2026-07-10 15:29:44 +01:00
commit 66f77a2e35
6 changed files with 151 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import assert from "node:assert/strict";
import test from "node:test";
import { readFileSync } from "node:fs";
import { dispatch } from "../src/plugin.mjs";
function request(operation, input = {}) {
@ -39,3 +40,13 @@ test("measures field domains without mutating provider state", () => {
assert.equal(result.channelCount, 1);
assert.equal(result.preservesProviderAuthority, true);
});
test("publishes a runtime-neutral Unity contract package", () => {
const packageRoot = new URL("../unity/org.gamecult.eve.plugin-fields/", import.meta.url);
const manifest = JSON.parse(readFileSync(new URL("package.json", packageRoot), "utf8"));
const contracts = readFileSync(new URL("Runtime/EveFieldsContracts.cs", packageRoot), "utf8");
assert.equal(manifest.name, "org.gamecult.eve.plugin-fields");
assert.match(contracts, /interface IEveFieldsSplatsDocument/);
assert.match(contracts, /gamecult\.fields\.splats\.v1/);
assert.doesNotMatch(contracts, /UnityEngine|Aetheria|MessagePack|GameCult\.Caching/);
});