@takagaki/cortex-decisions-viewer 0.12.25 → 0.12.27
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/build.js +1 -72
- package/dist/render.js +243 -1240
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -40,8 +40,6 @@ exports.PROJECT_ICON_EXTS = void 0;
|
|
|
40
40
|
exports.sanitizeBody = sanitizeBody;
|
|
41
41
|
exports.findProjectIcon = findProjectIcon;
|
|
42
42
|
exports.readFleetSources = readFleetSources;
|
|
43
|
-
exports.readHarnessSchedules = readHarnessSchedules;
|
|
44
|
-
exports.readHarnessShelf = readHarnessShelf;
|
|
45
43
|
exports.readGoldProposals = readGoldProposals;
|
|
46
44
|
exports.buildHomeGrounding = buildHomeGrounding;
|
|
47
45
|
exports.collectMeetings = collectMeetings;
|
|
@@ -589,64 +587,6 @@ async function readFleetSources(repoRoot) {
|
|
|
589
587
|
}
|
|
590
588
|
return { externalSources, slackWorkspaces, internalSources, pipelines, capabilities, fleetGeneratedAt, secretSources, secretSpaces, checks, githubOwners, backlogTarget };
|
|
591
589
|
}
|
|
592
|
-
/**
|
|
593
|
-
* いまオンになっているハーネスの機能(リポジトリ直下 `ハーネス連携/schedules.json`)を読む。
|
|
594
|
-
*
|
|
595
|
-
* **読み方は readFleetSources と同じ流儀**——素通しはせず、明示の許可リストを通す。
|
|
596
|
-
* このファイルは engine 側(プラン生成)と画面の両方が読む正本で、engine が先に欄を
|
|
597
|
-
* 増やすことがある。**知らないものは画面へ載せない**が唯一の安全側。
|
|
598
|
-
* 篩の実体は render.ts の `sanitizeHarnessSchedules`(画面側の楽観更新と同じ関数を通す
|
|
599
|
-
* ——写経して2枚にすると、片方だけ語彙を増やしたときに静かに食い違う)。
|
|
600
|
-
*
|
|
601
|
-
* **無い・壊れているときは undefined**(=「何もオンでない」と同じ見え方)。
|
|
602
|
-
* 壊れの検知はプラン生成(赤で落ちる)と intake の責務で、画面がそれを兼ねると
|
|
603
|
-
* 「読めないから何も出さない」と「1件もオンでない」の区別が画面に出せない。
|
|
604
|
-
*/
|
|
605
|
-
async function readHarnessSchedules(repoRoot) {
|
|
606
|
-
let json;
|
|
607
|
-
try {
|
|
608
|
-
const raw = await node_fs_1.promises.readFile(path.join(repoRoot, "ハーネス連携", "schedules.json"), "utf8");
|
|
609
|
-
json = JSON.parse(raw);
|
|
610
|
-
}
|
|
611
|
-
catch {
|
|
612
|
-
return undefined; // 無い・壊れている → キーごと出さない
|
|
613
|
-
}
|
|
614
|
-
if (json == null || typeof json !== "object" || Array.isArray(json))
|
|
615
|
-
return undefined;
|
|
616
|
-
const rows = json.schedules;
|
|
617
|
-
if (!Array.isArray(rows))
|
|
618
|
-
return undefined;
|
|
619
|
-
return (0, render_1.sanitizeHarnessSchedules)(rows);
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* この案件で使う機能の棚(リポジトリ直下 `ハーネス連携/shelf.json`)を読む。
|
|
623
|
-
*
|
|
624
|
-
* **読み方は readHarnessSchedules と同じ流儀**(無い/壊れ→undefined・在れば配列)。
|
|
625
|
-
* ただし**意味が1つ違う**: このファイルは「無い」ことに意味がある(設計 B-1)。
|
|
626
|
-
* - 無い … まだ棚を作っていない → 画面はオン中の行を**注記なしで**並べる
|
|
627
|
-
* - 在って空 … 意図した空 → 画面は空状態の文言に倒す
|
|
628
|
-
* ここで空配列と undefined を同一視すると、**画面がこの2つを言い分けられなくなる**
|
|
629
|
-
*(導入直後の既存案件が、いきなり「棚に無いがオン」の注記だらけになる)。
|
|
630
|
-
*
|
|
631
|
-
* `items` が配列でなければ undefined。**黙って [] にしない**——手で書いた棚を
|
|
632
|
-
* 「0件の棚」として画面に出すと、空状態の文言が嘘になる(intake 側の2分岐と同じ判断)。
|
|
633
|
-
*/
|
|
634
|
-
async function readHarnessShelf(repoRoot) {
|
|
635
|
-
let json;
|
|
636
|
-
try {
|
|
637
|
-
const raw = await node_fs_1.promises.readFile(path.join(repoRoot, "ハーネス連携", "shelf.json"), "utf8");
|
|
638
|
-
json = JSON.parse(raw);
|
|
639
|
-
}
|
|
640
|
-
catch {
|
|
641
|
-
return undefined; // 無い・壊れている → キーごと出さない(=まだ棚を作っていない)
|
|
642
|
-
}
|
|
643
|
-
if (json == null || typeof json !== "object" || Array.isArray(json))
|
|
644
|
-
return undefined;
|
|
645
|
-
const rows = json.items;
|
|
646
|
-
if (!Array.isArray(rows))
|
|
647
|
-
return undefined;
|
|
648
|
-
return (0, render_1.sanitizeHarnessShelf)(rows);
|
|
649
|
-
}
|
|
650
590
|
/**
|
|
651
591
|
* AIからの更新提案(`.cortex/gold-proposals.json`)を読む。
|
|
652
592
|
*
|
|
@@ -1844,10 +1784,6 @@ async function build(opts) {
|
|
|
1844
1784
|
computeLayout(graph); // 各ノードに x/y を書き込む(クライアントはこれを初期位置に使いウォームアップ省略)
|
|
1845
1785
|
// データソースと自動化(fleet-status.json 由来)。無ければ undefined でセクション非表示。
|
|
1846
1786
|
const fleet = await readFleetSources(repoRoot);
|
|
1847
|
-
// いまオンになっているハーネスの機能。無ければ undefined でタイルは「すべてオフ」
|
|
1848
|
-
const harnessSchedules = await readHarnessSchedules(repoRoot);
|
|
1849
|
-
// この案件で使う機能の棚。**無ければ undefined のまま**(「まだ棚を作っていない」)
|
|
1850
|
-
const harnessShelf = await readHarnessShelf(repoRoot);
|
|
1851
1787
|
// すでにある会議(投入モーダルの「会議名」の選択肢)。intake の有無に関わらず載せる——
|
|
1852
1788
|
// 出し分けは表示側の仕事で、ここで絞ると「投入の口を後から付けたら選択肢が空」になる
|
|
1853
1789
|
const meetings = await collectMeetings(repoRoot);
|
|
@@ -1901,14 +1837,7 @@ async function build(opts) {
|
|
|
1901
1837
|
checks: fleet.checks,
|
|
1902
1838
|
githubOwners: fleet.githubOwners,
|
|
1903
1839
|
backlogTarget: fleet.backlogTarget,
|
|
1904
|
-
//
|
|
1905
|
-
// 「画面が読む欄を build.ts が受け渡しているか」を `名前:` の字面で走査しており、
|
|
1906
|
-
// 短縮記法にすると、その守りの外へ静かに落ちる
|
|
1907
|
-
harnessSchedules: harnessSchedules,
|
|
1908
|
-
// 同上(短縮記法にしない)。**undefined のまま渡すのが仕様**——「棚が無い」と
|
|
1909
|
-
// 「棚が空」を画面が言い分けるための材料で、ここで [] へ倒すと区別が消える
|
|
1910
|
-
harnessShelf: harnessShelf,
|
|
1911
|
-
// 同上(短縮記法にしない)。**undefined ならキーごと出さない**——画面は
|
|
1840
|
+
// **undefined ならキーごと出さない**——画面は
|
|
1912
1841
|
// 「アイコンがある/無い」をキーの有無で見る(空の器を通さない)
|
|
1913
1842
|
projectIcon: projectIcon ? { file: projectIcon.file, repoPath: projectIcon.repoPath } : undefined,
|
|
1914
1843
|
// null(無い・壊れ・version違い)は undefined へ落とす——SiteData の
|