@vibedrift/cli 0.5.5 → 0.5.7
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 +52 -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
|
}
|
|
@@ -7675,25 +7682,37 @@ function buildDeviatingBlocks(d) {
|
|
|
7675
7682
|
if (!devByPattern.has(key)) devByPattern.set(key, []);
|
|
7676
7683
|
devByPattern.get(key).push(df);
|
|
7677
7684
|
}
|
|
7685
|
+
const expectedNote = `<span style="font-size:11px;color:var(--text-tertiary);font-weight:400">expected: ${esc(d.dominantPattern)}</span>`;
|
|
7678
7686
|
if (isConvention && d.deviatingFiles.length > 4) {
|
|
7679
7687
|
return [...devByPattern.entries()].map(([pattern, files]) => {
|
|
7680
|
-
const fileList = files.map((df) => esc(df.path)).join("
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7688
|
+
const fileList = files.map((df) => `<div style="padding:2px 0;font-size:12px;color:var(--text-secondary)" class="mono">${esc(df.path)}</div>`).join("");
|
|
7689
|
+
return `<div style="background:var(--tint-orange);border-left:3px solid var(--drift-orange);border-radius:0;margin:8px 0">
|
|
7690
|
+
<details>
|
|
7691
|
+
<summary style="cursor:pointer;padding:12px 16px;list-style:none;display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
|
7692
|
+
<span class="chevron">▶</span>
|
|
7693
|
+
<span class="label" style="color:var(--drift-orange);margin:0">DRIFT — ${esc(pattern)}</span>
|
|
7694
|
+
${expectedNote}
|
|
7695
|
+
<span style="font-size:12px;color:var(--text-tertiary);margin-left:auto">${files.length} files</span>
|
|
7696
|
+
</summary>
|
|
7697
|
+
<div style="padding:4px 16px 12px">${fileList}</div>
|
|
7698
|
+
</details>
|
|
7686
7699
|
</div>`;
|
|
7687
7700
|
}).join("");
|
|
7688
7701
|
}
|
|
7689
|
-
return d.deviatingFiles.slice(0,
|
|
7702
|
+
return d.deviatingFiles.slice(0, 6).map((df) => {
|
|
7690
7703
|
const evidence = df.evidence.slice(0, 3).map(
|
|
7691
7704
|
(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
7705
|
).join("");
|
|
7693
|
-
return `<div style="background:var(--tint-orange);border-left:3px solid var(--drift-orange);border-radius:0;
|
|
7694
|
-
<
|
|
7695
|
-
|
|
7696
|
-
|
|
7706
|
+
return `<div style="background:var(--tint-orange);border-left:3px solid var(--drift-orange);border-radius:0;margin:8px 0">
|
|
7707
|
+
<details>
|
|
7708
|
+
<summary style="cursor:pointer;padding:10px 16px;list-style:none;display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
|
7709
|
+
<span class="chevron">▶</span>
|
|
7710
|
+
<span class="label" style="color:var(--drift-orange);margin:0">DRIFT — ${esc(df.detectedPattern)}</span>
|
|
7711
|
+
<span class="mono" style="font-size:12px;color:var(--text-secondary);margin-left:8px">${esc(df.path)}</span>
|
|
7712
|
+
<span style="font-size:11px;color:var(--text-tertiary);margin-left:auto">expected: <span style="color:var(--intent-green)">${esc(d.dominantPattern)}</span></span>
|
|
7713
|
+
</summary>
|
|
7714
|
+
<div style="padding:4px 16px 12px">${evidence}</div>
|
|
7715
|
+
</details>
|
|
7697
7716
|
</div>`;
|
|
7698
7717
|
}).join("");
|
|
7699
7718
|
}
|
|
@@ -7728,13 +7747,16 @@ function buildDistributionBar(d) {
|
|
|
7728
7747
|
</div>`;
|
|
7729
7748
|
}
|
|
7730
7749
|
function buildDriftFindings(result) {
|
|
7731
|
-
const driftCats = ["architectural_consistency", "security_posture", "semantic_duplication", "naming_conventions", "phantom_scaffolding"];
|
|
7750
|
+
const driftCats = ["architectural_consistency", "security_posture", "semantic_duplication", "naming_conventions", "phantom_scaffolding", "import_style", "export_style", "async_patterns"];
|
|
7732
7751
|
const catLabels = {
|
|
7733
7752
|
architectural_consistency: "Architectural contradictions",
|
|
7734
7753
|
security_posture: "Security posture gaps",
|
|
7735
7754
|
semantic_duplication: "Semantic duplication",
|
|
7736
7755
|
naming_conventions: "Convention drift",
|
|
7737
|
-
phantom_scaffolding: "Phantom scaffolding"
|
|
7756
|
+
phantom_scaffolding: "Phantom scaffolding",
|
|
7757
|
+
import_style: "Import style drift",
|
|
7758
|
+
export_style: "Export style drift",
|
|
7759
|
+
async_patterns: "Async pattern drift"
|
|
7738
7760
|
};
|
|
7739
7761
|
const groups = driftCats.map((cat) => ({
|
|
7740
7762
|
cat,
|
|
@@ -7761,18 +7783,21 @@ function buildDriftFindings(result) {
|
|
|
7761
7783
|
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
7784
|
<span style="color:var(--text-secondary);font-weight:700;margin-right:4px">→</span> ${esc(recText)}
|
|
7763
7785
|
</div>` : "";
|
|
7764
|
-
return `<
|
|
7765
|
-
<
|
|
7786
|
+
return `<details style="background:var(--bg-surface);border-radius:0;margin-bottom:10px;border:1px solid var(--border)">
|
|
7787
|
+
<summary style="cursor:pointer;padding:16px 20px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;list-style:none">
|
|
7788
|
+
<span class="chevron">▶</span>
|
|
7766
7789
|
<span class="sev-badge" style="background:${sevColor(d.severity)}">${sevLabel(d.severity)}</span>
|
|
7767
|
-
<span style="font-size:
|
|
7790
|
+
<span style="font-size:14px;font-weight:500;color:var(--text-primary);flex:1">${esc(d.finding)}</span>
|
|
7768
7791
|
<span class="mono" style="font-size:12px;color:var(--text-tertiary)">${d.dominantCount}/${d.totalRelevantFiles}</span>
|
|
7792
|
+
</summary>
|
|
7793
|
+
<div style="padding:4px 20px 20px">
|
|
7794
|
+
${domBlock}
|
|
7795
|
+
${devBlocks}
|
|
7796
|
+
${distBar}
|
|
7797
|
+
${rec}
|
|
7798
|
+
${closeSplitQualifier}
|
|
7769
7799
|
</div>
|
|
7770
|
-
|
|
7771
|
-
${devBlocks}
|
|
7772
|
-
${distBar}
|
|
7773
|
-
${rec}
|
|
7774
|
-
${closeSplitQualifier}
|
|
7775
|
-
</div>`;
|
|
7800
|
+
</details>`;
|
|
7776
7801
|
}).join("");
|
|
7777
7802
|
return `<details ${gi === 0 ? "open" : ""} style="margin-bottom:8px">
|
|
7778
7803
|
<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)">
|