@vibedrift/cli 0.5.5 → 0.5.6
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.js +49 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7414,8 +7414,12 @@ function buildCoherenceMatrix(files) {
|
|
|
7414
7414
|
}
|
|
7415
7415
|
const colCount = categories.length + 3;
|
|
7416
7416
|
const alignedRows = aligned.slice(0, 3).map((f) => fileRow(f)).join("");
|
|
7417
|
-
const collapsedAligned = aligned.length > 3 ? `<tr><td colspan="${colCount}" style="padding:
|
|
7418
|
-
|
|
7417
|
+
const collapsedAligned = aligned.length > 3 ? `<tr><td colspan="${colCount}" style="padding:0"><details style="margin:0">
|
|
7418
|
+
<summary style="cursor:pointer;padding:8px 16px;font-size:12px;color:var(--text-tertiary);list-style:none;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,0.02)">
|
|
7419
|
+
<span class="chevron">▶</span> ${aligned.length - 3} more files at 100% alignment
|
|
7420
|
+
</summary>
|
|
7421
|
+
<table style="width:100%;border-collapse:collapse">${aligned.slice(3).map((f) => fileRow(f)).join("")}</table>
|
|
7422
|
+
</details></td></tr>` : "";
|
|
7419
7423
|
const singleIssueDrifting = /* @__PURE__ */ new Map();
|
|
7420
7424
|
const multiIssueDrifting = [];
|
|
7421
7425
|
for (const f of drifting) {
|
|
@@ -7432,9 +7436,12 @@ function buildCoherenceMatrix(files) {
|
|
|
7432
7436
|
for (const [devKey, files2] of singleIssueDrifting) {
|
|
7433
7437
|
if (files2.length >= 4) {
|
|
7434
7438
|
driftingRows += fileRow(files2[0]);
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7439
|
+
driftingRows += `<tr><td colspan="${colCount}" style="padding:0"><details style="margin:0">
|
|
7440
|
+
<summary style="cursor:pointer;padding:8px 16px;font-size:12px;color:var(--text-tertiary);list-style:none;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,0.02)">
|
|
7441
|
+
<span class="chevron">▶</span> ${files2.length - 1} more files with same issue <span style="color:var(--drift-orange)">(${esc(devKey)})</span>
|
|
7442
|
+
</summary>
|
|
7443
|
+
<table style="width:100%;border-collapse:collapse">${files2.slice(1).map((f) => fileRow(f)).join("")}</table>
|
|
7444
|
+
</details></td></tr>`;
|
|
7438
7445
|
} else {
|
|
7439
7446
|
driftingRows += files2.map((f) => fileRow(f)).join("");
|
|
7440
7447
|
}
|
|
@@ -7677,23 +7684,32 @@ function buildDeviatingBlocks(d) {
|
|
|
7677
7684
|
}
|
|
7678
7685
|
if (isConvention && d.deviatingFiles.length > 4) {
|
|
7679
7686
|
return [...devByPattern.entries()].map(([pattern, files]) => {
|
|
7680
|
-
const fileList = files.map((df) => esc(df.path)).join("
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7687
|
+
const fileList = files.map((df) => `<div style="padding:2px 0;font-size:12px;color:var(--text-secondary)" class="mono">${esc(df.path)}</div>`).join("");
|
|
7688
|
+
return `<div style="background:var(--tint-orange);border-left:3px solid var(--drift-orange);border-radius:0;margin:8px 0">
|
|
7689
|
+
<details>
|
|
7690
|
+
<summary style="cursor:pointer;padding:12px 16px;list-style:none;display:flex;align-items:center;gap:6px">
|
|
7691
|
+
<span class="chevron">▶</span>
|
|
7692
|
+
<span class="label" style="color:var(--drift-orange);margin:0">DRIFT — ${esc(pattern)}</span>
|
|
7693
|
+
<span style="font-size:12px;color:var(--text-tertiary);margin-left:auto">${files.length} files</span>
|
|
7694
|
+
</summary>
|
|
7695
|
+
<div style="padding:4px 16px 12px">${fileList}</div>
|
|
7696
|
+
</details>
|
|
7686
7697
|
</div>`;
|
|
7687
7698
|
}).join("");
|
|
7688
7699
|
}
|
|
7689
|
-
return d.deviatingFiles.slice(0,
|
|
7700
|
+
return d.deviatingFiles.slice(0, 6).map((df) => {
|
|
7690
7701
|
const evidence = df.evidence.slice(0, 3).map(
|
|
7691
7702
|
(e) => `<div style="background:var(--bg-code);padding:6px 12px;border-radius:0;margin:4px 0;overflow-x:auto" class="mono"><span style="color:var(--text-tertiary);margin-right:12px;user-select:none">${e.line}</span>${esc(e.code.slice(0, 120))}</div>`
|
|
7692
7703
|
).join("");
|
|
7693
|
-
return `<div style="background:var(--tint-orange);border-left:3px solid var(--drift-orange);border-radius:0;
|
|
7694
|
-
<
|
|
7695
|
-
|
|
7696
|
-
|
|
7704
|
+
return `<div style="background:var(--tint-orange);border-left:3px solid var(--drift-orange);border-radius:0;margin:8px 0">
|
|
7705
|
+
<details>
|
|
7706
|
+
<summary style="cursor:pointer;padding:10px 16px;list-style:none;display:flex;align-items:center;gap:6px">
|
|
7707
|
+
<span class="chevron">▶</span>
|
|
7708
|
+
<span class="label" style="color:var(--drift-orange);margin:0">DRIFT — ${esc(df.detectedPattern)}</span>
|
|
7709
|
+
<span class="mono" style="font-size:12px;color:var(--text-secondary);margin-left:8px">${esc(df.path)}</span>
|
|
7710
|
+
</summary>
|
|
7711
|
+
<div style="padding:4px 16px 12px">${evidence}</div>
|
|
7712
|
+
</details>
|
|
7697
7713
|
</div>`;
|
|
7698
7714
|
}).join("");
|
|
7699
7715
|
}
|
|
@@ -7728,13 +7744,16 @@ function buildDistributionBar(d) {
|
|
|
7728
7744
|
</div>`;
|
|
7729
7745
|
}
|
|
7730
7746
|
function buildDriftFindings(result) {
|
|
7731
|
-
const driftCats = ["architectural_consistency", "security_posture", "semantic_duplication", "naming_conventions", "phantom_scaffolding"];
|
|
7747
|
+
const driftCats = ["architectural_consistency", "security_posture", "semantic_duplication", "naming_conventions", "phantom_scaffolding", "import_style", "export_style", "async_patterns"];
|
|
7732
7748
|
const catLabels = {
|
|
7733
7749
|
architectural_consistency: "Architectural contradictions",
|
|
7734
7750
|
security_posture: "Security posture gaps",
|
|
7735
7751
|
semantic_duplication: "Semantic duplication",
|
|
7736
7752
|
naming_conventions: "Convention drift",
|
|
7737
|
-
phantom_scaffolding: "Phantom scaffolding"
|
|
7753
|
+
phantom_scaffolding: "Phantom scaffolding",
|
|
7754
|
+
import_style: "Import style drift",
|
|
7755
|
+
export_style: "Export style drift",
|
|
7756
|
+
async_patterns: "Async pattern drift"
|
|
7738
7757
|
};
|
|
7739
7758
|
const groups = driftCats.map((cat) => ({
|
|
7740
7759
|
cat,
|
|
@@ -7761,18 +7780,21 @@ function buildDriftFindings(result) {
|
|
|
7761
7780
|
const rec = recText ? `<div style="margin-top:12px;padding:10px 16px;background:var(--tint-cyan);border-left:3px solid var(--border);border-radius:0;font-size:14px;line-height:1.6;color:var(--text-primary)">
|
|
7762
7781
|
<span style="color:var(--text-secondary);font-weight:700;margin-right:4px">→</span> ${esc(recText)}
|
|
7763
7782
|
</div>` : "";
|
|
7764
|
-
return `<
|
|
7765
|
-
<
|
|
7783
|
+
return `<details style="background:var(--bg-surface);border-radius:0;margin-bottom:10px;border:1px solid var(--border)">
|
|
7784
|
+
<summary style="cursor:pointer;padding:16px 20px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;list-style:none">
|
|
7785
|
+
<span class="chevron">▶</span>
|
|
7766
7786
|
<span class="sev-badge" style="background:${sevColor(d.severity)}">${sevLabel(d.severity)}</span>
|
|
7767
|
-
<span style="font-size:
|
|
7787
|
+
<span style="font-size:14px;font-weight:500;color:var(--text-primary);flex:1">${esc(d.finding)}</span>
|
|
7768
7788
|
<span class="mono" style="font-size:12px;color:var(--text-tertiary)">${d.dominantCount}/${d.totalRelevantFiles}</span>
|
|
7789
|
+
</summary>
|
|
7790
|
+
<div style="padding:4px 20px 20px">
|
|
7791
|
+
${domBlock}
|
|
7792
|
+
${devBlocks}
|
|
7793
|
+
${distBar}
|
|
7794
|
+
${rec}
|
|
7795
|
+
${closeSplitQualifier}
|
|
7769
7796
|
</div>
|
|
7770
|
-
|
|
7771
|
-
${devBlocks}
|
|
7772
|
-
${distBar}
|
|
7773
|
-
${rec}
|
|
7774
|
-
${closeSplitQualifier}
|
|
7775
|
-
</div>`;
|
|
7797
|
+
</details>`;
|
|
7776
7798
|
}).join("");
|
|
7777
7799
|
return `<details ${gi === 0 ? "open" : ""} style="margin-bottom:8px">
|
|
7778
7800
|
<summary style="cursor:pointer;padding:12px 18px;background:var(--bg-surface);border-radius:0;display:flex;align-items:center;gap:10px;font-size:14px;font-weight:600;color:var(--text-primary);list-style:none;border:1px solid var(--border)">
|