@farming-labs/docs 0.1.51 → 0.1.53

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.
@@ -89,7 +89,7 @@ async function main() {
89
89
  printAgentCompactHelp();
90
90
  process.exit(1);
91
91
  } else if (parsedCommand.command === "doctor") {
92
- const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-BfBpzPir.mjs");
92
+ const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-B0xEGzBU.mjs");
93
93
  const doctorOptions = parseDoctorArgs(args.slice(1));
94
94
  if (doctorOptions.help) {
95
95
  printDoctorHelp();
@@ -166,6 +166,7 @@ ${pc.dim("Options for doctor:")}
166
166
  ${pc.cyan("doctor --agent")} Same as ${pc.cyan("doctor")}; explicit agent scoring mode
167
167
  ${pc.cyan("doctor --site")} Score the current docs app for reader-facing docs quality
168
168
  ${pc.cyan("doctor --human")} Alias for ${pc.cyan("doctor --site")}
169
+ ${pc.cyan("doctor --json")} Print the report as JSON for CI, scripts, and automation
169
170
  ${pc.cyan("doctor agent")} Subcommand alias for agent scoring
170
171
  ${pc.cyan("doctor site")} Subcommand alias for reader-facing scoring
171
172
  ${pc.cyan("doctor human")} Legacy alias for reader-facing scoring
@@ -45,6 +45,10 @@ function parseDoctorArgs(argv) {
45
45
  parsed.mode = "agent";
46
46
  continue;
47
47
  }
48
+ if (arg === "--json") {
49
+ parsed.json = true;
50
+ continue;
51
+ }
48
52
  if (arg === "--human" || arg === "human" || arg === "--site" || arg === "site") {
49
53
  parsed.mode = "human";
50
54
  continue;
@@ -75,6 +79,7 @@ ${pc.dim("Usage:")}
75
79
  pnpm exec docs doctor
76
80
  pnpm exec docs doctor --agent
77
81
  pnpm exec docs doctor --site
82
+ pnpm exec docs doctor --agent --json
78
83
  pnpm exec docs doctor agent
79
84
  pnpm exec docs doctor site
80
85
 
@@ -82,6 +87,7 @@ ${pc.dim("Options:")}
82
87
  ${pc.cyan("--agent")} Score agent-readiness for the current docs app (default)
83
88
  ${pc.cyan("--site")} Score reader-facing docs quality for the current docs app
84
89
  ${pc.cyan("--human")} Alias for ${pc.cyan("--site")}
90
+ ${pc.cyan("--json")} Print the report as JSON for CI, scripts, and other agents
85
91
  ${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
86
92
  ${pc.cyan("-h, --help")} Show this help message
87
93
  `);
@@ -844,13 +850,31 @@ function printHumanDoctorReport(report) {
844
850
  for (const recommendation of report.recommendations) console.log(`- ${recommendation}`);
845
851
  }
846
852
  }
853
+ function serializeDoctorJsonReport(report) {
854
+ if (report.mode === "human") return {
855
+ ...report,
856
+ mode: "site"
857
+ };
858
+ return report;
859
+ }
860
+ function printDoctorJsonReport(report) {
861
+ console.log(JSON.stringify(serializeDoctorJsonReport(report), null, 2));
862
+ }
847
863
  async function runDoctor(options = {}) {
848
864
  if (options.mode === "human") {
849
865
  const report = await inspectHumanReadiness(options);
866
+ if (options.json) {
867
+ printDoctorJsonReport(report);
868
+ return report;
869
+ }
850
870
  printHumanDoctorReport(report);
851
871
  return report;
852
872
  }
853
873
  const report = await inspectAgentReadiness(options);
874
+ if (options.json) {
875
+ printDoctorJsonReport(report);
876
+ return report;
877
+ }
854
878
  printAgentDoctorReport(report);
855
879
  return report;
856
880
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",