import l from"@contractspec/lib.ui-link";import{jsx as o,jsxs as p}from"react/jsx-runtime";function d({title:n="Need the operating layer on top of OSS ContractSpec?",body:r="ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",ctaLabel:i="See what Studio adds",href:s="https://www.contractspec.studio/docs"}){return p("div",{className:"card-subtle space-y-3 p-6",children:[o("h3",{className:"font-semibold text-lg",children:n}),o("p",{className:"text-muted-foreground text-sm",children:r}),o(l,{href:s,className:"btn-primary",children:i})]})}import{CodeBlock as a}from"@contractspec/lib.design-system";import c from"@contractspec/lib.ui-link";import{ChevronRight as u}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function y(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Build the docs pipeline"}),e("p",{className:"text-lg text-muted-foreground",children:"Generate reference docs, chunk the index, and wire the docs pages the same way this repo does."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Generated Markdown and a chunked index manifest."}),e("li",{children:"Reference routes powered by the docs loader."}),e("li",{children:"Versioned outputs you can publish per release."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Generate contract docs"}),e(a,{language:"bash",filename:"generate-contract-docs",code:"contractspec generate"}),t("p",{className:"text-muted-foreground text-sm",children:["Expected output: Markdown in ",e("code",{children:"generated/docs"}),"."]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Build the docs index"}),e(a,{language:"bash",filename:"docs-generate",code:`bun docs:generate
# versioned output
bun docs:generate -- --version v1.0.0`}),t("p",{className:"text-muted-foreground text-sm",children:["This writes ",e("code",{children:"docs-index.manifest.json"})," and chunked",e("code",{children:"docs-index.*.json"})," files in the generated docs bundle."]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Wire reference routes"}),e(a,{language:"tsx",filename:"docs-reference-route",code:`import { notFound } from "next/navigation";
import {
  DocsReferenceIndexPage,
  DocsReferencePage,
  getGeneratedDocById,
  listGeneratedDocs,
} from "@contractspec/bundle.library";

export async function generateStaticParams() {
  const docs = await listGeneratedDocs();
  return docs.map((doc) => ({ slug: doc.id.split("/") }));
}

export default async function Page({ params }: { params: { slug?: string[] } }) {
  const slug = params.slug?.join("/") ?? "";
  const doc = await getGeneratedDocById(slug);
  if (!doc) notFound();
  return <DocsReferencePage entry={doc.entry} content={doc.content} />;
}`}),t("p",{className:"text-muted-foreground text-sm",children:["Use the index page on ",e("code",{children:"/docs/reference"})," to render the searchable list."]})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Repo reference"}),t("p",{className:"text-muted-foreground text-sm",children:["This repo wires docs under"," ",e("code",{children:"packages/apps/web-landing/src/app/docs/reference"}),"."]})]}),e(d,{title:"Need decision-to-export automation?",body:"Studio exports evidence-backed spec changes and task packs to Linear, Jira, Notion, and GitHub."})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(c,{href:"/docs/guides/ci-contract-diff-gating",className:"btn-primary",children:["Next: CI gating ",e(u,{size:16})]}),e(c,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}export{y as GuideDocsPipelinePage};
