docs: portable demos, an honest quick start, and an agent-readable surface - #60
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A developer tried to install
@intentface/chatwith an agent and couldn't reproduce the styled interface. Three verified causes, all in the docs rather than the package:installation.mdxtold readers that each component page's "View source" link was the styled component to copy — butpage-actions.tsxbuilt that URL aspackages/chat/src/${source}, the headless primitive they'd already installed from npm.components/ai/was referenced nowhere incontent/./docs-markdown/[...slug]andreadDocsPagereturned raw MDX, so an agent received<ComponentPreview name="…" />— an opaque tag with no code in it. The source existed only in the rendered page's code tab.packages/chat/README.mdadvertised a "shadcn-style styled layer from the docs" — the first thing read after install.Positioning is now settled as the Base UI model, not shadcn: no registry, no
npx shadcn add. The demos are the styled reference.What changed
1. Honest quick start — deleted the theming page (its CSS was a hand-maintained copy that had already drifted from
app/globals.css: 114 tokens vs 131), replacedinstallation.mdxwithquick-start.mdxin Base UI's shape, retargeted seven identical broken pointers, and relabelled "View source" → "Primitive source". The Set up section documentsisolation: isolate, a real constraint that was undocumented — the package portals todocument.bodyin four places.2. Self-contained demos — all 14 rewritten to import only
@intentface/chat/*andreact, with icons inlined and sample data local. Colocated undercontent/docs/**/demos/. Colours and geometry are derived from the four theme seeds rather than approximated.ComponentPreviewandcomponents/docs/previews/are gone;<Demo>replaces them. Quick start also gains package-manager tabs.Three package-behaviour bugs surfaced while writing them, now fixed in the docs: the ask-user section referenced a
<Composer.AskUser />that doesn't exist in the package, the attachments section claimedComposer.Attachmentsrenders a file strip (it carries policy and a hidden input), andheadless/index.mdxstill described a copy-paste styled layer we'd removed.3. Agent-readable surface —
lib/docs/expand-demos.tsrewrites each<Demo>into a fenced block with the real source and strips the imports that fed it, applied to both the markdown route and thereadDocsPagetool. The composer page goes 31k → 61k characters of genuinely copyable code.<InstallationBlock>expands too, so the install command is no longer invisible to agents. Adds a generated/llms.txt.Verification
biome check,tsc --noEmit, andbun run buildall cleantsconfig.demos.jsonmaps@intentface/chat/*topackages/chat/dist/*and defines no@/*alias, so demos must compile against the published package. Proven against both failure modes — an app-internal import givesTS2307, a missing package export givesTS2305@/components,@/lib,@/hooks,lucide-react,motion/react, ornext/imagecomponents/ai,/docs/theming, or/docs/installationreferences remain incontent/Not included
build-a-chatstaged guide (next)classNamecallback — it already works via the vendored render machinery, but is undocumented and unused; 51 of 67 parts declare no state, which needs a decisionNote on structure
Three commits, one PR. Each depends on the one before — the hero demo slots into the page the first commit creates, and the expander needs the
<Demo>component from the second — so separate branches offmainwould each be broken alone.