@mark1russell7/conventions 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { spawnSync } from "node:child_process";
3
3
  import { appendFileSync, existsSync, readFileSync, readdirSync, statSync } from "node:fs";
4
- import { dirname, extname, join, relative, resolve, sep } from "node:path";
4
+ import { dirname, extname, join, posix, relative, resolve, sep } from "node:path";
5
5
  // src/config.ts
6
6
  /** The fields of the configuration of a rule that are not options. */
7
7
  const RULE_FIELDS = [
@@ -1032,6 +1032,661 @@ const requiredScripts = {
1032
1032
  });
1033
1033
  }
1034
1034
  };
1035
+ // ../site-pages/src/data/status.ts
1036
+ /** An error in the roadmap file, with the file and the line. */
1037
+ var RoadmapParseError = class extends Error {};
1038
+ const STATUS_KEYWORDS = [
1039
+ ["open", /\bnot\s+(?:yet\s+)?(?:started|done|fixed|merged|shipped|released)\b|\bto[ -]?do\b/],
1040
+ ["done", /\b(?:done|shipped|merged|fixed|released|complete|completed|closed|never|dropped|cancell?ed|wontfix)\b|\bwon't do\b/],
1041
+ ["progress", /\bin[ -]progress\b|\b(?:active|ongoing|started|wip)\b/],
1042
+ ["waiting", /\b(?:waiting|waits|awaiting|needs)\b/],
1043
+ ["blocked", /\bblocked\b/],
1044
+ ["later", /\b(?:later|deferred|postponed|someday)\b/]
1045
+ ];
1046
+ /**
1047
+ * This function gives the class of a free-text status: done, progress, waiting, blocked, later or
1048
+ * open. The first keyword of the text decides. A text without a keyword ("next", "open") is open.
1049
+ */
1050
+ function statusClassOf(text) {
1051
+ const lower = String(text ?? "").toLowerCase();
1052
+ let best = {
1053
+ index: Infinity,
1054
+ value: "open"
1055
+ };
1056
+ for (const [value, pattern] of STATUS_KEYWORDS) {
1057
+ const match = pattern.exec(lower);
1058
+ if (match && match.index < best.index) best = {
1059
+ index: match.index,
1060
+ value
1061
+ };
1062
+ }
1063
+ return best.value;
1064
+ }
1065
+ /** This function gives the cells of a table row. A "|" in a code span or after "\" is text. */
1066
+ function splitRow(line) {
1067
+ const cells = [];
1068
+ let cell = "";
1069
+ let code = false;
1070
+ const text = line.trim().replace(/^\|/, "").replace(/\|$/, "");
1071
+ for (let index = 0; index < text.length; index++) {
1072
+ const char = text[index];
1073
+ if (char === "\\" && text[index + 1] === "|") {
1074
+ cell += "|";
1075
+ index++;
1076
+ } else if (char === "`") {
1077
+ code = !code;
1078
+ cell += char;
1079
+ } else if (char === "|" && !code) {
1080
+ cells.push(cell.trim());
1081
+ cell = "";
1082
+ } else cell += char;
1083
+ }
1084
+ cells.push(cell.trim());
1085
+ return cells;
1086
+ }
1087
+ /** A whitespace character, as `\s` of a regular expression and `String.prototype.trim` read it. */
1088
+ const SPACE = /\s/;
1089
+ /** A character that `.` of a regular expression does not match. */
1090
+ const LINE_TERMINATOR = /[\n\r\u2028\u2029]/;
1091
+ /** The first whitespace character at or after `lastIndex`. */
1092
+ const NEXT_SPACE = /\s/g;
1093
+ /**
1094
+ * This function replaces each Markdown link `[label](target)` of a text with the result of
1095
+ * `replace`. The label ends at the first `]`, and the target ends at the first `)`. In `strict`
1096
+ * mode, the label and the target are not empty, and the target has no whitespace.
1097
+ *
1098
+ * @remarks The function reads the text one time. A regular expression for these links can
1099
+ * backtrack (CodeQL `js/polynomial-redos`). For a long text with many `[` characters, its time
1100
+ * grows with the square of the length.
1101
+ */
1102
+ function replaceLinks(text, strict, replace) {
1103
+ let result = "";
1104
+ let copied = 0;
1105
+ let close = -1;
1106
+ let end = -1;
1107
+ let space = -1;
1108
+ for (let open = text.indexOf("["); open !== -1; open = text.indexOf("[", open + 1)) {
1109
+ if (close <= open) close = text.indexOf("]", open + 1);
1110
+ if (close === -1) break;
1111
+ if (text[close + 1] !== "(" || strict && close === open + 1) continue;
1112
+ const start = close + 2;
1113
+ if (end < start) end = text.indexOf(")", start);
1114
+ if (end === -1) break;
1115
+ if (strict) {
1116
+ if (space !== Infinity && space < start) {
1117
+ NEXT_SPACE.lastIndex = start;
1118
+ space = NEXT_SPACE.exec(text)?.index ?? Infinity;
1119
+ }
1120
+ if (end === start || space < end) continue;
1121
+ }
1122
+ result += text.slice(copied, open) + replace(text.slice(open + 1, close), text.slice(start, end));
1123
+ copied = end + 1;
1124
+ open = end;
1125
+ }
1126
+ return result + text.slice(copied);
1127
+ }
1128
+ /**
1129
+ * This function gives the text of an ATX heading without its closing sequence: the whitespace,
1130
+ * then the `#` characters, then the whitespace at the end. It gives null when the rest has a line
1131
+ * terminator, as the regular expression `(.*?)\s*#*\s*$` does.
1132
+ */
1133
+ function closeHeading(text) {
1134
+ let end = text.length;
1135
+ while (end > 0 && SPACE.test(text[end - 1] ?? "")) end--;
1136
+ while (end > 0 && text[end - 1] === "#") end--;
1137
+ while (end > 0 && SPACE.test(text[end - 1] ?? "")) end--;
1138
+ const rest = text.slice(0, end);
1139
+ return LINE_TERMINATOR.test(rest) ? null : rest;
1140
+ }
1141
+ /** The start of an ATX heading. The text after the whitespace goes to `closeHeading`. */
1142
+ const HEADING = /^(#{1,6})\s+(\S[\s\S]*)?$/;
1143
+ /** This function gives the level and the text of an ATX heading line, or null for another line. */
1144
+ function headingOf(line) {
1145
+ const match = HEADING.exec(line);
1146
+ const text = match ? closeHeading(match[2] ?? "") : null;
1147
+ return match && text !== null ? {
1148
+ level: match[1]?.length ?? 0,
1149
+ text
1150
+ } : null;
1151
+ }
1152
+ /** This function gives the plain text of inline Markdown: no code marks, no emphasis, the text of each link. */
1153
+ function plainText(markdown) {
1154
+ return replaceLinks(String(markdown ?? ""), false, (label) => label).replace(/[`*_]/g, "").replace(/\s+/g, " ").trim();
1155
+ }
1156
+ /** A cell with no value: empty, or a dash. */
1157
+ function isEmpty(cell) {
1158
+ return cell === void 0 || /^(?:[-–—]|n\/a)?$/i.test(cell.trim());
1159
+ }
1160
+ /**
1161
+ * This function gives the tables of a Markdown file. Each table has its header names in lowercase
1162
+ * plain text, the nearest heading above it, the line of its header and its rows. Fenced code is not read.
1163
+ */
1164
+ function markdownTables(markdown) {
1165
+ const lines = String(markdown).split(/\r?\n/);
1166
+ const tables = [];
1167
+ let section = "";
1168
+ let fence = null;
1169
+ for (let index = 0; index < lines.length; index++) {
1170
+ const line = lines[index] ?? "";
1171
+ const fenceMark = /^\s*(`{3,}|~{3,})/.exec(line)?.[1];
1172
+ if (fenceMark !== void 0) {
1173
+ if (fence === null) fence = fenceMark[0] ?? null;
1174
+ else if (fenceMark[0] === fence) fence = null;
1175
+ continue;
1176
+ }
1177
+ if (fence !== null) continue;
1178
+ const heading = headingOf(line);
1179
+ if (heading) {
1180
+ section = plainText(heading.text);
1181
+ continue;
1182
+ }
1183
+ if (!line.trim().startsWith("|")) continue;
1184
+ const separator = lines[index + 1] ?? "";
1185
+ if (!/^\s*(?:\|\s*)?:?-{3,}/.test(separator)) continue;
1186
+ const header = splitRow(line).map((name) => plainText(name).toLowerCase());
1187
+ const rows = [];
1188
+ let next = index + 2;
1189
+ for (; next < lines.length && (lines[next] ?? "").trim().startsWith("|"); next++) rows.push({
1190
+ line: next + 1,
1191
+ cells: splitRow(lines[next] ?? "")
1192
+ });
1193
+ tables.push({
1194
+ section,
1195
+ line: index + 1,
1196
+ header,
1197
+ rows
1198
+ });
1199
+ index = next - 1;
1200
+ }
1201
+ return tables;
1202
+ }
1203
+ /** The columns whose cells hold the links of an item. */
1204
+ const LINK_COLUMNS = [
1205
+ "where",
1206
+ "commit",
1207
+ "commits",
1208
+ "link",
1209
+ "links",
1210
+ "pr",
1211
+ "prs"
1212
+ ];
1213
+ /** Words before a reference that do not name a repository. */
1214
+ const NOT_REPOSITORIES = new Set("a an and also at by commit commits done fixed for from in into issue issues merged of on or plus pr prs run see the then to via with".split(" "));
1215
+ /** The URL of a link target of the roadmap file: an absolute URL stays, and a relative one goes to GitHub. */
1216
+ function linkUrl(target, { file = "", repository = "", ref = "HEAD" }) {
1217
+ if (/^[a-z][a-z0-9+.-]*:/i.test(target)) return target;
1218
+ if (!repository) return null;
1219
+ const [path = "", anchor = ""] = target.split("#", 2);
1220
+ const resolved = path === "" ? file : posix.normalize(posix.join(posix.dirname(file), path));
1221
+ if (resolved.startsWith("..")) return null;
1222
+ return `https://github.com/${repository}/blob/${ref}/${resolved}${anchor ? `#${anchor}` : ""}`;
1223
+ }
1224
+ /**
1225
+ * This function gives the word right before the whitespace that ends `text.slice(0, end)`, as the
1226
+ * regular expression `([A-Za-z][\w.-]*)\s+$` does. The word starts with a letter. The function
1227
+ * reads only the characters of the word and of the whitespace.
1228
+ */
1229
+ function wordBefore(text, end) {
1230
+ let stop = end;
1231
+ while (stop > 0 && SPACE.test(text[stop - 1] ?? "")) stop--;
1232
+ if (stop === end) return void 0;
1233
+ let start = stop;
1234
+ while (start > 0 && /[\w.-]/.test(text[start - 1] ?? "")) start--;
1235
+ while (start < stop && !/[A-Za-z]/.test(text[start] ?? "")) start++;
1236
+ return start < stop ? text.slice(start, stop) : void 0;
1237
+ }
1238
+ /**
1239
+ * This function gives the links of a cell: each Markdown link, then each bare reference in the rest
1240
+ * of the text. A reference is a pull request ("PR #12", "#12") or a commit hash in a code span.
1241
+ *
1242
+ * @remarks A repository name right before a reference ("systems PR #16") applies to it and to the
1243
+ * next references of the cell. Without a name, a reference belongs to `repository`.
1244
+ */
1245
+ function linksOf(cell, options = {}) {
1246
+ const { repository = "" } = options;
1247
+ const links = [];
1248
+ const seen = /* @__PURE__ */ new Set();
1249
+ const add = (label, url) => {
1250
+ if (!url || seen.has(url)) return;
1251
+ seen.add(url);
1252
+ links.push({
1253
+ label,
1254
+ url
1255
+ });
1256
+ };
1257
+ const rest = replaceLinks(String(cell ?? ""), true, (label, target) => {
1258
+ add(plainText(label), linkUrl(target, options));
1259
+ return " ";
1260
+ });
1261
+ if (!repository) return links;
1262
+ const [owner, defaultRepo] = repository.split("/");
1263
+ let current = defaultRepo;
1264
+ let pulls = false;
1265
+ const reference = /\bPRs?\s*#(\d+)|(?<![\w/&])#(\d+)\b|`([0-9a-f]{7,40})`/g;
1266
+ for (let match = reference.exec(rest); match; match = reference.exec(rest)) {
1267
+ const word = wordBefore(rest, match.index);
1268
+ if (word && !NOT_REPOSITORIES.has(word.toLowerCase())) current = word;
1269
+ const prefix = current === defaultRepo ? "" : `${current} `;
1270
+ if (match[1] !== void 0) pulls = true;
1271
+ const number = match[1] ?? match[2];
1272
+ if (number !== void 0) add(`${prefix}#${number}`, `https://github.com/${owner}/${current}/${pulls ? "pull" : "issues"}/${number}`);
1273
+ else if (match[3] !== void 0) add(`${prefix}${match[3].slice(0, 7)}`, `https://github.com/${owner}/${current}/commit/${match[3]}`);
1274
+ }
1275
+ return links;
1276
+ }
1277
+ /**
1278
+ * The heading of an item: "### `id`: Title". A dash can take the place of the colon. The title goes
1279
+ * to `closeHeading`.
1280
+ */
1281
+ const ITEM_HEADING = /^###\s+`([^`]+)`\s*[:–—-]\s*(\S[\s\S]*)?$/;
1282
+ /** The other heading of an item: "### S1 · Title". The ID is one word before the middle dot. */
1283
+ const ITEM_HEADING_DOT = /^###\s+([A-Za-z0-9][\w.-]*)\s+·\s+(\S[\s\S]*)?$/;
1284
+ /** This function gives the ID and the title of an item heading, or null for another line. */
1285
+ function itemHeadingOf(line) {
1286
+ for (const pattern of [ITEM_HEADING, ITEM_HEADING_DOT]) {
1287
+ const match = pattern.exec(line);
1288
+ const title = match ? closeHeading(match[2] ?? "") : null;
1289
+ if (match && title !== null) return {
1290
+ id: match[1] ?? "",
1291
+ title
1292
+ };
1293
+ }
1294
+ return null;
1295
+ }
1296
+ /**
1297
+ * A field of an item heading: "- Area: Docs", "- **Area:** Docs" or "- **Area**: Docs". The label
1298
+ * matches without case.
1299
+ */
1300
+ const ITEM_FIELD = /^\s*[-*]\s+(\*\*|__)?([A-Za-z][A-Za-z ]*?)(?::\1|\1:)\s*(\S.*)?$/;
1301
+ /** The fields of an item heading that give the optional fields of an item. */
1302
+ const ITEM_FIELDS = {
1303
+ area: "area",
1304
+ owner: "owner",
1305
+ "waits for": "needs",
1306
+ needs: "needs",
1307
+ "depends on": "needs"
1308
+ };
1309
+ /**
1310
+ * This function gives the items of the second form of a roadmap: each heading "### `id`: Title" or
1311
+ * "### id · Title". The list item "Status:" gives the status. Without it, the "##" heading above
1312
+ * the item gives the status, for example "Waiting on Mark", "Later" or "Shipped". A heading without
1313
+ * a status is not an item.
1314
+ *
1315
+ * The list items "Area:", "Owner:" and "Waits for:" give the optional fields. The list item
1316
+ * "Links:" and the other list items give the links. Fenced code is not read.
1317
+ */
1318
+ function headingItems(markdown, options) {
1319
+ const lines = String(markdown).split(/\r?\n/);
1320
+ const items = [];
1321
+ let section = "";
1322
+ let current;
1323
+ let fence = null;
1324
+ for (let index = 0; index < lines.length; index++) {
1325
+ const line = lines[index] ?? "";
1326
+ const fenceMark = /^\s*(`{3,}|~{3,})/.exec(line)?.[1];
1327
+ if (fenceMark !== void 0) {
1328
+ if (fence === null) fence = fenceMark[0] ?? null;
1329
+ else if (fenceMark[0] === fence) fence = null;
1330
+ continue;
1331
+ }
1332
+ if (fence !== null) continue;
1333
+ const heading = headingOf(line);
1334
+ if (heading) {
1335
+ const { level } = heading;
1336
+ if (level > 3) continue;
1337
+ current = void 0;
1338
+ if (level === 2) section = plainText(heading.text);
1339
+ if (level === 1) section = "";
1340
+ if (level !== 3) continue;
1341
+ const item = itemHeadingOf(line);
1342
+ const id = plainText(item?.id);
1343
+ if (!item || isEmpty(id)) continue;
1344
+ current = {
1345
+ id,
1346
+ title: item.title,
1347
+ status: section,
1348
+ statusClass: statusClassOf(section),
1349
+ section,
1350
+ line: index + 1,
1351
+ links: []
1352
+ };
1353
+ items.push(current);
1354
+ continue;
1355
+ }
1356
+ if (!current) continue;
1357
+ const field = ITEM_FIELD.exec(line);
1358
+ const label = (field?.[2] ?? "").trim().toLowerCase();
1359
+ const value = (field?.[3] ?? "").trim();
1360
+ const key = field ? ITEM_FIELDS[label] : void 0;
1361
+ if (field && label === "status") {
1362
+ if (!isEmpty(value)) {
1363
+ current.status = value;
1364
+ current.statusClass = statusClassOf(plainText(value));
1365
+ }
1366
+ } else if (field && key !== void 0) {
1367
+ if (!isEmpty(value)) current[key] = value;
1368
+ } else if (/^\s*[-*]\s+/.test(line)) {
1369
+ const seen = new Set(current.links.map((link) => link.url));
1370
+ for (const link of linksOf(line, options)) if (!seen.has(link.url)) current.links.push(link);
1371
+ }
1372
+ }
1373
+ return items.filter((item) => item.status !== "");
1374
+ }
1375
+ /**
1376
+ * This function gives the items of a roadmap file in the order of the file. It reads two forms:
1377
+ *
1378
+ * - Each row of each table with an `ID` column and a `Status` column. The header names match without
1379
+ * case. The title comes from `Item`, else from `Title`. `Owner`, `Area` and `Needs` are optional.
1380
+ * `Where`, `Commit` and `Links` give the links.
1381
+ * - Each heading "### `id`: Title" or "### id · Title". The list item "Status:", else the "##"
1382
+ * heading above it, gives the status. The list items "Area:", "Owner:" and "Waits for:" give the
1383
+ * optional fields, and "Links:" and the other list items give the links.
1384
+ *
1385
+ * @throws RoadmapParseError when the cells of a row do not match the header
1386
+ */
1387
+ function roadmapItems(markdown, options = {}) {
1388
+ const { file = "ROADMAP.md" } = options;
1389
+ const items = [];
1390
+ for (const table of markdownTables(markdown)) {
1391
+ const column = (...names) => names.map((name) => table.header.indexOf(name)).find((index) => index >= 0) ?? -1;
1392
+ const id = column("id");
1393
+ const status = column("status");
1394
+ if (id < 0 || status < 0) continue;
1395
+ const title = column("item", "title");
1396
+ const owner = column("owner");
1397
+ const area = column("area");
1398
+ const needs = column("needs");
1399
+ const linkColumns = LINK_COLUMNS.map((name) => table.header.indexOf(name)).filter((index) => index >= 0);
1400
+ for (const row of table.rows) {
1401
+ if (row.cells.length !== table.header.length) throw new RoadmapParseError(`${file}:${row.line}: the row has ${row.cells.length} cells, and the header has ${table.header.length}`);
1402
+ const idText = plainText(row.cells[id]);
1403
+ if (isEmpty(idText)) continue;
1404
+ const statusText = row.cells[status] ?? "";
1405
+ const item = {
1406
+ id: idText,
1407
+ title: title >= 0 ? row.cells[title] ?? "" : "",
1408
+ status: statusText,
1409
+ statusClass: statusClassOf(plainText(statusText)),
1410
+ section: table.section,
1411
+ line: row.line,
1412
+ links: linkColumns.flatMap((index) => linksOf(row.cells[index], {
1413
+ ...options,
1414
+ file
1415
+ }))
1416
+ };
1417
+ const optional = (index) => index >= 0 && !isEmpty(row.cells[index]) ? row.cells[index] : void 0;
1418
+ const ownerText = optional(owner);
1419
+ const areaText = optional(area);
1420
+ const needsText = optional(needs);
1421
+ if (ownerText !== void 0) item.owner = ownerText;
1422
+ if (areaText !== void 0) item.area = areaText;
1423
+ if (needsText !== void 0) item.needs = needsText;
1424
+ items.push(item);
1425
+ }
1426
+ }
1427
+ const headings = headingItems(markdown, {
1428
+ ...options,
1429
+ file
1430
+ });
1431
+ return headings.length === 0 ? items : [...items, ...headings].sort((a, b) => a.line - b.line);
1432
+ }
1433
+ /**
1434
+ * This function gives the items of a roadmap file, as the Status page reads them. It fails when the file has no item.
1435
+ *
1436
+ * @throws RoadmapParseError when the cells of a row do not match the header
1437
+ * @throws RoadmapParseError when the roadmap has no item: no table with an ID and a Status column, and no item heading
1438
+ */
1439
+ function parseRoadmap(markdown, options = {}) {
1440
+ const { file = "ROADMAP.md" } = options;
1441
+ const items = roadmapItems(markdown, options);
1442
+ if (items.length === 0) throw new RoadmapParseError(`${file}: no table with an ID column and a Status column, and no heading "### \`id\`: Title"`);
1443
+ return items;
1444
+ }
1445
+ String.raw`
1446
+ const boxes = Array.from(document.querySelectorAll("[data-sp-timeline]"));
1447
+ const panels = new Map(Array.from(document.querySelectorAll("[data-sp-release]"), (panel) => [panel.dataset.version, panel]));
1448
+ const reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1449
+ let selected = (document.querySelector("[data-sp-release]:not([hidden])") || {}).dataset?.version;
1450
+ const markIn = (box, version) => Array.from(box.querySelectorAll("[data-sp-mark]")).find((mark) => mark.dataset.version === version);
1451
+ function reveal(box, version, smooth) {
1452
+ const mark = markIn(box, version);
1453
+ if (!mark || box.scrollWidth <= box.clientWidth) return;
1454
+ const x = Number(mark.dataset.x);
1455
+ const margin = Number(mark.dataset.half) + 16;
1456
+ if (x - margin >= box.scrollLeft && x + margin <= box.scrollLeft + box.clientWidth) return;
1457
+ box.scrollTo({ left: x - box.clientWidth / 2, behavior: smooth && !reduced ? "smooth" : "auto" });
1458
+ }
1459
+ function select(version, box) {
1460
+ const panel = panels.get(version);
1461
+ if (!panel) return;
1462
+ selected = version;
1463
+ for (const each of boxes) {
1464
+ for (const mark of each.querySelectorAll("[data-sp-mark]")) {
1465
+ const on = mark.dataset.version === version;
1466
+ mark.classList.toggle("sp-selected", on);
1467
+ mark.setAttribute("aria-pressed", String(on));
1468
+ mark.setAttribute("tabindex", on ? "0" : "-1");
1469
+ }
1470
+ }
1471
+ for (const [key, each] of panels) each.hidden = key !== version;
1472
+ if (box) {
1473
+ const mark = markIn(box, version);
1474
+ if (mark) mark.focus({ preventScroll: true });
1475
+ reveal(box, version, true);
1476
+ }
1477
+ try {
1478
+ history.replaceState(null, "", "#" + encodeURIComponent(panel.id));
1479
+ } catch {}
1480
+ }
1481
+ for (const box of boxes) {
1482
+ box.addEventListener("click", (event) => {
1483
+ const mark = event.target.closest("[data-sp-mark]");
1484
+ if (mark) select(mark.dataset.version, box);
1485
+ });
1486
+ box.addEventListener("keydown", (event) => {
1487
+ const mark = event.target.closest("[data-sp-mark]");
1488
+ if (!mark || event.altKey || event.ctrlKey || event.metaKey) return;
1489
+ const marks = Array.from(box.querySelectorAll("[data-sp-mark]"));
1490
+ const position = marks.indexOf(mark);
1491
+ const targets = { ArrowLeft: position - 1, ArrowRight: position + 1, Home: 0, End: marks.length - 1, Enter: position, " ": position };
1492
+ if (!(event.key in targets)) return;
1493
+ event.preventDefault();
1494
+ const next = marks[Math.max(0, Math.min(marks.length - 1, targets[event.key]))];
1495
+ if (next) select(next.dataset.version, box);
1496
+ });
1497
+ }
1498
+ document.addEventListener("click", (event) => {
1499
+ const button = event.target.closest("[data-sp-toggle]");
1500
+ const list = button && document.getElementById(button.getAttribute("aria-controls"));
1501
+ if (!list) return;
1502
+ const open = button.getAttribute("aria-expanded") !== "true";
1503
+ for (const extra of list.querySelectorAll(":scope > .sp-extra")) extra.hidden = !open;
1504
+ button.setAttribute("aria-expanded", String(open));
1505
+ const label = button.querySelector("[data-sp-label]");
1506
+ if (label) label.textContent = open ? button.dataset.less : button.dataset.more;
1507
+ });
1508
+ // A malformed hash, for example "#100%", must not stop the module
1509
+ let hashed = "";
1510
+ try {
1511
+ hashed = decodeURIComponent(location.hash.slice(1));
1512
+ } catch {}
1513
+ for (const [version, panel] of panels) if (panel.id === hashed) select(version, null);
1514
+ const revealAll = () => { for (const box of boxes) reveal(box, selected, false); };
1515
+ revealAll();
1516
+ window.addEventListener("resize", revealAll);
1517
+ `;
1518
+ String.raw`
1519
+ function relativeTime(then, now) {
1520
+ const seconds = Math.round((now - then) / 1000);
1521
+ if (!Number.isFinite(seconds)) return "at an unknown time";
1522
+ if (seconds < 60) return "just now";
1523
+ const steps = [[60, "minute"], [3600, "hour"], [86400, "day"], [2592000, "month"], [31536000, "year"]];
1524
+ let unit = steps[0];
1525
+ for (const step of steps) if (seconds >= step[0]) unit = step;
1526
+ const count = Math.floor(seconds / unit[0]);
1527
+ return count + " " + unit[1] + (count === 1 ? "" : "s") + " ago";
1528
+ }
1529
+ function listOf(text) {
1530
+ return (text || "").split(",").filter((part) => part !== "");
1531
+ }
1532
+ ` + String.raw`
1533
+ const now = Date.now();
1534
+ for (const time of document.querySelectorAll("time[data-sp-rel]")) {
1535
+ time.textContent = relativeTime(Date.parse(time.dateTime), now) + " (" + time.title + ")";
1536
+ }
1537
+ const board = document.querySelector("[data-sp-board]");
1538
+ if (board) {
1539
+ const classChips = Array.from(board.querySelectorAll("[data-sp-class]"));
1540
+ const sectionChips = Array.from(board.querySelectorAll("[data-sp-section]"));
1541
+ const groups = Array.from(board.querySelectorAll("[data-sp-group]"));
1542
+ const shown = board.querySelector("[data-sp-shown]");
1543
+ const empty = board.querySelector("[data-sp-empty]");
1544
+ const clear = board.querySelector("[data-sp-clear]");
1545
+ const done = board.querySelector("[data-sp-done]");
1546
+ const query = new URLSearchParams(location.search);
1547
+ const state = {
1548
+ classes: listOf(query.get("status")).filter((value) => classChips.some((chip) => chip.dataset.spClass === value)),
1549
+ sections: listOf(query.get("section")),
1550
+ };
1551
+ if (done && query.get("done") === "1") done.open = true;
1552
+ const apply = (write) => {
1553
+ for (const chip of classChips) chip.setAttribute("aria-pressed", String(state.classes.includes(chip.dataset.spClass)));
1554
+ for (const chip of sectionChips) chip.setAttribute("aria-pressed", String(state.sections.includes(chip.dataset.spSection)));
1555
+ let count = 0;
1556
+ for (const group of groups) {
1557
+ const isDone = group.dataset.class === "done";
1558
+ const classOn = isDone || state.classes.length === 0 || state.classes.includes(group.dataset.class);
1559
+ let visible = 0;
1560
+ for (const row of group.querySelectorAll("tr[data-section]")) {
1561
+ const on = classOn && (state.sections.length === 0 || state.sections.includes(row.dataset.section));
1562
+ row.hidden = !on;
1563
+ if (on) visible++;
1564
+ }
1565
+ if (isDone) {
1566
+ const none = group.querySelector("[data-sp-done-empty]");
1567
+ if (none) none.hidden = visible > 0;
1568
+ } else {
1569
+ group.hidden = visible === 0;
1570
+ const badge = group.querySelector("[data-sp-group-count]");
1571
+ if (badge) badge.textContent = String(visible);
1572
+ count += visible;
1573
+ }
1574
+ }
1575
+ if (shown) shown.textContent = count + " of " + shown.dataset.label;
1576
+ if (empty) empty.hidden = count > 0;
1577
+ if (clear) clear.hidden = state.classes.length === 0 && state.sections.length === 0;
1578
+ if (done) {
1579
+ const label = done.querySelector("[data-sp-done-label]");
1580
+ if (label) label.textContent = done.open ? "Hide the done items" : "Show the done items";
1581
+ }
1582
+ if (!write) return;
1583
+ const next = new URLSearchParams(location.search);
1584
+ const put = (key, value) => (value ? next.set(key, value) : next.delete(key));
1585
+ put("status", state.classes.join(","));
1586
+ put("section", state.sections.join(","));
1587
+ put("done", done && done.open ? "1" : "");
1588
+ const search = next.toString();
1589
+ try {
1590
+ history.replaceState(null, "", location.pathname + (search ? "?" + search : "") + location.hash);
1591
+ } catch {}
1592
+ };
1593
+ const toggle = (list, value) => (list.includes(value) ? list.filter((each) => each !== value) : list.concat(value));
1594
+ board.addEventListener("click", (event) => {
1595
+ const chip = event.target.closest("button");
1596
+ if (!chip) return;
1597
+ if (chip.dataset.spClass) state.classes = toggle(state.classes, chip.dataset.spClass);
1598
+ else if (chip.dataset.spSection) state.sections = toggle(state.sections, chip.dataset.spSection);
1599
+ else if (chip.hasAttribute("data-sp-clear")) {
1600
+ state.classes = [];
1601
+ state.sections = [];
1602
+ } else return;
1603
+ apply(true);
1604
+ });
1605
+ if (done) done.addEventListener("toggle", () => apply(true));
1606
+ apply(false);
1607
+ }
1608
+ `;
1609
+ // src/rules/roadmap-parses.ts
1610
+ /**
1611
+ * The rule `roadmap-parses`: each roadmap that a workflow gives to the Status page parses, on the pull request.
1612
+ */
1613
+ /** A workflow file. */
1614
+ const WORKFLOW = /^\.github\/workflows\/[^/]+\.ya?ml$/;
1615
+ /** This function gives the value of a `roadmap: <file>` line, or undefined for another line, an empty value or an expression. */
1616
+ function roadmapOfLine(line) {
1617
+ const text = line.trimStart();
1618
+ if (!text.startsWith("roadmap:")) return void 0;
1619
+ let value = text.slice(8);
1620
+ const comment = value.indexOf(" #");
1621
+ if (comment >= 0) value = value.slice(0, comment);
1622
+ value = value.trim();
1623
+ const quote = value.charAt(0);
1624
+ if (value.length >= 2 && (quote === "\"" || quote === "'") && value.endsWith(quote)) value = value.slice(1, -1).trim();
1625
+ if (value === "" || value.includes("${{")) return void 0;
1626
+ return cleanPath(value);
1627
+ }
1628
+ const roadmapParses = {
1629
+ id: "roadmap-parses",
1630
+ title: "Each roadmap that a workflow gives to the Status page (the input `roadmap`) parses as site-pages reads it.",
1631
+ reason: "Only the Pages job on main reads the roadmap. A pull request with a bad table row passes each check, and then the build of the site stops and the site stays stale. On 2026-10-30, one repository had 3 red Pages runs in a row because of one row with 2 cells under a header with 4.",
1632
+ fix: "Correct the row or the heading that the message names. Each table row has one cell for each column of its header, and the file has a table with an ID column and a Status column, or a heading \"### `id`: Title\".",
1633
+ sources: [{
1634
+ repo: "fleet",
1635
+ rule: "fail-closed",
1636
+ doc: "docs/STRATEGY.md (2026-10-30, gates and probes fail closed)"
1637
+ }],
1638
+ options: { roadmaps: {
1639
+ type: "strings",
1640
+ default: [],
1641
+ description: "More roadmap files to check: a roadmap that no workflow names with a `roadmap:` key."
1642
+ } },
1643
+ check(context, options) {
1644
+ const files = context.gitFiles();
1645
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
1646
+ const named = [];
1647
+ for (const file of files.filter((path) => WORKFLOW.test(path)).sort(byCode)) readFileSync(join(context.root, file), "utf8").split(/\r?\n/).forEach((line, index) => {
1648
+ const roadmap = roadmapOfLine(line);
1649
+ if (roadmap !== void 0) named.push({
1650
+ roadmap,
1651
+ file,
1652
+ line: index + 1
1653
+ });
1654
+ });
1655
+ for (const roadmap of options["roadmaps"]) named.push({
1656
+ roadmap: cleanPath(roadmap),
1657
+ file: "the option roadmaps",
1658
+ line: 0
1659
+ });
1660
+ if (named.length === 0) return { skipped: "no workflow names a roadmap (the input roadmap of the Pages workflow)" };
1661
+ const breaks = [];
1662
+ const seen = /* @__PURE__ */ new Set();
1663
+ for (const { roadmap, file, line } of named) {
1664
+ if (seen.has(roadmap)) continue;
1665
+ seen.add(roadmap);
1666
+ if (!existsSync(join(context.root, roadmap))) {
1667
+ breaks.push({
1668
+ file: line > 0 ? file : roadmap,
1669
+ ...line > 0 ? { line } : {},
1670
+ message: `${file} names the roadmap ${roadmap}, and the file does not exist.`
1671
+ });
1672
+ continue;
1673
+ }
1674
+ try {
1675
+ parseRoadmap(readFileSync(join(context.root, roadmap), "utf8"), { file: roadmap });
1676
+ } catch (error) {
1677
+ if (!(error instanceof RoadmapParseError)) throw error;
1678
+ const at = /^[^:]+:(\d+): /.exec(error.message);
1679
+ const rest = at ? error.message.slice(at[0].length) : error.message.slice(error.message.indexOf(": ") + 2);
1680
+ breaks.push({
1681
+ file: roadmap,
1682
+ ...at ? { line: Number(at[1]) } : {},
1683
+ message: `${roadmap}: ${rest}`
1684
+ });
1685
+ }
1686
+ }
1687
+ return breaks;
1688
+ }
1689
+ };
1035
1690
  // src/rules/source-main.ts
1036
1691
  /**
1037
1692
  * The rule `source-main`: a workspace package is a source package, and a public package moves its
@@ -1167,6 +1822,46 @@ const sourceMain = {
1167
1822
  return breaks;
1168
1823
  }
1169
1824
  };
1825
+ // src/rules/tests-required.ts
1826
+ /**
1827
+ * The rule `tests-required`: no test runner passes when it finds no test (`passWithNoTests`).
1828
+ */
1829
+ /** The files that set the options of a test runner: its configs, and package.json for the scripts. */
1830
+ const RUNNER_FILE = /(?:^|\/)(?:(?:vitest|vite|jest|playwright)(?:\.[\w-]+)*\.config\.[cm]?[jt]s|vitest\.workspace\.[cm]?[jt]s|package\.json)$/;
1831
+ /** The option in a config (`passWithNoTests: true`) or on a command line (`--passWithNoTests`, `--pass-with-no-tests`). */
1832
+ const PASS_WITH_NO_TESTS = /passWithNoTests\s*:\s*true|--passWithNoTests(?!=false)|--pass-with-no-tests(?!=false)/;
1833
+ const testsRequired = {
1834
+ id: "tests-required",
1835
+ title: "No test runner passes when it finds no test: no `passWithNoTests: true` in a config, and no `--passWithNoTests` in a script.",
1836
+ reason: "With the option, a test step that finds 0 tests passes. A broken include pattern, a moved folder or a renamed file then turns the gate green with no test run. In the fleet audit of 2026-10-30, vex had the option in all 9 vitest configs and client in 2 packages that have tests.",
1837
+ fix: "Remove the option. A package with no tests has no test script, so the shared CI skips it. A package whose tests a later change adds keeps no test script until then.",
1838
+ sources: [{
1839
+ repo: "fleet",
1840
+ rule: "fail-closed",
1841
+ doc: "docs/STRATEGY.md (2026-10-30, gates and probes fail closed)"
1842
+ }],
1843
+ options: {},
1844
+ check(context) {
1845
+ const files = context.gitFiles();
1846
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
1847
+ const breaks = [];
1848
+ for (const file of files.filter((path) => RUNNER_FILE.test(path)).sort(byCode)) {
1849
+ let text;
1850
+ try {
1851
+ text = readFileSync(join(context.root, file), "utf8");
1852
+ } catch {
1853
+ continue;
1854
+ }
1855
+ const index = text.split(/\r?\n/).findIndex((line) => PASS_WITH_NO_TESTS.test(line));
1856
+ if (index >= 0) breaks.push({
1857
+ file,
1858
+ line: index + 1,
1859
+ message: `${file} lets the tests pass when they find no test (passWithNoTests).`
1860
+ });
1861
+ }
1862
+ return breaks;
1863
+ }
1864
+ };
1170
1865
  // src/rules/tsconfig-test.ts
1171
1866
  /**
1172
1867
  * The rule `tsconfig-test`: each TypeScript package has a `tsconfig.test.json`, and its typecheck
@@ -1260,6 +1955,217 @@ const tsconfigTest = {
1260
1955
  return breaks;
1261
1956
  }
1262
1957
  };
1958
+ // src/rules/typed-files.ts
1959
+ /**
1960
+ * The rule `typed-files`: each TypeScript file that git keeps is in a tsconfig that a `typecheck`
1961
+ * script examines.
1962
+ */
1963
+ /** A TypeScript source: `.ts`, `.tsx`, `.mts` or `.cts`, and not a declaration file. */
1964
+ const TYPESCRIPT = /\.(?:[cm]?ts|tsx)$/;
1965
+ const DECLARATION = /\.d\.(?:[cm]?ts|tsx)$/;
1966
+ /** The compilers that read `-p <config>` (or `tsconfig.json` without it). */
1967
+ const COMPILERS = /* @__PURE__ */ new Set([
1968
+ "tsc",
1969
+ "tsgo",
1970
+ "vue-tsc"
1971
+ ]);
1972
+ /** This function gives the commands of a script: its parts between `&&`, `||`, `;`, `|` and parentheses, each as words. */
1973
+ function commandsOf(script) {
1974
+ return script.split(/&&|\|\||[;|()]/).map((part) => part.trim().split(/\s+/).filter((word) => word !== "")).filter((words) => words.length > 0);
1975
+ }
1976
+ /** The last part of a path of a command (`node_modules/.bin/tsc` gives `tsc`). */
1977
+ const commandName = (word) => word.slice(word.lastIndexOf("/") + 1);
1978
+ /** This function gives the configs that one `tsc` command examines, from the words after the command. */
1979
+ function compilerConfigs(words) {
1980
+ const configs = [];
1981
+ let named = false;
1982
+ for (let index = 0; index < words.length; index++) {
1983
+ const word = words[index];
1984
+ if (word === "-p" || word === "--project") {
1985
+ const next = words[index + 1];
1986
+ if (next !== void 0) configs.push(next);
1987
+ named = true;
1988
+ index++;
1989
+ } else if (word.startsWith("-p=") || word.startsWith("--project=")) {
1990
+ configs.push(word.slice(word.indexOf("=") + 1));
1991
+ named = true;
1992
+ } else if (word === "-b" || word === "--build") {
1993
+ named = true;
1994
+ let more = 0;
1995
+ while (words[index + 1] !== void 0 && !words[index + 1].startsWith("-")) {
1996
+ configs.push(words[index + 1]);
1997
+ index++;
1998
+ more++;
1999
+ }
2000
+ if (more === 0) configs.push("tsconfig.json");
2001
+ }
2002
+ }
2003
+ if (!named) configs.push("tsconfig.json");
2004
+ return configs;
2005
+ }
2006
+ /** This function gives the configs that one `typecheck` script examines, relative to the folder of the package. */
2007
+ function configsOfScript(script) {
2008
+ const configs = [];
2009
+ for (const words of commandsOf(script)) {
2010
+ const at = words.findIndex((word) => COMPILERS.has(commandName(word)) || commandName(word) === "svelte-check");
2011
+ if (at < 0) continue;
2012
+ const rest = words.slice(at + 1);
2013
+ if (commandName(words[at]) !== "svelte-check") {
2014
+ configs.push(...compilerConfigs(rest));
2015
+ continue;
2016
+ }
2017
+ for (let index = 0; index < rest.length; index++) {
2018
+ const word = rest[index];
2019
+ if (word === "--tsconfig" && rest[index + 1] !== void 0) configs.push(rest[index + 1]);
2020
+ else if (word.startsWith("--tsconfig=")) configs.push(word.slice(11));
2021
+ }
2022
+ }
2023
+ return configs.map((config) => config.replace(/^["']|["']$/g, ""));
2024
+ }
2025
+ /** The package managers whose `run <script>` (or `<script>`) starts another script of the same package. */
2026
+ const MANAGERS = /* @__PURE__ */ new Set([
2027
+ "pnpm",
2028
+ "npm",
2029
+ "yarn",
2030
+ "bun"
2031
+ ]);
2032
+ /** The options that start the script in other packages: the rule reads those packages on their own. */
2033
+ const OTHER_PACKAGES = /^(?:-r|--recursive|-F|--filter(?:=.*)?|--workspaces?|-w|-ws)$/;
2034
+ /**
2035
+ * This function gives the text of the script `name` and of each script of the same package that it
2036
+ * starts (`pnpm run typecheck:scripts`), once each.
2037
+ */
2038
+ function scriptsOf(scripts, name, seen = /* @__PURE__ */ new Set()) {
2039
+ const text = scripts[name];
2040
+ if (typeof text !== "string" || seen.has(name)) return [];
2041
+ seen.add(name);
2042
+ const texts = [text];
2043
+ for (const part of text.split(/&&|\|\||[;|]/)) {
2044
+ const words = part.trim().split(/\s+/);
2045
+ if (!MANAGERS.has(words[0] ?? "") || words.some((word) => OTHER_PACKAGES.test(word))) continue;
2046
+ const rest = words.slice(1).filter((word) => !word.startsWith("-"));
2047
+ const next = rest[0] === "run" || rest[0] === "run-script" ? rest[1] : rest[0];
2048
+ if (next !== void 0) texts.push(...scriptsOf(scripts, next, seen));
2049
+ }
2050
+ return texts;
2051
+ }
2052
+ /** This function gives the path of `bin/tsc` of `typescript` of the repository, or of this package, or `undefined`. */
2053
+ function findTsc(root) {
2054
+ for (const from of [join(root, "package.json"), import.meta.url]) try {
2055
+ const tsc = join(dirname(createRequire(from).resolve("typescript/package.json")), "bin", "tsc");
2056
+ if (existsSync(tsc)) return tsc;
2057
+ } catch {}
2058
+ }
2059
+ /** This function gives the files of the program of one config (`tsc --listFilesOnly`), or the error of tsc. */
2060
+ function listFiles(tsc, config) {
2061
+ const result = spawnSync(process.execPath, [
2062
+ tsc,
2063
+ "-p",
2064
+ config,
2065
+ "--listFilesOnly"
2066
+ ], {
2067
+ encoding: "utf8",
2068
+ maxBuffer: 67108864
2069
+ });
2070
+ const lines = (result.stdout ?? "").split(/\r?\n/).filter((line) => line.trim() !== "");
2071
+ if (result.status !== 0) return { error: (result.stderr || result.stdout || `exit ${String(result.status)}`).trim().split(/\r?\n/)[0] ?? "" };
2072
+ return { files: lines.map((line) => line.trim()) };
2073
+ }
2074
+ /** This function gives the paths of the `references` of a config, as absolute paths. */
2075
+ function referencesOf(config) {
2076
+ const json = readJsonc(config);
2077
+ const references = typeof json === "object" && json !== null ? json.references : void 0;
2078
+ if (!Array.isArray(references)) return [];
2079
+ return references.flatMap((item) => typeof item === "object" && item !== null && typeof item.path === "string" ? [resolve(dirname(config), item.path)] : []);
2080
+ }
2081
+ /** The path of `file` relative to `root`, with `/`. */
2082
+ const fromRoot = (root, file) => relative(root, file).split("\\").join("/");
2083
+ const typedFiles = {
2084
+ id: "typed-files",
2085
+ title: "Each TypeScript file that git keeps is in a tsconfig that a `typecheck` script examines: the tests, the e2e specs, the scripts, the benches and the configs too.",
2086
+ reason: "A file that no tsconfig of a typecheck holds has no type check. Its type errors hide until it runs, and a broken test or script can pass a gate. A test runner such as vitest strips the types, so it does not examine them. In the fleet audit of 2026-10-30, every repository had such files (in one, 90 of 612 files, its e2e specs among them), and the new checks found real defects.",
2087
+ fix: "Add the file to the `include` of a tsconfig that the `typecheck` script names (for example `tsconfig.test.json`, with `*.config.ts`, `scripts/**`, `bench/**` and `e2e/**`). A config file at the root of a package needs `rootDir: \".\"` there. For the files at the root of the repository, add a `tsconfig.repo.json` and name it in the root `typecheck`. A file that cannot be in a typecheck (it imports a module that only a tool makes) goes in `ignore` with its reason.",
2088
+ sources: [{
2089
+ repo: "fleet",
2090
+ rule: "fail-closed",
2091
+ doc: "docs/STRATEGY.md (2026-10-30, gates and probes fail closed)"
2092
+ }],
2093
+ options: { configs: {
2094
+ type: "strings",
2095
+ default: [],
2096
+ description: "More tsconfig files, relative to the root, that CI examines with another command (for example a script that the typecheck starts)."
2097
+ } },
2098
+ check(context, options) {
2099
+ const tracked = context.gitFiles();
2100
+ if (tracked === void 0) return { skipped: "the root is not in a git repository" };
2101
+ const files = tracked.filter((file) => TYPESCRIPT.test(file) && !DECLARATION.test(file)).sort(byCode);
2102
+ if (files.length === 0) return [];
2103
+ const tsc = findTsc(context.root);
2104
+ if (tsc === void 0) return [{
2105
+ file: "package.json",
2106
+ message: "The rule cannot find typescript, so it cannot read the tsconfig files.",
2107
+ fix: "Add typescript to the devDependencies of the root package."
2108
+ }];
2109
+ const breaks = [];
2110
+ const queue = [];
2111
+ const packages = [context.rootPackage, ...codePackages(context).filter((info) => info !== context.rootPackage)];
2112
+ for (const info of packages) {
2113
+ const scripts = info.manifest["scripts"];
2114
+ const table = typeof scripts === "object" && scripts !== null ? scripts : {};
2115
+ if (typeof table["typecheck"] !== "string") continue;
2116
+ for (const config of scriptsOf(table, "typecheck").flatMap(configsOfScript)) {
2117
+ const path = resolve(info.dir, config);
2118
+ if (!existsSync(path)) {
2119
+ const line = lineOf(info.text, "\"typecheck\"");
2120
+ breaks.push({
2121
+ file: info.file,
2122
+ ...line === void 0 ? {} : { line },
2123
+ message: `The script typecheck names ${inFolder(info.folder, config)}, and that file does not exist.`
2124
+ });
2125
+ continue;
2126
+ }
2127
+ queue.push(path);
2128
+ }
2129
+ }
2130
+ const extra = Array.isArray(options["configs"]) ? options["configs"] : [];
2131
+ for (const config of extra) {
2132
+ const path = resolve(context.root, config);
2133
+ if (!existsSync(path)) breaks.push({
2134
+ file: "package.json",
2135
+ message: `The option configs names ${config}, and that file does not exist.`
2136
+ });
2137
+ else queue.push(path);
2138
+ }
2139
+ const covered = /* @__PURE__ */ new Set();
2140
+ const seen = /* @__PURE__ */ new Set();
2141
+ while (queue.length > 0) {
2142
+ let path = queue.shift();
2143
+ if (existsSync(path) && statSync(path).isDirectory()) path = join(path, "tsconfig.json");
2144
+ if (seen.has(path)) continue;
2145
+ seen.add(path);
2146
+ queue.push(...referencesOf(path));
2147
+ const listed = listFiles(tsc, path);
2148
+ if ("error" in listed) {
2149
+ breaks.push({
2150
+ file: fromRoot(context.root, path),
2151
+ message: `tsc cannot list the files of ${fromRoot(context.root, path)}: ${listed.error}`
2152
+ });
2153
+ continue;
2154
+ }
2155
+ for (const name of listed.files) covered.add(fromRoot(context.root, resolve(name)));
2156
+ }
2157
+ if (seen.size === 0) breaks.push({
2158
+ file: "package.json",
2159
+ message: "No typecheck script names a tsconfig, so no TypeScript file has a type check.",
2160
+ fix: "Add a script typecheck (`tsc -p tsconfig.json`) to each package."
2161
+ });
2162
+ for (const file of files) if (!covered.has(file)) breaks.push({
2163
+ file,
2164
+ message: `${file} is in no tsconfig that a typecheck script examines.`
2165
+ });
2166
+ return breaks;
2167
+ }
2168
+ };
1263
2169
  // src/rules/typed-scripts.ts
1264
2170
  /**
1265
2171
  * The rule `typed-scripts`: git keeps no JavaScript source and no shell script with logic. Each
@@ -1440,7 +2346,10 @@ const RULES = [
1440
2346
  noBuildOutput,
1441
2347
  noLocalPaths,
1442
2348
  releaseFiles,
1443
- typedScripts
2349
+ typedScripts,
2350
+ typedFiles,
2351
+ testsRequired,
2352
+ roadmapParses
1444
2353
  ];
1445
2354
  // src/run.ts
1446
2355
  /**
@@ -1730,6 +2639,6 @@ function runCli(args, io) {
1730
2639
  if (summary) appendFileSync(summary, summaryMarkdown(result));
1731
2640
  return result.failed ? 1 : 0;
1732
2641
  }
1733
- export { cleanPath as A, specifiersOf as B, DEFAULT_ALLOWED as C, STRICT_OPTIONS as D, noBuildOutput as E, lineOf as F, defaultOptions as G, globToRegExp as H, matchesAny as I, parseConfig as K, parseJsonc as L, hasFile as M, inFolder as N, cuePreset as O, keyLine as P, readJsonc as R, pinnedGitDeps as S, noLocalPaths as T, packageFolders as U, globFolders as V, workspaceGlobs as W, sourceMain as _, listRules as a, isGitSpecifier as b, runCli as c, workspaceProtocol as d, typedScripts as f, pathsOf as g, isSourcePath as h, formatResult as i, codePackages as j, DEPENDENCY_FIELDS as k, summaryMarkdown as l, tsconfigTest as m, annotations as n, readConfig as o, hasTests as p, createContext as r, runChecks as s, USAGE as t, RULES as u, requiredScripts as v, HOME_PATTERNS as w, isPinned as x, releaseFiles as y, runGit as z };
2642
+ export { HOME_PATTERNS as A, keyLine as B, roadmapParses as C, isPinned as D, isGitSpecifier as E, DEPENDENCY_FIELDS as F, runGit as G, matchesAny as H, cleanPath as I, globToRegExp as J, specifiersOf as K, codePackages as L, noBuildOutput as M, STRICT_OPTIONS as N, pinnedGitDeps as O, cuePreset as P, parseConfig as Q, hasFile as R, roadmapOfLine as S, releaseFiles as T, parseJsonc as U, lineOf as V, readJsonc as W, workspaceGlobs as X, packageFolders as Y, defaultOptions as Z, tsconfigTest as _, listRules as a, pathsOf as b, runCli as c, workspaceProtocol as d, typedScripts as f, hasTests as g, typedFiles as h, formatResult as i, noLocalPaths as j, DEFAULT_ALLOWED as k, summaryMarkdown as l, scriptsOf as m, annotations as n, readConfig as o, configsOfScript as p, globFolders as q, createContext as r, runChecks as s, USAGE as t, RULES as u, testsRequired as v, requiredScripts as w, sourceMain as x, isSourcePath as y, inFolder as z };
1734
2643
 
1735
- //# sourceMappingURL=run-AxDtnOOy.js.map
2644
+ //# sourceMappingURL=run-BYTCunT5.js.map