Skip to content

feat(docs): add Fumadocs documentation site#8

Open
azizbecha wants to merge 1 commit into
mainfrom
feat/docs-site
Open

feat(docs): add Fumadocs documentation site#8
azizbecha wants to merge 1 commit into
mainfrom
feat/docs-site

Conversation

@azizbecha
Copy link
Copy Markdown
Owner

Summary

New `docs/` workspace serving the library's documentation. Built on Next.js 16 + Fumadocs 16 (App Router + MDX + Orama search).

Pages

  • Introduction — quick start with a live ``.
  • Installation — yarn/npm/pnpm/bun tabs, peer deps, RN-web notes.
  • LinkPreview — full prop table, live demo, states, styling.
  • useUrlPreview — signature, return shape, cancellation, validation.
  • Caching — defaults, `configureCache`, `invalidateUrl`, `clearCache`.
  • API reference — every export with signatures.

Live demos

`LinkPreviewDemo` is a thin client component that imports the actual `LinkPreview` from the library. `next.config.mjs` aliases `react-native` → `react-native-web` for both Turbopack (dev) and webpack (prod).

Workspace plumbing

  • Yarn 3 doesn't symlink the root workspace package into a sibling workspace's `node_modules`. `docs/scripts/link-workspace-root.mjs` runs in `postinstall` to create the symlink.
  • Root `tsconfig.json` and `tsconfig.build.json` now exclude `docs/` so the library's typecheck and bob build don't trip on Next.js-only globals.
  • oxlint/oxfmt ignore `docs/.next/`, `docs/.source/`, `docs/out/`, plus `docs/content/` (oxfmt mishandles MDX with nested code fences inside ``).

Test plan

  • `yarn lint` — clean
  • `yarn format:check` — clean
  • `yarn typecheck` — clean
  • `yarn test` — 90/90 pass
  • `yarn docs:build` — 10 routes generated (home + 6 docs pages + search + 404 + catch-all)
  • Connect Vercel project with Root Directory = `docs` and confirm preview deploys
  • Click through every page on the preview deploy and verify live demos render

New `docs/` workspace built on Next.js 16 + Fumadocs 16, served via
`yarn docs:dev` and `yarn docs:build`.

Pages
- Introduction with quick start + live `<LinkPreviewDemo />`
- Installation (yarn/npm/pnpm/bun tabs, peer deps, RN-web notes)
- LinkPreview component (full prop table, live demo, behavior, styling)
- useUrlPreview hook (signature, return shape, cancellation, validation)
- Caching (defaults, configureCache, invalidateUrl, clearCache)
- API reference (every export with signatures)

Live demos
- `LinkPreviewDemo` is a thin client component that imports the actual
  `LinkPreview` from the library and renders inside an RN-web container.
- `next.config.mjs` aliases `react-native` -> `react-native-web` for both
  Turbopack (dev) and webpack (prod), and adds RN-style `.web.*` extension
  precedence.

Workspace plumbing
- Yarn 3 doesn't symlink the root workspace package into a sibling
  workspace's node_modules. `docs/scripts/link-workspace-root.mjs` runs
  in `postinstall` to create `docs/node_modules/react-native-preview-url`
  -> the repo root.
- Root `tsconfig.json` and `tsconfig.build.json` exclude `docs/` so the
  library's typecheck and bob build don't trip on Next.js-only globals.
- oxlint/oxfmt ignore `docs/.next/`, `docs/.source/`, `docs/out/`, plus
  `docs/content/` (oxfmt mishandles MDX with nested code fences).

Verification
- `yarn lint`, `yarn format:check`, `yarn typecheck`, `yarn test` all
  green.
- `yarn docs:build` produces 10 routes (home + 6 docs pages + search +
  404 + dynamic catch-all) in ~6 s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant