cursor-doctor 1.1.4 → 1.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.
- package/package.json +1 -1
- package/src/cli.js +16 -4
- package/src/doctor.js +7 -6
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ const { autoFix } = require('./autofix');
|
|
|
11
11
|
const { isLicensed, activateLicense } = require('./license');
|
|
12
12
|
const { fixProject } = require('./fix');
|
|
13
13
|
|
|
14
|
-
const VERSION = '1.
|
|
14
|
+
const VERSION = '1.2.0';
|
|
15
15
|
|
|
16
16
|
const RED = '\x1b[31m';
|
|
17
17
|
const YELLOW = '\x1b[33m';
|
|
@@ -110,11 +110,19 @@ async function main() {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
var gradeColors = { A: GREEN, B: GREEN, C: YELLOW, D: YELLOW, F: RED };
|
|
113
|
+
var gradeEmoji = { A: String.fromCharCode(11088), B: String.fromCharCode(10004), C: String.fromCharCode(9888), D: String.fromCharCode(9881), F: String.fromCharCode(128680) };
|
|
113
114
|
var gc = gradeColors[report.grade] || RESET;
|
|
114
115
|
|
|
115
116
|
console.log();
|
|
116
|
-
console.log(' ' + gc + BOLD + 'Cursor Health: ' + report.grade + '
|
|
117
|
-
console.log(
|
|
117
|
+
console.log(' ' + gc + BOLD + String.fromCharCode(9618).repeat(2) + ' Cursor Health: ' + report.grade + ' ' + String.fromCharCode(9618).repeat(2) + RESET);
|
|
118
|
+
console.log();
|
|
119
|
+
|
|
120
|
+
// Progress bar
|
|
121
|
+
var barWidth = 30;
|
|
122
|
+
var filled = Math.round((report.percentage / 100) * barWidth);
|
|
123
|
+
var empty = barWidth - filled;
|
|
124
|
+
var bar = gc + String.fromCharCode(9608).repeat(filled) + RESET + DIM + String.fromCharCode(9617).repeat(empty) + RESET;
|
|
125
|
+
console.log(' ' + bar + ' ' + gc + BOLD + report.percentage + '%' + RESET);
|
|
118
126
|
console.log();
|
|
119
127
|
|
|
120
128
|
for (var i = 0; i < report.checks.length; i++) {
|
|
@@ -129,9 +137,13 @@ async function main() {
|
|
|
129
137
|
}
|
|
130
138
|
console.log();
|
|
131
139
|
|
|
140
|
+
var passes = report.checks.filter(function(c) { return c.status === 'pass'; }).length;
|
|
132
141
|
var fixable = report.checks.filter(function(c) { return c.status === 'fail' || c.status === 'warn'; }).length;
|
|
142
|
+
console.log(' ' + GREEN + passes + ' passed' + RESET + ' ' + (fixable > 0 ? YELLOW + fixable + ' fixable' + RESET : ''));
|
|
143
|
+
console.log();
|
|
144
|
+
|
|
133
145
|
if (fixable > 0) {
|
|
134
|
-
console.log(' ' + CYAN +
|
|
146
|
+
console.log(' ' + CYAN + 'Auto-fix:' + RESET + ' npx cursor-doctor fix');
|
|
135
147
|
console.log(' ' + DIM + 'Pro ($9 one-time) ' + PURCHASE_URL + RESET);
|
|
136
148
|
console.log();
|
|
137
149
|
}
|
package/src/doctor.js
CHANGED
|
@@ -22,7 +22,7 @@ async function doctor(dir) {
|
|
|
22
22
|
report.score += 20;
|
|
23
23
|
report.checks.push({ name: 'Rules exist', status: 'pass', detail: '.cursor/rules/ found with .mdc files' });
|
|
24
24
|
} else if (hasCursorrules) {
|
|
25
|
-
report.score +=
|
|
25
|
+
report.score += 12;
|
|
26
26
|
report.checks.push({ name: 'Rules exist', status: 'warn', detail: 'Only .cursorrules found — run cursor-doctor migrate to convert' });
|
|
27
27
|
} else {
|
|
28
28
|
report.checks.push({ name: 'Rules exist', status: 'fail', detail: 'No rules found. Run cursor-doctor generate to create rules for your stack.' });
|
|
@@ -37,6 +37,7 @@ async function doctor(dir) {
|
|
|
37
37
|
report.score += 10;
|
|
38
38
|
report.checks.push({ name: 'No legacy .cursorrules', status: 'pass', detail: 'Using modern .mdc format' });
|
|
39
39
|
} else {
|
|
40
|
+
report.score += 4;
|
|
40
41
|
report.checks.push({ name: 'No legacy .cursorrules', status: 'warn', detail: 'Using legacy .cursorrules — run cursor-doctor migrate' });
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -54,7 +55,7 @@ async function doctor(dir) {
|
|
|
54
55
|
report.score += 25;
|
|
55
56
|
report.checks.push({ name: 'Rule syntax', status: 'pass', detail: 'All rules pass lint checks' });
|
|
56
57
|
} else if (errors === 0) {
|
|
57
|
-
report.score +=
|
|
58
|
+
report.score += 18;
|
|
58
59
|
report.checks.push({ name: 'Rule syntax', status: 'warn', detail: `${warnings} warning(s). Run cursor-doctor lint for details.` });
|
|
59
60
|
} else {
|
|
60
61
|
report.score += Math.max(0, 8 - errors * 2);
|
|
@@ -205,10 +206,10 @@ async function doctor(dir) {
|
|
|
205
206
|
|
|
206
207
|
// Calculate grade
|
|
207
208
|
const pct = report.maxScore > 0 ? (report.score / report.maxScore) * 100 : 0;
|
|
208
|
-
if (pct >=
|
|
209
|
-
else if (pct >=
|
|
210
|
-
else if (pct >=
|
|
211
|
-
else if (pct >=
|
|
209
|
+
if (pct >= 85) report.grade = 'A';
|
|
210
|
+
else if (pct >= 70) report.grade = 'B';
|
|
211
|
+
else if (pct >= 50) report.grade = 'C';
|
|
212
|
+
else if (pct >= 30) report.grade = 'D';
|
|
212
213
|
else report.grade = 'F';
|
|
213
214
|
report.percentage = Math.round(pct);
|
|
214
215
|
|