-
Notifications
You must be signed in to change notification settings - Fork 0
Turn docs-smoke into @inth/docs demo app #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "radix-nova", | ||
| "rsc": false, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "src/styles.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "iconLibrary": "tabler", | ||
| "rtl": false, | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib", | ||
| "hooks": "@/hooks" | ||
| }, | ||
| "registries": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| title: "AutoTypeTable Fixture" | ||
| description: "Pipeline-only fixture for type extraction coverage." | ||
| --- | ||
|
|
||
| # AutoTypeTable Fixture | ||
|
|
||
| <AutoTypeTable | ||
| name="PipelineExampleOptions" | ||
| path="./apps/docs-smoke/type-fixtures/pipeline-example.ts" | ||
| /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| --- | ||
| title: "Components Fixture" | ||
| description: "Render the runtime-facing adapters from @inth/docs in one browser route." | ||
| --- | ||
|
|
||
| # Components Fixture | ||
|
|
||
| <Callout variant="success" title="Runtime fixture"> | ||
| This page intentionally exercises the browser-facing adapters without replacing them with shadcn variants. | ||
| </Callout> | ||
|
|
||
| ## Authoring Example | ||
|
|
||
| ```mdx | ||
| <Callout variant="success" title="Runtime fixture"> | ||
| Render the exported adapters through your shared `mdxComponents` map. | ||
| </Callout> | ||
|
|
||
| <PackageCommandTabs command="{pm} add @inth/docs" /> | ||
|
|
||
| <Tabs items={["Overview", "Types"]}> | ||
| <Tab value="Overview">Tabs hydrate in the browser.</Tab> | ||
| <Tab value="Types">Use `TypeTable` when the type data already exists in MDX.</Tab> | ||
| </Tabs> | ||
|
|
||
| <Mermaid chart={`flowchart LR | ||
| A[MDX] --> B[mdxComponents] | ||
| B --> C[Rendered route] | ||
| `} /> | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| command: { | ||
| type: "string", | ||
| description: "Command template with a {pm} placeholder.", | ||
| required: true, | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| <AutoTypeTable | ||
| name="PipelineExampleOptions" | ||
| path="./apps/docs-smoke/type-fixtures/pipeline-example.ts" | ||
| type={pipelineExampleType} | ||
| /> | ||
| ``` | ||
|
|
||
| `AutoTypeTable` still needs extracted `type` data from the route or conversion pipeline. This demo renders that extracted output on `/docs`. | ||
|
|
||
| <Cards> | ||
| <Card title="Quickstart route" description="Internal docs route rendered by the package card component." href="/docs/guides/quickstart" /> | ||
| <Card title="External reference" description="External links should preserve safe target and rel attributes." href="https://example.com/docs" /> | ||
| </Cards> | ||
|
|
||
| <Steps> | ||
| <Step title="Author MDX"> | ||
| Start with semantic components such as `Callout`, `Tabs`, `Cards`, and `TypeTable`. | ||
| </Step> | ||
| <Step title="Render in TanStack Start"> | ||
| Import the `.mdx` file directly and provide `mdxComponents` through the shared runtime map. | ||
| </Step> | ||
| <Step title="Validate separately"> | ||
| Keep `AutoTypeTable` in pipeline coverage where source extraction actually happens. | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| <PackageCommandTabs command="{pm} add @inth/docs" /> | ||
|
|
||
| <Tabs items={["Overview", "Tables", "Pipeline note"]}> | ||
| <Tab value="Overview"> | ||
| This tabset proves the package adapters hydrate correctly inside the demo app. | ||
| </Tab> | ||
| <Tab value="Tables"> | ||
| `TypeTable` is safe to render live because all of its data is already present in the MDX payload. | ||
| </Tab> | ||
| <Tab value="Pipeline note"> | ||
| `AutoTypeTable` is not shown live here because extraction depends on a stable build-time file system base path. | ||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| <Mermaid chart={`flowchart LR | ||
| A[MDX fixture] --> B[mdxComponents] | ||
| B --> C[TanStack Start route] | ||
| C --> D[Playwright coverage] | ||
| `} /> | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| command: { | ||
| type: "string", | ||
| description: "Command template with a {pm} placeholder.", | ||
| required: true, | ||
| }, | ||
| commands: { | ||
| type: "Record<PackageManager, string>", | ||
| description: "Explicit per-manager overrides when templates are not enough.", | ||
| }, | ||
| defaultManager: { | ||
| type: "\"npm\" | \"pnpm\" | \"yarn\" | \"bun\"", | ||
| description: "The tab that should be active on first render.", | ||
| default: "npm", | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| <Callout variant="canary" title="Pipeline-only coverage"> | ||
| `AutoTypeTable` is verified by the markdown conversion fixture at `content/docs/guides/auto-type-table-fixture.mdx` and by the dedicated pipeline test script. | ||
| </Callout> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,98 @@ | ||
| --- | ||
| title: "Smoke SDK" | ||
| description: "Welcome to the Smoke SDK docs. Exercise @inth/docs end-to-end." | ||
| title: "@inth/docs" | ||
| description: "Package docs for runtime adapters, remark plugins, conversion, LLM output, and linting." | ||
| --- | ||
|
|
||
| # Smoke SDK | ||
| # @inth/docs | ||
|
|
||
| <Callout variant="info" title="Welcome"> | ||
| This is a fixture page that mirrors how consumer apps integrate with `@inth/docs`. | ||
| </Callout> | ||
| `@inth/docs` has five package surfaces: | ||
|
|
||
| Pick your path below. | ||
| <TypeTable | ||
| type={{ | ||
| "@inth/docs": { | ||
| type: "runtime", | ||
| description: "React adapters and `mdxComponents` for browser-rendered MDX.", | ||
| required: true, | ||
| }, | ||
| "@inth/docs/remark": { | ||
| type: "pipeline", | ||
| description: "remark plugins and `defaultRemarkPlugins` for MDX processing.", | ||
| required: true, | ||
| }, | ||
| "@inth/docs/convert": { | ||
| type: "pipeline", | ||
| description: "`convertMdxFile`, `convertSingleMdxFile`, and `convertAllMdx`.", | ||
| required: true, | ||
| }, | ||
| "@inth/docs/llm": { | ||
| type: "pipeline", | ||
| description: "Generate `llms.txt` and topic-scoped agent context files.", | ||
| }, | ||
| "@inth/docs/lint": { | ||
| type: "pipeline", | ||
| description: "Validation APIs and the `inth-docs-lint` CLI.", | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| ## Install | ||
|
|
||
| <PackageCommandTabs command="{pm} install @inth/docs" /> | ||
|
|
||
| ## Runtime integration | ||
|
|
||
| Use the root package when you want to render authored MDX in a React app. | ||
|
|
||
| ```tsx | ||
| import { mdxComponents } from "@inth/docs"; | ||
|
|
||
| const components = { | ||
| ...mdxComponents, | ||
| }; | ||
| ``` | ||
|
|
||
| The root export is the runtime contract. It is not tied to shadcn, TanStack Start, or any specific docs shell. | ||
|
|
||
| ## Convert MDX | ||
|
|
||
| Use the conversion and remark packages when you want markdown output instead of browser rendering. | ||
|
|
||
| ```ts | ||
| import { convertAllMdx } from "@inth/docs/convert"; | ||
| import { defaultRemarkPlugins, remarkInclude } from "@inth/docs/remark"; | ||
|
|
||
| await convertAllMdx({ | ||
| srcDir: "content", | ||
| outDir: "public", | ||
| remarkPlugins: [remarkInclude, ...defaultRemarkPlugins], | ||
| }); | ||
| ``` | ||
|
|
||
| ## What to open in this app | ||
|
|
||
| <Cards> | ||
| <Card title="Quickstart" description="Install and send your first request." href="/docs/guides/quickstart" /> | ||
| <Card | ||
| title="Quickstart" | ||
| description="Shows the basic conversion flow plus hydrated `Tabs` and `PackageCommandTabs`." | ||
| href="/docs/guides/quickstart" | ||
| /> | ||
| <Card | ||
| title="Components Fixture" | ||
| description="Shows the runtime adapters rendered together through `mdxComponents`." | ||
| href="/docs/guides/components-fixture" | ||
| /> | ||
| </Cards> | ||
|
|
||
| ## Validation layers | ||
|
|
||
| <Steps> | ||
| <Step title="Package tests"> | ||
| Cover semantic HTML and safe runtime behavior in `packages/docs/src/**/*.test.ts*`. | ||
| </Step> | ||
| <Step title="Pipeline fixtures"> | ||
| Cover conversion, extraction, and LLM output in `apps/docs-smoke/scripts` and `apps/docs-smoke/content`. | ||
| </Step> | ||
| <Step title="Browser coverage"> | ||
| Cover hydration and interactive adapters in the Playwright suite for this app. | ||
| </Step> | ||
| </Steps> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| { | ||
| "title": "Docs", | ||
| "pages": ["index", "guides/quickstart"] | ||
| "pages": [ | ||
| "index", | ||
| "guides/quickstart", | ||
| "guides/components-fixture", | ||
| "guides/auto-type-table-fixture" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,18 +4,57 @@ | |
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "convert": "bun run scripts/mdx-convert.ts", | ||
| "llm": "bun run scripts/llm-generate.ts", | ||
| "build": "bun run convert && bun run llm", | ||
| "setup:real": "bun run scripts/setup-real-content.ts", | ||
| "test:real": "bun run setup:real && bun run scripts/test-real.ts", | ||
| "bench": "bun run setup:real && bun run scripts/bench.ts" | ||
| "dev": "bun run --filter @inth/docs build && vite dev --host 0.0.0.0 --port 3000", | ||
| "build": "bun run --filter @inth/docs build && vite build", | ||
| "preview": "vite preview --host 0.0.0.0 --port 3000", | ||
| "check-types": "tsc --noEmit", | ||
| "test:e2e": "bun run --filter @inth/docs build && playwright test", | ||
| "convert": "bun run pipeline:convert", | ||
| "llm": "bun run pipeline:llm", | ||
| "setup:real": "bun run pipeline:setup-real", | ||
| "test:real": "bun run pipeline:test-real", | ||
| "bench": "bun run pipeline:bench", | ||
| "pipeline:convert": "bun run scripts/mdx-convert.ts", | ||
| "pipeline:llm": "bun run scripts/llm-generate.ts", | ||
| "pipeline:build": "bun run pipeline:convert && bun run pipeline:llm", | ||
| "pipeline:test": "bun run scripts/test-pipeline.ts", | ||
| "pipeline:setup-real": "bun run scripts/setup-real-content.ts", | ||
| "pipeline:test-real": "bun run pipeline:setup-real && bun run scripts/test-real.ts", | ||
| "pipeline:bench": "bun run pipeline:setup-real && bun run scripts/bench.ts", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This script rename leaves only Useful? React with 👍 / 👎. |
||
| "pipeline:convert-real": "bun run scripts/convert-real.ts", | ||
| "pipeline:llm-real": "bun run scripts/llm-generate-real.ts" | ||
| }, | ||
| "dependencies": { | ||
| "@inth/docs": "workspace:*" | ||
| "@fontsource-variable/geist": "^5.2.8", | ||
| "@fontsource-variable/geist-mono": "^5.2.7", | ||
| "@inth/docs": "workspace:*", | ||
| "@mdx-js/react": "^3.1.1", | ||
| "@radix-ui/react-separator": "^1.1.7", | ||
| "@radix-ui/react-slot": "^1.2.3", | ||
| "@tanstack/react-router": "^1.167.4", | ||
| "@tanstack/react-start": "^1.166.15", | ||
| "class-variance-authority": "^0.7.1", | ||
| "clsx": "^2.1.1", | ||
| "nitro": "3.0.260415-beta", | ||
| "react": "^19.0.0", | ||
| "react-dom": "^19.0.0", | ||
| "tailwind-merge": "^3.5.0", | ||
| "tailwindcss": "^4.2.1", | ||
| "tw-animate-css": "^1.4.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@mdx-js/rollup": "^3.1.1", | ||
| "@playwright/test": "^1.54.2", | ||
| "@tailwindcss/vite": "^4.2.1", | ||
| "@types/mdast": "^4.0.4", | ||
| "@types/mdx": "^2.0.13", | ||
| "@types/node": "^22.10.0", | ||
| "typescript": "5.9.2" | ||
| "@types/react": "^19.0.0", | ||
| "@types/react-dom": "^19.0.0", | ||
| "@vitejs/plugin-react": "^5.2.0", | ||
| "remark-frontmatter": "^5.0.0", | ||
| "typescript": "5.9.2", | ||
| "vite": "^7.3.1", | ||
| "vite-tsconfig-paths": "^5.1.4" | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.