devcompass 2.1.0 โ†’ 2.3.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 CHANGED
@@ -6,21 +6,26 @@
6
6
  [![npm downloads](https://img.shields.io/npm/dm/devcompass.svg)](https://www.npmjs.com/package/devcompass)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
8
 
9
- Analyze your JavaScript projects to find unused dependencies, outdated packages, **detect known security issues**, and **automatically fix them** with a single command.
9
+ Analyze your JavaScript projects to find unused dependencies, outdated packages, **detect security vulnerabilities**, **check bundle sizes**, **verify licenses**, and **automatically fix issues** with a single command. Perfect for **CI/CD pipelines** with JSON output and exit codes.
10
10
 
11
+ > **NEW in v2.3:** Security scanning, bundle analysis & license checker! ๐Ÿ”
12
+ > **NEW in v2.2:** CI/CD integration with JSON output & smart caching! ๐Ÿš€
11
13
  > **NEW in v2.1:** Auto-fix command! ๐Ÿ”ง Fix critical issues automatically!
12
14
  > **NEW in v2.0:** Real-time ecosystem alerts for known issues! ๐Ÿšจ
13
15
 
14
16
  ## โœจ Features
15
17
 
16
- - ๐Ÿ”ง **Auto-Fix Command** (NEW in v2.1!) - Fix issues automatically with one command
17
- - ๐Ÿšจ **Ecosystem Intelligence** - Detect known issues before they break production
18
+ - ๐Ÿ” **Security Scanning** (NEW in v2.3!) - npm audit integration with severity breakdown
19
+ - ๐Ÿ“ฆ **Bundle Size Analysis** (NEW in v2.3!) - Identify heavy packages (> 1MB)
20
+ - โš–๏ธ **License Checker** (NEW in v2.3!) - Detect restrictive licenses (GPL, AGPL)
21
+ - ๐Ÿš€ **CI/CD Integration** (v2.2) - JSON output, exit codes, and silent mode
22
+ - โšก **Smart Caching** (v2.2) - 70% faster on repeated runs
23
+ - ๐ŸŽ›๏ธ **Advanced Filtering** (v2.2) - Control alerts by severity level
24
+ - ๐Ÿ”ง **Auto-Fix Command** (v2.1) - Fix issues automatically with one command
25
+ - ๐Ÿšจ **Ecosystem Intelligence** (v2.0) - Detect known issues before they break production
18
26
  - ๐Ÿ” **Detect unused dependencies** - Find packages you're not actually using
19
- - ๐Ÿ“ฆ **Check for outdated packages** - See what needs updating
20
- - ๐Ÿ” **Security alerts** - Critical vulnerabilities and deprecated packages
21
27
  - ๐Ÿ“Š **Project health score** - Get a 0-10 rating for your dependencies
22
28
  - ๐ŸŽจ **Beautiful terminal UI** - Colored output with severity indicators
23
- - โšก **Fast analysis** - Scans projects in seconds
24
29
  - ๐Ÿ”ง **Framework-aware** - Handles React, Next.js, Angular, NestJS, PostCSS, Tailwind
25
30
 
26
31
  ## ๐Ÿš€ Installation
@@ -42,189 +47,375 @@ npx devcompass analyze
42
47
 
43
48
  ## ๐Ÿ“– Usage
44
49
 
45
- ### Analyze Your Project
46
- Navigate to your project directory and run:
50
+ ### Basic Commands
47
51
  ```bash
52
+ # Analyze your project
48
53
  devcompass analyze
49
- ```
50
54
 
51
- ### Auto-Fix Issues (NEW in v2.1!)
52
- Automatically fix detected issues:
53
- ```bash
55
+ # Auto-fix issues
54
56
  devcompass fix
57
+
58
+ # JSON output (for CI/CD)
59
+ devcompass analyze --json
60
+
61
+ # CI mode (exit code 1 if score < threshold)
62
+ devcompass analyze --ci
63
+
64
+ # Silent mode (no output)
65
+ devcompass analyze --silent
55
66
  ```
56
67
 
57
- ## ๐Ÿ”ง Auto-Fix Command (NEW in v2.1!)
68
+ ## ๐Ÿ” NEW in v2.3: Security & Compliance Features
58
69
 
59
- DevCompass can now **automatically fix issues** in your project!
70
+ ### Security Vulnerability Scanning
60
71
 
61
- ### What it does:
62
- - ๐Ÿ”ด **Fixes critical security issues** - Upgrades packages with known vulnerabilities
63
- - ๐Ÿงน **Removes unused dependencies** - Cleans up packages you're not using
64
- - โฌ†๏ธ **Safe updates** - Applies patch and minor updates automatically
65
- - โš ๏ธ **Skips breaking changes** - Major updates require manual review
72
+ DevCompass now integrates with **npm audit** to detect security vulnerabilities automatically!
66
73
 
67
- ### Usage
68
- ```bash
69
- # Interactive mode (asks for confirmation)
70
- devcompass fix
74
+ **Example Output:**
75
+ ```
76
+ ๐Ÿ” SECURITY VULNERABILITIES (12)
71
77
 
72
- # Auto-apply without confirmation
73
- devcompass fix --yes
74
- devcompass fix -y
78
+ ๐Ÿ”ด CRITICAL: 2
79
+ ๐ŸŸ  HIGH: 4
80
+ ๐ŸŸก MODERATE: 5
81
+ โšช LOW: 1
75
82
 
76
- # Fix specific directory
77
- devcompass fix --path /path/to/project
83
+ Run npm audit fix to fix vulnerabilities
84
+ ```
85
+
86
+ **How it works:**
87
+ 1. Runs `npm audit` in the background
88
+ 2. Parses vulnerability data
89
+ 3. Shows severity breakdown
90
+ 4. Impacts health score (-2.5 per critical issue)
91
+ 5. Suggests fix commands
92
+
93
+ **Health Score Impact:**
94
+ - Critical: โˆ’2.5 points each
95
+ - High: โˆ’1.5 points each
96
+ - Moderate: โˆ’0.5 points each
97
+ - Low: โˆ’0.2 points each
98
+
99
+ ### Bundle Size Analysis
100
+
101
+ Identify large dependencies that bloat your `node_modules`!
102
+
103
+ **Example Output:**
104
+ ```
105
+ ๐Ÿ“ฆ HEAVY PACKAGES (3)
106
+
107
+ Packages larger than 1MB:
108
+
109
+ webpack 2.3 MB
110
+ typescript 8.1 MB
111
+ @tensorflow/tfjs 12.4 MB
78
112
  ```
79
113
 
80
- ### Example Output
114
+ **Perfect for:**
115
+ - Frontend developers optimizing bundle size
116
+ - Identifying unnecessary large dependencies
117
+ - Web performance optimization
118
+ - Docker image size reduction
119
+
120
+ ### License Compliance Checker
121
+
122
+ Detect restrictive licenses that may require legal review!
123
+
124
+ **Example Output:**
81
125
  ```
82
- ๐Ÿ”ง DevCompass Fix - Analyzing and fixing your project...
126
+ โš–๏ธ LICENSE WARNINGS (2)
127
+
128
+ sharp - Restrictive (LGPL-3.0)
129
+ custom-lib - Unknown (UNLICENSED)
83
130
 
84
- ๐Ÿ”ด CRITICAL ISSUES TO FIX:
131
+ Note: Restrictive licenses may require legal review
132
+ ```
85
133
 
86
- ๐Ÿ”ด lodash@4.17.19
87
- Issue: Prototype pollution vulnerability
88
- Fix: Upgrade to 4.17.21
134
+ **What gets flagged:**
135
+ - **Restrictive licenses:** GPL, AGPL, LGPL (may require source code disclosure)
136
+ - **Unknown licenses:** Packages without license information
137
+ - **Unlicensed packages:** Legal risk for commercial use
89
138
 
90
- ๐ŸŸ  axios@1.6.0
91
- Issue: Memory leak in request interceptors
92
- Fix: Upgrade to 1.6.2
139
+ **Supported licenses:**
140
+ - โœ… **Safe:** MIT, Apache-2.0, BSD, ISC, CC0
141
+ - โš ๏ธ **Restrictive:** GPL, AGPL, LGPL
142
+ - โ“ **Unknown:** Missing or custom licenses
143
+
144
+ ### Combined Analysis Example (v2.3)
145
+
146
+ **Full Output:**
147
+ ```
148
+ ๐Ÿ” DevCompass v2.3.0 - Analyzing your project...
149
+ โœ” Scanned 25 dependencies in project
93
150
 
94
151
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
95
152
 
96
- ๐Ÿงน UNUSED DEPENDENCIES TO REMOVE:
153
+ ๐Ÿ” SECURITY VULNERABILITIES (5)
97
154
 
98
- โ— moment
99
- โ— express
155
+ ๐Ÿ”ด CRITICAL: 1
156
+ ๐ŸŸ  HIGH: 2
157
+ ๐ŸŸก MODERATE: 2
158
+
159
+ Run npm audit fix to fix vulnerabilities
100
160
 
101
161
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
102
162
 
103
- โฌ†๏ธ SAFE UPDATES (patch/minor):
163
+ ๐Ÿšจ ECOSYSTEM ALERTS (1)
104
164
 
105
- react-dom: 18.2.0 โ†’ 18.2.1 (patch update)
165
+ ๐ŸŸ  HIGH
166
+ axios@1.6.0
167
+ Issue: Memory leak in request interceptors
168
+ Fix: 1.6.2
106
169
 
107
170
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
108
171
 
109
- โš ๏ธ MAJOR UPDATES (skipped - may have breaking changes):
172
+ ๐Ÿ“ฆ HEAVY PACKAGES (2)
173
+
174
+ Packages larger than 1MB:
175
+
176
+ typescript 8.1 MB
177
+ webpack 2.3 MB
178
+
179
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
110
180
 
111
- express: 4.18.0 โ†’ 5.2.1
181
+ โš–๏ธ LICENSE WARNINGS (1)
112
182
 
113
- Run these manually after reviewing changelog:
114
- npm install express@5.2.1
183
+ sharp - Restrictive (LGPL-3.0)
115
184
 
116
185
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
117
186
 
118
- ๐Ÿ“Š FIX SUMMARY:
187
+ ๐Ÿ“Š PROJECT HEALTH
119
188
 
120
- Critical fixes: 2
121
- Remove unused: 2
122
- Safe updates: 1
123
- Skipped major: 1
189
+ Overall Score: 6.2/10
190
+ Total Dependencies: 25
191
+ Security Vulnerabilities: 5
192
+ Ecosystem Alerts: 1
193
+ Unused: 0
194
+ Outdated: 3
124
195
 
125
196
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
126
197
 
127
- โ“ Apply these fixes? (y/N): y
198
+ ๐Ÿ’ก QUICK WINS
199
+
200
+ ๐Ÿ” Fix security vulnerabilities:
201
+
202
+ npm audit fix
128
203
 
129
- ๐Ÿ”ง Applying fixes...
204
+ ๐Ÿ”ด Fix critical issues:
130
205
 
131
- โœ” โœ… Removed 2 unused packages
132
- โœ” โœ… Fixed lodash@4.17.21
133
- โœ” โœ… Fixed axios@1.6.2
134
- โœ” โœ… Updated 1 packages
206
+ npm install axios@1.6.2
135
207
 
136
- โœจ All fixes applied successfully!
208
+ Expected impact:
209
+ โœ“ Resolve security vulnerabilities
210
+ โœ“ Resolve critical stability issues
211
+ โœ“ Improve health score โ†’ 8.7/10
137
212
 
138
- ๐Ÿ’ก Run devcompass analyze to see the new health score.
213
+ ๐Ÿ’ก TIP: Run 'devcompass fix' to apply these fixes automatically!
139
214
  ```
140
215
 
141
- ### Safety Features
142
- - โœ… Shows what will be changed before applying
143
- - โœ… Requires confirmation (unless `--yes` flag used)
144
- - โœ… Skips major updates (may have breaking changes)
145
- - โœ… Groups actions by priority (critical โ†’ cleanup โ†’ updates)
146
- - โœ… Provides clear summary of changes
216
+ ## ๐Ÿš€ CI/CD Integration (v2.2)
147
217
 
148
- ### Workflow Example
218
+ ### JSON Output
219
+ Perfect for parsing in CI/CD pipelines:
149
220
  ```bash
150
- # 1. Analyze your project
151
- devcompass analyze
221
+ devcompass analyze --json
222
+ ```
152
223
 
153
- # 2. If issues found, auto-fix them
154
- devcompass fix
224
+ **Output (v2.3):**
225
+ ```json
226
+ {
227
+ "version": "2.3.0",
228
+ "timestamp": "2026-04-02T10:30:00.000Z",
229
+ "summary": {
230
+ "healthScore": 6.2,
231
+ "totalDependencies": 25,
232
+ "securityVulnerabilities": 5,
233
+ "ecosystemAlerts": 1,
234
+ "unusedDependencies": 0,
235
+ "outdatedPackages": 3,
236
+ "heavyPackages": 2,
237
+ "licenseWarnings": 1
238
+ },
239
+ "security": {
240
+ "total": 5,
241
+ "critical": 1,
242
+ "high": 2,
243
+ "moderate": 2,
244
+ "low": 0,
245
+ "vulnerabilities": [...]
246
+ },
247
+ "bundleAnalysis": {
248
+ "heavyPackages": [
249
+ { "name": "typescript", "size": "8.1 MB" },
250
+ { "name": "webpack", "size": "2.3 MB" }
251
+ ]
252
+ },
253
+ "licenses": {
254
+ "warnings": [
255
+ { "package": "sharp", "license": "LGPL-3.0", "type": "restrictive" }
256
+ ]
257
+ },
258
+ "ecosystemAlerts": [...],
259
+ "unusedDependencies": [...],
260
+ "outdatedPackages": [...]
261
+ }
262
+ ```
155
263
 
156
- # 3. Verify the improvements
157
- devcompass analyze
264
+ ### CI Mode
265
+ Automatically fail builds if health score is too low:
266
+ ```bash
267
+ devcompass analyze --ci
158
268
  ```
159
269
 
160
- ## ๐Ÿ“Š Analyze Command
270
+ - โœ… **Exit code 0** if score โ‰ฅ threshold (default: 7/10)
271
+ - โŒ **Exit code 1** if score < threshold
272
+
273
+ **GitHub Actions Example:**
274
+ ```yaml
275
+ name: Dependency Health Check
161
276
 
162
- ### Example Output (v2.1)
277
+ on: [push, pull_request]
278
+
279
+ jobs:
280
+ health-check:
281
+ runs-on: ubuntu-latest
282
+ steps:
283
+ - uses: actions/checkout@v3
284
+ - uses: actions/setup-node@v3
285
+ - run: npm install
286
+ - run: npx devcompass analyze --ci
163
287
  ```
164
- ๐Ÿ” DevCompass v2.1.0 - Analyzing your project...
165
- โœ” Scanned 15 dependencies in project
166
288
 
167
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
289
+ ### Silent Mode
290
+ For background checks or scripts:
291
+ ```bash
292
+ devcompass analyze --silent
293
+ echo $? # Check exit code
294
+ ```
168
295
 
169
- ๐Ÿšจ ECOSYSTEM ALERTS (2)
296
+ ## โšก Smart Caching (v2.2)
170
297
 
171
- ๐Ÿ”ด CRITICAL
172
- lodash@4.17.19
173
- Issue: Prototype pollution vulnerability
174
- Affected: <4.17.21
175
- Fix: 4.17.21
176
- Source: npm advisory 1523
298
+ DevCompass caches results to improve performance:
177
299
 
178
- ๐ŸŸ  HIGH
179
- axios@1.6.0
180
- Issue: Memory leak in request interceptors
181
- Affected: >=1.5.0 <1.6.2
182
- Fix: 1.6.2
183
- Source: GitHub Issue #5456
300
+ - **First run:** Normal speed (fetches all data)
301
+ - **Cached runs:** ~70% faster
302
+ - **Cache duration:** 1 hour
303
+ - **Cache file:** `.devcompass-cache.json` (auto-gitignored)
184
304
 
185
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
305
+ **What gets cached:**
306
+ - Security vulnerabilities
307
+ - Ecosystem alerts
308
+ - Unused dependencies
309
+ - Outdated packages
310
+ - Bundle sizes
311
+ - License information
186
312
 
187
- ๐Ÿ”ด UNUSED DEPENDENCIES (2)
188
- โ— moment
189
- โ— request
313
+ **Disable caching:**
314
+ ```json
315
+ // devcompass.config.json
316
+ {
317
+ "cache": false
318
+ }
319
+ ```
190
320
 
191
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
321
+ ## ๐ŸŽ›๏ธ Advanced Configuration (v2.2)
322
+
323
+ Create `devcompass.config.json` in your project root:
324
+ ```json
325
+ {
326
+ "ignore": ["lodash", "moment"],
327
+ "ignoreSeverity": ["low"],
328
+ "minSeverity": "medium",
329
+ "minScore": 7,
330
+ "cache": true
331
+ }
332
+ ```
192
333
 
193
- ๐ŸŸก OUTDATED PACKAGES (3)
194
- react 18.2.0 โ†’ ^19.0.0 (major update)
195
- express 4.18.0 โ†’ ^4.19.0 (patch update)
334
+ ### Configuration Options
196
335
 
197
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
336
+ | Option | Type | Description | Example |
337
+ |--------|------|-------------|---------|
338
+ | `ignore` | `string[]` | Ignore specific packages from alerts | `["lodash", "axios"]` |
339
+ | `ignoreSeverity` | `string[]` | Ignore severity levels | `["low", "medium"]` |
340
+ | `minSeverity` | `string` | Only show alerts above this level | `"high"` (shows critical + high) |
341
+ | `minScore` | `number` | Minimum score for CI mode | `7` (fails if < 7) |
342
+ | `cache` | `boolean` | Enable/disable caching | `true` |
198
343
 
199
- ๐Ÿ“Š PROJECT HEALTH
200
- Overall Score: 5.5/10
201
- Total Dependencies: 15
202
- Ecosystem Alerts: 2
203
- Unused: 2
204
- Outdated: 3
344
+ ### Severity Levels (highest to lowest)
345
+ 1. **critical** - Immediate security risk
346
+ 2. **high** - Production stability issues
347
+ 3. **medium** - Maintenance concerns
348
+ 4. **low** - Minor issues
205
349
 
206
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
350
+ ### Example Configurations
207
351
 
208
- ๐Ÿ’ก QUICK WINS
209
- ๐Ÿ”ด Fix critical issues:
352
+ **Security-focused (strict):**
353
+ ```json
354
+ {
355
+ "minSeverity": "critical",
356
+ "minScore": 9
357
+ }
358
+ ```
210
359
 
211
- npm install lodash@4.17.21
212
- npm install axios@1.6.2
360
+ **Balanced (recommended):**
361
+ ```json
362
+ {
363
+ "ignoreSeverity": ["low"],
364
+ "minScore": 7
365
+ }
366
+ ```
213
367
 
214
- ๐Ÿงน Clean up unused dependencies:
368
+ **Relaxed (development):**
369
+ ```json
370
+ {
371
+ "ignoreSeverity": ["low", "medium"],
372
+ "minScore": 5
373
+ }
374
+ ```
215
375
 
216
- npm uninstall moment request
376
+ ## ๐Ÿ”ง Auto-Fix Command (v2.1)
217
377
 
218
- Expected impact:
219
- โœ“ Resolve critical security/stability issues
220
- โœ“ Remove 2 unused packages
221
- โœ“ Reduce node_modules size
222
- โœ“ Improve health score โ†’ 8.5/10
378
+ DevCompass can **automatically fix issues** in your project!
223
379
 
224
- ๐Ÿ’ก TIP: Run 'devcompass fix' to apply these fixes automatically!
380
+ ### What it does:
381
+ - ๐Ÿ”ด **Fixes critical security issues** - Upgrades packages with known vulnerabilities
382
+ - ๐Ÿงน **Removes unused dependencies** - Cleans up packages you're not using
383
+ - โฌ†๏ธ **Safe updates** - Applies patch and minor updates automatically
384
+ - โš ๏ธ **Skips breaking changes** - Major updates require manual review
385
+
386
+ ### Usage
387
+ ```bash
388
+ # Interactive mode (asks for confirmation)
389
+ devcompass fix
390
+
391
+ # Auto-apply without confirmation (for CI/CD)
392
+ devcompass fix --yes
393
+ devcompass fix -y
394
+
395
+ # Fix specific directory
396
+ devcompass fix --path /path/to/project
397
+ ```
398
+
399
+ ### Safety Features
400
+ - โœ… Shows what will be changed before applying
401
+ - โœ… Requires confirmation (unless `--yes` flag used)
402
+ - โœ… Skips major updates (may have breaking changes)
403
+ - โœ… Groups actions by priority (critical โ†’ cleanup โ†’ updates)
404
+ - โœ… Provides clear summary of changes
405
+
406
+ ### Workflow Example
407
+ ```bash
408
+ # 1. Analyze your project
409
+ devcompass analyze
410
+
411
+ # 2. If issues found, auto-fix them
412
+ devcompass fix
413
+
414
+ # 3. Verify the improvements
415
+ devcompass analyze
225
416
  ```
226
417
 
227
- ## ๐Ÿšจ Ecosystem Intelligence
418
+ ## ๐Ÿšจ Ecosystem Intelligence (v2.0)
228
419
 
229
420
  DevCompass tracks **real-world issues** in popular packages and warns you before they break production!
230
421
 
@@ -277,11 +468,12 @@ DevCompass won't flag these as unused (they're typically used in config files):
277
468
  - Shows current vs latest versions
278
469
  - Indicates update type (major/minor/patch)
279
470
 
280
- ### Health Score (Enhanced in v2.0)
471
+ ### Health Score (Enhanced in v2.3)
281
472
  Calculated from 0-10 based on:
282
473
  - Percentage of unused dependencies (โˆ’4 points per 100%)
283
474
  - Percentage of outdated packages (โˆ’3 points per 100%)
284
475
  - Ecosystem alerts by severity (โˆ’0.2 to โˆ’2.0 per issue)
476
+ - Security vulnerabilities by severity (โˆ’0.2 to โˆ’2.5 per issue)
285
477
  - Higher score = healthier project
286
478
 
287
479
  ## โš™๏ธ Commands & Options
@@ -303,17 +495,86 @@ devcompass --help
303
495
  devcompass -h
304
496
  ```
305
497
 
306
- ### Options
498
+ ### Analyze Options
307
499
  ```bash
308
- # Analyze/fix specific directory
500
+ # Analyze specific directory
309
501
  devcompass analyze --path /path/to/project
502
+
503
+ # JSON output (for CI/CD)
504
+ devcompass analyze --json
505
+
506
+ # CI mode (fail if score < threshold)
507
+ devcompass analyze --ci
508
+
509
+ # Silent mode (no output)
510
+ devcompass analyze --silent
511
+
512
+ # Combine options
513
+ devcompass analyze --path ./my-project --json
514
+ ```
515
+
516
+ ### Fix Options
517
+ ```bash
518
+ # Fix specific directory
310
519
  devcompass fix --path /path/to/project
311
520
 
312
- # Auto-fix without confirmation
521
+ # Auto-apply without confirmation
313
522
  devcompass fix --yes
314
523
  devcompass fix -y
315
524
  ```
316
525
 
526
+ ## ๐Ÿ”„ Complete Workflows
527
+
528
+ ### Local Development Workflow
529
+ ```bash
530
+ # Check project health
531
+ devcompass analyze
532
+
533
+ # Fix issues automatically
534
+ devcompass fix
535
+
536
+ # Verify improvements
537
+ devcompass analyze
538
+ ```
539
+
540
+ ### CI/CD Pipeline Workflow
541
+ ```bash
542
+ # Analyze and export JSON
543
+ devcompass analyze --json > health-report.json
544
+
545
+ # Fail build if score too low
546
+ devcompass analyze --ci
547
+
548
+ # Or combine with other checks
549
+ devcompass analyze --ci && npm test && npm run build
550
+ ```
551
+
552
+ ### Pre-commit Hook Workflow
553
+ ```bash
554
+ # .husky/pre-commit
555
+ #!/bin/sh
556
+ devcompass analyze --silent
557
+ if [ $? -ne 0 ]; then
558
+ echo "โŒ Dependency health check failed!"
559
+ exit 1
560
+ fi
561
+ ```
562
+
563
+ ### Security-Focused Workflow
564
+ ```bash
565
+ # 1. Run security scan
566
+ devcompass analyze
567
+
568
+ # 2. Check for critical vulnerabilities
569
+ devcompass analyze --json | jq '.security.critical'
570
+
571
+ # 3. Auto-fix if possible
572
+ npm audit fix
573
+
574
+ # 4. Verify fixes
575
+ devcompass analyze
576
+ ```
577
+
317
578
  ## โš ๏ธ Known Issues & Best Practices
318
579
 
319
580
  ### Installation
@@ -332,6 +593,11 @@ DevCompass is smart about config-based dependencies, but occasionally may flag p
332
593
 
333
594
  If you encounter a false positive, please [report it](https://github.com/AjayBThorat-20/devcompass/issues)!
334
595
 
596
+ ### Cache Management
597
+ - Cache files (`.devcompass-cache.json`) are automatically gitignored
598
+ - Cache expires after 1 hour
599
+ - Delete cache file manually if needed: `rm .devcompass-cache.json`
600
+
335
601
  ## ๐Ÿ› ๏ธ Requirements
336
602
 
337
603
  - Node.js >= 14.0.0
@@ -341,9 +607,14 @@ If you encounter a false positive, please [report it](https://github.com/AjayBTh
341
607
 
342
608
  1. **Run regularly** - Add to your CI/CD pipeline or git hooks
343
609
  2. **Use fix command** - Let DevCompass handle routine maintenance
344
- 3. **Fix critical alerts first** - Prioritize security and stability
345
- 4. **Review major updates** - Always check changelogs before major version bumps
346
- 5. **Verify before uninstalling** - DevCompass helps identify candidates, but always verify
610
+ 3. **Check security first** - Prioritize fixing critical vulnerabilities
611
+ 4. **Monitor bundle size** - Keep an eye on heavy packages
612
+ 5. **Review licenses** - Ensure compliance with your legal requirements
613
+ 6. **Configure severity levels** - Filter out noise with `minSeverity`
614
+ 7. **Enable CI mode** - Catch issues before they reach production
615
+ 8. **Use JSON output** - Integrate with your monitoring tools
616
+ 9. **Review major updates** - Always check changelogs before major version bumps
617
+ 10. **Verify before uninstalling** - DevCompass helps identify candidates, but always verify
347
618
 
348
619
  ## ๐Ÿค Contributing
349
620
 
@@ -427,15 +698,21 @@ Check out DevCompass stats:
427
698
 
428
699
  ## ๐ŸŒŸ What's Next?
429
700
 
430
- ### Roadmap (v2.2+)
701
+ ### Roadmap (v2.4+)
431
702
  - [x] ~~Automatic fix command~~ โœ… **Added in v2.1!**
432
- - [ ] Integration with `npm audit` for automated security scanning
433
- - [ ] CI/CD integration with `--json` output
434
- - [ ] GitHub Issues API for real-time issue tracking
435
- - [ ] Web dashboard for team health monitoring
436
- - [ ] More tracked packages (React, Next.js, Vue, Angular)
437
- - [ ] Custom ignore rules via config file
438
- - [ ] Bundle size analysis
703
+ - [x] ~~CI/CD integration with JSON output~~ โœ… **Added in v2.2!**
704
+ - [x] ~~Smart caching system~~ โœ… **Added in v2.2!**
705
+ - [x] ~~Custom ignore rules via config file~~ โœ… **Added in v2.2!**
706
+ - [x] ~~npm audit integration~~ โœ… **Added in v2.3!**
707
+ - [x] ~~Bundle size analysis~~ โœ… **Added in v2.3!**
708
+ - [x] ~~License compliance checker~~ โœ… **Added in v2.3!**
709
+ - [ ] GitHub Issues API for real-time issue tracking (v2.4.0)
710
+ - [ ] Automated security patch suggestions (v2.4.0)
711
+ - [ ] Dependency graph visualization (v2.5.0)
712
+ - [ ] Web dashboard for team health monitoring (v2.5.0)
713
+ - [ ] More tracked packages (React, Next.js, Vue, Angular) (v2.5.0)
714
+ - [ ] Team collaboration features (v2.6.0)
715
+ - [ ] Slack/Discord notifications (v2.6.0)
439
716
 
440
717
  Want to contribute? Pick an item and open an issue! ๐Ÿš€
441
718
 
@@ -445,4 +722,4 @@ Want to contribute? Pick an item and open an issue! ๐Ÿš€
445
722
 
446
723
  *DevCompass - Keep your dependencies healthy!* ๐Ÿงญ
447
724
 
448
- **Like Lighthouse for your dependencies** โšก
725
+ **Like Lighthouse for your dependencies** โšก