@specatlas/core 0.1.25 → 0.1.26
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.
- package/dist/index.d.ts +3 -2
- package/dist/index.js +33 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1804,10 +1804,11 @@ interface LivingFix {
|
|
|
1804
1804
|
file: string;
|
|
1805
1805
|
date: string;
|
|
1806
1806
|
result: string;
|
|
1807
|
-
domain?: string;
|
|
1808
|
-
title?: string;
|
|
1809
1807
|
covers: string[];
|
|
1810
1808
|
content: string;
|
|
1809
|
+
source: 'living' | 'archive';
|
|
1810
|
+
domain?: string;
|
|
1811
|
+
title?: string;
|
|
1811
1812
|
}
|
|
1812
1813
|
declare function parseFixCovers(content: string): string[];
|
|
1813
1814
|
declare function parseLivingFix(content: string, file: string): LivingFix;
|
package/dist/index.js
CHANGED
|
@@ -1513,12 +1513,43 @@ function parseLivingFix(content, file) {
|
|
|
1513
1513
|
date: typeof data["date"] === "string" ? data["date"] : "",
|
|
1514
1514
|
result: typeof data["result"] === "string" ? data["result"] : "pass",
|
|
1515
1515
|
covers: coversOf(data["covers"]),
|
|
1516
|
-
content: fm.body.trimStart()
|
|
1516
|
+
content: fm.body.trimStart(),
|
|
1517
|
+
source: "living"
|
|
1517
1518
|
};
|
|
1518
1519
|
if (typeof data["domain"] === "string") fix.domain = data["domain"];
|
|
1519
1520
|
if (typeof data["title"] === "string") fix.title = data["title"];
|
|
1520
1521
|
return fix;
|
|
1521
1522
|
}
|
|
1523
|
+
async function archivedFixes(root, known) {
|
|
1524
|
+
const archiveDir = path4.join(root, ".sdd", "changes", "archive");
|
|
1525
|
+
const fixes = [];
|
|
1526
|
+
for (const entry of await listDirs(archiveDir)) {
|
|
1527
|
+
const dir = path4.join(archiveDir, entry);
|
|
1528
|
+
const fixFile = path4.join(dir, "fix.md");
|
|
1529
|
+
const fixRaw = await readTextIfExists(fixFile);
|
|
1530
|
+
if (fixRaw === void 0) continue;
|
|
1531
|
+
const metaFile = path4.join(dir, "meta.yaml");
|
|
1532
|
+
const metaRaw = await readTextIfExists(metaFile);
|
|
1533
|
+
const meta = metaRaw !== void 0 ? parseChangeMeta(metaRaw, metaFile).meta : void 0;
|
|
1534
|
+
if (meta?.lane !== "fix") continue;
|
|
1535
|
+
const slug = entry.replace(/^\d{4}-\d{2}-/, "");
|
|
1536
|
+
if (known.has(slug)) continue;
|
|
1537
|
+
const evidence = parseVerifyFile(fixRaw, fixFile).evidence;
|
|
1538
|
+
const fix = {
|
|
1539
|
+
slug,
|
|
1540
|
+
file: fixFile,
|
|
1541
|
+
date: /^(\d{4}-\d{2})/.exec(entry)?.[1] ?? "",
|
|
1542
|
+
result: evidence.some((e) => e.result === "pass") ? "pass" : evidence.length > 0 ? "fail" : "pending",
|
|
1543
|
+
covers: parseFixCovers(fixRaw),
|
|
1544
|
+
content: parseFrontmatter(fixRaw, fixFile).body.trimStart(),
|
|
1545
|
+
source: "archive"
|
|
1546
|
+
};
|
|
1547
|
+
if (meta.domain !== void 0) fix.domain = meta.domain;
|
|
1548
|
+
if (meta.title !== void 0) fix.title = meta.title;
|
|
1549
|
+
fixes.push(fix);
|
|
1550
|
+
}
|
|
1551
|
+
return fixes;
|
|
1552
|
+
}
|
|
1522
1553
|
async function loadLivingFixes(root) {
|
|
1523
1554
|
const dir = path4.join(root, LIVING_FIXES_DIR);
|
|
1524
1555
|
const entries = (await listDir(dir)).filter((entry) => entry.toLowerCase().endsWith(".md")).sort();
|
|
@@ -1529,6 +1560,7 @@ async function loadLivingFixes(root) {
|
|
|
1529
1560
|
if (content === void 0) continue;
|
|
1530
1561
|
fixes.push(parseLivingFix(content, file));
|
|
1531
1562
|
}
|
|
1563
|
+
fixes.push(...await archivedFixes(root, new Set(fixes.map((fix) => fix.slug))));
|
|
1532
1564
|
return fixes.sort((a, b) => b.date.localeCompare(a.date) || b.slug.localeCompare(a.slug));
|
|
1533
1565
|
}
|
|
1534
1566
|
async function writeLivingFix(root, input) {
|