@geoql/vue-doctor 0.1.1 → 1.0.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 +1 -1
- package/dist/index.js +278 -52
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import { readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { audit, detectProject, encodeAnnotations, format, listChangedFiles, listRules, loadDoctorConfig, loadRuleDoc, mergeCliOverrides, renderVerboseTrace } from "@geoql/doctor-core";
|
|
5
|
+
import { audit, detectProject, detectSummary, encodeAnnotations, findMonorepoRoot, format, listChangedFiles, listRules, listWorkspacePackages, loadDoctorConfig, loadRuleDoc, mergeCliOverrides, normalizeInitAnswers, planInit, renderVerboseTrace, scoreDiagnostics } from "@geoql/doctor-core";
|
|
6
6
|
import { cac } from "cac";
|
|
7
|
+
import prompts from "prompts";
|
|
7
8
|
//#region src/cli.ts
|
|
8
9
|
function readVersion() {
|
|
9
10
|
try {
|
|
@@ -93,6 +94,11 @@ const VALID_SOURCES = new Set([
|
|
|
93
94
|
"oxlint-builtin",
|
|
94
95
|
"eslint-plugin-vue"
|
|
95
96
|
]);
|
|
97
|
+
const VALID_CONFIG_FORMATS = new Set([
|
|
98
|
+
"ts",
|
|
99
|
+
"json",
|
|
100
|
+
"package-json"
|
|
101
|
+
]);
|
|
96
102
|
function buildListRulesFilter(flags) {
|
|
97
103
|
const out = {};
|
|
98
104
|
if (flags.preset !== void 0) {
|
|
@@ -144,19 +150,253 @@ function parseRuleOverrides(rules) {
|
|
|
144
150
|
return out;
|
|
145
151
|
}
|
|
146
152
|
function resolveFormat(flags) {
|
|
153
|
+
if (flags.prComment !== void 0) return "pr-comment";
|
|
147
154
|
if (flags.jsonCompact) return "json-compact";
|
|
148
155
|
if (flags.json) return "json";
|
|
149
156
|
const kind = flags.format;
|
|
150
|
-
if (kind === "pretty" || kind === "json" || kind === "json-compact" || kind === "sarif" || kind === "html") return kind;
|
|
157
|
+
if (kind === "pretty" || kind === "json" || kind === "json-compact" || kind === "sarif" || kind === "html" || kind === "pr-comment") return kind;
|
|
151
158
|
if (typeof flags.output === "string" && flags.output.toLowerCase().endsWith(".html")) return "html";
|
|
152
159
|
return "agent";
|
|
153
160
|
}
|
|
154
161
|
function isFailOnLevel(v) {
|
|
155
162
|
return v === "error" || v === "warn" || v === "none";
|
|
156
163
|
}
|
|
164
|
+
async function runSingleAudit(rootDir, flags, prepared) {
|
|
165
|
+
let scopeFiles;
|
|
166
|
+
if (!flags.full && (flags.diff || flags.staged)) scopeFiles = await listChangedFiles({
|
|
167
|
+
rootDir,
|
|
168
|
+
mode: flags.staged ? "staged" : "diff"
|
|
169
|
+
});
|
|
170
|
+
const resolved = await loadDoctorConfig(rootDir, {
|
|
171
|
+
...flags.config ? { explicitPath: flags.config } : {},
|
|
172
|
+
...flags.preset ? { presetOverride: flags.preset } : {}
|
|
173
|
+
});
|
|
174
|
+
const fixExclude = toArray(flags.fixExclude);
|
|
175
|
+
const merged = mergeCliOverrides(resolved, {
|
|
176
|
+
failOn: flags.failOn,
|
|
177
|
+
include: toArray(flags.include),
|
|
178
|
+
exclude: toArray(flags.exclude),
|
|
179
|
+
rules: prepared.ruleOverrides,
|
|
180
|
+
threshold: prepared.threshold,
|
|
181
|
+
...fixExclude ? { fixExcludes: fixExclude } : {}
|
|
182
|
+
});
|
|
183
|
+
const report = await audit({
|
|
184
|
+
rootDir: merged.rootDir,
|
|
185
|
+
include: merged.include,
|
|
186
|
+
exclude: merged.exclude,
|
|
187
|
+
rules: merged.rules,
|
|
188
|
+
failOn: merged.failOn,
|
|
189
|
+
threshold: merged.threshold,
|
|
190
|
+
deadCode: flags.deadCode,
|
|
191
|
+
lint: flags.lint,
|
|
192
|
+
respectInlineDisables: flags.respectInlineDisables,
|
|
193
|
+
scopeFiles,
|
|
194
|
+
fix: flags.fix,
|
|
195
|
+
...merged.fixExcludes ? { fixExcludes: merged.fixExcludes } : {}
|
|
196
|
+
});
|
|
197
|
+
const allowedRuleIds = new Set(Object.keys(merged.rules));
|
|
198
|
+
report.diagnostics = report.diagnostics.filter((d) => allowedRuleIds.has(d.ruleId));
|
|
199
|
+
return {
|
|
200
|
+
report,
|
|
201
|
+
source: resolved.source
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function aggregateReports(reports, rootDirectory) {
|
|
205
|
+
const first = reports[0];
|
|
206
|
+
const diagnostics = reports.flatMap((r) => r.diagnostics);
|
|
207
|
+
let filesScanned = 0;
|
|
208
|
+
let elapsedMs = 0;
|
|
209
|
+
let exitCode = 0;
|
|
210
|
+
for (const r of reports) {
|
|
211
|
+
filesScanned += r.filesScanned;
|
|
212
|
+
elapsedMs += r.elapsedMs;
|
|
213
|
+
if (r.exitCode > exitCode) exitCode = r.exitCode;
|
|
214
|
+
}
|
|
215
|
+
const ruleCounts = {};
|
|
216
|
+
for (const d of diagnostics) ruleCounts[d.ruleId] = (ruleCounts[d.ruleId] ?? 0) + 1;
|
|
217
|
+
const scoreResult = scoreDiagnostics(diagnostics, { threshold: first.scoreResult.threshold });
|
|
218
|
+
return {
|
|
219
|
+
rootDir: rootDirectory,
|
|
220
|
+
filesScanned,
|
|
221
|
+
diagnostics,
|
|
222
|
+
score: scoreResult.score,
|
|
223
|
+
errorCount: scoreResult.errorCount,
|
|
224
|
+
warnCount: scoreResult.warnCount,
|
|
225
|
+
infoCount: scoreResult.infoCount,
|
|
226
|
+
exitCode,
|
|
227
|
+
scoreResult,
|
|
228
|
+
projectInfo: {
|
|
229
|
+
...first.projectInfo,
|
|
230
|
+
rootDirectory
|
|
231
|
+
},
|
|
232
|
+
elapsedMs,
|
|
233
|
+
timings: first.timings,
|
|
234
|
+
ruleCounts
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function emitReport(report, reporter, flags) {
|
|
238
|
+
const out = format({
|
|
239
|
+
toolName: "@geoql/vue-doctor",
|
|
240
|
+
toolVersion: readVersion(),
|
|
241
|
+
rootDirectory: report.rootDir,
|
|
242
|
+
analyzedFileCount: report.filesScanned,
|
|
243
|
+
elapsedMs: report.elapsedMs,
|
|
244
|
+
diagnostics: report.diagnostics,
|
|
245
|
+
score: report.scoreResult,
|
|
246
|
+
projectInfo: report.projectInfo
|
|
247
|
+
}, reporter, {
|
|
248
|
+
color: flags.color,
|
|
249
|
+
quiet: flags.quiet
|
|
250
|
+
});
|
|
251
|
+
if (flags.output) writeFileSync(resolve(flags.output), out);
|
|
252
|
+
else process.stdout.write(out);
|
|
253
|
+
const ciExplicitOptOut = flags.ci === false;
|
|
254
|
+
const ciExplicitOptIn = flags.ci === true;
|
|
255
|
+
const ciAutoDetected = !ciExplicitOptOut && isCiEnvironment();
|
|
256
|
+
if ((flags.annotations === true || ciExplicitOptIn || ciAutoDetected) && (reporter === "agent" || reporter === "pretty") && !flags.quiet && report.diagnostics.length > 0) process.stdout.write(`${encodeAnnotations(report.diagnostics)}\n`);
|
|
257
|
+
}
|
|
258
|
+
async function runProjectAudits(rootDir, flags, prepared, packages) {
|
|
259
|
+
const requested = flags.project.split(",").map((name) => name.trim()).filter((name) => name.length > 0);
|
|
260
|
+
const byName = new Map(packages.map((p) => [p.name, p]));
|
|
261
|
+
const reports = [];
|
|
262
|
+
let source = "built-in";
|
|
263
|
+
for (const name of requested) {
|
|
264
|
+
const match = byName.get(name);
|
|
265
|
+
if (!match) {
|
|
266
|
+
process.stderr.write(`vue-doctor: --project: unknown project "${name}" (skipped)\n`);
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const single = await runSingleAudit(match.dir, flags, prepared);
|
|
270
|
+
reports.push(single.report);
|
|
271
|
+
source = single.source;
|
|
272
|
+
}
|
|
273
|
+
if (reports.length === 0) {
|
|
274
|
+
process.stderr.write("vue-doctor: --project: no matching workspace projects\n");
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
const { root } = await findMonorepoRoot(rootDir);
|
|
278
|
+
return {
|
|
279
|
+
report: aggregateReports(reports, root),
|
|
280
|
+
source
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
async function runInit(dir, flags) {
|
|
284
|
+
const targetDir = resolve(dir);
|
|
285
|
+
const configFormat = flags.configFormat ?? "ts";
|
|
286
|
+
if (!VALID_CONFIG_FORMATS.has(configFormat)) {
|
|
287
|
+
process.stderr.write(`vue-doctor init: --config-format must be ts | json | package-json, got '${flags.configFormat}'\n`);
|
|
288
|
+
process.exitCode = 2;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const resolvedAnswers = flags.yes ? {
|
|
292
|
+
configFormat,
|
|
293
|
+
preset: "recommended",
|
|
294
|
+
threshold: void 0,
|
|
295
|
+
exclude: void 0
|
|
296
|
+
} : await runInteractiveInit(configFormat);
|
|
297
|
+
if (process.exitCode === 2) return;
|
|
298
|
+
const plan = await planInit({
|
|
299
|
+
dir: targetDir,
|
|
300
|
+
configFormat: resolvedAnswers.configFormat,
|
|
301
|
+
preset: resolvedAnswers.preset,
|
|
302
|
+
threshold: resolvedAnswers.threshold,
|
|
303
|
+
exclude: resolvedAnswers.exclude,
|
|
304
|
+
binName: "vue-doctor"
|
|
305
|
+
});
|
|
306
|
+
const summary = await detectSummary(targetDir);
|
|
307
|
+
process.stdout.write(`${summary}\n`);
|
|
308
|
+
if (plan.conflict && !flags.force) {
|
|
309
|
+
process.stderr.write(`vue-doctor init: ${plan.conflictPath} already exists. Run with --force to overwrite.\n`);
|
|
310
|
+
process.exitCode = 2;
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
if (flags.dryRun) {
|
|
314
|
+
for (const write of plan.writes) {
|
|
315
|
+
process.stdout.write(`[dry-run] would write ${write.path}\n`);
|
|
316
|
+
process.stdout.write(`${write.content}\n`);
|
|
317
|
+
}
|
|
318
|
+
process.exitCode = 0;
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
for (const write of plan.writes) writeFileSync(write.path, write.content, "utf8");
|
|
322
|
+
process.exitCode = 0;
|
|
323
|
+
}
|
|
324
|
+
async function runInteractiveInit(defaultFormat) {
|
|
325
|
+
const answers = await prompts([
|
|
326
|
+
{
|
|
327
|
+
type: "select",
|
|
328
|
+
name: "target",
|
|
329
|
+
message: "Config target?",
|
|
330
|
+
choices: [
|
|
331
|
+
{
|
|
332
|
+
title: "doctor.config.ts (recommended)",
|
|
333
|
+
value: "ts"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
title: "doctor.config.json",
|
|
337
|
+
value: "json"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
title: "package.json#doctor",
|
|
341
|
+
value: "package-json"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
initial: defaultFormat === "package-json" ? 2 : 0
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
type: "select",
|
|
348
|
+
name: "preset",
|
|
349
|
+
message: "Base preset?",
|
|
350
|
+
choices: [
|
|
351
|
+
{
|
|
352
|
+
title: "recommended (errors + warnings)",
|
|
353
|
+
value: "recommended"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
title: "strict (recommended + info)",
|
|
357
|
+
value: "strict"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
title: "minimal (errors only)",
|
|
361
|
+
value: "minimal"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
initial: 0
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
type: "number",
|
|
368
|
+
name: "threshold",
|
|
369
|
+
message: "Minimum passing score (0-100, blank to skip)",
|
|
370
|
+
min: 0,
|
|
371
|
+
max: 100,
|
|
372
|
+
initial: ""
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
type: "text",
|
|
376
|
+
name: "exclude",
|
|
377
|
+
message: "Exclude glob patterns (comma-separated, blank to skip)",
|
|
378
|
+
initial: ""
|
|
379
|
+
}
|
|
380
|
+
], { onCancel: () => {
|
|
381
|
+
process.stderr.write("vue-doctor init: cancelled\n");
|
|
382
|
+
process.exitCode = 2;
|
|
383
|
+
} });
|
|
384
|
+
if (process.exitCode === 2) return {
|
|
385
|
+
configFormat: "ts",
|
|
386
|
+
preset: "recommended",
|
|
387
|
+
threshold: void 0,
|
|
388
|
+
exclude: void 0
|
|
389
|
+
};
|
|
390
|
+
return normalizeInitAnswers({
|
|
391
|
+
target: answers.target,
|
|
392
|
+
preset: answers.preset,
|
|
393
|
+
threshold: answers.threshold || void 0,
|
|
394
|
+
exclude: answers.exclude
|
|
395
|
+
});
|
|
396
|
+
}
|
|
157
397
|
async function run(argv = process.argv) {
|
|
158
398
|
const cli = cac("vue-doctor");
|
|
159
|
-
cli.command("[path]", "Audit a Vue project").option("--format <kind>", "Output format (agent|pretty|json|json-compact|sarif|html)", { default: "agent" }).option("--json", "Shorthand for --format json").option("--json-compact", "Emit single-line JSON").option("--config <path>", "Path to doctor.config.ts").option("--preset <name>", "Base preset: minimal|recommended|strict|all").option("--fail-on <level>", "Exit non-zero on this severity or worse (error|warn|none)", { default: "error" }).option("--quiet", "Only show the summary").option("--verbose", "Emit per-pass timing and rule diagnostics
|
|
399
|
+
cli.command("[path]", "Audit a Vue project").option("--format <kind>", "Output format (agent|pretty|json|json-compact|sarif|html|pr-comment)", { default: "agent" }).option("--json", "Shorthand for --format json").option("--json-compact", "Emit single-line JSON").option("--config <path>", "Path to doctor.config.ts").option("--preset <name>", "Base preset: minimal|recommended|strict|all").option("--fail-on <level>", "Exit non-zero on this severity or a worse (error|warn|none)", { default: "error" }).option("--quiet", "Only show the summary").option("--verbose", "Emit per-pass timing and rule diagnostics on stderr").option("--no-color", "Disable colored output").option("--rule <id:level>", "Override a rule (repeatable), e.g. --rule a/b:off").option("--include <glob>", "Glob of files to include (repeatable)").option("--exclude <glob>", "Glob of files to exclude (repeatable)").option("--no-dead-code", "Skip the dead-code (knip) analysis pass").option("--no-lint", "Skip the lint passes (template/SFC/oxlint)").option("--no-respect-inline-disables", "Surface findings even inside doctor-disable comments").option("--threshold <n>", "Minimum passing score (0-100)").option("--score", "Output only the numeric score (for piping)").option("--annotations", "Emit GitHub Actions ::error::/::warning:: lines").option("--ci", "Auto-enable CI behavior (--annotations on GitHub Actions)").option("--no-ci", "Disable CI auto-detection even when CI env is set").option("--diff", "Only report findings in files changed vs HEAD").option("--staged", "Only report findings in staged files").option("--full", "Force a complete scan (overrides --diff/--staged)").option("--project <name>", "Comma-separated workspace project names to audit (monorepo)").option("--output <file>", "Write the report to a file instead of stdout").option("--pr-comment", "Emit a focused Markdown PR-comment body").option("--fix", "Auto-fix oxlint-pass findings in place (built-in vue/* rules only; template/SFC/dead-code/project findings are not fixable). Skipped in --diff/--staged mode.").option("--fix-exclude <ruleId>", "Mark a rule as not-auto-fixable (repeatable). Note: oxlint applies built-in fixes globally, so this is enforced only for doctor plugin fixes; built-in vue/* fixes still apply.").action(async (path, flags) => {
|
|
160
400
|
const reporter = resolveFormat(flags);
|
|
161
401
|
if (flags.failOn !== void 0 && !isFailOnLevel(flags.failOn)) {
|
|
162
402
|
process.stderr.write(`vue-doctor: --fail-on must be 'error', 'warn', or 'none', got '${flags.failOn}'\n`);
|
|
@@ -171,64 +411,42 @@ async function run(argv = process.argv) {
|
|
|
171
411
|
if (threshold !== void 0 && (!Number.isInteger(threshold) || threshold < 0 || threshold > 100)) throw new Error(`--threshold must be an integer 0-100, got "${flags.threshold}".`);
|
|
172
412
|
if (flags.diff && flags.staged) throw new Error("--diff and --staged are mutually exclusive.");
|
|
173
413
|
if (flags.verbose && flags.quiet) throw new Error("--verbose and --quiet are mutually exclusive.");
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
...flags.config ? { explicitPath: flags.config } : {},
|
|
181
|
-
...flags.preset ? { presetOverride: flags.preset } : {}
|
|
182
|
-
});
|
|
183
|
-
const merged = mergeCliOverrides(resolved, {
|
|
184
|
-
failOn: flags.failOn,
|
|
185
|
-
include: toArray(flags.include),
|
|
186
|
-
exclude: toArray(flags.exclude),
|
|
187
|
-
rules: ruleOverrides,
|
|
414
|
+
const fixActive = flags.fix === true;
|
|
415
|
+
const fixSkippedForScope = fixActive && !flags.full && (flags.diff || flags.staged);
|
|
416
|
+
if (fixSkippedForScope) process.stderr.write("vue-doctor: --fix skipped in --diff/--staged mode (auto-fix only runs on a full scan to avoid rewriting files outside the diff).\n");
|
|
417
|
+
if (fixActive && flags.fixExclude !== void 0) process.stderr.write("vue-doctor: --fix-exclude is not enforced for built-in vue/* rules (oxlint applies their fixes globally); it currently scopes only future doctor plugin fixes.\n");
|
|
418
|
+
const prepared = {
|
|
419
|
+
ruleOverrides,
|
|
188
420
|
threshold
|
|
189
|
-
}
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
421
|
+
};
|
|
422
|
+
const workspacePackages = flags.project ? await listWorkspacePackages(rootDir) : [];
|
|
423
|
+
if (flags.project && workspacePackages.length === 0) process.stderr.write("vue-doctor: --project ignored: not a pnpm workspace\n");
|
|
424
|
+
let report;
|
|
425
|
+
let configSource;
|
|
426
|
+
if (flags.project && workspacePackages.length > 0) {
|
|
427
|
+
const aggregated = await runProjectAudits(rootDir, flags, prepared, workspacePackages);
|
|
428
|
+
if (!aggregated) {
|
|
429
|
+
process.exitCode = 2;
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
report = aggregated.report;
|
|
433
|
+
configSource = aggregated.source;
|
|
434
|
+
} else {
|
|
435
|
+
const single = await runSingleAudit(rootDir, flags, prepared);
|
|
436
|
+
report = single.report;
|
|
437
|
+
configSource = single.source;
|
|
438
|
+
}
|
|
204
439
|
if (flags.verbose) {
|
|
205
|
-
const verboseOutput = renderVerboseTrace(report, { configSource
|
|
440
|
+
const verboseOutput = renderVerboseTrace(report, { configSource });
|
|
206
441
|
process.stderr.write(`${verboseOutput}\n`);
|
|
207
442
|
}
|
|
443
|
+
if (fixActive && !fixSkippedForScope) process.stderr.write(`vue-doctor: applied oxlint --fix; ${report.diagnostics.length} finding${report.diagnostics.length === 1 ? "" : "s"} remain (re-run to see them).\n`);
|
|
208
444
|
if (flags.score) {
|
|
209
445
|
process.stdout.write(`${report.score}\n`);
|
|
210
446
|
process.exitCode = report.exitCode;
|
|
211
447
|
return;
|
|
212
448
|
}
|
|
213
|
-
|
|
214
|
-
toolName: "@geoql/vue-doctor",
|
|
215
|
-
toolVersion: readVersion(),
|
|
216
|
-
rootDirectory: report.rootDir,
|
|
217
|
-
analyzedFileCount: report.filesScanned,
|
|
218
|
-
elapsedMs: report.elapsedMs,
|
|
219
|
-
diagnostics: report.diagnostics,
|
|
220
|
-
score: report.scoreResult,
|
|
221
|
-
projectInfo: report.projectInfo
|
|
222
|
-
}, reporter, {
|
|
223
|
-
color: flags.color,
|
|
224
|
-
quiet: flags.quiet
|
|
225
|
-
});
|
|
226
|
-
if (flags.output) writeFileSync(resolve(flags.output), out);
|
|
227
|
-
else process.stdout.write(out);
|
|
228
|
-
const ciExplicitOptOut = flags.ci === false;
|
|
229
|
-
const ciExplicitOptIn = flags.ci === true;
|
|
230
|
-
const ciAutoDetected = !ciExplicitOptOut && isCiEnvironment();
|
|
231
|
-
if ((flags.annotations === true || ciExplicitOptIn || ciAutoDetected) && (reporter === "agent" || reporter === "pretty") && !flags.quiet && report.diagnostics.length > 0) process.stdout.write(`${encodeAnnotations(report.diagnostics)}\n`);
|
|
449
|
+
emitReport(report, reporter, flags);
|
|
232
450
|
process.exitCode = report.exitCode;
|
|
233
451
|
} catch (err) {
|
|
234
452
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -274,6 +492,14 @@ async function run(argv = process.argv) {
|
|
|
274
492
|
} else process.stdout.write(renderInspect(project, rootDir));
|
|
275
493
|
process.exitCode = 0;
|
|
276
494
|
});
|
|
495
|
+
cli.command("init [dir]", "Scaffold a doctor config for the project").option("-y, --yes", "Non-interactive, use recommended defaults").option("--config-format <ts|json|package-json>", "Config file format (default: ts)").option("--force", "Overwrite existing config").option("--dry-run", "Print what would be written, touch nothing").action(async (dir, flags) => {
|
|
496
|
+
try {
|
|
497
|
+
await runInit(dir ?? ".", flags);
|
|
498
|
+
} catch (err) {
|
|
499
|
+
process.stderr.write(`${err instanceof Error ? err.message : err}\n`);
|
|
500
|
+
process.exitCode = 2;
|
|
501
|
+
}
|
|
502
|
+
});
|
|
277
503
|
cli.help();
|
|
278
504
|
cli.version(readVersion());
|
|
279
505
|
cli.parse(argv, { run: false });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport process from 'node:process';\nimport { fileURLToPath } from 'node:url';\nimport {\n audit,\n detectProject,\n encodeAnnotations,\n format,\n listChangedFiles,\n listRules,\n loadDoctorConfig,\n loadRuleDoc,\n mergeCliOverrides,\n renderVerboseTrace,\n type ListRulesFilter,\n type ProjectInfo,\n type RegisteredRule,\n type ReporterFormat,\n type ReporterInput,\n type RuleCategory,\n type RuleSource,\n type Severity,\n} from '@geoql/doctor-core';\nimport { cac } from 'cac';\n\nfunction readVersion(): string {\n try {\n const here = dirname(fileURLToPath(import.meta.url));\n const pkg = JSON.parse(\n readFileSync(resolve(here, '../package.json'), 'utf-8'),\n ) as { version?: string };\n return pkg.version ?? '0.0.0';\n } catch {\n return '0.0.0';\n }\n}\n\ninterface ListRulesCliFlags {\n preset?: string;\n category?: string;\n source?: string;\n severity?: string;\n json?: boolean;\n jsonCompact?: boolean;\n}\n\ninterface ExplainCliFlags {\n json?: boolean;\n}\n\ninterface InspectCliFlags {\n json?: boolean;\n jsonCompact?: boolean;\n}\n\ninterface ProjectInfoJsonPayload {\n framework: string;\n rootDirectory: string;\n packageJsonPath: string | null;\n vueVersion: string | null;\n nuxtVersion: string | null;\n nuxtCompatibilityVersion: 3 | 4 | null;\n nitroPreset: string | null;\n typescriptVersion: string | null;\n monorepoKind: string | null;\n hasAutoImports: boolean;\n hasComponentsAutoImport: boolean;\n hasPinia: boolean;\n hasVueRouter: boolean;\n capabilities: string[];\n}\n\nfunction isCiEnvironment(): boolean {\n const env = process.env;\n return Boolean(\n env.CI === 'true' ||\n env.CI === '1' ||\n env.GITHUB_ACTIONS === 'true' ||\n env.GITLAB_CI === 'true' ||\n env.CIRCLECI === 'true' ||\n env.TRAVIS === 'true' ||\n env.BUILDKITE === 'true' ||\n env.JENKINS_HOME,\n );\n}\n\nfunction projectInfoToJson(p: ProjectInfo): ProjectInfoJsonPayload {\n return {\n framework: p.framework,\n rootDirectory: p.rootDirectory,\n packageJsonPath: p.packageJsonPath,\n vueVersion: p.vueVersion,\n nuxtVersion: p.nuxtVersion,\n nuxtCompatibilityVersion: p.nuxtCompatibilityVersion,\n nitroPreset: p.nitroPreset,\n typescriptVersion: p.typescriptVersion,\n monorepoKind: p.monorepoKind,\n hasAutoImports: p.hasAutoImports,\n hasComponentsAutoImport: p.hasComponentsAutoImport,\n hasPinia: p.hasPinia,\n hasVueRouter: p.hasVueRouter,\n capabilities: [...p.capabilities].sort(),\n };\n}\n\nfunction renderInspect(p: ProjectInfo, rootDir: string): string {\n const lines: string[] = [];\n lines.push(`@geoql/vue-doctor v${readVersion()} — project capabilities`);\n lines.push('');\n lines.push('framework');\n lines.push(` ${p.framework}`);\n lines.push(` vue: ${p.vueVersion ?? '(none)'}`);\n lines.push(` typescript: ${p.typescriptVersion ?? '(none)'}`);\n lines.push('');\n lines.push('project layout');\n lines.push(` rootDirectory: ${rootDir}`);\n lines.push(` packageJsonPath: ${p.packageJsonPath ?? '(none)'}`);\n lines.push(` monorepoKind: ${p.monorepoKind ?? '(none)'}`);\n lines.push('');\n lines.push('ecosystem');\n lines.push(` hasAutoImports: ${p.hasAutoImports}`);\n lines.push(` hasComponentsAutoImport: ${p.hasComponentsAutoImport}`);\n lines.push(` hasPinia: ${p.hasPinia}`);\n lines.push(` hasVueRouter: ${p.hasVueRouter}`);\n lines.push('');\n lines.push('capability tokens (used by rule gating)');\n lines.push(` ${[...p.capabilities].sort().join('\\n ')}`);\n lines.push('');\n lines.push(\"run 'vue-doctor inspect --json' for machine output\");\n lines.push(\n \"run 'vue-doctor list-rules' to see which rules these capabilities enable\",\n );\n return `${lines.join('\\n')}\\n`;\n}\n\ninterface ExplainableDoc {\n id: string;\n severity: string;\n category: string;\n source: string;\n recommended: boolean;\n helpUri: string;\n description: string;\n hasOverride: boolean;\n}\n\nfunction renderExplain(doc: ExplainableDoc): string {\n const lines: string[] = [];\n lines.push(`Rule: ${doc.id}`);\n lines.push(`Severity: ${doc.severity}`);\n lines.push(`Category: ${doc.category}`);\n lines.push(`Source: ${doc.source}`);\n lines.push(\n `Recommended: ${doc.recommended ? 'yes' : 'no (off in `recommended` preset)'}`,\n );\n lines.push(`Help: ${doc.helpUri}`);\n lines.push('');\n lines.push(doc.description);\n return `${lines.join('\\n')}\\n`;\n}\n\nconst VALID_LIST_PRESETS = new Set(['recommended', 'all']);\nconst VALID_CATEGORIES = new Set<RuleCategory>([\n 'ai-slop',\n 'reactivity',\n 'composition',\n 'performance',\n 'template',\n 'template-perf',\n 'build-quality',\n 'deps',\n 'dead-code',\n 'sfc',\n 'vue-builtin',\n]);\nconst VALID_SOURCES = new Set<RuleSource>([\n 'doctor',\n 'oxlint-builtin',\n 'eslint-plugin-vue',\n]);\n\nfunction buildListRulesFilter(flags: ListRulesCliFlags): ListRulesFilter {\n const out: {\n preset?: 'recommended' | 'all';\n category?: RuleCategory;\n source?: RuleSource;\n severity?: Severity;\n } = {};\n if (flags.preset !== undefined) {\n if (!VALID_LIST_PRESETS.has(flags.preset)) {\n throw new Error(\n `unknown --preset '${flags.preset}' (expected: recommended | all)`,\n );\n }\n out.preset = flags.preset as 'recommended' | 'all';\n }\n if (flags.category !== undefined) {\n if (!VALID_CATEGORIES.has(flags.category as RuleCategory)) {\n throw new Error(`unknown --category '${flags.category}'`);\n }\n out.category = flags.category as RuleCategory;\n }\n if (flags.source !== undefined) {\n if (!VALID_SOURCES.has(flags.source as RuleSource)) {\n throw new Error(`unknown --source '${flags.source}'`);\n }\n out.source = flags.source as RuleSource;\n }\n if (flags.severity !== undefined) {\n if (\n flags.severity !== 'error' &&\n flags.severity !== 'warn' &&\n flags.severity !== 'info'\n ) {\n throw new Error(\n `unknown --severity '${flags.severity}' (expected: error | warn | info)`,\n );\n }\n out.severity = flags.severity;\n }\n return out;\n}\n\nfunction renderRulesTable(rules: RegisteredRule[]): string {\n if (rules.length === 0) return 'No rules matched.\\n';\n const lines: string[] = [\n `@geoql/vue-doctor — ${rules.length} rule${rules.length === 1 ? '' : 's'}`,\n '',\n ];\n const idWidth = Math.max(...rules.map((r) => r.id.length));\n const sevWidth = Math.max(...rules.map((r) => r.severity.length));\n const catWidth = Math.max(...rules.map((r) => r.category.length));\n for (const r of rules) {\n const tag = r.recommended ? '[recommended]' : ' ';\n lines.push(\n ` ${r.id.padEnd(idWidth)} ${r.severity.padEnd(sevWidth)} ${r.category.padEnd(catWidth)} ${r.source} ${tag}`,\n );\n }\n return `${lines.join('\\n')}\\n`;\n}\n\ninterface CliFlags {\n format?: string;\n config?: string;\n preset?: string;\n failOn?: string;\n json?: boolean;\n jsonCompact?: boolean;\n color?: boolean;\n quiet?: boolean;\n verbose?: boolean;\n output?: string;\n rule?: string | string[];\n include?: string | string[];\n exclude?: string | string[];\n deadCode?: boolean;\n lint?: boolean;\n respectInlineDisables?: boolean;\n threshold?: string;\n score?: boolean;\n annotations?: boolean;\n ci?: boolean;\n diff?: boolean;\n staged?: boolean;\n full?: boolean;\n}\n\nfunction toArray(value: string | string[] | undefined): string[] | undefined {\n if (value === undefined) return undefined;\n return Array.isArray(value) ? value : [value];\n}\n\nfunction parseRuleOverrides(\n rules: string[] | undefined,\n): Record<string, Severity | 'off'> | undefined {\n if (!rules || rules.length === 0) return undefined;\n const out: Record<string, Severity | 'off'> = {};\n for (const entry of rules) {\n const idx = entry.lastIndexOf(':');\n if (idx === -1) {\n throw new Error(\n `Invalid --rule \"${entry}\". Expected format <ruleId>:<error|warn|info|off>.`,\n );\n }\n const ruleId = entry.slice(0, idx);\n const level = entry.slice(idx + 1);\n if (\n level !== 'error' &&\n level !== 'warn' &&\n level !== 'info' &&\n level !== 'off'\n ) {\n throw new Error(\n `Invalid severity \"${level}\" for --rule \"${entry}\". Expected error|warn|info|off.`,\n );\n }\n if (ruleId.length === 0) {\n throw new Error(`Invalid --rule \"${entry}\". Rule id must not be empty.`);\n }\n out[ruleId] = level;\n }\n return out;\n}\n\nfunction resolveFormat(flags: CliFlags): ReporterFormat {\n if (flags.jsonCompact) return 'json-compact';\n if (flags.json) return 'json';\n const kind = flags.format;\n const userPickedFormat =\n kind === 'pretty' ||\n kind === 'json' ||\n kind === 'json-compact' ||\n kind === 'sarif' ||\n kind === 'html';\n if (userPickedFormat) {\n return kind;\n }\n if (\n typeof flags.output === 'string' &&\n flags.output.toLowerCase().endsWith('.html')\n ) {\n return 'html';\n }\n return 'agent';\n}\n\nfunction isFailOnLevel(v: string): v is 'error' | 'warn' | 'none' {\n return v === 'error' || v === 'warn' || v === 'none';\n}\n\nexport async function run(argv: string[] = process.argv): Promise<number> {\n const cli = cac('vue-doctor');\n\n cli\n .command('[path]', 'Audit a Vue project')\n .option(\n '--format <kind>',\n 'Output format (agent|pretty|json|json-compact|sarif|html)',\n {\n default: 'agent',\n },\n )\n .option('--json', 'Shorthand for --format json')\n .option('--json-compact', 'Emit single-line JSON')\n .option('--config <path>', 'Path to doctor.config.ts')\n .option('--preset <name>', 'Base preset: minimal|recommended|strict|all')\n .option(\n '--fail-on <level>',\n 'Exit non-zero on this severity or worse (error|warn|none)',\n {\n default: 'error',\n },\n )\n .option('--quiet', 'Only show the summary')\n .option('--verbose', 'Emit per-pass timing and rule diagnostics to stderr')\n .option('--no-color', 'Disable colored output')\n .option(\n '--rule <id:level>',\n 'Override a rule (repeatable), e.g. --rule a/b:off',\n )\n .option('--include <glob>', 'Glob of files to include (repeatable)')\n .option('--exclude <glob>', 'Glob of files to exclude (repeatable)')\n .option('--no-dead-code', 'Skip the dead-code (knip) analysis pass')\n .option('--no-lint', 'Skip the lint passes (template/SFC/oxlint)')\n .option(\n '--no-respect-inline-disables',\n 'Surface findings even inside doctor-disable comments',\n )\n .option('--threshold <n>', 'Minimum passing score (0-100)')\n .option('--score', 'Output only the numeric score (for piping)')\n .option('--annotations', 'Emit GitHub Actions ::error::/::warning:: lines')\n .option('--ci', 'Auto-enable CI behavior (--annotations on GitHub Actions)')\n .option('--no-ci', 'Disable CI auto-detection even when CI env is set')\n .option('--diff', 'Only report findings in files changed vs HEAD')\n .option('--staged', 'Only report findings in staged files')\n .option('--full', 'Force a complete scan (overrides --diff/--staged)')\n .option('--output <file>', 'Write the report to a file instead of stdout')\n .action(async (path: string | undefined, flags: CliFlags) => {\n const reporter = resolveFormat(flags);\n if (flags.failOn !== undefined && !isFailOnLevel(flags.failOn)) {\n process.stderr.write(\n `vue-doctor: --fail-on must be 'error', 'warn', or 'none', got '${flags.failOn}'\\n`,\n );\n process.exitCode = 2;\n return;\n }\n const rootDir = resolve(path ?? '.');\n\n try {\n if (flags.score && (flags.json || flags.jsonCompact)) {\n throw new Error(\n '--score and --json are mutually exclusive (--score outputs a plaintext integer).',\n );\n }\n const ruleOverrides = parseRuleOverrides(toArray(flags.rule));\n const threshold =\n flags.threshold === undefined ? undefined : Number(flags.threshold);\n if (\n threshold !== undefined &&\n (!Number.isInteger(threshold) || threshold < 0 || threshold > 100)\n ) {\n throw new Error(\n `--threshold must be an integer 0-100, got \"${flags.threshold}\".`,\n );\n }\n if (flags.diff && flags.staged) {\n throw new Error('--diff and --staged are mutually exclusive.');\n }\n if (flags.verbose && flags.quiet) {\n throw new Error('--verbose and --quiet are mutually exclusive.');\n }\n let scopeFiles: string[] | undefined;\n if (!flags.full && (flags.diff || flags.staged)) {\n scopeFiles = await listChangedFiles({\n rootDir,\n mode: flags.staged ? 'staged' : 'diff',\n });\n }\n const resolved = await loadDoctorConfig(rootDir, {\n ...(flags.config ? { explicitPath: flags.config } : {}),\n ...(flags.preset ? { presetOverride: flags.preset } : {}),\n });\n const merged = mergeCliOverrides(resolved, {\n failOn: flags.failOn as 'error' | 'warn' | 'none' | undefined,\n include: toArray(flags.include),\n exclude: toArray(flags.exclude),\n rules: ruleOverrides,\n threshold,\n });\n const report = await audit({\n rootDir: merged.rootDir,\n include: merged.include,\n exclude: merged.exclude,\n rules: merged.rules,\n failOn: merged.failOn,\n threshold: merged.threshold,\n deadCode: flags.deadCode,\n lint: flags.lint,\n respectInlineDisables: flags.respectInlineDisables,\n scopeFiles,\n });\n const allowedRuleIds = new Set(Object.keys(merged.rules));\n report.diagnostics = report.diagnostics.filter((d) =>\n allowedRuleIds.has(d.ruleId),\n );\n if (flags.verbose) {\n const verboseOutput = renderVerboseTrace(report, {\n configSource: resolved.source,\n });\n process.stderr.write(`${verboseOutput}\\n`);\n }\n if (flags.score) {\n process.stdout.write(`${report.score}\\n`);\n process.exitCode = report.exitCode;\n return;\n }\n const input: ReporterInput = {\n toolName: '@geoql/vue-doctor',\n toolVersion: readVersion(),\n rootDirectory: report.rootDir,\n analyzedFileCount: report.filesScanned,\n elapsedMs: report.elapsedMs,\n diagnostics: report.diagnostics,\n score: report.scoreResult,\n projectInfo: report.projectInfo,\n };\n const out = format(input, reporter, {\n color: flags.color,\n quiet: flags.quiet,\n });\n if (flags.output) {\n writeFileSync(resolve(flags.output), out);\n } else {\n process.stdout.write(out);\n }\n const ciExplicitOptOut = flags.ci === false;\n const ciExplicitOptIn = flags.ci === true;\n const ciAutoDetected = !ciExplicitOptOut && isCiEnvironment();\n const wantsAnnotations =\n flags.annotations === true || ciExplicitOptIn || ciAutoDetected;\n const reporterCarriesAnnotations =\n reporter === 'agent' || reporter === 'pretty';\n if (\n wantsAnnotations &&\n reporterCarriesAnnotations &&\n !flags.quiet &&\n report.diagnostics.length > 0\n ) {\n process.stdout.write(`${encodeAnnotations(report.diagnostics)}\\n`);\n }\n process.exitCode = report.exitCode;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n process.stderr.write(`vue-doctor: ${msg}\\n`);\n process.exitCode = 2;\n }\n });\n\n cli\n .command(\n 'list-rules',\n 'List every registered rule with id, severity, category, source, and preset membership',\n )\n .option('--preset <name>', 'Filter to: recommended | all')\n .option('--category <name>', 'Filter by category')\n .option(\n '--source <name>',\n 'Filter by source: doctor | oxlint-builtin | eslint-plugin-vue',\n )\n .option('--severity <level>', 'Filter by: error | warn | info')\n .option('--json', 'Emit JSON instead of formatted text')\n .option('--json-compact', 'With --json, single-line output')\n .action(async (flags: ListRulesCliFlags) => {\n try {\n const filter = buildListRulesFilter(flags);\n const rules = listRules(filter);\n if (flags.json || flags.jsonCompact) {\n const payload = { count: rules.length, rules };\n process.stdout.write(\n flags.jsonCompact\n ? JSON.stringify(payload)\n : `${JSON.stringify(payload, null, 2)}\\n`,\n );\n } else {\n process.stdout.write(renderRulesTable(rules));\n }\n process.exitCode = 0;\n } catch (err) {\n const msg = (err as Error).message;\n process.stderr.write(`vue-doctor list-rules: ${msg}\\n`);\n process.exitCode = 2;\n }\n });\n\n cli\n .command(\n 'explain <ruleId>',\n \"Print the rule's severity, category, recommendation, and helpUri\",\n )\n .option('--json', 'Emit structured JSON instead of formatted text')\n .action(async (ruleId: string, flags: ExplainCliFlags) => {\n const doc = loadRuleDoc(ruleId);\n if (!doc) {\n process.stderr.write(\n `vue-doctor explain: unknown rule '${ruleId}'. Try \\`vue-doctor list-rules\\` to see registered rules.\\n`,\n );\n process.exitCode = 2;\n return;\n }\n if (flags.json) {\n process.stdout.write(`${JSON.stringify(doc, null, 2)}\\n`);\n } else {\n process.stdout.write(renderExplain(doc));\n }\n process.exitCode = 0;\n });\n\n cli\n .command(\n 'inspect [dir]',\n 'Print the detected project capabilities doctor uses to gate rules',\n )\n .option('--json', 'Emit structured JSON instead of formatted text')\n .option('--json-compact', 'With --json, emit a single-line payload')\n .action(async (dir: string | undefined, flags: InspectCliFlags) => {\n const rootDir = resolve(dir ?? '.');\n const project = await detectProject(rootDir);\n if (flags.json || flags.jsonCompact) {\n const payload = projectInfoToJson(project);\n const out = flags.jsonCompact\n ? JSON.stringify(payload)\n : JSON.stringify(payload, null, 2);\n process.stdout.write(`${out}\\n`);\n } else {\n process.stdout.write(renderInspect(project, rootDir));\n }\n process.exitCode = 0;\n });\n\n cli.help();\n cli.version(readVersion());\n cli.parse(argv, { run: false });\n await cli.runMatchedCommand();\n return process.exitCode ?? 0;\n}\n"],"mappings":";;;;;;;AA0BA,SAAS,cAAsB;CAC7B,IAAI;EACF,MAAM,OAAO,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;EAIpD,OAHY,KAAK,MACf,aAAa,QAAQ,MAAM,kBAAkB,EAAE,QAAQ,CAE/C,CAAC,WAAW;SAChB;EACN,OAAO;;;AAuCX,SAAS,kBAA2B;CAClC,MAAM,MAAM,QAAQ;CACpB,OAAO,QACL,IAAI,OAAO,UACX,IAAI,OAAO,OACX,IAAI,mBAAmB,UACvB,IAAI,cAAc,UAClB,IAAI,aAAa,UACjB,IAAI,WAAW,UACf,IAAI,cAAc,UAClB,IAAI,aACL;;AAGH,SAAS,kBAAkB,GAAwC;CACjE,OAAO;EACL,WAAW,EAAE;EACb,eAAe,EAAE;EACjB,iBAAiB,EAAE;EACnB,YAAY,EAAE;EACd,aAAa,EAAE;EACf,0BAA0B,EAAE;EAC5B,aAAa,EAAE;EACf,mBAAmB,EAAE;EACrB,cAAc,EAAE;EAChB,gBAAgB,EAAE;EAClB,yBAAyB,EAAE;EAC3B,UAAU,EAAE;EACZ,c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d,KAAK,UAAU,QAAQ,GACvB,KAAK,UAAU,SAAS,MAAM,EAAE;GACpC,QAAQ,OAAO,MAAM,GAAG,IAAI,IAAI;SAEhC,QAAQ,OAAO,MAAM,cAAc,SAAS,QAAQ,CAAC;EAEvD,QAAQ,WAAW;GACnB;CAEJ,IAAI,MAAM;CACV,IAAI,QAAQ,aAAa,CAAC;CAC1B,IAAI,MAAM,MAAM,EAAE,KAAK,OAAO,CAAC;CAC/B,MAAM,IAAI,mBAAmB;CAC7B,OAAO,QAAQ,YAAY"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport process from 'node:process';\nimport { fileURLToPath } from 'node:url';\nimport {\n audit,\n detectProject,\n detectSummary,\n encodeAnnotations,\n findMonorepoRoot,\n format,\n listChangedFiles,\n listRules,\n listWorkspacePackages,\n loadDoctorConfig,\n loadRuleDoc,\n mergeCliOverrides,\n normalizeInitAnswers,\n planInit,\n renderVerboseTrace,\n scoreDiagnostics,\n type AuditReport,\n type ConfigSource,\n type InitConfigFormat,\n type ListRulesFilter,\n type ProjectInfo,\n type RegisteredRule,\n type ReporterFormat,\n type ReporterInput,\n type ResolvedDoctorConfig,\n type RuleCategory,\n type RuleSource,\n type Severity,\n type WorkspacePackage,\n} from '@geoql/doctor-core';\nimport { cac } from 'cac';\nimport prompts from 'prompts';\n\nfunction readVersion(): string {\n try {\n const here = dirname(fileURLToPath(import.meta.url));\n const pkg = JSON.parse(\n readFileSync(resolve(here, '../package.json'), 'utf-8'),\n ) as { version?: string };\n return pkg.version ?? '0.0.0';\n } catch {\n return '0.0.0';\n }\n}\n\ninterface ListRulesCliFlags {\n preset?: string;\n category?: string;\n source?: string;\n severity?: string;\n json?: boolean;\n jsonCompact?: boolean;\n}\n\ninterface ExplainCliFlags {\n json?: boolean;\n}\n\ninterface InspectCliFlags {\n json?: boolean;\n jsonCompact?: boolean;\n}\n\ninterface InitCliFlags {\n yes?: boolean;\n configFormat?: string;\n force?: boolean;\n dryRun?: boolean;\n}\n\ninterface ProjectInfoJsonPayload {\n framework: string;\n rootDirectory: string;\n packageJsonPath: string | null;\n vueVersion: string | null;\n nuxtVersion: string | null;\n nuxtCompatibilityVersion: 3 | 4 | null;\n nitroPreset: string | null;\n typescriptVersion: string | null;\n monorepoKind: string | null;\n hasAutoImports: boolean;\n hasComponentsAutoImport: boolean;\n hasPinia: boolean;\n hasVueRouter: boolean;\n capabilities: string[];\n}\n\nfunction isCiEnvironment(): boolean {\n const env = process.env;\n return Boolean(\n env.CI === 'true' ||\n env.CI === '1' ||\n env.GITHUB_ACTIONS === 'true' ||\n env.GITLAB_CI === 'true' ||\n env.CIRCLECI === 'true' ||\n env.TRAVIS === 'true' ||\n env.BUILDKITE === 'true' ||\n env.JENKINS_HOME,\n );\n}\n\nfunction projectInfoToJson(p: ProjectInfo): ProjectInfoJsonPayload {\n return {\n framework: p.framework,\n rootDirectory: p.rootDirectory,\n packageJsonPath: p.packageJsonPath,\n vueVersion: p.vueVersion,\n nuxtVersion: p.nuxtVersion,\n nuxtCompatibilityVersion: p.nuxtCompatibilityVersion,\n nitroPreset: p.nitroPreset,\n typescriptVersion: p.typescriptVersion,\n monorepoKind: p.monorepoKind,\n hasAutoImports: p.hasAutoImports,\n hasComponentsAutoImport: p.hasComponentsAutoImport,\n hasPinia: p.hasPinia,\n hasVueRouter: p.hasVueRouter,\n capabilities: [...p.capabilities].sort(),\n };\n}\n\nfunction renderInspect(p: ProjectInfo, rootDir: string): string {\n const lines: string[] = [];\n lines.push(`@geoql/vue-doctor v${readVersion()} — project capabilities`);\n lines.push('');\n lines.push('framework');\n lines.push(` ${p.framework}`);\n lines.push(` vue: ${p.vueVersion ?? '(none)'}`);\n lines.push(` typescript: ${p.typescriptVersion ?? '(none)'}`);\n lines.push('');\n lines.push('project layout');\n lines.push(` rootDirectory: ${rootDir}`);\n lines.push(` packageJsonPath: ${p.packageJsonPath ?? '(none)'}`);\n lines.push(` monorepoKind: ${p.monorepoKind ?? '(none)'}`);\n lines.push('');\n lines.push('ecosystem');\n lines.push(` hasAutoImports: ${p.hasAutoImports}`);\n lines.push(` hasComponentsAutoImport: ${p.hasComponentsAutoImport}`);\n lines.push(` hasPinia: ${p.hasPinia}`);\n lines.push(` hasVueRouter: ${p.hasVueRouter}`);\n lines.push('');\n lines.push('capability tokens (used by rule gating)');\n lines.push(` ${[...p.capabilities].sort().join('\\n ')}`);\n lines.push('');\n lines.push(\"run 'vue-doctor inspect --json' for machine output\");\n lines.push(\n \"run 'vue-doctor list-rules' to see which rules these capabilities enable\",\n );\n return `${lines.join('\\n')}\\n`;\n}\n\ninterface ExplainableDoc {\n id: string;\n severity: string;\n category: string;\n source: string;\n recommended: boolean;\n helpUri: string;\n description: string;\n hasOverride: boolean;\n}\n\nfunction renderExplain(doc: ExplainableDoc): string {\n const lines: string[] = [];\n lines.push(`Rule: ${doc.id}`);\n lines.push(`Severity: ${doc.severity}`);\n lines.push(`Category: ${doc.category}`);\n lines.push(`Source: ${doc.source}`);\n lines.push(\n `Recommended: ${doc.recommended ? 'yes' : 'no (off in `recommended` preset)'}`,\n );\n lines.push(`Help: ${doc.helpUri}`);\n lines.push('');\n lines.push(doc.description);\n return `${lines.join('\\n')}\\n`;\n}\n\nconst VALID_LIST_PRESETS = new Set(['recommended', 'all']);\nconst VALID_CATEGORIES = new Set<RuleCategory>([\n 'ai-slop',\n 'reactivity',\n 'composition',\n 'performance',\n 'template',\n 'template-perf',\n 'build-quality',\n 'deps',\n 'dead-code',\n 'sfc',\n 'vue-builtin',\n]);\nconst VALID_SOURCES = new Set<RuleSource>([\n 'doctor',\n 'oxlint-builtin',\n 'eslint-plugin-vue',\n]);\nconst VALID_CONFIG_FORMATS = new Set(['ts', 'json', 'package-json']);\n\nfunction buildListRulesFilter(flags: ListRulesCliFlags): ListRulesFilter {\n const out: {\n preset?: 'recommended' | 'all';\n category?: RuleCategory;\n source?: RuleSource;\n severity?: Severity;\n } = {};\n if (flags.preset !== undefined) {\n if (!VALID_LIST_PRESETS.has(flags.preset)) {\n throw new Error(\n `unknown --preset '${flags.preset}' (expected: recommended | all)`,\n );\n }\n out.preset = flags.preset as 'recommended' | 'all';\n }\n if (flags.category !== undefined) {\n if (!VALID_CATEGORIES.has(flags.category as RuleCategory)) {\n throw new Error(`unknown --category '${flags.category}'`);\n }\n out.category = flags.category as RuleCategory;\n }\n if (flags.source !== undefined) {\n if (!VALID_SOURCES.has(flags.source as RuleSource)) {\n throw new Error(`unknown --source '${flags.source}'`);\n }\n out.source = flags.source as RuleSource;\n }\n if (flags.severity !== undefined) {\n if (\n flags.severity !== 'error' &&\n flags.severity !== 'warn' &&\n flags.severity !== 'info'\n ) {\n throw new Error(\n `unknown --severity '${flags.severity}' (expected: error | warn | info)`,\n );\n }\n out.severity = flags.severity;\n }\n return out;\n}\n\nfunction renderRulesTable(rules: RegisteredRule[]): string {\n if (rules.length === 0) return 'No rules matched.\\n';\n const lines: string[] = [\n `@geoql/vue-doctor — ${rules.length} rule${rules.length === 1 ? '' : 's'}`,\n '',\n ];\n const idWidth = Math.max(...rules.map((r) => r.id.length));\n const sevWidth = Math.max(...rules.map((r) => r.severity.length));\n const catWidth = Math.max(...rules.map((r) => r.category.length));\n for (const r of rules) {\n const tag = r.recommended ? '[recommended]' : ' ';\n lines.push(\n ` ${r.id.padEnd(idWidth)} ${r.severity.padEnd(sevWidth)} ${r.category.padEnd(catWidth)} ${r.source} ${tag}`,\n );\n }\n return `${lines.join('\\n')}\\n`;\n}\n\ninterface CliFlags {\n format?: string;\n config?: string;\n preset?: string;\n failOn?: string;\n json?: boolean;\n jsonCompact?: boolean;\n color?: boolean;\n quiet?: boolean;\n verbose?: boolean;\n output?: string;\n rule?: string | string[];\n include?: string | string[];\n exclude?: string | string[];\n deadCode?: boolean;\n lint?: boolean;\n respectInlineDisables?: boolean;\n threshold?: string;\n score?: boolean;\n annotations?: boolean;\n ci?: boolean;\n diff?: boolean;\n staged?: boolean;\n full?: boolean;\n project?: string;\n prComment?: string | true;\n fix?: boolean;\n fixExclude?: string | string[];\n}\n\ninterface PreparedOptions {\n ruleOverrides: Record<string, Severity | 'off'> | undefined;\n threshold: number | undefined;\n}\n\nfunction toArray(value: string | string[] | undefined): string[] | undefined {\n if (value === undefined) return undefined;\n return Array.isArray(value) ? value : [value];\n}\n\nfunction parseRuleOverrides(\n rules: string[] | undefined,\n): Record<string, Severity | 'off'> | undefined {\n if (!rules || rules.length === 0) return undefined;\n const out: Record<string, Severity | 'off'> = {};\n for (const entry of rules) {\n const idx = entry.lastIndexOf(':');\n if (idx === -1) {\n throw new Error(\n `Invalid --rule \"${entry}\". Expected format <ruleId>:<error|warn|info|off>.`,\n );\n }\n const ruleId = entry.slice(0, idx);\n const level = entry.slice(idx + 1);\n if (\n level !== 'error' &&\n level !== 'warn' &&\n level !== 'info' &&\n level !== 'off'\n ) {\n throw new Error(\n `Invalid severity \"${level}\" for --rule \"${entry}\". Expected error|warn|info|off.`,\n );\n }\n if (ruleId.length === 0) {\n throw new Error(`Invalid --rule \"${entry}\". Rule id must not be empty.`);\n }\n out[ruleId] = level;\n }\n return out;\n}\n\nfunction resolveFormat(flags: CliFlags): ReporterFormat {\n if (flags.prComment !== undefined) return 'pr-comment';\n if (flags.jsonCompact) return 'json-compact';\n if (flags.json) return 'json';\n const kind = flags.format;\n const userPickedFormat =\n kind === 'pretty' ||\n kind === 'json' ||\n kind === 'json-compact' ||\n kind === 'sarif' ||\n kind === 'html' ||\n kind === 'pr-comment';\n if (userPickedFormat) {\n return kind as ReporterFormat;\n }\n if (\n typeof flags.output === 'string' &&\n flags.output.toLowerCase().endsWith('.html')\n ) {\n return 'html';\n }\n return 'agent';\n}\n\nfunction isFailOnLevel(v: string): v is 'error' | 'warn' | 'none' {\n return v === 'error' || v === 'warn' || v === 'none';\n}\n\nasync function runSingleAudit(\n rootDir: string,\n flags: CliFlags,\n prepared: PreparedOptions,\n): Promise<{ report: AuditReport; source: ConfigSource }> {\n let scopeFiles: string[] | undefined;\n if (!flags.full && (flags.diff || flags.staged)) {\n scopeFiles = await listChangedFiles({\n rootDir,\n mode: flags.staged ? 'staged' : 'diff',\n });\n }\n const resolved = await loadDoctorConfig(rootDir, {\n ...(flags.config ? { explicitPath: flags.config } : {}),\n ...(flags.preset ? { presetOverride: flags.preset } : {}),\n });\n const fixExclude = toArray(flags.fixExclude);\n const merged: ResolvedDoctorConfig = mergeCliOverrides(resolved, {\n failOn: flags.failOn as 'error' | 'warn' | 'none' | undefined,\n include: toArray(flags.include),\n exclude: toArray(flags.exclude),\n rules: prepared.ruleOverrides,\n threshold: prepared.threshold,\n ...(fixExclude ? { fixExcludes: fixExclude } : {}),\n });\n const report = await audit({\n rootDir: merged.rootDir,\n include: merged.include,\n exclude: merged.exclude,\n rules: merged.rules,\n failOn: merged.failOn,\n threshold: merged.threshold,\n deadCode: flags.deadCode,\n lint: flags.lint,\n respectInlineDisables: flags.respectInlineDisables,\n scopeFiles,\n fix: flags.fix,\n ...(merged.fixExcludes ? { fixExcludes: merged.fixExcludes } : {}),\n });\n const allowedRuleIds = new Set(Object.keys(merged.rules));\n report.diagnostics = report.diagnostics.filter((d) =>\n allowedRuleIds.has(d.ruleId),\n );\n return { report, source: resolved.source };\n}\n\nfunction aggregateReports(\n reports: AuditReport[],\n rootDirectory: string,\n): AuditReport {\n const first = reports[0];\n const diagnostics = reports.flatMap((r) => r.diagnostics);\n let filesScanned = 0;\n let elapsedMs = 0;\n let exitCode: 0 | 1 | 2 = 0;\n for (const r of reports) {\n filesScanned += r.filesScanned;\n elapsedMs += r.elapsedMs;\n if (r.exitCode > exitCode) exitCode = r.exitCode;\n }\n const ruleCounts: Record<string, number> = {};\n for (const d of diagnostics) {\n ruleCounts[d.ruleId] = (ruleCounts[d.ruleId] ?? 0) + 1;\n }\n const scoreResult = scoreDiagnostics(diagnostics, {\n threshold: first.scoreResult.threshold,\n });\n return {\n rootDir: rootDirectory,\n filesScanned,\n diagnostics,\n score: scoreResult.score,\n errorCount: scoreResult.errorCount,\n warnCount: scoreResult.warnCount,\n infoCount: scoreResult.infoCount,\n exitCode,\n scoreResult,\n projectInfo: { ...first.projectInfo, rootDirectory },\n elapsedMs,\n timings: first.timings,\n ruleCounts,\n };\n}\n\nfunction emitReport(\n report: AuditReport,\n reporter: ReporterFormat,\n flags: CliFlags,\n): void {\n const input: ReporterInput = {\n toolName: '@geoql/vue-doctor',\n toolVersion: readVersion(),\n rootDirectory: report.rootDir,\n analyzedFileCount: report.filesScanned,\n elapsedMs: report.elapsedMs,\n diagnostics: report.diagnostics,\n score: report.scoreResult,\n projectInfo: report.projectInfo,\n };\n const out = format(input, reporter, {\n color: flags.color,\n quiet: flags.quiet,\n });\n if (flags.output) {\n writeFileSync(resolve(flags.output), out);\n } else {\n process.stdout.write(out);\n }\n const ciExplicitOptOut = flags.ci === false;\n const ciExplicitOptIn = flags.ci === true;\n const ciAutoDetected = !ciExplicitOptOut && isCiEnvironment();\n const wantsAnnotations =\n flags.annotations === true || ciExplicitOptIn || ciAutoDetected;\n const reporterCarriesAnnotations =\n reporter === 'agent' || reporter === 'pretty';\n if (\n wantsAnnotations &&\n reporterCarriesAnnotations &&\n !flags.quiet &&\n report.diagnostics.length > 0\n ) {\n process.stdout.write(`${encodeAnnotations(report.diagnostics)}\\n`);\n }\n}\n\nasync function runProjectAudits(\n rootDir: string,\n flags: CliFlags,\n prepared: PreparedOptions,\n packages: WorkspacePackage[],\n): Promise<{ report: AuditReport; source: ConfigSource } | null> {\n const requested = flags\n .project!.split(',')\n .map((name) => name.trim())\n .filter((name) => name.length > 0);\n const byName = new Map(packages.map((p) => [p.name, p]));\n const reports: AuditReport[] = [];\n let source: ConfigSource = 'built-in';\n for (const name of requested) {\n const match = byName.get(name);\n if (!match) {\n process.stderr.write(\n `vue-doctor: --project: unknown project \"${name}\" (skipped)\\n`,\n );\n continue;\n }\n const single = await runSingleAudit(match.dir, flags, prepared);\n reports.push(single.report);\n source = single.source;\n }\n if (reports.length === 0) {\n process.stderr.write(\n 'vue-doctor: --project: no matching workspace projects\\n',\n );\n return null;\n }\n const { root } = await findMonorepoRoot(rootDir);\n return { report: aggregateReports(reports, root), source };\n}\n\nasync function runInit(dir: string, flags: InitCliFlags): Promise<void> {\n const targetDir = resolve(dir);\n const configFormat = (flags.configFormat ?? 'ts') as InitConfigFormat;\n if (!VALID_CONFIG_FORMATS.has(configFormat)) {\n process.stderr.write(\n `vue-doctor init: --config-format must be ts | json | package-json, got '${flags.configFormat}'\\n`,\n );\n process.exitCode = 2;\n return;\n }\n\n const resolvedAnswers = flags.yes\n ? {\n configFormat,\n preset: 'recommended' as const,\n threshold: undefined,\n exclude: undefined,\n }\n : await runInteractiveInit(configFormat);\n\n if (process.exitCode === 2) return;\n\n const plan = await planInit({\n dir: targetDir,\n configFormat: resolvedAnswers.configFormat,\n preset: resolvedAnswers.preset,\n threshold: resolvedAnswers.threshold,\n exclude: resolvedAnswers.exclude,\n binName: 'vue-doctor',\n });\n\n const summary = await detectSummary(targetDir);\n process.stdout.write(`${summary}\\n`);\n\n if (plan.conflict && !flags.force) {\n process.stderr.write(\n `vue-doctor init: ${plan.conflictPath} already exists. Run with --force to overwrite.\\n`,\n );\n process.exitCode = 2;\n return;\n }\n\n if (flags.dryRun) {\n for (const write of plan.writes) {\n process.stdout.write(`[dry-run] would write ${write.path}\\n`);\n process.stdout.write(`${write.content}\\n`);\n }\n process.exitCode = 0;\n return;\n }\n\n for (const write of plan.writes) {\n writeFileSync(write.path, write.content, 'utf8');\n }\n process.exitCode = 0;\n}\n\nasync function runInteractiveInit(defaultFormat: InitConfigFormat): Promise<{\n configFormat: InitConfigFormat;\n preset: 'recommended' | 'strict' | 'minimal';\n threshold: number | undefined;\n exclude: string | undefined;\n}> {\n const answers = await prompts(\n [\n {\n type: 'select',\n name: 'target',\n message: 'Config target?',\n choices: [\n { title: 'doctor.config.ts (recommended)', value: 'ts' },\n { title: 'doctor.config.json', value: 'json' },\n { title: 'package.json#doctor', value: 'package-json' },\n ],\n initial: defaultFormat === 'package-json' ? 2 : 0,\n },\n {\n type: 'select',\n name: 'preset',\n message: 'Base preset?',\n choices: [\n { title: 'recommended (errors + warnings)', value: 'recommended' },\n { title: 'strict (recommended + info)', value: 'strict' },\n { title: 'minimal (errors only)', value: 'minimal' },\n ],\n initial: 0,\n },\n {\n type: 'number',\n name: 'threshold',\n message: 'Minimum passing score (0-100, blank to skip)',\n min: 0,\n max: 100,\n initial: '',\n },\n {\n type: 'text',\n name: 'exclude',\n message: 'Exclude glob patterns (comma-separated, blank to skip)',\n initial: '',\n },\n ],\n {\n onCancel: () => {\n process.stderr.write('vue-doctor init: cancelled\\n');\n process.exitCode = 2;\n },\n },\n );\n\n if (process.exitCode === 2)\n return {\n configFormat: 'ts' as InitConfigFormat,\n preset: 'recommended' as const,\n threshold: undefined,\n exclude: undefined,\n };\n\n return normalizeInitAnswers({\n target: answers.target as InitConfigFormat | undefined,\n preset: answers.preset as 'recommended' | 'strict' | 'minimal' | undefined,\n threshold: answers.threshold || undefined,\n exclude: answers.exclude as string | undefined,\n });\n}\n\nexport async function run(argv: string[] = process.argv): Promise<number> {\n const cli = cac('vue-doctor');\n\n cli\n .command('[path]', 'Audit a Vue project')\n .option(\n '--format <kind>',\n 'Output format (agent|pretty|json|json-compact|sarif|html|pr-comment)',\n {\n default: 'agent',\n },\n )\n .option('--json', 'Shorthand for --format json')\n .option('--json-compact', 'Emit single-line JSON')\n .option('--config <path>', 'Path to doctor.config.ts')\n .option('--preset <name>', 'Base preset: minimal|recommended|strict|all')\n .option(\n '--fail-on <level>',\n 'Exit non-zero on this severity or a worse (error|warn|none)',\n {\n default: 'error',\n },\n )\n .option('--quiet', 'Only show the summary')\n .option('--verbose', 'Emit per-pass timing and rule diagnostics on stderr')\n .option('--no-color', 'Disable colored output')\n .option(\n '--rule <id:level>',\n 'Override a rule (repeatable), e.g. --rule a/b:off',\n )\n .option('--include <glob>', 'Glob of files to include (repeatable)')\n .option('--exclude <glob>', 'Glob of files to exclude (repeatable)')\n .option('--no-dead-code', 'Skip the dead-code (knip) analysis pass')\n .option('--no-lint', 'Skip the lint passes (template/SFC/oxlint)')\n .option(\n '--no-respect-inline-disables',\n 'Surface findings even inside doctor-disable comments',\n )\n .option('--threshold <n>', 'Minimum passing score (0-100)')\n .option('--score', 'Output only the numeric score (for piping)')\n .option('--annotations', 'Emit GitHub Actions ::error::/::warning:: lines')\n .option('--ci', 'Auto-enable CI behavior (--annotations on GitHub Actions)')\n .option('--no-ci', 'Disable CI auto-detection even when CI env is set')\n .option('--diff', 'Only report findings in files changed vs HEAD')\n .option('--staged', 'Only report findings in staged files')\n .option('--full', 'Force a complete scan (overrides --diff/--staged)')\n .option(\n '--project <name>',\n 'Comma-separated workspace project names to audit (monorepo)',\n )\n .option('--output <file>', 'Write the report to a file instead of stdout')\n .option('--pr-comment', 'Emit a focused Markdown PR-comment body')\n .option(\n '--fix',\n 'Auto-fix oxlint-pass findings in place (built-in vue/* rules only; template/SFC/dead-code/project findings are not fixable). Skipped in --diff/--staged mode.',\n )\n .option(\n '--fix-exclude <ruleId>',\n 'Mark a rule as not-auto-fixable (repeatable). Note: oxlint applies built-in fixes globally, so this is enforced only for doctor plugin fixes; built-in vue/* fixes still apply.',\n )\n .action(async (path: string | undefined, flags: CliFlags) => {\n const reporter = resolveFormat(flags);\n if (flags.failOn !== undefined && !isFailOnLevel(flags.failOn)) {\n process.stderr.write(\n `vue-doctor: --fail-on must be 'error', 'warn', or 'none', got '${flags.failOn}'\\n`,\n );\n process.exitCode = 2;\n return;\n }\n const rootDir = resolve(path ?? '.');\n\n try {\n if (flags.score && (flags.json || flags.jsonCompact)) {\n throw new Error(\n '--score and --json are mutually exclusive (--score outputs a plaintext integer).',\n );\n }\n const ruleOverrides = parseRuleOverrides(toArray(flags.rule));\n const threshold =\n flags.threshold === undefined ? undefined : Number(flags.threshold);\n if (\n threshold !== undefined &&\n (!Number.isInteger(threshold) || threshold < 0 || threshold > 100)\n ) {\n throw new Error(\n `--threshold must be an integer 0-100, got \"${flags.threshold}\".`,\n );\n }\n if (flags.diff && flags.staged) {\n throw new Error('--diff and --staged are mutually exclusive.');\n }\n if (flags.verbose && flags.quiet) {\n throw new Error('--verbose and --quiet are mutually exclusive.');\n }\n const fixActive = flags.fix === true;\n const fixSkippedForScope =\n fixActive && !flags.full && (flags.diff || flags.staged);\n if (fixSkippedForScope) {\n process.stderr.write(\n 'vue-doctor: --fix skipped in --diff/--staged mode (auto-fix only runs on a full scan to avoid rewriting files outside the diff).\\n',\n );\n }\n if (fixActive && flags.fixExclude !== undefined) {\n process.stderr.write(\n 'vue-doctor: --fix-exclude is not enforced for built-in vue/* rules (oxlint applies their fixes globally); it currently scopes only future doctor plugin fixes.\\n',\n );\n }\n const prepared: PreparedOptions = { ruleOverrides, threshold };\n\n const workspacePackages = flags.project\n ? await listWorkspacePackages(rootDir)\n : [];\n if (flags.project && workspacePackages.length === 0) {\n process.stderr.write(\n 'vue-doctor: --project ignored: not a pnpm workspace\\n',\n );\n }\n\n let report: AuditReport;\n let configSource: ConfigSource;\n if (flags.project && workspacePackages.length > 0) {\n const aggregated = await runProjectAudits(\n rootDir,\n flags,\n prepared,\n workspacePackages,\n );\n if (!aggregated) {\n process.exitCode = 2;\n return;\n }\n report = aggregated.report;\n configSource = aggregated.source;\n } else {\n const single = await runSingleAudit(rootDir, flags, prepared);\n report = single.report;\n configSource = single.source;\n }\n\n if (flags.verbose) {\n const verboseOutput = renderVerboseTrace(report, {\n configSource,\n });\n process.stderr.write(`${verboseOutput}\\n`);\n }\n if (fixActive && !fixSkippedForScope) {\n process.stderr.write(\n `vue-doctor: applied oxlint --fix; ${report.diagnostics.length} finding${report.diagnostics.length === 1 ? '' : 's'} remain (re-run to see them).\\n`,\n );\n }\n if (flags.score) {\n process.stdout.write(`${report.score}\\n`);\n process.exitCode = report.exitCode;\n return;\n }\n emitReport(report, reporter, flags);\n process.exitCode = report.exitCode;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n process.stderr.write(`vue-doctor: ${msg}\\n`);\n process.exitCode = 2;\n }\n });\n\n cli\n .command(\n 'list-rules',\n 'List every registered rule with id, severity, category, source, and preset membership',\n )\n .option('--preset <name>', 'Filter to: recommended | all')\n .option('--category <name>', 'Filter by category')\n .option(\n '--source <name>',\n 'Filter by source: doctor | oxlint-builtin | eslint-plugin-vue',\n )\n .option('--severity <level>', 'Filter by: error | warn | info')\n .option('--json', 'Emit JSON instead of formatted text')\n .option('--json-compact', 'With --json, single-line output')\n .action(async (flags: ListRulesCliFlags) => {\n try {\n const filter = buildListRulesFilter(flags);\n const rules = listRules(filter);\n if (flags.json || flags.jsonCompact) {\n const payload = { count: rules.length, rules };\n process.stdout.write(\n flags.jsonCompact\n ? JSON.stringify(payload)\n : `${JSON.stringify(payload, null, 2)}\\n`,\n );\n } else {\n process.stdout.write(renderRulesTable(rules));\n }\n process.exitCode = 0;\n } catch (err) {\n const msg = (err as Error).message;\n process.stderr.write(`vue-doctor list-rules: ${msg}\\n`);\n process.exitCode = 2;\n }\n });\n\n cli\n .command(\n 'explain <ruleId>',\n \"Print the rule's severity, category, recommendation, and helpUri\",\n )\n .option('--json', 'Emit structured JSON instead of formatted text')\n .action(async (ruleId: string, flags: ExplainCliFlags) => {\n const doc = loadRuleDoc(ruleId);\n if (!doc) {\n process.stderr.write(\n `vue-doctor explain: unknown rule '${ruleId}'. Try \\`vue-doctor list-rules\\` to see registered rules.\\n`,\n );\n process.exitCode = 2;\n return;\n }\n if (flags.json) {\n process.stdout.write(`${JSON.stringify(doc, null, 2)}\\n`);\n } else {\n process.stdout.write(renderExplain(doc));\n }\n process.exitCode = 0;\n });\n\n cli\n .command(\n 'inspect [dir]',\n 'Print the detected project capabilities doctor uses to gate rules',\n )\n .option('--json', 'Emit structured JSON instead of formatted text')\n .option('--json-compact', 'With --json, emit a single-line payload')\n .action(async (dir: string | undefined, flags: InspectCliFlags) => {\n const rootDir = resolve(dir ?? '.');\n const project = await detectProject(rootDir);\n if (flags.json || flags.jsonCompact) {\n const payload = projectInfoToJson(project);\n const out = flags.jsonCompact\n ? JSON.stringify(payload)\n : JSON.stringify(payload, null, 2);\n process.stdout.write(`${out}\\n`);\n } else {\n process.stdout.write(renderInspect(project, rootDir));\n }\n process.exitCode = 0;\n });\n\n cli\n .command('init [dir]', 'Scaffold a doctor config for the project')\n .option('-y, --yes', 'Non-interactive, use recommended defaults')\n .option(\n '--config-format <ts|json|package-json>',\n 'Config file format (default: ts)',\n )\n .option('--force', 'Overwrite existing config')\n .option('--dry-run', 'Print what would be written, touch nothing')\n .action(async (dir: string | undefined, flags: InitCliFlags) => {\n try {\n await runInit(dir ?? '.', flags);\n } catch (err) {\n process.stderr.write(`${err instanceof Error ? err.message : err}\\n`);\n process.exitCode = 2;\n }\n });\n\n cli.help();\n cli.version(readVersion());\n cli.parse(argv, { run: false });\n await cli.runMatchedCommand();\n return process.exitCode ?? 0;\n}\n"],"mappings":";;;;;;;;AAsCA,SAAS,cAAsB;CAC7B,IAAI;EACF,MAAM,OAAO,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;EAIpD,OAHY,KAAK,MACf,aAAa,QAAQ,MAAM,kBAAkB,EAAE,QAAQ,CAE/C,CAAC,WAAW;SAChB;EACN,OAAO;;;AA8CX,SAAS,kBAA2B;CAClC,MAAM,MAAM,QAAQ;CACpB,OAAO,QACL,IAAI,OAAO,UACX,IAAI,OAAO,OACX,IAAI,mBAAmB,UACvB,IAAI,cAAc,UAClB,IAAI,aAAa,UACjB,IAAI,WAAW,UACf,IAAI,cAAc,UAClB,IAAI,aACL;;AAGH,SAAS,kBAAkB,GAAwC;CACjE,OAAO;EACL,WAAW,EAAE;EACb,eAAe,EAAE;EACjB,iBAAiB,EAAE;EACnB,YAAY,EAAE;EACd,aAAa,EAAE;EACf,0BAA0B,EAAE;EAC5B,aAAa,EAAE;EACf,mBAAmB,EAAE;EACrB,cAAc,EAAE;EAChB,gBA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a,6CAA6C,CACjE,OAAO,OAAO,KAAyB,UAAwB;EAC9D,IAAI;GACF,MAAM,QAAQ,OAAO,KAAK,MAAM;WACzB,KAAK;GACZ,QAAQ,OAAO,MAAM,GAAG,eAAe,QAAQ,IAAI,UAAU,IAAI,IAAI;GACrE,QAAQ,WAAW;;GAErB;CAEJ,IAAI,MAAM;CACV,IAAI,QAAQ,aAAa,CAAC;CAC1B,IAAI,MAAM,MAAM,EAAE,KAAK,OAAO,CAAC;CAC/B,MAAM,IAAI,mBAAmB;CAC7B,OAAO,QAAQ,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoql/vue-doctor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI auditor for Vue 3 apps. Detects anti-patterns, AI-slop, and best-practice violations via @vue/compiler-sfc + oxlint. Run with `npx -y @geoql/vue-doctor`.",
|
|
6
6
|
"keywords": [
|
|
@@ -49,11 +49,13 @@
|
|
|
49
49
|
"cac": "^7.0.0",
|
|
50
50
|
"kolorist": "^1.8.0",
|
|
51
51
|
"oxlint": "^1.67.0",
|
|
52
|
-
"
|
|
53
|
-
"@geoql/
|
|
52
|
+
"prompts": "^2.4.2",
|
|
53
|
+
"@geoql/doctor-core": "^1.0.0",
|
|
54
|
+
"@geoql/oxlint-plugin-vue-doctor": "1.0.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@types/node": "^25.9.1",
|
|
58
|
+
"@types/prompts": "^2.4.9",
|
|
57
59
|
"@vue/compiler-core": "^3.5.35",
|
|
58
60
|
"@vue/compiler-sfc": "^3.5.35",
|
|
59
61
|
"c12": "^4.0.0-beta.5",
|