Skip to content

docs: refresh adapter pages with hand-authored MDX#474

Merged
bensabic merged 12 commits into
mainfrom
docs/refresh-adapters
May 12, 2026
Merged

docs: refresh adapter pages with hand-authored MDX#474
bensabic merged 12 commits into
mainfrom
docs/refresh-adapters

Conversation

@bensabic
Copy link
Copy Markdown
Contributor

@bensabic bensabic commented May 9, 2026

Summary

Refreshes the adapter docs end-to-end so every adapter — official, vendor-official, and community — now ships hand-authored MDX, lives under a clean URL structure, and renders on a polished sidebar/right-rail layout dedicated to /adapters (the shared /docs chrome is untouched).

flowchart LR
  subgraph Before
    direction TB
    OB[official] --> CB[community<br/>incl. 5 vendor pages]
  end
  subgraph After
    direction TB
    OA[official] --> VA[vendor-official<br/>5 pages] --> CA[community]
  end
  Before -.-> After
Loading

Content & routing

  • New /adapters/vendor-official/<slug> route for vendor-maintained adapters (Beeper Matrix, Photon iMessage, Liveblocks, Resend, Zernio). Sidebar gets a third labelled group ("Vendor-Official Adapters") between Official and Community, with a top divider matching the existing Community treatment.
  • All 13 vendor-official + community adapters migrated from runtime README fetching to hand-authored MDX with rich features: matrices and full body content (install, quick start, configuration, auth, gateway/streaming, troubleshooting). README fetch stays as a fallback for any future community adapter that hasn't been migrated yet, gated by a new mdxBody: true frontmatter flag.
  • Messenger filter pages removed (/adapters/for/<messenger> + the "Browse by messenger" chip row on /adapters). Existing URLs 308-redirect to /adapters.
  • Permanent redirects from /adapters/community/{matrix,imessage,resend,zernio,liveblocks} to their new /adapters/vendor-official/... paths.
  • Fixed /docs/adapters and /docs/state so the bare pages are accessible again — the previous catch-all redirect (:slug*) was swallowing them. Switched to :slug+ so subpath URLs still 308 while the bare pages render.

Visual polish

  • Adapter-only sidebar variant (AdaptersDocsLayout + AdaptersSidebar) with uppercase eyebrow separators, tighter rows, and a thin themed scrollbar utility class. The shared /docs sidebar is untouched.
  • Restyled AdapterHero: drops the badges row + packageName, sits the title inline with the logo, larger 17 px tagline, horizontal divider beneath the block.
  • Restyled PackageInstall as a tabbed dark single-line snippet with a $ prompt prefix and a copy button — replaces the previous multi-line CodeBlock layout.
  • New "Deploy your chat app on Vercel" upsell card (<Upsell />) replaces the old EditSource / ScrollTop / Feedback / CopyPage footer cluster on every adapter detail page.
  • Listing & messenger pages: align the H1 to a tighter text-4xl sm:text-[44px], and the section headers to text-base font-medium tracking-tight with a one-line muted lede.

Tooling & tests

  • Added mdxBody: true opt-in to the adapter frontmatter schema (source.config.ts), and updated both detail-page handlers (community/[slug] and the new vendor-official/[slug]) to render the MDX body when present, falling back to README fetch otherwise.
  • Refactored both detail-page handlers to flatten the body-render branches into a renderBody() helper, removing the nested ternaries that were tripping lint/style/noNestedTernary.
  • New test file packages/integration-tests/src/docs-adapters.test.ts220 new assertions covering:
    • Adapter MDX frontmatter completeness, slug ↔ filename consistency, and type ∈ {platform, state}.
    • Vendor-official invariants: exactly the expected slugs, vendorOfficial: true, community: true, author, mdxBody: true, <FeatureSupport /> rendered.
    • Community invariants: community: true (never vendor-official), mdxBody: true, <FeatureSupport />.
    • Official invariants: never flagged, packageName always under @chat-adapter/*.
    • adapters.json ↔ MDX sync on packageName / type / community / vendorOfficial.
  • Extended VALID_DOC_PACKAGES so docs-content.test.ts accepts the new vendor-official + community packages, plus @chat-adapter/web, @chat-adapter/web/react, and @chat-adapter/messenger.

Per-package AGENTS.md

  • Added AGENTS.md to every official adapter and state adapter (14 packages), each tailored to that adapter's surface — overview, directory layout, build/test commands, public exports, thread ID format, webhook flow, authentication, format conversion, cards/streaming, platform quirks, testing approach, coding conventions, and release rules.
  • Added a one-line CLAUDE.md (@AGENTS.md) beside each so Claude Code picks up the same instructions through its built-in resolver — same convention as the root.

Web adapter copy

  • Cleaned up the Web adapter tagline (removed inline backticks) and dropped the now-redundant "v1 scope" section from the body.

Move official adapter pages from runtime README fetching to hand-authored
MDX under content/adapters/{official,community}/<slug>.mdx.

- New fumadocs collection (source.config.ts) with adapter frontmatter
  (packageName, slug, type, logo, tagline, beta, features, ...).
- New URL structure: /adapters/official/<slug> and /adapters/community/<slug>.
  Legacy /adapters/<slug> and /docs/adapters/* now 301 to /adapters listing.
- New components: PackageInstall (pnpm/npm/yarn/bun tabs), FeatureSupport
  (per-page mini matrix from frontmatter), GlobalFeatureMatrix (drives
  /docs/adapters from the same frontmatter), AdapterHero.
- Standardized template: Install -> Quick start -> Configuration (TypeTable)
  -> Authentication -> Advanced -> Feature support.
- Adapter pages now share the same docs chrome as /docs (sidebar + ToC +
  edit-on-GitHub). Sidebar groups official adapters flat with sub-headings
  for Platforms / State, then a collapsible "Community Adapters" section.
- Community pages keep README fetching via the new route until they
  migrate to MDX; URLs are stable.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-sdk-nextjs-chat Ready Ready Preview, Comment May 12, 2026 6:00am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
chat Ignored Ignored Preview May 12, 2026 6:00am

@bensabic bensabic self-assigned this May 9, 2026
@bensabic bensabic added the documentation Improvements or additions to documentation label May 9, 2026
bensabic added 10 commits May 10, 2026 19:40
Mounts a parallel sidebar/layout for /adapters routes so the adapter pages
can adopt their own typography (uppercase eyebrow separators, tighter rows,
themed thin scrollbar) without touching the shared /docs sidebar. Adds a
styled-scrollbar utility class to the global stylesheet.
Adapter hero: drop the badges row and packageName, sit the title inline
with the logo, bump the tagline to 17px with a horizontal divider beneath.

Install snippet: rebuild as a tabbed dark single-line snippet with a
visible $ prompt prefix and a copy button — replaces the previous
multi-line CodeBlock layout.
Promotes the five vendor-maintained adapters (Beeper Matrix, Photon
iMessage, Liveblocks, Resend, Zernio) out of the Community group and
into a peer Vendor-Official group with its own /adapters/vendor-official
route, sidebar folder, and hand-authored MDX pages.

Detail pages now opt-in to MDX-body rendering via a new mdxBody
frontmatter flag, with the README fetch kept as a fallback for any
adapter that hasn't been migrated yet.

The right-rail footer is replaced with a 'Deploy your chat app on
Vercel' upsell card across all adapter detail pages, and the listing
grid uses a getAdapterHref helper so vendor-official cards resolve to
the new route.

Existing /adapters/community/{matrix,imessage,resend,zernio,liveblocks}
URLs 308-redirect to their /adapters/vendor-official/... equivalents.
Drops the per-messenger landing pages under /adapters/for/[messenger]
and the 'Browse by messenger' chip row on the /adapters listing.
Existing /adapters/for/* URLs 308-redirect to /adapters.
The previous redirects used :slug* (zero-or-more segments), which
swallowed the bare /docs/adapters and /docs/state pages along with
their subpaths. Switching to :slug+ (one-or-more) lets the bare
paths fall through to their MDX while subpath URLs still 308 to
/adapters.
Replaces the frontmatter-only stubs for the eight community adapters
(Baileys, Blooio, Cloudflare Durable Objects, Mattermost, MySQL,
Sendblue, Webex, Zalo) with hand-authored MDX bodies sourced from each
adapter's pinned README. Each page now opts in to mdxBody rendering and
exposes a feature matrix via the FeatureSupport component, matching the
official adapter pages.
Removes the inline backticks around package and API names in the Web
adapter tagline so the rendered hero reads as plain prose, and drops
the now-redundant 'v1 scope' subsection from the Advanced section.
Replaces the nested ternaries in the community and vendor-official
detail-page handlers with a guarded readme assignment plus a renderBody
helper. No behavior change — only addresses the noNestedTernary lint
introduced when MDX-body fallback was added.
Adds a docs-adapters test file with 220 assertions across four groups:
- Adapter MDX frontmatter — every adapter page (official, vendor-official,
  community) declares title, description, packageName, slug, tagline,
  and a valid type, and the file basename matches the slug field.
- Vendor-official adapters — exactly the expected slugs, every page sets
  vendorOfficial: true, community: true, an author, mdxBody: true, and
  renders <FeatureSupport />.
- Community adapters — every page sets community: true (never
  vendor-official), opts in to mdxBody, and renders <FeatureSupport />.
- Official adapters — never flagged community/vendor-official; every
  packageName lives under @chat-adapter/*.
- adapters.json registry — vendor-official + community MDX entries are
  in sync with adapters.json on packageName, type, community, and
  vendorOfficial.

Also extends VALID_DOC_PACKAGES so docs-content.test.ts accepts the new
vendor-official + community packages, plus @chat-adapter/web,
@chat-adapter/web/react, and @chat-adapter/messenger.
Drops a per-package AGENTS.md beside each official adapter and state
adapter, plus a tiny CLAUDE.md (`@AGENTS.md`) so Claude Code picks
the same instructions up through its built-in resolver.

Each AGENTS.md follows the same structure: overview, directory
layout, build/test/typecheck commands, public surface, thread ID
format, webhook/event flow, authentication, format conversion,
cards/streaming/file-uploads where relevant, platform quirks,
testing approach, coding conventions, and release rules. Content
is tailored per adapter so coding agents working inside one package
get adapter-specific guidance without trawling the root CLAUDE.md
or the user-facing docs.

Coverage:
- Platform adapters: slack, teams, gchat, discord, telegram, github,
  linear, whatsapp, messenger, web.
- State adapters: memory, redis, ioredis, pg.
visyat
visyat previously approved these changes May 12, 2026
@bensabic bensabic merged commit 79227ae into main May 12, 2026
15 of 16 checks passed
@bensabic bensabic deleted the docs/refresh-adapters branch May 12, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants