/**
 * Generate API documentation from TSDoc comments across all @nobulex/* packages.
 *
 * Usage:
 *   npx tsx scripts/generate-docs.ts
 *
 * Output:
 *   docs/api/  — HTML documentation generated by TypeDoc
 */

import { execSync } from "node:child_process";
import { resolve } from "node:path";

const ROOT = resolve(import.meta.dirname, "..");

function main(): void {
  console.log("Generating API documentation...\n");

  // Run TypeDoc using the root typedoc.json config
  execSync("npx typedoc", {
    cwd: ROOT,
    stdio: "inherit",
  });

  console.log("\nDocumentation generated at docs/api/");
}

main();
