@takagaki/cortex-decisions-viewer 0.4.22 → 0.4.24
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 +15 -1
- package/dist/render.js +42 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -149,6 +149,7 @@ async function readFleetSources(repoRoot) {
|
|
|
149
149
|
? s.matchKeys.map((k) => String(k)).filter(Boolean)
|
|
150
150
|
: undefined,
|
|
151
151
|
driveSync: typeof s.driveSync === "boolean" ? s.driveSync : undefined,
|
|
152
|
+
enabled: typeof s.enabled === "boolean" ? s.enabled : undefined,
|
|
152
153
|
}))
|
|
153
154
|
: undefined;
|
|
154
155
|
const pipelines = Array.isArray(obj.pipelines)
|
|
@@ -160,9 +161,21 @@ async function readFleetSources(repoRoot) {
|
|
|
160
161
|
lastSuccess: p.lastSuccess != null ? String(p.lastSuccess) : undefined,
|
|
161
162
|
lastConclusion: p.lastConclusion != null ? String(p.lastConclusion) : undefined,
|
|
162
163
|
lastRun: p.lastRun != null ? String(p.lastRun) : undefined,
|
|
164
|
+
applicable: typeof p.applicable === "boolean" ? p.applicable : undefined,
|
|
163
165
|
}))
|
|
164
166
|
: undefined;
|
|
165
|
-
|
|
167
|
+
// 能力→ツールの宣言マップ(例: { チャット: "slack", 開発: "none" })。"none" は未使用のグレー行表示に使う
|
|
168
|
+
let tools;
|
|
169
|
+
if (obj.tools != null && typeof obj.tools === "object" && !Array.isArray(obj.tools)) {
|
|
170
|
+
tools = {};
|
|
171
|
+
for (const [k, v] of Object.entries(obj.tools)) {
|
|
172
|
+
if (typeof v === "string")
|
|
173
|
+
tools[k] = v;
|
|
174
|
+
}
|
|
175
|
+
if (!Object.keys(tools).length)
|
|
176
|
+
tools = undefined;
|
|
177
|
+
}
|
|
178
|
+
return { externalSources, internalSources, pipelines, tools };
|
|
166
179
|
}
|
|
167
180
|
/** ディレクトリ内の .md を汎用レコードとして読み込む(存在しなければ空配列) */
|
|
168
181
|
async function loadGenericRecords(dirAbs, exclude, repoBaseUrl, branch) {
|
|
@@ -947,6 +960,7 @@ async function build(opts) {
|
|
|
947
960
|
externalSources: fleet.externalSources,
|
|
948
961
|
internalSources: fleet.internalSources,
|
|
949
962
|
pipelines: fleet.pipelines,
|
|
963
|
+
tools: fleet.tools,
|
|
950
964
|
};
|
|
951
965
|
// サムネイル(デザイン画面等)をサイトに同梱し、ノードのパスをサイト内相対に書き換える
|
|
952
966
|
await node_fs_1.promises.mkdir(outAbs, { recursive: true });
|
package/dist/render.js
CHANGED
|
@@ -360,6 +360,11 @@ a.ds-name:hover { text-decoration: underline; }
|
|
|
360
360
|
.ds-group > .ds-list { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--border); }
|
|
361
361
|
.badge.ds-sum-ok { background: #e9f7ef; color: #1f7a45; }
|
|
362
362
|
.badge.ds-sum-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
|
|
363
|
+
/* 未使用(非活性)行: アダプターとして存在するが、この案件では設定されていないもの */
|
|
364
|
+
.ds-card.ds-inactive, .ds-pipe.ds-inactive { background: #f8f9fa; border-style: dashed; box-shadow: none; }
|
|
365
|
+
.ds-inactive .ds-icon { filter: grayscale(1); opacity: .55; }
|
|
366
|
+
.ds-inactive .ds-type, .ds-inactive .ds-name, .ds-inactive a.ds-name, .ds-inactive .ds-pipe-label { color: #9ca3af; }
|
|
367
|
+
.ds-inactive-note { font-size: 12px; color: #9ca3af; line-height: 1.6; flex: 0 0 auto; }
|
|
363
368
|
.ds-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
|
|
364
369
|
.badge.ds-gold { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
|
|
365
370
|
.badge.ds-excluded { background: #eceef1; color: #6b7280; }
|
|
@@ -736,7 +741,11 @@ const CLIENT_JS = `
|
|
|
736
741
|
var internals = SITE.internalSources || [];
|
|
737
742
|
var sources = SITE.externalSources || [];
|
|
738
743
|
var pipes = SITE.pipelines || [];
|
|
739
|
-
|
|
744
|
+
// 能力→ツールの宣言(例: チャット: "none")。"none" の能力は「未使用」のグレー行で存在だけ見せる
|
|
745
|
+
var tools = SITE.tools || {};
|
|
746
|
+
var chatOff = tools["チャット"] === "none";
|
|
747
|
+
var devOff = tools["開発"] === "none";
|
|
748
|
+
if (!internals.length && !sources.length && !pipes.length && !chatOff && !devOff) return; // すべて無ければセクションごと出さない
|
|
740
749
|
|
|
741
750
|
var sec = el("section", { class: "datasources" });
|
|
742
751
|
sec.appendChild(el("h2", { class: "datasources-head", text: "データソースと自動化" }));
|
|
@@ -761,13 +770,18 @@ const CLIENT_JS = `
|
|
|
761
770
|
if (s.driveSync === false) {
|
|
762
771
|
col.appendChild(el("span", { class: "ds-drive-note", text: "Drive自動同期は未設定(手動で置いたファイルの変換のみ)" }));
|
|
763
772
|
}
|
|
764
|
-
|
|
773
|
+
// 未使用(enabled: false)はグレー行。アダプターの存在は見せつつ、この案件では設定されていないことを示す
|
|
774
|
+
var inactive = s.enabled === false;
|
|
775
|
+
if (inactive) {
|
|
776
|
+
col.appendChild(el("span", { class: "ds-inactive-note", text: "未使用(この案件では設定されていません)" }));
|
|
777
|
+
}
|
|
778
|
+
var card = el("div", { class: "ds-card" + (inactive ? " ds-inactive" : "") }, [
|
|
765
779
|
el("div", { class: "ds-card-main" }, [
|
|
766
780
|
el("span", { class: "ds-icon", text: DS_KIND_ICON[s.kind] || "📁" }),
|
|
767
781
|
el("span", { class: "ds-type", text: s.kind || "" }),
|
|
768
782
|
col,
|
|
769
783
|
]),
|
|
770
|
-
s.lastSync && dsFmtTime(s.lastSync)
|
|
784
|
+
!inactive && s.lastSync && dsFmtTime(s.lastSync)
|
|
771
785
|
? el("span", { class: "ds-sync", text: "最終同期: " + dsFmtTime(s.lastSync) })
|
|
772
786
|
: null,
|
|
773
787
|
]);
|
|
@@ -777,7 +791,7 @@ const CLIENT_JS = `
|
|
|
777
791
|
sec.appendChild(el("p", { class: "ds-note", text: "これらの更新は毎晩の Gold 昇格が読み取ります。" }));
|
|
778
792
|
}
|
|
779
793
|
|
|
780
|
-
if (sources.length) {
|
|
794
|
+
if (sources.length || chatOff || devOff) {
|
|
781
795
|
sec.appendChild(el("div", { class: "ds-sub", text: "外部ソース(ライブ参照)" }));
|
|
782
796
|
// ツール(type)別にグループ化し、多いグループ(4件以上)は折りたたむ
|
|
783
797
|
var groups = [];
|
|
@@ -789,6 +803,8 @@ const CLIENT_JS = `
|
|
|
789
803
|
});
|
|
790
804
|
var UNIT = { "slack": "チャンネル", "github-issues": "リポジトリ", "github-discussions": "リポジトリ" };
|
|
791
805
|
var wrap = el("div", { class: "ds-list" });
|
|
806
|
+
// チャット未使用: Slackグループの位置(先頭)に「存在するが未設定」のグレー行を出す
|
|
807
|
+
if (chatOff) wrap.appendChild(inactiveSourceRow("💬", "チャット"));
|
|
792
808
|
groups.forEach(function (g) {
|
|
793
809
|
var meta = DS_TYPE[g.type] || { icon: "🔗", label: g.type || "その他" };
|
|
794
810
|
var cards = el("div", { class: "ds-list" });
|
|
@@ -808,6 +824,8 @@ const CLIENT_JS = `
|
|
|
808
824
|
while (cards.firstChild) wrap.appendChild(cards.firstChild);
|
|
809
825
|
}
|
|
810
826
|
});
|
|
827
|
+
// 開発未使用: GitHubグループの位置(末尾)にグレー行を出す
|
|
828
|
+
if (devOff) wrap.appendChild(inactiveSourceRow("🐙", "GitHub"));
|
|
811
829
|
sec.appendChild(wrap);
|
|
812
830
|
}
|
|
813
831
|
|
|
@@ -815,6 +833,15 @@ const CLIENT_JS = `
|
|
|
815
833
|
sec.appendChild(el("div", { class: "ds-sub", text: "自動化パイプライン" }));
|
|
816
834
|
var plist = el("div", { class: "ds-pipes" });
|
|
817
835
|
pipes.forEach(function (p) {
|
|
836
|
+
// tools宣言上この案件の対象外(applicable: false)はグレー行。✅❌や最終成功は出さない
|
|
837
|
+
// (スキップ正常終了のrunが成功表示に見えるため)。存在自体は見せる
|
|
838
|
+
if (p.applicable === false) {
|
|
839
|
+
plist.appendChild(el("div", { class: "ds-pipe ds-inactive" }, [
|
|
840
|
+
el("span", { class: "ds-pipe-label", text: p.label || p.id || "" }),
|
|
841
|
+
el("span", { class: "ds-inactive-note", text: "未使用" }),
|
|
842
|
+
]));
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
818
845
|
var t = p.lastSuccess ? dsFmtTime(p.lastSuccess) : "";
|
|
819
846
|
var children = [];
|
|
820
847
|
if (p.lastConclusion === "success") {
|
|
@@ -831,6 +858,17 @@ const CLIENT_JS = `
|
|
|
831
858
|
|
|
832
859
|
app.appendChild(sec);
|
|
833
860
|
}
|
|
861
|
+
// 未使用能力のプレースホルダ行(アダプターとして存在するが、この案件では設定されていないもの)
|
|
862
|
+
function inactiveSourceRow(icon, typeLabel) {
|
|
863
|
+
return el("div", { class: "ds-card ds-inactive" }, [
|
|
864
|
+
el("div", { class: "ds-card-main" }, [
|
|
865
|
+
el("span", { class: "ds-icon", text: icon }),
|
|
866
|
+
el("span", { class: "ds-type", text: typeLabel }),
|
|
867
|
+
el("span", { class: "ds-name", text: "未使用" }),
|
|
868
|
+
]),
|
|
869
|
+
el("span", { class: "ds-inactive-note", text: "この案件では設定されていません" }),
|
|
870
|
+
]);
|
|
871
|
+
}
|
|
834
872
|
// 外部ソース1件のカード(グループ化表示・展開表示の両方から使う)
|
|
835
873
|
function extSourceCard(s, meta) {
|
|
836
874
|
var badges = el("div", { class: "ds-badges" });
|
package/package.json
CHANGED