@lsctech/polaris 0.3.8 → 0.3.10
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/cli/adopt-canon.js +10 -1
- package/package.json +1 -1
package/dist/cli/adopt-canon.js
CHANGED
|
@@ -51,7 +51,16 @@ async function enrichCanonFiles(repoRoot) {
|
|
|
51
51
|
const indexPath = (0, node_path_1.join)(repoRoot, ".polaris", "map", "index.json");
|
|
52
52
|
if (!(0, node_fs_1.existsSync)(indexPath))
|
|
53
53
|
return;
|
|
54
|
-
const
|
|
54
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)(indexPath, "utf-8"));
|
|
55
|
+
// entries may be an array of {doc_path,route,title} OR an object keyed by file path
|
|
56
|
+
const rawEntries = raw["entries"] ?? [];
|
|
57
|
+
const entries = Array.isArray(rawEntries)
|
|
58
|
+
? rawEntries
|
|
59
|
+
: Object.entries(rawEntries).map(([filePath, meta]) => ({
|
|
60
|
+
doc_path: filePath,
|
|
61
|
+
route: String(meta["route"] ?? ""),
|
|
62
|
+
title: meta["title"] ? String(meta["title"]) : undefined,
|
|
63
|
+
}));
|
|
55
64
|
const summaryDirs = [];
|
|
56
65
|
walkForSummaryDirs(repoRoot, repoRoot, summaryDirs);
|
|
57
66
|
for (const dir of summaryDirs) {
|