Implement the 031-quality-gates-hygiene feature that strengthens automated quality gates by adding pnpm audit to the check script, v8 coverage thresholds with per-directory auto-ratchet (domain 96%, adapters 71%, persistence 87%), Biome cognitive complexity enforcement (max 15), and keyboard accessibility for the combatant row, while cleaning up all blanket biome-ignore comments, refactoring 5 overly complex functions into smaller helpers, and codifying the early-enforcement principle in the constitution and CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,29 +27,28 @@ const OUTPUT_PATH = join(PROJECT_ROOT, "data/bestiary/index.json");
|
||||
|
||||
// --- Build source display name map from books.json + adventures.json ---
|
||||
|
||||
/** Populate map from a list of entries that have source/id + name. */
|
||||
function addEntriesToMap(map, entries) {
|
||||
for (const entry of entries) {
|
||||
if (!entry.name) continue;
|
||||
if (entry.source) {
|
||||
map[entry.source] = entry.name;
|
||||
}
|
||||
// Some entries use "id" instead of "source"
|
||||
if (entry.id && !map[entry.id]) {
|
||||
map[entry.id] = entry.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildSourceMap() {
|
||||
const map = {};
|
||||
|
||||
const books = JSON.parse(readFileSync(BOOKS_PATH, "utf-8"));
|
||||
for (const book of books.book ?? []) {
|
||||
if (book.source && book.name) {
|
||||
map[book.source] = book.name;
|
||||
}
|
||||
// Some books use "id" instead of "source"
|
||||
if (book.id && book.name && !map[book.id]) {
|
||||
map[book.id] = book.name;
|
||||
}
|
||||
}
|
||||
addEntriesToMap(map, books.book ?? []);
|
||||
|
||||
const adventures = JSON.parse(readFileSync(ADVENTURES_PATH, "utf-8"));
|
||||
for (const adv of adventures.adventure ?? []) {
|
||||
if (adv.source && adv.name) {
|
||||
map[adv.source] = adv.name;
|
||||
}
|
||||
if (adv.id && adv.name && !map[adv.id]) {
|
||||
map[adv.id] = adv.name;
|
||||
}
|
||||
}
|
||||
addEntriesToMap(map, adventures.adventure ?? []);
|
||||
|
||||
// Manual additions for sources missing from books.json / adventures.json
|
||||
const manual = {
|
||||
|
||||
Reference in New Issue
Block a user