depwire-cli 0.9.6 → 0.9.8
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.
|
@@ -4381,12 +4381,12 @@ function displayTable(headers, rows) {
|
|
|
4381
4381
|
}
|
|
4382
4382
|
function displayStats(report) {
|
|
4383
4383
|
console.log(chalk.cyan.bold("\n\u{1F4CA} Summary\n"));
|
|
4384
|
-
console.log(` Total symbols analyzed: ${chalk.bold(report.totalSymbols.toLocaleString())}`);
|
|
4385
|
-
console.log(` Potentially dead: ${chalk.yellow.bold(report.deadSymbols)} (${report.deadPercentage.toFixed(1)}%)`);
|
|
4384
|
+
console.log(` Total symbols analyzed: ${chalk.bold((report.totalSymbols ?? 0).toLocaleString())}`);
|
|
4385
|
+
console.log(` Potentially dead: ${chalk.yellow.bold(report.deadSymbols ?? 0)} (${(report.deadPercentage ?? 0).toFixed(1)}%)`);
|
|
4386
4386
|
console.log(
|
|
4387
|
-
` By confidence: ${chalk.red(report.byConfidence
|
|
4387
|
+
` By confidence: ${chalk.red(report.byConfidence?.high ?? 0)} high, ${chalk.yellow(report.byConfidence?.medium ?? 0)} medium, ${chalk.gray(report.byConfidence?.low ?? 0)} low`
|
|
4388
4388
|
);
|
|
4389
|
-
const estimatedLines = report.deadSymbols * 18;
|
|
4389
|
+
const estimatedLines = (report.deadSymbols ?? 0) * 18;
|
|
4390
4390
|
console.log(` Estimated dead code: ${chalk.gray(`~${estimatedLines.toLocaleString()} lines`)}
|
|
4391
4391
|
`);
|
|
4392
4392
|
}
|
|
@@ -4489,7 +4489,7 @@ function timestamp(version, date, fileCount, symbolCount) {
|
|
|
4489
4489
|
return blockquote(`Auto-generated by Depwire ${version} on ${date} | ${fileCount.toLocaleString()} files, ${symbolCount.toLocaleString()} symbols`);
|
|
4490
4490
|
}
|
|
4491
4491
|
function formatNumber(n) {
|
|
4492
|
-
return n.toLocaleString();
|
|
4492
|
+
return (n ?? 0).toLocaleString();
|
|
4493
4493
|
}
|
|
4494
4494
|
function formatPercent(value, total) {
|
|
4495
4495
|
if (total === 0) return "0.0%";
|
|
@@ -8299,23 +8299,40 @@ function generateDeadCode(graph, projectRoot, projectName) {
|
|
|
8299
8299
|
});
|
|
8300
8300
|
let output = "";
|
|
8301
8301
|
output += header(`${projectName} - Dead Code Analysis`, 1);
|
|
8302
|
-
|
|
8302
|
+
const version = process.env.npm_package_version || "0.9.7";
|
|
8303
|
+
const date = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" });
|
|
8304
|
+
const fileCount = graph.order;
|
|
8305
|
+
const symbolCount = report.totalSymbols;
|
|
8306
|
+
output += timestamp(version, date, fileCount, symbolCount);
|
|
8303
8307
|
output += "\n";
|
|
8304
8308
|
output += header("Summary", 2);
|
|
8305
|
-
|
|
8309
|
+
if (report.deadSymbols === 0) {
|
|
8310
|
+
output += "\u2705 **No dead code detected!**\n\n";
|
|
8311
|
+
output += "All symbols in this codebase have at least one dependent. This indicates:\n\n";
|
|
8312
|
+
output += "- Clean architecture with no orphaned functions or unused exports\n";
|
|
8313
|
+
output += "- Active codebase with well-maintained dependencies\n";
|
|
8314
|
+
output += "- Or very few symbols (small project)\n\n";
|
|
8315
|
+
output += `Total symbols analyzed: **${formatNumber(report.totalSymbols ?? 0)}**
|
|
8306
8316
|
|
|
8307
8317
|
`;
|
|
8308
|
-
|
|
8318
|
+
output += "---\n\n";
|
|
8319
|
+
output += "_This document was auto-generated by Depwire._\n";
|
|
8320
|
+
return output;
|
|
8321
|
+
}
|
|
8322
|
+
output += `Total symbols analyzed: **${formatNumber(report.totalSymbols ?? 0)}**
|
|
8323
|
+
|
|
8324
|
+
`;
|
|
8325
|
+
output += `Potentially dead symbols: **${formatNumber(report.deadSymbols ?? 0)}** (${(report.deadPercentage ?? 0).toFixed(1)}%)
|
|
8309
8326
|
|
|
8310
8327
|
`;
|
|
8311
|
-
output += `- \u{1F534} High confidence (definitely dead): **${report.byConfidence
|
|
8328
|
+
output += `- \u{1F534} High confidence (definitely dead): **${report.byConfidence?.high ?? 0}**
|
|
8312
8329
|
`;
|
|
8313
|
-
output += `- \u{1F7E1} Medium confidence (probably dead): **${report.byConfidence
|
|
8330
|
+
output += `- \u{1F7E1} Medium confidence (probably dead): **${report.byConfidence?.medium ?? 0}**
|
|
8314
8331
|
`;
|
|
8315
|
-
output += `- \u26AA Low confidence (might be dead): **${report.byConfidence
|
|
8332
|
+
output += `- \u26AA Low confidence (might be dead): **${report.byConfidence?.low ?? 0}**
|
|
8316
8333
|
|
|
8317
8334
|
`;
|
|
8318
|
-
const estimatedLines = report.deadSymbols * 18;
|
|
8335
|
+
const estimatedLines = (report.deadSymbols ?? 0) * 18;
|
|
8319
8336
|
output += `Estimated dead code: **~${formatNumber(estimatedLines)} lines**
|
|
8320
8337
|
|
|
8321
8338
|
`;
|
package/dist/index.js
CHANGED
package/dist/mcpb-entry.js
CHANGED
|
@@ -153,7 +153,13 @@ function startPlayback() {
|
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
// If we're at the last snapshot, start from the beginning
|
|
157
|
+
if (currentIndex >= temporalData.snapshots.length - 1) {
|
|
158
|
+
currentIndex = 0;
|
|
159
|
+
goToSnapshot(0);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
console.log(`Temporal playback started: ${temporalData.snapshots.length} snapshots at ${playSpeed}x speed`);
|
|
157
163
|
isPlaying = true;
|
|
158
164
|
document.getElementById('playBtn').innerHTML = `
|
|
159
165
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
@@ -270,13 +276,20 @@ function renderArcDiagram(snapshot) {
|
|
|
270
276
|
const margin = { top: 60, right: 40, bottom: 120, left: 40 };
|
|
271
277
|
const plotWidth = width - margin.left - margin.right;
|
|
272
278
|
const plotHeight = height - margin.top - margin.bottom;
|
|
273
|
-
const baseline = margin.top + plotHeight;
|
|
279
|
+
const baseline = margin.top + plotHeight; // Position baseline at consistent percentage
|
|
274
280
|
|
|
275
281
|
const totalSymbols = d3.sum(snapshot.files, (d) => d.symbols);
|
|
276
282
|
const minBarWidth = 4;
|
|
277
283
|
const gap = 2;
|
|
278
284
|
|
|
279
|
-
|
|
285
|
+
// Calculate total width needed for all bars
|
|
286
|
+
const totalBarsWidth = snapshot.files.reduce((sum, file) => {
|
|
287
|
+
const barWidth = Math.max(minBarWidth, (file.symbols / totalSymbols) * plotWidth * 0.8);
|
|
288
|
+
return sum + barWidth + gap;
|
|
289
|
+
}, 0) - gap; // Remove last gap
|
|
290
|
+
|
|
291
|
+
// Center the bar group horizontally
|
|
292
|
+
let x = margin.left + (plotWidth - totalBarsWidth) / 2;
|
|
280
293
|
filePositions.clear();
|
|
281
294
|
|
|
282
295
|
snapshot.files.forEach((file) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "depwire-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "Code cross-reference visualization and AI context engine for TypeScript, JavaScript, Python, Go, Rust, and C. Zero native dependencies — works on Windows, macOS, and Linux.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|