Tidy the compendium, and release 1.0.0

Three things were untidy, and one of them was a stale declaration of exactly the
kind this project keeps producing.

  - packFolders named ten packs of seventeen. Talents, the Quiet Arts, the
    primer, the rules and all three scenarios were sitting loose in the sidebar
    because the declaration was written when there were ten packs and never
    revisited. It now covers all seventeen in four subfolders under one parent
    — Scenarios, Characters, Equipment, Rules & reference — and the build
    asserts the folder list and the pack list are the same set, so it cannot
    drift again.

  - Labels were off-pattern in three places ("Transport", and the two prologues
    reading "Custodians: Prologue — X"). Everything is "The Custodians · X".

  - Thirty-six pregens in one flat list. The pack now carries three compendium
    folders — Duty roster (16), Before the department (16), Original pregens
    (4) — and every actor is filed. Nothing unfiled.

Worth knowing, and verified against Foundry's own source rather than guessed:
packFolders only assigns a pack that has NO existing entry in the world's
core.compendiumConfiguration, and the routine only runs when the set of active
packs changes. So a world that already has this system installed keeps whatever
layout it had; the new one applies to a new world. The local world was brought
into line by writing the configuration directly.

Version 1.0.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
slaguru666
2026-08-12 18:29:44 +01:00
co-authored by Claude Opus 5
parent 1bf8d7f6fb
commit c595bf5a33
139 changed files with 216 additions and 53 deletions
+22
View File
@@ -376,6 +376,28 @@ test("LAST ADMISSION's fight numbers match the actor the build will generate", a
`the page says the shears do ${dmg}; the ${w.name} on his sheet does ${w.dmg}`);
});
// packFolders was written when there were ten packs and never revisited, so seven of
// seventeen sat loose in the sidebar — the same defect as always, a declaration nothing
// re-reads. Foundry does not warn: a pack missing from the declaration is simply not
// filed, and a folder naming a pack that does not exist is silently skipped.
test("every compendium pack is declared in exactly one packFolders folder", async () => {
const { readFile } = await import("node:fs/promises");
const sys = JSON.parse(await readFile(new URL("../system.json", import.meta.url), "utf8"));
const declared = [];
const walk = f => { declared.push(...(f.packs ?? [])); (f.folders ?? []).forEach(walk); };
(sys.packFolders ?? []).forEach(walk);
const packs = sys.packs.map(p => p.name);
const missing = packs.filter(n => !declared.includes(n));
assert.equal(missing.length, 0, `not in any folder, so loose in the sidebar: ${missing.join(", ")}`);
const phantom = declared.filter(n => !packs.includes(n));
assert.equal(phantom.length, 0, `folder names a pack that does not exist: ${phantom.join(", ")}`);
const dupes = declared.filter((n, i) => declared.indexOf(n) !== i);
assert.equal(dupes.length, 0, `declared in more than one folder: ${dupes.join(", ")}`);
});
/* ---------------------------------------------------------------- */
await runAll();