@geoql/nuxt-doctor 0.0.0-bootstrap

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 ADDED
@@ -0,0 +1,39 @@
1
+ # `@geoql/nuxt-doctor`
2
+
3
+ > Your agent writes bad Nuxt. This catches it.
4
+
5
+ CLI auditor for Nuxt 4 apps. Detects anti-patterns, AI-slop, and best-practice violations via a hybrid pass over `@vue/compiler-sfc` template ASTs and `oxlint` (with its built-in `vue` plugin) for script-level rules. Extends the `@geoql/vue-doctor` rule set with Nuxt-specific checks.
6
+
7
+ ## Quickstart
8
+
9
+ ```bash
10
+ npx -y @geoql/nuxt-doctor ./app
11
+ ```
12
+
13
+ ## CLI
14
+
15
+ ```
16
+ nuxt-doctor [path] [--format text|json] [--config doctor.config.ts] [--fail-on error|warning]
17
+ ```
18
+
19
+ | Flag | Description |
20
+ | ----------- | -------------------------------------------------------------------------- |
21
+ | `--format` | `text` (default) or `json` |
22
+ | `--config` | Path to `doctor.config.ts`. Defaults to `./doctor.config.ts` if it exists. |
23
+ | `--fail-on` | `error` (default) or `warning` — threshold for non-zero exit code. |
24
+
25
+ Exit codes:
26
+
27
+ | Code | Meaning |
28
+ | ---- | ------------------------------------------------------------ |
29
+ | 0 | No findings at/above `--fail-on` threshold (default: error). |
30
+ | 1 | Findings at/above threshold. |
31
+ | 2 | Configuration error or scan failure. |
32
+
33
+ ## Architecture
34
+
35
+ See [`docs/ARCHITECTURE.md`](../../docs/ARCHITECTURE.md).
36
+
37
+ ## License
38
+
39
+ MIT © Vinayak Kulkarni
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../dist/index.js';
3
+ const code = await run(process.argv);
4
+ process.exit(code);
@@ -0,0 +1,5 @@
1
+ //#region src/cli.d.ts
2
+ declare function run(argv?: string[]): Promise<number>;
3
+ //#endregion
4
+ export { run };
5
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,294 @@
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ import { dirname, resolve } from "node:path";
3
+ import process from "node:process";
4
+ import { fileURLToPath } from "node:url";
5
+ import { audit, detectProject, encodeAnnotations, format, listChangedFiles, listRules, loadDoctorConfig, loadRuleDoc, mergeCliOverrides, renderVerboseTrace } from "@geoql/doctor-core";
6
+ import { cac } from "cac";
7
+ //#region src/cli.ts
8
+ function readVersion() {
9
+ try {
10
+ const here = dirname(fileURLToPath(import.meta.url));
11
+ return JSON.parse(readFileSync(resolve(here, "../package.json"), "utf-8")).version ?? "0.0.0";
12
+ } catch {
13
+ return "0.0.0";
14
+ }
15
+ }
16
+ function isCiEnvironment() {
17
+ const env = process.env;
18
+ return Boolean(env.CI === "true" || env.CI === "1" || env.GITHUB_ACTIONS === "true" || env.GITLAB_CI === "true" || env.CIRCLECI === "true" || env.TRAVIS === "true" || env.BUILDKITE === "true" || env.JENKINS_HOME);
19
+ }
20
+ function projectInfoToJson(p) {
21
+ return {
22
+ framework: p.framework,
23
+ rootDirectory: p.rootDirectory,
24
+ packageJsonPath: p.packageJsonPath,
25
+ vueVersion: p.vueVersion,
26
+ nuxtVersion: p.nuxtVersion,
27
+ nuxtCompatibilityVersion: p.nuxtCompatibilityVersion,
28
+ nitroPreset: p.nitroPreset,
29
+ typescriptVersion: p.typescriptVersion,
30
+ monorepoKind: p.monorepoKind,
31
+ hasAutoImports: p.hasAutoImports,
32
+ hasComponentsAutoImport: p.hasComponentsAutoImport,
33
+ hasPinia: p.hasPinia,
34
+ hasVueRouter: p.hasVueRouter,
35
+ capabilities: [...p.capabilities].sort()
36
+ };
37
+ }
38
+ function renderInspect(p, rootDir) {
39
+ const lines = [];
40
+ lines.push(`@geoql/nuxt-doctor v${readVersion()} — project capabilities`);
41
+ lines.push("");
42
+ lines.push("framework");
43
+ lines.push(` ${p.framework}`);
44
+ lines.push(` vue: ${p.vueVersion ?? "(none)"}`);
45
+ lines.push(` typescript: ${p.typescriptVersion ?? "(none)"}`);
46
+ lines.push("");
47
+ lines.push("project layout");
48
+ lines.push(` rootDirectory: ${rootDir}`);
49
+ lines.push(` packageJsonPath: ${p.packageJsonPath ?? "(none)"}`);
50
+ lines.push(` monorepoKind: ${p.monorepoKind ?? "(none)"}`);
51
+ lines.push("");
52
+ lines.push("ecosystem");
53
+ lines.push(` hasAutoImports: ${p.hasAutoImports}`);
54
+ lines.push(` hasComponentsAutoImport: ${p.hasComponentsAutoImport}`);
55
+ lines.push(` hasPinia: ${p.hasPinia}`);
56
+ lines.push(` hasVueRouter: ${p.hasVueRouter}`);
57
+ lines.push("");
58
+ lines.push("capability tokens (used by rule gating)");
59
+ lines.push(` ${[...p.capabilities].sort().join("\n ")}`);
60
+ lines.push("");
61
+ lines.push("run 'nuxt-doctor inspect --json' for machine output");
62
+ lines.push("run 'nuxt-doctor list-rules' to see which rules these capabilities enable");
63
+ return `${lines.join("\n")}\n`;
64
+ }
65
+ function renderExplain(doc) {
66
+ const lines = [];
67
+ lines.push(`Rule: ${doc.id}`);
68
+ lines.push(`Severity: ${doc.severity}`);
69
+ lines.push(`Category: ${doc.category}`);
70
+ lines.push(`Source: ${doc.source}`);
71
+ lines.push(`Recommended: ${doc.recommended ? "yes" : "no (off in `recommended` preset)"}`);
72
+ lines.push(`Help: ${doc.helpUri}`);
73
+ lines.push("");
74
+ lines.push(doc.description);
75
+ return `${lines.join("\n")}\n`;
76
+ }
77
+ const VALID_LIST_PRESETS = new Set(["recommended", "all"]);
78
+ const VALID_CATEGORIES = new Set([
79
+ "ai-slop",
80
+ "reactivity",
81
+ "composition",
82
+ "performance",
83
+ "template",
84
+ "template-perf",
85
+ "build-quality",
86
+ "deps",
87
+ "dead-code",
88
+ "sfc",
89
+ "vue-builtin",
90
+ "structure",
91
+ "modules-deps",
92
+ "nitro",
93
+ "seo",
94
+ "cloudflare",
95
+ "server-routes",
96
+ "hydration",
97
+ "data-fetching"
98
+ ]);
99
+ const VALID_SOURCES = new Set([
100
+ "doctor",
101
+ "oxlint-builtin",
102
+ "eslint-plugin-vue"
103
+ ]);
104
+ function buildListRulesFilter(flags) {
105
+ const out = {};
106
+ if (flags.preset !== void 0) {
107
+ if (!VALID_LIST_PRESETS.has(flags.preset)) throw new Error(`unknown --preset '${flags.preset}' (expected: recommended | all)`);
108
+ out.preset = flags.preset;
109
+ }
110
+ if (flags.category !== void 0) {
111
+ if (!VALID_CATEGORIES.has(flags.category)) throw new Error(`unknown --category '${flags.category}'`);
112
+ out.category = flags.category;
113
+ }
114
+ if (flags.source !== void 0) {
115
+ if (!VALID_SOURCES.has(flags.source)) throw new Error(`unknown --source '${flags.source}'`);
116
+ out.source = flags.source;
117
+ }
118
+ if (flags.severity !== void 0) {
119
+ if (flags.severity !== "error" && flags.severity !== "warn" && flags.severity !== "info") throw new Error(`unknown --severity '${flags.severity}' (expected: error | warn | info)`);
120
+ out.severity = flags.severity;
121
+ }
122
+ return out;
123
+ }
124
+ function renderRulesTable(rules) {
125
+ if (rules.length === 0) return "No rules matched.\n";
126
+ const lines = [`@geoql/nuxt-doctor — ${rules.length} rule${rules.length === 1 ? "" : "s"}`, ""];
127
+ const idWidth = Math.max(...rules.map((r) => r.id.length));
128
+ const sevWidth = Math.max(...rules.map((r) => r.severity.length));
129
+ const catWidth = Math.max(...rules.map((r) => r.category.length));
130
+ for (const r of rules) {
131
+ const tag = r.recommended ? "[recommended]" : " ";
132
+ lines.push(` ${r.id.padEnd(idWidth)} ${r.severity.padEnd(sevWidth)} ${r.category.padEnd(catWidth)} ${r.source} ${tag}`);
133
+ }
134
+ return `${lines.join("\n")}\n`;
135
+ }
136
+ function toArray(value) {
137
+ if (value === void 0) return void 0;
138
+ return Array.isArray(value) ? value : [value];
139
+ }
140
+ function parseRuleOverrides(rules) {
141
+ if (!rules || rules.length === 0) return void 0;
142
+ const out = {};
143
+ for (const entry of rules) {
144
+ const idx = entry.lastIndexOf(":");
145
+ if (idx === -1) throw new Error(`Invalid --rule "${entry}". Expected format <ruleId>:<error|warn|info|off>.`);
146
+ const ruleId = entry.slice(0, idx);
147
+ const level = entry.slice(idx + 1);
148
+ if (level !== "error" && level !== "warn" && level !== "info" && level !== "off") throw new Error(`Invalid severity "${level}" for --rule "${entry}". Expected error|warn|info|off.`);
149
+ if (ruleId.length === 0) throw new Error(`Invalid --rule "${entry}". Rule id must not be empty.`);
150
+ out[ruleId] = level;
151
+ }
152
+ return out;
153
+ }
154
+ function resolveFormat(flags) {
155
+ if (flags.jsonCompact) return "json-compact";
156
+ if (flags.json) return "json";
157
+ const kind = flags.format;
158
+ if (kind === "pretty" || kind === "json" || kind === "json-compact" || kind === "sarif" || kind === "html") return kind;
159
+ if (typeof flags.output === "string" && flags.output.toLowerCase().endsWith(".html")) return "html";
160
+ return "agent";
161
+ }
162
+ function isFailOnLevel(v) {
163
+ return v === "error" || v === "warn" || v === "none";
164
+ }
165
+ async function run(argv = process.argv) {
166
+ const cli = cac("nuxt-doctor");
167
+ cli.command("[path]", "Audit a Nuxt 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 to 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("--output <file>", "Write the report to a file instead of stdout").action(async (path, flags) => {
168
+ const reporter = resolveFormat(flags);
169
+ if (flags.failOn !== void 0 && !isFailOnLevel(flags.failOn)) {
170
+ process.stderr.write(`nuxt-doctor: --fail-on must be 'error', 'warn', or 'none', got '${flags.failOn}'\n`);
171
+ process.exitCode = 2;
172
+ return;
173
+ }
174
+ const rootDir = resolve(path ?? ".");
175
+ try {
176
+ if (flags.score && (flags.json || flags.jsonCompact)) throw new Error("--score and --json are mutually exclusive (--score outputs a plaintext integer).");
177
+ const ruleOverrides = parseRuleOverrides(toArray(flags.rule));
178
+ const threshold = flags.threshold === void 0 ? void 0 : Number(flags.threshold);
179
+ if (threshold !== void 0 && (!Number.isInteger(threshold) || threshold < 0 || threshold > 100)) throw new Error(`--threshold must be an integer 0-100, got "${flags.threshold}".`);
180
+ if (flags.diff && flags.staged) throw new Error("--diff and --staged are mutually exclusive.");
181
+ if (flags.verbose && flags.quiet) throw new Error("--verbose and --quiet are mutually exclusive.");
182
+ let scopeFiles;
183
+ if (!flags.full && (flags.diff || flags.staged)) scopeFiles = await listChangedFiles({
184
+ rootDir,
185
+ mode: flags.staged ? "staged" : "diff"
186
+ });
187
+ const resolved = await loadDoctorConfig(rootDir, {
188
+ ...flags.config ? { explicitPath: flags.config } : {},
189
+ ...flags.preset ? { presetOverride: flags.preset } : {}
190
+ });
191
+ const merged = mergeCliOverrides(resolved, {
192
+ failOn: flags.failOn,
193
+ include: toArray(flags.include),
194
+ exclude: toArray(flags.exclude),
195
+ rules: ruleOverrides,
196
+ threshold
197
+ });
198
+ const report = await audit({
199
+ rootDir: merged.rootDir,
200
+ include: merged.include,
201
+ exclude: merged.exclude,
202
+ rules: merged.rules,
203
+ failOn: merged.failOn,
204
+ threshold: merged.threshold,
205
+ deadCode: flags.deadCode,
206
+ lint: flags.lint,
207
+ respectInlineDisables: flags.respectInlineDisables,
208
+ scopeFiles
209
+ });
210
+ const allowedRuleIds = new Set(Object.keys(merged.rules));
211
+ report.diagnostics = report.diagnostics.filter((d) => allowedRuleIds.has(d.ruleId));
212
+ if (flags.verbose) {
213
+ const verboseOutput = renderVerboseTrace(report, { configSource: resolved.source });
214
+ process.stderr.write(`${verboseOutput}\n`);
215
+ }
216
+ if (flags.score) {
217
+ process.stdout.write(`${report.score}\n`);
218
+ process.exitCode = report.exitCode;
219
+ return;
220
+ }
221
+ const out = format({
222
+ toolName: "@geoql/nuxt-doctor",
223
+ toolVersion: readVersion(),
224
+ rootDirectory: report.rootDir,
225
+ analyzedFileCount: report.filesScanned,
226
+ elapsedMs: report.elapsedMs,
227
+ diagnostics: report.diagnostics,
228
+ score: report.scoreResult,
229
+ projectInfo: report.projectInfo
230
+ }, reporter, {
231
+ color: flags.color,
232
+ quiet: flags.quiet
233
+ });
234
+ if (flags.output) writeFileSync(resolve(flags.output), out);
235
+ else process.stdout.write(out);
236
+ const ciExplicitOptOut = flags.ci === false;
237
+ const ciExplicitOptIn = flags.ci === true;
238
+ const ciAutoDetected = !ciExplicitOptOut && isCiEnvironment();
239
+ if ((flags.annotations === true || ciExplicitOptIn || ciAutoDetected) && (reporter === "agent" || reporter === "pretty") && !flags.quiet && report.diagnostics.length > 0) process.stdout.write(`${encodeAnnotations(report.diagnostics)}\n`);
240
+ process.exitCode = report.exitCode;
241
+ } catch (err) {
242
+ const msg = err instanceof Error ? err.message : String(err);
243
+ process.stderr.write(`nuxt-doctor: ${msg}\n`);
244
+ process.exitCode = 2;
245
+ }
246
+ });
247
+ cli.command("list-rules", "List every registered rule with id, severity, category, source, and preset membership").option("--preset <name>", "Filter to: recommended | all").option("--category <name>", "Filter by category").option("--source <name>", "Filter by source: doctor | oxlint-builtin | eslint-plugin-vue").option("--severity <level>", "Filter by: error | warn | info").option("--json", "Emit JSON instead of formatted text").option("--json-compact", "With --json, single-line output").action(async (flags) => {
248
+ try {
249
+ const rules = listRules(buildListRulesFilter(flags));
250
+ if (flags.json || flags.jsonCompact) {
251
+ const payload = {
252
+ count: rules.length,
253
+ rules
254
+ };
255
+ process.stdout.write(flags.jsonCompact ? JSON.stringify(payload) : `${JSON.stringify(payload, null, 2)}\n`);
256
+ } else process.stdout.write(renderRulesTable(rules));
257
+ process.exitCode = 0;
258
+ } catch (err) {
259
+ const msg = err.message;
260
+ process.stderr.write(`nuxt-doctor list-rules: ${msg}\n`);
261
+ process.exitCode = 2;
262
+ }
263
+ });
264
+ cli.command("explain <ruleId>", "Print the rule's severity, category, recommendation, and helpUri").option("--json", "Emit structured JSON instead of formatted text").action(async (ruleId, flags) => {
265
+ const doc = loadRuleDoc(ruleId);
266
+ if (!doc) {
267
+ process.stderr.write(`nuxt-doctor explain: unknown rule '${ruleId}'. Try \`nuxt-doctor list-rules\` to see registered rules.\n`);
268
+ process.exitCode = 2;
269
+ return;
270
+ }
271
+ if (flags.json) process.stdout.write(`${JSON.stringify(doc, null, 2)}\n`);
272
+ else process.stdout.write(renderExplain(doc));
273
+ process.exitCode = 0;
274
+ });
275
+ cli.command("inspect [dir]", "Print the detected project capabilities doctor uses to gate rules").option("--json", "Emit structured JSON instead of formatted text").option("--json-compact", "With --json, emit a single-line payload").action(async (dir, flags) => {
276
+ const rootDir = resolve(dir ?? ".");
277
+ const project = await detectProject(rootDir);
278
+ if (flags.json || flags.jsonCompact) {
279
+ const payload = projectInfoToJson(project);
280
+ const out = flags.jsonCompact ? JSON.stringify(payload) : JSON.stringify(payload, null, 2);
281
+ process.stdout.write(`${out}\n`);
282
+ } else process.stdout.write(renderInspect(project, rootDir));
283
+ process.exitCode = 0;
284
+ });
285
+ cli.help();
286
+ cli.version(readVersion());
287
+ cli.parse(argv, { run: false });
288
+ await cli.runMatchedCommand();
289
+ return process.exitCode ?? 0;
290
+ }
291
+ //#endregion
292
+ export { run };
293
+
294
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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/nuxt-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 'nuxt-doctor inspect --json' for machine output\");\n lines.push(\n \"run 'nuxt-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 'structure',\n 'modules-deps',\n 'nitro',\n 'seo',\n 'cloudflare',\n 'server-routes',\n 'hydration',\n 'data-fetching',\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/nuxt-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('nuxt-doctor');\n\n cli\n .command('[path]', 'Audit a Nuxt 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 `nuxt-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/nuxt-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(`nuxt-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(`nuxt-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 `nuxt-doctor explain: unknown rule '${ruleId}'. Try \\`nuxt-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,cAAc,EAAE;EAChB,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM;EACzC;;AAGH,SAAS,cAAc,GAAgB,SAAyB;CAC9D,MAAM,QAAkB,EAAE;CAC1B,MAAM,KAAK,uBAAuB,aAAa,CAAC,yBAAyB;CACzE,MAAM,KAAK,GAAG;CACd,MAAM,KAAK,YAAY;CACvB,MAAM,KAAK,KAAK,EAAE,YAAY;CAC9B,MAAM,KAAK,UAAU,EAAE,cAAc,WAAW;CAChD,MAAM,KAAK,iBAAiB,EAAE,qBAAqB,WAAW;CAC9D,MAAM,KAAK,GAAG;CACd,MAAM,KAAK,iBAAiB;CAC5B,MAAM,KAAK,oBAAoB,UAAU;CACzC,MAAM,KAAK,sB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0.0.0-bootstrap",
4
+ "private": false,
5
+ "description": "CLI auditor for Nuxt 4 apps. Detects anti-patterns, AI-slop, and best-practice violations via @vue/compiler-sfc + oxlint. Run with `npx -y @geoql/nuxt-doctor`.",
6
+ "keywords": [
7
+ "audit",
8
+ "cli",
9
+ "doctor",
10
+ "geoql",
11
+ "lint",
12
+ "nuxt",
13
+ "nuxt4",
14
+ "oxlint"
15
+ ],
16
+ "homepage": "https://github.com/geoql/doctor#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/geoql/doctor/issues"
19
+ },
20
+ "license": "MIT",
21
+ "author": {
22
+ "name": "Vinayak Kulkarni",
23
+ "email": "inbox.vinayak@gmail.com",
24
+ "url": "https://vinayakkulkarni.dev"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/geoql/doctor.git",
29
+ "directory": "packages/nuxt-doctor"
30
+ },
31
+ "bin": {
32
+ "nuxt-doctor": "./bin/nuxt-doctor.mjs"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "bin"
37
+ ],
38
+ "type": "module",
39
+ "exports": {
40
+ ".": {
41
+ "import": "./dist/index.js",
42
+ "types": "./dist/index.d.ts"
43
+ }
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "scripts": {
49
+ "lint": "vp lint src",
50
+ "lint:fix": "vp lint src --fix",
51
+ "format": "vp fmt",
52
+ "format:check": "vp fmt --check",
53
+ "build": "vp pack",
54
+ "test": "vitest run --passWithNoTests"
55
+ },
56
+ "dependencies": {
57
+ "@geoql/doctor-core": "workspace:^",
58
+ "@geoql/oxlint-plugin-nuxt-doctor": "workspace:*",
59
+ "@geoql/oxlint-plugin-vue-doctor": "workspace:*",
60
+ "cac": "^7.0.0",
61
+ "kolorist": "^1.8.0",
62
+ "oxlint": "^1.67.0"
63
+ },
64
+ "devDependencies": {
65
+ "@types/node": "^25.9.1",
66
+ "typescript": "^6.0.3",
67
+ "vitest": "^4.1.7"
68
+ }
69
+ }