devcompass 1.0.5 → 2.2.0

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.
@@ -0,0 +1,44 @@
1
+ // src/utils/json-formatter.js
2
+
3
+ /**
4
+ * Format analysis results as JSON
5
+ */
6
+ function formatAsJson(alerts, unusedDeps, outdatedDeps, score, totalDeps) {
7
+ return JSON.stringify({
8
+ version: require('../../package.json').version,
9
+ timestamp: new Date().toISOString(),
10
+ summary: {
11
+ healthScore: score.total,
12
+ totalDependencies: totalDeps,
13
+ ecosystemAlerts: alerts.length,
14
+ unusedDependencies: unusedDeps.length,
15
+ outdatedPackages: outdatedDeps.length
16
+ },
17
+ ecosystemAlerts: alerts.map(alert => ({
18
+ package: alert.package,
19
+ version: alert.version,
20
+ severity: alert.severity,
21
+ title: alert.title,
22
+ affected: alert.affected,
23
+ fix: alert.fix,
24
+ source: alert.source,
25
+ reported: alert.reported
26
+ })),
27
+ unusedDependencies: unusedDeps.map(dep => ({
28
+ name: dep.name
29
+ })),
30
+ outdatedPackages: outdatedDeps.map(dep => ({
31
+ name: dep.name,
32
+ current: dep.current,
33
+ latest: dep.latest,
34
+ updateType: dep.versionsBehind
35
+ })),
36
+ scoreBreakdown: {
37
+ unusedPenalty: score.breakdown.unusedPenalty,
38
+ outdatedPenalty: score.breakdown.outdatedPenalty,
39
+ alertsPenalty: score.breakdown.alertsPenalty
40
+ }
41
+ }, null, 2);
42
+ }
43
+
44
+ module.exports = { formatAsJson };
@@ -1,3 +1,4 @@
1
+ // src/utils/logger.js
1
2
  const chalk = require('chalk');
2
3
 
3
4
  function log(message) {
package/src/index.js DELETED
File without changes