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 +412 -135
- package/bin/devcompass.js +4 -0
- package/package.json +9 -2
- package/src/alerts/formatter.js +1 -0
- package/src/alerts/index.js +1 -0
- package/src/alerts/matcher.js +1 -0
- package/src/alerts/predictive.js +54 -0
- package/src/alerts/resolver.js +1 -0
- package/src/analyzers/bundle-size.js +85 -0
- package/src/analyzers/licenses.js +107 -0
- package/src/analyzers/outdated.js +2 -0
- package/src/analyzers/scoring.js +19 -4
- package/src/analyzers/security.js +111 -0
- package/src/analyzers/unused-deps.js +1 -0
- package/src/cache/manager.js +90 -0
- package/src/commands/analyze.js +268 -32
- package/src/commands/fix.js +1 -0
- package/src/config/loader.js +46 -3
- package/src/utils/ci-handler.js +33 -0
- package/src/utils/json-formatter.js +78 -0
- package/src/utils/logger.js +1 -0
package/README.md
CHANGED
|
@@ -6,21 +6,26 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/devcompass)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
|
|
9
|
-
Analyze your JavaScript projects to find unused dependencies, outdated packages, **detect
|
|
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
|
-
-
|
|
17
|
-
-
|
|
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
|
-
###
|
|
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
|
-
|
|
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
|
-
##
|
|
68
|
+
## ๐ NEW in v2.3: Security & Compliance Features
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
### Security Vulnerability Scanning
|
|
60
71
|
|
|
61
|
-
|
|
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
|
-
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
devcompass fix
|
|
74
|
+
**Example Output:**
|
|
75
|
+
```
|
|
76
|
+
๐ SECURITY VULNERABILITIES (12)
|
|
71
77
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
๐ด CRITICAL: 2
|
|
79
|
+
๐ HIGH: 4
|
|
80
|
+
๐ก MODERATE: 5
|
|
81
|
+
โช LOW: 1
|
|
75
82
|
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
126
|
+
โ๏ธ LICENSE WARNINGS (2)
|
|
127
|
+
|
|
128
|
+
sharp - Restrictive (LGPL-3.0)
|
|
129
|
+
custom-lib - Unknown (UNLICENSED)
|
|
83
130
|
|
|
84
|
-
|
|
131
|
+
Note: Restrictive licenses may require legal review
|
|
132
|
+
```
|
|
85
133
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
153
|
+
๐ SECURITY VULNERABILITIES (5)
|
|
97
154
|
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
163
|
+
๐จ ECOSYSTEM ALERTS (1)
|
|
104
164
|
|
|
105
|
-
|
|
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
|
-
|
|
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
|
-
|
|
181
|
+
โ๏ธ LICENSE WARNINGS (1)
|
|
112
182
|
|
|
113
|
-
|
|
114
|
-
npm install express@5.2.1
|
|
183
|
+
sharp - Restrictive (LGPL-3.0)
|
|
115
184
|
|
|
116
185
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
117
186
|
|
|
118
|
-
๐
|
|
187
|
+
๐ PROJECT HEALTH
|
|
119
188
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
198
|
+
๐ก QUICK WINS
|
|
199
|
+
|
|
200
|
+
๐ Fix security vulnerabilities:
|
|
201
|
+
|
|
202
|
+
npm audit fix
|
|
128
203
|
|
|
129
|
-
|
|
204
|
+
๐ด Fix critical issues:
|
|
130
205
|
|
|
131
|
-
|
|
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
|
-
|
|
208
|
+
Expected impact:
|
|
209
|
+
โ Resolve security vulnerabilities
|
|
210
|
+
โ Resolve critical stability issues
|
|
211
|
+
โ Improve health score โ 8.7/10
|
|
137
212
|
|
|
138
|
-
๐ก Run devcompass
|
|
213
|
+
๐ก TIP: Run 'devcompass fix' to apply these fixes automatically!
|
|
139
214
|
```
|
|
140
215
|
|
|
141
|
-
|
|
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
|
-
###
|
|
218
|
+
### JSON Output
|
|
219
|
+
Perfect for parsing in CI/CD pipelines:
|
|
149
220
|
```bash
|
|
150
|
-
|
|
151
|
-
|
|
221
|
+
devcompass analyze --json
|
|
222
|
+
```
|
|
152
223
|
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
157
|
-
|
|
264
|
+
### CI Mode
|
|
265
|
+
Automatically fail builds if health score is too low:
|
|
266
|
+
```bash
|
|
267
|
+
devcompass analyze --ci
|
|
158
268
|
```
|
|
159
269
|
|
|
160
|
-
|
|
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
|
-
|
|
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
|
-
|
|
296
|
+
## โก Smart Caching (v2.2)
|
|
170
297
|
|
|
171
|
-
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
|
|
209
|
-
|
|
352
|
+
**Security-focused (strict):**
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"minSeverity": "critical",
|
|
356
|
+
"minScore": 9
|
|
357
|
+
}
|
|
358
|
+
```
|
|
210
359
|
|
|
211
|
-
|
|
212
|
-
|
|
360
|
+
**Balanced (recommended):**
|
|
361
|
+
```json
|
|
362
|
+
{
|
|
363
|
+
"ignoreSeverity": ["low"],
|
|
364
|
+
"minScore": 7
|
|
365
|
+
}
|
|
366
|
+
```
|
|
213
367
|
|
|
214
|
-
|
|
368
|
+
**Relaxed (development):**
|
|
369
|
+
```json
|
|
370
|
+
{
|
|
371
|
+
"ignoreSeverity": ["low", "medium"],
|
|
372
|
+
"minScore": 5
|
|
373
|
+
}
|
|
374
|
+
```
|
|
215
375
|
|
|
216
|
-
|
|
376
|
+
## ๐ง Auto-Fix Command (v2.1)
|
|
217
377
|
|
|
218
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
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-
|
|
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. **
|
|
345
|
-
4. **
|
|
346
|
-
5. **
|
|
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.
|
|
701
|
+
### Roadmap (v2.4+)
|
|
431
702
|
- [x] ~~Automatic fix command~~ โ
**Added in v2.1!**
|
|
432
|
-
- [
|
|
433
|
-
- [
|
|
434
|
-
- [
|
|
435
|
-
- [
|
|
436
|
-
- [
|
|
437
|
-
- [
|
|
438
|
-
- [ ]
|
|
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** โก
|