devcompass 2.7.1 → 2.8.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.
- package/README.md +475 -129
- package/bin/devcompass.js +3 -1
- package/package.json +8 -3
- package/src/commands/fix.js +295 -213
- package/src/utils/backup-manager.js +113 -0
- package/src/utils/fix-report.js +129 -0
- package/src/utils/progress-tracker.js +79 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🧭 DevCompass
|
|
2
2
|
|
|
3
|
-
**Dependency health checker with ecosystem intelligence, real-time GitHub issue tracking for 500+ popular npm packages, parallel processing, supply chain security analysis,
|
|
3
|
+
**Dependency health checker with ecosystem intelligence, real-time GitHub issue tracking for 500+ popular npm packages, parallel processing, supply chain security analysis, advanced license risk detection, and enhanced fix command with dry-run mode.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/devcompass)
|
|
6
6
|
[](https://www.npmjs.com/package/devcompass)
|
|
@@ -8,13 +8,115 @@
|
|
|
8
8
|
|
|
9
9
|
Analyze your JavaScript projects to find unused dependencies, outdated packages, **detect security vulnerabilities**, **monitor GitHub issues in real-time for 500+ packages**, **check bundle sizes**, **verify licenses**, **detect supply chain attacks**, **analyze package quality**, and **automatically fix issues** with a single command. Perfect for **CI/CD pipelines** with JSON output and exit codes.
|
|
10
10
|
|
|
11
|
+
> **LATEST v2.8.0:** Enhanced fix command - Dry-run, progress tracking, backups & reports! 🔧
|
|
12
|
+
> **PREVIOUS v2.7.1:** Bugfix - Fixed false positive typosquatting warnings! 🐛
|
|
11
13
|
> **NEW in v2.7.0:** Advanced security features - Supply chain analysis, license risk detection, package quality metrics! 🔐
|
|
12
14
|
> **NEW in v2.6.0:** 80% faster with parallel processing! ⚡
|
|
13
|
-
> **NEW in v2.5.0:** Expanded to 502 packages across 33 categories! 🎯
|
|
14
|
-
> **NEW in v2.4.0:** Real-time GitHub issue tracking & predictive warnings! 🔮
|
|
15
|
-
> **NEW in v2.3.1:** Fixed all security vulnerabilities! Health score: 2.5/10 → 8/10 🔒
|
|
15
|
+
> **NEW in v2.5.0:** Expanded to 502 packages across 33 categories! 🎯
|
|
16
16
|
|
|
17
|
-
## 🎉 Latest Update: v2.
|
|
17
|
+
## 🎉 Latest Update: v2.8.0 - Enhanced Fix Command
|
|
18
|
+
|
|
19
|
+
**Major improvements to the fix command!** DevCompass now includes dry-run mode, progress tracking, automatic backups, and detailed fix reports.
|
|
20
|
+
|
|
21
|
+
### What's New in v2.8.0:
|
|
22
|
+
- 🔍 **Dry-Run Mode** - Preview fixes without making changes (`--dry-run` or `--dry`)
|
|
23
|
+
- 📊 **Progress Tracking** - Real-time progress with ETA and percentage completion
|
|
24
|
+
- 💾 **Automatic Backups** - Creates backup before applying any fixes
|
|
25
|
+
- 📄 **Fix Reports** - Detailed JSON reports saved to `devcompass-fix-report.json`
|
|
26
|
+
- ⚡ **Enhanced Error Handling** - Graceful failure recovery with detailed error messages
|
|
27
|
+
- 🎯 **6-Step Workflow** - Clear step-by-step process from analysis to completion
|
|
28
|
+
|
|
29
|
+
**Example workflow:**
|
|
30
|
+
```bash
|
|
31
|
+
# Preview what will be fixed (no changes)
|
|
32
|
+
devcompass fix --dry-run
|
|
33
|
+
|
|
34
|
+
# Apply fixes with confirmation
|
|
35
|
+
devcompass fix
|
|
36
|
+
|
|
37
|
+
# Auto-apply without confirmation (CI/CD)
|
|
38
|
+
devcompass fix --yes
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Enhanced output:**
|
|
42
|
+
```
|
|
43
|
+
🔧 DevCompass Fix
|
|
44
|
+
|
|
45
|
+
Step 1: Analyzing issues...
|
|
46
|
+
✔ Analysis complete
|
|
47
|
+
|
|
48
|
+
Step 2: Planned fixes
|
|
49
|
+
|
|
50
|
+
🔴 CRITICAL SECURITY FIXES
|
|
51
|
+
→ Run npm audit fix to resolve 5 vulnerabilities
|
|
52
|
+
|
|
53
|
+
🟡 UNUSED DEPENDENCIES
|
|
54
|
+
lodash
|
|
55
|
+
→ Will be removed
|
|
56
|
+
|
|
57
|
+
🔵 SAFE UPDATES (patch/minor)
|
|
58
|
+
axios
|
|
59
|
+
→ 1.6.0 → 1.6.2
|
|
60
|
+
|
|
61
|
+
Total fixes to apply: 7
|
|
62
|
+
|
|
63
|
+
Step 3: Confirm
|
|
64
|
+
⚠️ Apply these fixes? (y/N): y
|
|
65
|
+
|
|
66
|
+
Step 4: Creating backup...
|
|
67
|
+
✓ Backup created: backup-2026-04-04T10-30-00-000Z
|
|
68
|
+
|
|
69
|
+
Step 5: Applying fixes...
|
|
70
|
+
⠹ Removing lodash... [3/7] 43% • 2.1s elapsed • ETA: 2.8s
|
|
71
|
+
|
|
72
|
+
Step 6: Clearing cache...
|
|
73
|
+
✓ Cache cleared
|
|
74
|
+
|
|
75
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
76
|
+
📊 FIX REPORT
|
|
77
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
78
|
+
|
|
79
|
+
Summary:
|
|
80
|
+
✓ Fixes Applied: 7
|
|
81
|
+
⏱ Duration: 5.32s
|
|
82
|
+
|
|
83
|
+
Fixes Applied:
|
|
84
|
+
1. npm audit
|
|
85
|
+
→ Fixed security vulnerabilities
|
|
86
|
+
2. axios
|
|
87
|
+
→ Updated to 1.6.2
|
|
88
|
+
Version: 1.6.0 → 1.6.2
|
|
89
|
+
3. lodash
|
|
90
|
+
→ Removed unused dependency
|
|
91
|
+
|
|
92
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
93
|
+
|
|
94
|
+
✓ Successfully applied 7 fix(es)!
|
|
95
|
+
|
|
96
|
+
💡 TIP: Run devcompass analyze to verify improvements
|
|
97
|
+
|
|
98
|
+
📄 Full report saved to: devcompass-fix-report.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Upgrade now:**
|
|
102
|
+
```bash
|
|
103
|
+
npm install -g devcompass@2.8.0
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 🎉 v2.7.1 Update
|
|
109
|
+
|
|
110
|
+
**Quick bugfix release!** Fixed false positive typosquatting warnings in v2.7.0.
|
|
111
|
+
|
|
112
|
+
### What's Fixed in v2.7.1:
|
|
113
|
+
- ✅ **No more chalk vs chai warnings** - Enhanced whitelist prevents legitimate packages from being flagged
|
|
114
|
+
- ✅ **Improved typosquatting detection** - Skip comparison when both packages are legitimate
|
|
115
|
+
- ✅ **Better object iteration** - Fixed handling of typosquat_patterns structure
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 🎉 v2.7.0 Features
|
|
18
120
|
|
|
19
121
|
**Comprehensive security analysis without external dependencies!** DevCompass now includes advanced security features:
|
|
20
122
|
|
|
@@ -27,43 +129,31 @@ Analyze your JavaScript projects to find unused dependencies, outdated packages,
|
|
|
27
129
|
|
|
28
130
|
**Example output:**
|
|
29
131
|
```
|
|
30
|
-
🛡️ SUPPLY CHAIN SECURITY
|
|
132
|
+
🛡️ SUPPLY CHAIN SECURITY
|
|
31
133
|
|
|
32
|
-
|
|
33
|
-
expresss
|
|
34
|
-
Similar to: express (official package)
|
|
35
|
-
→ Remove expresss and install express
|
|
134
|
+
✅ No supply chain risks detected!
|
|
36
135
|
|
|
37
|
-
⚖️ LICENSE RISK ANALYSIS
|
|
136
|
+
⚖️ LICENSE RISK ANALYSIS
|
|
38
137
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Network copyleft - very restrictive
|
|
43
|
-
→ Replace with permissive alternative immediately
|
|
138
|
+
Project License: MIT
|
|
139
|
+
|
|
140
|
+
✅ All licenses are compliant!
|
|
44
141
|
|
|
45
142
|
📊 PACKAGE QUALITY METRICS (20 analyzed)
|
|
46
143
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Health Score: 1.2/10
|
|
50
|
-
Last Update: 3 years ago
|
|
51
|
-
→ Migrate to actively maintained alternative
|
|
144
|
+
✅ HEALTHY PACKAGES (18)
|
|
145
|
+
react, axios, lodash, express, webpack...
|
|
52
146
|
|
|
53
147
|
💡 SECURITY RECOMMENDATIONS (Prioritized)
|
|
54
148
|
|
|
55
|
-
🔴 CRITICAL (Fix Immediately)
|
|
56
|
-
1. Remove typosquatting package
|
|
57
|
-
$ npm uninstall expresss && npm install express
|
|
58
|
-
|
|
59
149
|
📈 Expected Impact:
|
|
60
|
-
✓ Current Health Score:
|
|
61
|
-
✓
|
|
62
|
-
✓ Improvement: +4.5 points (45% increase)
|
|
150
|
+
✓ Current Health Score: 8.5/10
|
|
151
|
+
✓ Project is in excellent health!
|
|
63
152
|
```
|
|
64
153
|
|
|
65
154
|
## ✨ Features
|
|
66
155
|
|
|
156
|
+
- 🔧 **Enhanced Fix Command** (v2.8.0) - Dry-run, progress tracking, backups & reports
|
|
67
157
|
- 🛡️ **Supply Chain Security** (v2.7) - Malicious package & typosquatting detection
|
|
68
158
|
- ⚖️ **License Risk Analysis** (v2.7) - Enhanced license compliance checking
|
|
69
159
|
- 📊 **Package Quality Metrics** (v2.7) - Health scoring for dependencies
|
|
@@ -78,7 +168,6 @@ Analyze your JavaScript projects to find unused dependencies, outdated packages,
|
|
|
78
168
|
- 🚀 **CI/CD Integration** (v2.2) - JSON output, exit codes, and silent mode
|
|
79
169
|
- ⚡ **Smart Caching** (v2.2) - 93% faster on repeated runs
|
|
80
170
|
- 🎛️ **Advanced Filtering** (v2.2) - Control alerts by severity level
|
|
81
|
-
- 🔧 **Auto-Fix Command** (v2.1) - Fix issues automatically with one command
|
|
82
171
|
- 🚨 **Ecosystem Intelligence** (v2.0) - Detect known issues before they break production
|
|
83
172
|
- 🔍 **Detect unused dependencies** - Find packages you're not actually using
|
|
84
173
|
- 📊 **Project health score** - Get a 0-10 rating for your dependencies
|
|
@@ -112,6 +201,12 @@ devcompass analyze
|
|
|
112
201
|
# Auto-fix issues
|
|
113
202
|
devcompass fix
|
|
114
203
|
|
|
204
|
+
# Preview fixes without making changes (NEW in v2.8.0!)
|
|
205
|
+
devcompass fix --dry-run
|
|
206
|
+
|
|
207
|
+
# Auto-fix without confirmation (CI/CD)
|
|
208
|
+
devcompass fix --yes
|
|
209
|
+
|
|
115
210
|
# JSON output (for CI/CD)
|
|
116
211
|
devcompass analyze --json
|
|
117
212
|
|
|
@@ -122,6 +217,273 @@ devcompass analyze --ci
|
|
|
122
217
|
devcompass analyze --silent
|
|
123
218
|
```
|
|
124
219
|
|
|
220
|
+
## 🔧 Auto-Fix Command (Enhanced in v2.8.0!)
|
|
221
|
+
|
|
222
|
+
DevCompass can **automatically fix issues** in your project with advanced features!
|
|
223
|
+
|
|
224
|
+
### What it does:
|
|
225
|
+
- 🔴 **Fixes critical security issues** - Upgrades packages with known vulnerabilities
|
|
226
|
+
- 🧹 **Removes unused dependencies** - Cleans up packages you're not using
|
|
227
|
+
- ⬆️ **Safe updates** - Applies patch and minor updates automatically
|
|
228
|
+
- ⚠️ **Skips breaking changes** - Major updates require manual review
|
|
229
|
+
- 🔄 **Clears cache** - Ensures fresh analysis after fixes (v2.4+)
|
|
230
|
+
- 🔍 **Dry-run mode** - Preview changes without applying (v2.8.0)
|
|
231
|
+
- 📊 **Progress tracking** - Real-time updates with ETA (v2.8.0)
|
|
232
|
+
- 💾 **Automatic backups** - Creates backup before fixes (v2.8.0)
|
|
233
|
+
- 📄 **Fix reports** - Detailed JSON reports (v2.8.0)
|
|
234
|
+
|
|
235
|
+
### Usage
|
|
236
|
+
```bash
|
|
237
|
+
# Preview fixes without making changes (NEW in v2.8.0!)
|
|
238
|
+
devcompass fix --dry-run
|
|
239
|
+
devcompass fix --dry # Shorthand
|
|
240
|
+
|
|
241
|
+
# Interactive mode (asks for confirmation)
|
|
242
|
+
devcompass fix
|
|
243
|
+
|
|
244
|
+
# Auto-apply without confirmation (for CI/CD)
|
|
245
|
+
devcompass fix --yes
|
|
246
|
+
devcompass fix -y
|
|
247
|
+
|
|
248
|
+
# Fix specific directory
|
|
249
|
+
devcompass fix --path /path/to/project
|
|
250
|
+
|
|
251
|
+
# Combine options
|
|
252
|
+
devcompass fix --path ./my-project --yes
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### New Features (v2.8.0)
|
|
256
|
+
|
|
257
|
+
#### 1. Dry-Run Mode 🔍
|
|
258
|
+
Test fixes safely before applying:
|
|
259
|
+
```bash
|
|
260
|
+
devcompass fix --dry-run
|
|
261
|
+
```
|
|
262
|
+
- Shows complete fix plan
|
|
263
|
+
- Zero risk testing
|
|
264
|
+
- Perfect for validation in CI/CD
|
|
265
|
+
- No changes made to your project
|
|
266
|
+
|
|
267
|
+
#### 2. Progress Tracking 📊
|
|
268
|
+
Real-time feedback during fixes:
|
|
269
|
+
- Shows current step (X/Y) with percentage
|
|
270
|
+
- Displays elapsed time
|
|
271
|
+
- Shows estimated time remaining (ETA)
|
|
272
|
+
- Live package-by-package updates
|
|
273
|
+
|
|
274
|
+
**Example:**
|
|
275
|
+
```
|
|
276
|
+
⠹ Updating axios... [3/7] 43% • 2.1s elapsed • ETA: 2.8s
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### 3. Automatic Backups 💾
|
|
280
|
+
Safety net before any changes:
|
|
281
|
+
- Backs up `package.json` and `package-lock.json`
|
|
282
|
+
- Stored in `.devcompass-backups/`
|
|
283
|
+
- Keeps last 5 backups (auto-cleanup)
|
|
284
|
+
- Timestamped for easy identification
|
|
285
|
+
|
|
286
|
+
**Backup location:**
|
|
287
|
+
```
|
|
288
|
+
.devcompass-backups/
|
|
289
|
+
├── backup-2026-04-04T10-30-00-000Z/
|
|
290
|
+
│ ├── package.json
|
|
291
|
+
│ ├── package-lock.json
|
|
292
|
+
│ └── metadata.json
|
|
293
|
+
└── ...
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### 4. Fix Reports 📄
|
|
297
|
+
Comprehensive documentation of all changes:
|
|
298
|
+
- Saved to `devcompass-fix-report.json`
|
|
299
|
+
- Lists all fixes applied with timestamps
|
|
300
|
+
- Tracks errors and skipped items
|
|
301
|
+
- Duration tracking for performance analysis
|
|
302
|
+
- Terminal display with color-coded output
|
|
303
|
+
|
|
304
|
+
**Report structure:**
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"summary": {
|
|
308
|
+
"totalFixes": 7,
|
|
309
|
+
"totalErrors": 0,
|
|
310
|
+
"totalSkipped": 2,
|
|
311
|
+
"duration": "5.32s",
|
|
312
|
+
"timestamp": "2026-04-04T10:30:00.000Z"
|
|
313
|
+
},
|
|
314
|
+
"fixes": [...],
|
|
315
|
+
"errors": [...],
|
|
316
|
+
"skipped": [...]
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
#### 5. Enhanced Error Handling ⚡
|
|
321
|
+
Robust failure recovery:
|
|
322
|
+
- Continues on partial errors
|
|
323
|
+
- Detailed error reporting
|
|
324
|
+
- Clear error messages
|
|
325
|
+
- Non-blocking execution
|
|
326
|
+
- Backup reminder on failure
|
|
327
|
+
|
|
328
|
+
#### 6. 6-Step Workflow 🎯
|
|
329
|
+
Clear, organized process:
|
|
330
|
+
1. **Analyze issues** - Scan project for fixable problems
|
|
331
|
+
2. **Show plan** - Display categorized fix plan
|
|
332
|
+
3. **Confirm** - Get user confirmation (unless `--yes` or `--dry-run`)
|
|
333
|
+
4. **Backup** - Create automatic backup
|
|
334
|
+
5. **Apply fixes** - Execute fixes with progress tracking
|
|
335
|
+
6. **Report** - Generate and display comprehensive report
|
|
336
|
+
|
|
337
|
+
### Safety Features
|
|
338
|
+
- ✅ Shows what will be changed before applying
|
|
339
|
+
- ✅ Requires confirmation (unless `--yes` flag used)
|
|
340
|
+
- ✅ Skips major updates (may have breaking changes)
|
|
341
|
+
- ✅ Groups actions by priority (critical → cleanup → updates)
|
|
342
|
+
- ✅ Clears cache after fixes (v2.4+)
|
|
343
|
+
- ✅ Provides clear summary of changes
|
|
344
|
+
- ✅ Creates automatic backup before any changes (v2.8.0)
|
|
345
|
+
- ✅ Dry-run mode for safe testing (v2.8.0)
|
|
346
|
+
- ✅ Detailed error messages and recovery (v2.8.0)
|
|
347
|
+
|
|
348
|
+
### Workflow Examples
|
|
349
|
+
|
|
350
|
+
#### Local Development
|
|
351
|
+
```bash
|
|
352
|
+
# 1. Preview what will be fixed
|
|
353
|
+
devcompass fix --dry-run
|
|
354
|
+
|
|
355
|
+
# 2. Review the plan, then apply
|
|
356
|
+
devcompass fix
|
|
357
|
+
|
|
358
|
+
# 3. Verify improvements
|
|
359
|
+
devcompass analyze
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
#### CI/CD Pipeline
|
|
363
|
+
```bash
|
|
364
|
+
# Dry-run in PR checks (no changes)
|
|
365
|
+
devcompass fix --dry-run
|
|
366
|
+
|
|
367
|
+
# Auto-apply in deployment pipeline
|
|
368
|
+
devcompass fix --yes
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
#### Emergency Security Fix
|
|
372
|
+
```bash
|
|
373
|
+
# Quick fix for critical vulnerabilities
|
|
374
|
+
devcompass fix --yes
|
|
375
|
+
|
|
376
|
+
# Check the fix report
|
|
377
|
+
cat devcompass-fix-report.json
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### What Gets Fixed
|
|
381
|
+
|
|
382
|
+
**Priority 1: Critical Security** 🔴
|
|
383
|
+
- Critical and high severity vulnerabilities
|
|
384
|
+
- Runs `npm audit fix`
|
|
385
|
+
- Upgrades to secure versions
|
|
386
|
+
|
|
387
|
+
**Priority 2: Ecosystem Alerts** 🟠
|
|
388
|
+
- Critical and high severity known issues
|
|
389
|
+
- Upgrades to recommended versions
|
|
390
|
+
- Fixes package-specific problems
|
|
391
|
+
|
|
392
|
+
**Priority 3: Unused Dependencies** 🟡
|
|
393
|
+
- Removes packages not used in code
|
|
394
|
+
- Cleans up `node_modules`
|
|
395
|
+
- Reduces security surface
|
|
396
|
+
|
|
397
|
+
**Priority 4: Safe Updates** 🔵
|
|
398
|
+
- Patch and minor version updates
|
|
399
|
+
- No breaking changes
|
|
400
|
+
- Gets bug fixes and improvements
|
|
401
|
+
|
|
402
|
+
**Skipped: Major Updates** ⚪
|
|
403
|
+
- Shown but not auto-applied
|
|
404
|
+
- May have breaking changes
|
|
405
|
+
- Requires manual review
|
|
406
|
+
|
|
407
|
+
### Use Cases
|
|
408
|
+
|
|
409
|
+
**Perfect for:**
|
|
410
|
+
- 🏢 **Development Teams** - Safe, automated dependency maintenance
|
|
411
|
+
- 🔄 **CI/CD Pipelines** - Automated fixes with `--yes` flag
|
|
412
|
+
- 🛡️ **Security Teams** - Quick vulnerability resolution
|
|
413
|
+
- 📦 **Package Maintainers** - Keeping dependencies up-to-date
|
|
414
|
+
- 📊 **Auditing** - Detailed fix reports for compliance
|
|
415
|
+
- 🧪 **Testing** - Dry-run mode for validation
|
|
416
|
+
|
|
417
|
+
### Performance
|
|
418
|
+
|
|
419
|
+
**v2.8.0 Improvements:**
|
|
420
|
+
- **Progress visibility** - Know exactly what's happening
|
|
421
|
+
- **Faster execution** - Parallel npm operations where possible
|
|
422
|
+
- **Better error recovery** - Continues despite partial failures
|
|
423
|
+
- **Comprehensive logging** - Full audit trail in fix reports
|
|
424
|
+
|
|
425
|
+
**Typical execution time:**
|
|
426
|
+
- Small project (5 fixes): ~5-10 seconds
|
|
427
|
+
- Medium project (15 fixes): ~15-25 seconds
|
|
428
|
+
- Large project (30 fixes): ~30-45 seconds
|
|
429
|
+
|
|
430
|
+
### Backup Management
|
|
431
|
+
|
|
432
|
+
**Automatic cleanup:**
|
|
433
|
+
- Keeps last 5 backups
|
|
434
|
+
- Automatically removes older backups
|
|
435
|
+
- Minimal disk space usage
|
|
436
|
+
|
|
437
|
+
**Manual backup restoration:**
|
|
438
|
+
```bash
|
|
439
|
+
# List available backups
|
|
440
|
+
ls .devcompass-backups/
|
|
441
|
+
|
|
442
|
+
# Restore from specific backup
|
|
443
|
+
cp .devcompass-backups/backup-TIMESTAMP/package.json package.json
|
|
444
|
+
cp .devcompass-backups/backup-TIMESTAMP/package-lock.json package-lock.json
|
|
445
|
+
|
|
446
|
+
# Then reinstall
|
|
447
|
+
npm install
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Troubleshooting
|
|
451
|
+
|
|
452
|
+
**If fix fails:**
|
|
453
|
+
1. Check the error message in terminal
|
|
454
|
+
2. Review `devcompass-fix-report.json` for details
|
|
455
|
+
3. Your backup is available in `.devcompass-backups/`
|
|
456
|
+
4. Restore from backup if needed
|
|
457
|
+
5. Report issue on GitHub
|
|
458
|
+
|
|
459
|
+
**Common issues:**
|
|
460
|
+
- **Network errors:** Check internet connection, retry
|
|
461
|
+
- **Permission errors:** Use `sudo` (not recommended) or fix npm permissions
|
|
462
|
+
- **Lock file conflicts:** Commit or stash changes first
|
|
463
|
+
- **Disk space:** Ensure sufficient space for backups
|
|
464
|
+
|
|
465
|
+
### Workflow Example (Complete)
|
|
466
|
+
```bash
|
|
467
|
+
# 1. Check current health
|
|
468
|
+
devcompass analyze
|
|
469
|
+
# Output: Health Score: 6.2/10
|
|
470
|
+
|
|
471
|
+
# 2. Preview fixes (no changes)
|
|
472
|
+
devcompass fix --dry-run
|
|
473
|
+
# Shows: 7 fixes will be applied
|
|
474
|
+
|
|
475
|
+
# 3. Apply fixes
|
|
476
|
+
devcompass fix
|
|
477
|
+
# Creates backup, applies fixes, generates report
|
|
478
|
+
|
|
479
|
+
# 4. Verify improvements
|
|
480
|
+
devcompass analyze
|
|
481
|
+
# Output: Health Score: 8.7/10
|
|
482
|
+
|
|
483
|
+
# 5. Check the report
|
|
484
|
+
cat devcompass-fix-report.json
|
|
485
|
+
```
|
|
486
|
+
|
|
125
487
|
## 🛡️ Supply Chain Security (v2.7.0)
|
|
126
488
|
|
|
127
489
|
DevCompass now detects **supply chain attacks** including malicious packages, typosquatting, and suspicious install scripts!
|
|
@@ -136,6 +498,7 @@ DevCompass now detects **supply chain attacks** including malicious packages, ty
|
|
|
136
498
|
- **Exact pattern matching** - Database of 15+ known malicious packages
|
|
137
499
|
- **Levenshtein distance** - Detects 1-2 character differences from popular packages
|
|
138
500
|
- **Pattern analysis** - Scans install scripts for suspicious commands
|
|
501
|
+
- **Smart whitelist** (v2.7.1) - Prevents false positives for legitimate packages
|
|
139
502
|
|
|
140
503
|
### Example Output:
|
|
141
504
|
```
|
|
@@ -166,6 +529,10 @@ DevCompass now detects **supply chain attacks** including malicious packages, ty
|
|
|
166
529
|
- react, vue, angular, next, typescript
|
|
167
530
|
- eslint, prettier, jest, mocha, chai
|
|
168
531
|
|
|
532
|
+
**Whitelisted legitimate packages (40+):**
|
|
533
|
+
- chalk, ora, yargs, commander, semver
|
|
534
|
+
- And more to prevent false positives!
|
|
535
|
+
|
|
169
536
|
**Suspicious install script patterns:**
|
|
170
537
|
- Network operations: curl, wget, http://, https://
|
|
171
538
|
- Code execution: eval, exec, child_process
|
|
@@ -349,7 +716,7 @@ Intelligent, **prioritized recommendations** with actionable commands and impact
|
|
|
349
716
|
💡 TIP: Run devcompass fix to apply automated fixes!
|
|
350
717
|
```
|
|
351
718
|
|
|
352
|
-
## 🔮 Predictive Warnings (v2.7.
|
|
719
|
+
## 🔮 Predictive Warnings (v2.7.1)
|
|
353
720
|
|
|
354
721
|
DevCompass monitors **real-time GitHub activity for 500+ packages** to detect potential issues before they're officially reported!
|
|
355
722
|
|
|
@@ -512,9 +879,9 @@ Detect restrictive licenses that may require legal review!
|
|
|
512
879
|
|
|
513
880
|
### Combined Analysis Example
|
|
514
881
|
|
|
515
|
-
**Full Output (v2.
|
|
882
|
+
**Full Output (v2.8.0):**
|
|
516
883
|
```
|
|
517
|
-
🔍 DevCompass v2.
|
|
884
|
+
🔍 DevCompass v2.8.0 - Analyzing your project...
|
|
518
885
|
✔ Scanned 25 dependencies in project
|
|
519
886
|
⚡ GitHub check completed in 1.23s (parallel processing)
|
|
520
887
|
|
|
@@ -526,12 +893,9 @@ Detect restrictive licenses that may require legal review!
|
|
|
526
893
|
|
|
527
894
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
528
895
|
|
|
529
|
-
|
|
896
|
+
✅ SUPPLY CHAIN SECURITY
|
|
530
897
|
|
|
531
|
-
|
|
532
|
-
expresss
|
|
533
|
-
Similar to: express (official package)
|
|
534
|
-
→ Remove expresss and install express
|
|
898
|
+
No supply chain risks detected!
|
|
535
899
|
|
|
536
900
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
537
901
|
|
|
@@ -544,23 +908,15 @@ Detect restrictive licenses that may require legal review!
|
|
|
544
908
|
|
|
545
909
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
546
910
|
|
|
547
|
-
|
|
911
|
+
✅ PREDICTIVE ANALYSIS
|
|
548
912
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
🟡 express
|
|
552
|
-
Increased issue activity
|
|
553
|
-
8 issues opened recently
|
|
554
|
-
→ Monitor for stability
|
|
555
|
-
GitHub: https://github.com/expressjs/express
|
|
913
|
+
No unusual activity detected (502+ packages monitored)!
|
|
556
914
|
|
|
557
915
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
558
916
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
Project License: MIT
|
|
917
|
+
✅ LICENSE COMPLIANCE
|
|
562
918
|
|
|
563
|
-
|
|
919
|
+
All licenses are compliant!
|
|
564
920
|
|
|
565
921
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
566
922
|
|
|
@@ -589,9 +945,9 @@ Detect restrictive licenses that may require legal review!
|
|
|
589
945
|
|
|
590
946
|
Overall Score: 8.5/10
|
|
591
947
|
Total Dependencies: 25
|
|
592
|
-
Supply Chain Warnings:
|
|
948
|
+
Supply Chain Warnings: 0
|
|
593
949
|
Ecosystem Alerts: 1
|
|
594
|
-
Predictive Warnings:
|
|
950
|
+
Predictive Warnings: 0
|
|
595
951
|
License Risks: 0
|
|
596
952
|
Quality Issues: 0
|
|
597
953
|
Unused: 0
|
|
@@ -603,11 +959,7 @@ Detect restrictive licenses that may require legal review!
|
|
|
603
959
|
|
|
604
960
|
🟠 HIGH (Fix Soon)
|
|
605
961
|
|
|
606
|
-
1.
|
|
607
|
-
Package: expresss
|
|
608
|
-
$ npm uninstall expresss && npm install express
|
|
609
|
-
|
|
610
|
-
2. Upgrade vulnerable package
|
|
962
|
+
1. Upgrade vulnerable package
|
|
611
963
|
Package: axios@1.6.0
|
|
612
964
|
$ npm install axios@1.6.2
|
|
613
965
|
|
|
@@ -616,8 +968,6 @@ Detect restrictive licenses that may require legal review!
|
|
|
616
968
|
✓ Current Health Score: 8.5/10
|
|
617
969
|
✓ Expected Score: 9.8/10
|
|
618
970
|
✓ Improvement: +1.3 points (13% increase)
|
|
619
|
-
✓ Eliminate 1 supply chain risk
|
|
620
|
-
✓ Resolve 1 high-priority issue
|
|
621
971
|
|
|
622
972
|
💡 TIP: Run 'devcompass fix' to apply these fixes automatically!
|
|
623
973
|
```
|
|
@@ -630,26 +980,26 @@ Perfect for parsing in CI/CD pipelines:
|
|
|
630
980
|
devcompass analyze --json
|
|
631
981
|
```
|
|
632
982
|
|
|
633
|
-
**Output (v2.
|
|
983
|
+
**Output (v2.8.0):**
|
|
634
984
|
```json
|
|
635
985
|
{
|
|
636
|
-
"version": "2.
|
|
986
|
+
"version": "2.8.0",
|
|
637
987
|
"timestamp": "2026-04-04T10:30:00.000Z",
|
|
638
988
|
"summary": {
|
|
639
989
|
"healthScore": 8.5,
|
|
640
990
|
"totalDependencies": 25,
|
|
641
991
|
"securityVulnerabilities": 0,
|
|
642
|
-
"supplyChainWarnings":
|
|
992
|
+
"supplyChainWarnings": 0,
|
|
643
993
|
"ecosystemAlerts": 1,
|
|
644
|
-
"predictiveWarnings":
|
|
994
|
+
"predictiveWarnings": 0,
|
|
645
995
|
"licenseRisks": 0,
|
|
646
996
|
"qualityIssues": 0,
|
|
647
997
|
"unusedDependencies": 0,
|
|
648
998
|
"outdatedPackages": 2
|
|
649
999
|
},
|
|
650
1000
|
"supplyChain": {
|
|
651
|
-
"total":
|
|
652
|
-
"warnings": [
|
|
1001
|
+
"total": 0,
|
|
1002
|
+
"warnings": []
|
|
653
1003
|
},
|
|
654
1004
|
"licenseRisk": {
|
|
655
1005
|
"total": 0,
|
|
@@ -663,9 +1013,9 @@ devcompass analyze --json
|
|
|
663
1013
|
"packages": [...]
|
|
664
1014
|
},
|
|
665
1015
|
"recommendations": {
|
|
666
|
-
"total":
|
|
1016
|
+
"total": 1,
|
|
667
1017
|
"critical": 0,
|
|
668
|
-
"high":
|
|
1018
|
+
"high": 1,
|
|
669
1019
|
"items": [...]
|
|
670
1020
|
}
|
|
671
1021
|
}
|
|
@@ -712,7 +1062,7 @@ DevCompass caches results to improve performance:
|
|
|
712
1062
|
- **Cache duration:** 1 hour
|
|
713
1063
|
- **Cache file:** `.devcompass-cache.json` (auto-gitignored)
|
|
714
1064
|
|
|
715
|
-
**What gets cached (v2.
|
|
1065
|
+
**What gets cached (v2.8.0):**
|
|
716
1066
|
- Supply chain analysis
|
|
717
1067
|
- License risk data
|
|
718
1068
|
- Package quality metrics
|
|
@@ -789,50 +1139,6 @@ Create `devcompass.config.json` in your project root:
|
|
|
789
1139
|
}
|
|
790
1140
|
```
|
|
791
1141
|
|
|
792
|
-
## 🔧 Auto-Fix Command
|
|
793
|
-
|
|
794
|
-
DevCompass can **automatically fix issues** in your project!
|
|
795
|
-
|
|
796
|
-
### What it does:
|
|
797
|
-
- 🔴 **Fixes critical security issues** - Upgrades packages with known vulnerabilities
|
|
798
|
-
- 🧹 **Removes unused dependencies** - Cleans up packages you're not using
|
|
799
|
-
- ⬆️ **Safe updates** - Applies patch and minor updates automatically
|
|
800
|
-
- ⚠️ **Skips breaking changes** - Major updates require manual review
|
|
801
|
-
- 🔄 **Clears cache** - Ensures fresh analysis after fixes (v2.4+)
|
|
802
|
-
|
|
803
|
-
### Usage
|
|
804
|
-
```bash
|
|
805
|
-
# Interactive mode (asks for confirmation)
|
|
806
|
-
devcompass fix
|
|
807
|
-
|
|
808
|
-
# Auto-apply without confirmation (for CI/CD)
|
|
809
|
-
devcompass fix --yes
|
|
810
|
-
devcompass fix -y
|
|
811
|
-
|
|
812
|
-
# Fix specific directory
|
|
813
|
-
devcompass fix --path /path/to/project
|
|
814
|
-
```
|
|
815
|
-
|
|
816
|
-
### Safety Features
|
|
817
|
-
- ✅ Shows what will be changed before applying
|
|
818
|
-
- ✅ Requires confirmation (unless `--yes` flag used)
|
|
819
|
-
- ✅ Skips major updates (may have breaking changes)
|
|
820
|
-
- ✅ Groups actions by priority (critical → cleanup → updates)
|
|
821
|
-
- ✅ Clears cache after fixes (v2.4+)
|
|
822
|
-
- ✅ Provides clear summary of changes
|
|
823
|
-
|
|
824
|
-
### Workflow Example
|
|
825
|
-
```bash
|
|
826
|
-
# 1. Analyze your project
|
|
827
|
-
devcompass analyze
|
|
828
|
-
|
|
829
|
-
# 2. If issues found, auto-fix them
|
|
830
|
-
devcompass fix
|
|
831
|
-
|
|
832
|
-
# 3. Verify the improvements
|
|
833
|
-
devcompass analyze
|
|
834
|
-
```
|
|
835
|
-
|
|
836
1142
|
## 🚨 Ecosystem Intelligence
|
|
837
1143
|
|
|
838
1144
|
DevCompass tracks **real-world issues** in 500+ popular packages and warns you before they break production!
|
|
@@ -898,6 +1204,9 @@ devcompass analyze
|
|
|
898
1204
|
# Auto-fix issues
|
|
899
1205
|
devcompass fix
|
|
900
1206
|
|
|
1207
|
+
# Preview fixes without changes (NEW in v2.8.0!)
|
|
1208
|
+
devcompass fix --dry-run
|
|
1209
|
+
|
|
901
1210
|
# Show version
|
|
902
1211
|
devcompass --version
|
|
903
1212
|
devcompass -v
|
|
@@ -927,12 +1236,19 @@ devcompass analyze --path ./my-project --json
|
|
|
927
1236
|
|
|
928
1237
|
### Fix Options
|
|
929
1238
|
```bash
|
|
1239
|
+
# Preview fixes without making changes (NEW!)
|
|
1240
|
+
devcompass fix --dry-run
|
|
1241
|
+
devcompass fix --dry # Shorthand
|
|
1242
|
+
|
|
930
1243
|
# Fix specific directory
|
|
931
1244
|
devcompass fix --path /path/to/project
|
|
932
1245
|
|
|
933
1246
|
# Auto-apply without confirmation
|
|
934
1247
|
devcompass fix --yes
|
|
935
1248
|
devcompass fix -y
|
|
1249
|
+
|
|
1250
|
+
# Combine options
|
|
1251
|
+
devcompass fix --path ./my-project --yes
|
|
936
1252
|
```
|
|
937
1253
|
|
|
938
1254
|
## 🔄 Complete Workflows
|
|
@@ -942,7 +1258,10 @@ devcompass fix -y
|
|
|
942
1258
|
# Check project health
|
|
943
1259
|
devcompass analyze
|
|
944
1260
|
|
|
945
|
-
#
|
|
1261
|
+
# Preview fixes first (NEW in v2.8.0!)
|
|
1262
|
+
devcompass fix --dry-run
|
|
1263
|
+
|
|
1264
|
+
# Apply fixes
|
|
946
1265
|
devcompass fix
|
|
947
1266
|
|
|
948
1267
|
# Verify improvements
|
|
@@ -954,6 +1273,9 @@ devcompass analyze
|
|
|
954
1273
|
# Analyze and export JSON
|
|
955
1274
|
devcompass analyze --json > health-report.json
|
|
956
1275
|
|
|
1276
|
+
# Dry-run in PR checks (no changes)
|
|
1277
|
+
devcompass fix --dry-run
|
|
1278
|
+
|
|
957
1279
|
# Fail build if score too low
|
|
958
1280
|
devcompass analyze --ci
|
|
959
1281
|
|
|
@@ -983,10 +1305,13 @@ devcompass analyze --json | jq '.security.critical'
|
|
|
983
1305
|
# 3. Check supply chain risks
|
|
984
1306
|
devcompass analyze --json | jq '.supplyChain.warnings'
|
|
985
1307
|
|
|
986
|
-
# 4.
|
|
987
|
-
|
|
1308
|
+
# 4. Preview fixes (NEW!)
|
|
1309
|
+
devcompass fix --dry-run
|
|
988
1310
|
|
|
989
|
-
# 5.
|
|
1311
|
+
# 5. Auto-fix if safe
|
|
1312
|
+
devcompass fix --yes
|
|
1313
|
+
|
|
1314
|
+
# 6. Verify fixes
|
|
990
1315
|
devcompass analyze
|
|
991
1316
|
```
|
|
992
1317
|
|
|
@@ -1013,6 +1338,11 @@ If you encounter a false positive, please [report it](https://github.com/AjayBTh
|
|
|
1013
1338
|
- Cache expires after 1 hour
|
|
1014
1339
|
- Delete cache file manually if needed: `rm .devcompass-cache.json`
|
|
1015
1340
|
|
|
1341
|
+
### Backup Management (v2.8.0)
|
|
1342
|
+
- Backup files (`.devcompass-backups/`) are automatically gitignored
|
|
1343
|
+
- Last 5 backups kept automatically
|
|
1344
|
+
- Restore manually if needed from `.devcompass-backups/`
|
|
1345
|
+
|
|
1016
1346
|
## 🛠️ Requirements
|
|
1017
1347
|
|
|
1018
1348
|
- Node.js >= 14.0.0
|
|
@@ -1022,19 +1352,22 @@ If you encounter a false positive, please [report it](https://github.com/AjayBTh
|
|
|
1022
1352
|
|
|
1023
1353
|
1. **Run regularly** - Add to your CI/CD pipeline or git hooks
|
|
1024
1354
|
2. **Use fix command** - Let DevCompass handle routine maintenance
|
|
1025
|
-
3. **
|
|
1026
|
-
4. **
|
|
1027
|
-
5. **
|
|
1028
|
-
6. **
|
|
1029
|
-
7. **
|
|
1030
|
-
8. **
|
|
1031
|
-
9. **
|
|
1032
|
-
10. **
|
|
1033
|
-
11. **
|
|
1034
|
-
12. **
|
|
1035
|
-
13. **
|
|
1036
|
-
14. **
|
|
1037
|
-
15. **
|
|
1355
|
+
3. **Use dry-run first** - Test fixes safely with `--dry-run` before applying (v2.8.0)
|
|
1356
|
+
4. **Check security first** - Prioritize fixing critical vulnerabilities
|
|
1357
|
+
5. **Monitor bundle size** - Keep an eye on heavy packages
|
|
1358
|
+
6. **Review licenses** - Ensure compliance with your legal requirements
|
|
1359
|
+
7. **Configure severity levels** - Filter out noise with `minSeverity`
|
|
1360
|
+
8. **Enable CI mode** - Catch issues before they reach production
|
|
1361
|
+
9. **Use JSON output** - Integrate with your monitoring tools
|
|
1362
|
+
10. **Review major updates** - Always check changelogs before major version bumps
|
|
1363
|
+
11. **Keep backups** - DevCompass auto-creates them, but you can keep your own too (v2.8.0)
|
|
1364
|
+
12. **Review fix reports** - Check `devcompass-fix-report.json` for audit trail (v2.8.0)
|
|
1365
|
+
13. **Watch predictive warnings** - Monitor packages with increasing issue activity
|
|
1366
|
+
14. **Leverage parallel processing** - First run takes ~2s with v2.6.0 (was ~8s)
|
|
1367
|
+
15. **Monitor supply chain** - Check for typosquatting regularly (v2.7.0)
|
|
1368
|
+
16. **Review license risks** - Ensure GPL/AGPL compliance (v2.7.0)
|
|
1369
|
+
17. **Track package quality** - Replace abandoned packages proactively (v2.7.0)
|
|
1370
|
+
18. **Update regularly** - Stay on latest version for bug fixes and new features!
|
|
1038
1371
|
|
|
1039
1372
|
## 🤝 Contributing
|
|
1040
1373
|
|
|
@@ -1086,6 +1419,7 @@ npm install
|
|
|
1086
1419
|
# Test locally
|
|
1087
1420
|
node bin/devcompass.js analyze
|
|
1088
1421
|
node bin/devcompass.js fix
|
|
1422
|
+
node bin/devcompass.js fix --dry-run # NEW in v2.8.0!
|
|
1089
1423
|
|
|
1090
1424
|
# Run on test projects
|
|
1091
1425
|
cd /tmp
|
|
@@ -1093,6 +1427,7 @@ mkdir test-project && cd test-project
|
|
|
1093
1427
|
npm init -y
|
|
1094
1428
|
npm install axios@1.6.0 lodash@4.17.19
|
|
1095
1429
|
node ~/devcompass/bin/devcompass.js analyze
|
|
1430
|
+
node ~/devcompass/bin/devcompass.js fix --dry-run
|
|
1096
1431
|
node ~/devcompass/bin/devcompass.js fix
|
|
1097
1432
|
```
|
|
1098
1433
|
|
|
@@ -1143,7 +1478,18 @@ Check out DevCompass stats:
|
|
|
1143
1478
|
- [x] Enhanced license risk detection
|
|
1144
1479
|
- [x] Package quality metrics
|
|
1145
1480
|
- [x] Security recommendations engine
|
|
1146
|
-
- [
|
|
1481
|
+
- [x] ~~Fix false positive typosquatting warnings~~ ✅ **Fixed in v2.7.1!**
|
|
1482
|
+
- [x] ~~Enhanced fix command improvements~~ ✅ **Added in v2.8.0!**
|
|
1483
|
+
- [x] Dry-run mode
|
|
1484
|
+
- [x] Progress tracking with ETA
|
|
1485
|
+
- [x] Automatic backups
|
|
1486
|
+
- [x] Fix reports
|
|
1487
|
+
- [x] Enhanced error handling
|
|
1488
|
+
- [ ] Supply chain auto-fix (v2.8.1)
|
|
1489
|
+
- [ ] License conflict resolution (v2.8.2)
|
|
1490
|
+
- [ ] Package quality auto-fix (v2.8.3)
|
|
1491
|
+
- [ ] Backup & rollback command (v2.8.4)
|
|
1492
|
+
- [ ] Batch fix modes (v2.8.5)
|
|
1147
1493
|
- [ ] Dependency graph visualization (v3.0.0)
|
|
1148
1494
|
- [ ] Web dashboard for team health monitoring (v3.0.0)
|
|
1149
1495
|
- [ ] Team collaboration features (v3.1.0)
|