This private pnpm workspace uses Next.js static export, Fumadocs UI, and MDX. It imports the local library through react-quiz-component's public exports.
From the repository root:
pnpm install
pnpm dev # http://localhost:3000
pnpm build:docs # Library build, then site export into docs/out
pnpm typecheck:docs
pnpm --filter @react-quiz/docs exec playwright install chromium
pnpm test:docs # Serves and tests the export at /react-quiz-component/Rebuild the library with pnpm build after changing its source; restarting pnpm dev also rebuilds it. MDX pages and demo components hot reload in the docs development server.
- Pages:
content/docs/*.mdx, ordered bymeta.json. - Examples use collapsible sidebar groups whose metadata references the flat example pages with
../page-name, preserving public URLs. Keep everyQuizPropsentry in the component reference linked to a runnable example. - Interactive demos:
components/examples/; each imports from the package root. ExampleSourcereads the runnable source during the build for highlighted, copyable examples.ExamplePreviewmounts demos only in the browser to avoid hydration mismatches from random sessions.public/imagesandpublic/audiocontain local example assets. Prefix raw asset URLs withNEXT_PUBLIC_BASE_PATH; Next links handlebasePathautomatically.- Search uses a build-time index and runs in the browser. It has no hosted search dependency or runtime API server.
Do not commit .next, generated MDX caches, out, or browser-test artifacts. The npm package includes only dist.