#!/usr/bin/env bun /** * Backward-compatibility shim. The real registry generator now lives at * `packages/react/react-ui/scripts/build-registry.ts` (per Wave 2 of * `enterprise-react-ui-v2`). This shim re-invokes it via Bun's * import-and-call entry point so any existing CI / docker pipelines * pointing at the ops path continue to function unchanged. * * The ops directory still owns the Caddy / Docker / rsync deployment * stack — only the source-of-truth for the registry GENERATION moved * into the chassis package. */ import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { build, parseArgs, } from "../../../packages/react/react-ui/scripts/build-registry.js"; const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = resolve(SCRIPT_DIR, "..", "..", ".."); const DEFAULT_COMPONENTS_DIR = resolve( REPO_ROOT, "packages", "react", "react-ui", "src", "components" ); const DEFAULT_OUT_DIR = resolve( REPO_ROOT, "packages", "react", "react-ui", "registry", "r" ); async function main(): Promise { const parsed = parseArgs(process.argv.slice(2)); await build({ componentsDir: parsed.componentsDir ?? DEFAULT_COMPONENTS_DIR, outDir: parsed.outDir ?? DEFAULT_OUT_DIR, }); } await main().catch((err: unknown) => { const message = err instanceof Error ? err.message : String(err); process.stderr.write(`build-registry FAILED: ${message}\n`); process.exit(1); });