@farming-labs/docs 0.2.7 → 0.2.9

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.
@@ -162,7 +162,7 @@ async function main() {
162
162
  printAgentsGenerateHelp();
163
163
  process.exit(1);
164
164
  } else if (parsedCommand.command === "doctor") {
165
- const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-D12L89uq.mjs");
165
+ const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-BnJYS39i.mjs");
166
166
  const doctorOptions = parseDoctorArgs(args.slice(1));
167
167
  if (doctorOptions.help) {
168
168
  printDoctorHelp();
@@ -340,6 +340,7 @@ ${pc.dim("Options for doctor:")}
340
340
  ${pc.cyan("doctor --site")} Score the current docs app for reader-facing docs quality
341
341
  ${pc.cyan("doctor --human")} Alias for ${pc.cyan("doctor --site")}
342
342
  ${pc.cyan("doctor --json")} Print the report as JSON for CI, scripts, and automation
343
+ ${pc.cyan("doctor --strict")} Exit with failure when any doctor check warns or fails
343
344
  ${pc.cyan("doctor agent")} Subcommand alias for agent scoring
344
345
  ${pc.cyan("doctor site")} Subcommand alias for reader-facing scoring
345
346
  ${pc.cyan("doctor human")} Legacy alias for reader-facing scoring
@@ -53,6 +53,10 @@ function parseDoctorArgs(argv) {
53
53
  parsed.json = true;
54
54
  continue;
55
55
  }
56
+ if (arg === "--strict") {
57
+ parsed.strict = true;
58
+ continue;
59
+ }
56
60
  if (arg === "--human" || arg === "human" || arg === "--site" || arg === "site") {
57
61
  parsed.mode = "human";
58
62
  continue;
@@ -97,6 +101,7 @@ ${pc.dim("Usage:")}
97
101
  pnpm exec docs doctor --agent
98
102
  pnpm exec docs doctor --site
99
103
  pnpm exec docs doctor --agent --json
104
+ pnpm exec docs doctor --agent --strict
100
105
  pnpm exec docs doctor agent
101
106
  pnpm exec docs doctor site
102
107
 
@@ -105,6 +110,7 @@ ${pc.dim("Options:")}
105
110
  ${pc.cyan("--site")} Score reader-facing docs quality for the current docs app
106
111
  ${pc.cyan("--human")} Alias for ${pc.cyan("--site")}
107
112
  ${pc.cyan("--json")} Print the report as JSON for CI, scripts, and other agents
113
+ ${pc.cyan("--strict")} Exit with failure when any check warns or fails
108
114
  ${pc.cyan("--url <url>")} Probe hosted agent surfaces, e.g. ${pc.dim("https://docs.example.com")}
109
115
  ${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
110
116
  ${pc.cyan("-h, --help")} Show this help message
@@ -1456,9 +1462,16 @@ function serializeDoctorJsonReport(report) {
1456
1462
  function printDoctorJsonReport(report) {
1457
1463
  console.log(JSON.stringify(serializeDoctorJsonReport(report), null, 2));
1458
1464
  }
1465
+ function hasNonPassingDoctorCheck(report) {
1466
+ return report.checks.some((check) => check.status !== "pass");
1467
+ }
1468
+ function applyStrictExitCode(report, options) {
1469
+ if (options.strict && hasNonPassingDoctorCheck(report)) process.exitCode = 1;
1470
+ }
1459
1471
  async function runDoctor(options = {}) {
1460
1472
  if (options.mode === "human") {
1461
1473
  const report = await inspectHumanReadiness(options);
1474
+ applyStrictExitCode(report, options);
1462
1475
  if (options.json) {
1463
1476
  printDoctorJsonReport(report);
1464
1477
  return report;
@@ -1467,6 +1480,7 @@ async function runDoctor(options = {}) {
1467
1480
  return report;
1468
1481
  }
1469
1482
  const report = await inspectAgentReadiness(options);
1483
+ applyStrictExitCode(report, options);
1470
1484
  if (options.json) {
1471
1485
  printDoctorJsonReport(report);
1472
1486
  return report;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",