This repository powers usereact.org (VitePress). Use English for documentation and UI copy.
git clone https://github.com/dedalik/use-react-docs.git
cd use-react-docs
npm ciFormatting uses Prettier, aligned with the main use-react package (single quotes, no semicolons, trailing commas).
| Command | Purpose |
|---|---|
npm run format |
Format Markdown, theme sources, and utils/ scripts |
npm run format:check |
Verify formatting (used in CI) |
EditorConfig (.editorconfig) sets two-space indentation and UTF-8 for consistent diffs across editors.
| Command | Purpose |
|---|---|
npm run docs:dev |
Local dev server |
npm run docs:build |
Production build + sitemap |
npm run docs:seo |
Refresh meta descriptions where configured |
predocs:build runs utils/generate-export-size.mjs. If ../use-react/dist/esm/hooks exists (after npm run build in a sibling use-react clone), sizes are regenerated. On Vercel, GitHub Actions, and other docs-only checkouts that directory is missing: the step skips and the site uses the committed docs/export-size.json. To refresh numbers locally, build the library first, then run npm run exportsize:generate or npm run docs:build.
- Run
npm run format:checkandnpm run docs:buildbefore opening a PR. - Register new guide pages in
docs/.vitepress/config.mtsand follow notes indocs/guide/contributing.mdwhen adding hooks or SEO-related files.
This repo pins Node.js 24.x via package.json engines and .nvmrc so Vercel and CI stay on a supported runtime (GitHub Actions uses Node 24 with actions/setup-node@v5).
If a project was created with an old default, open Vercel → Project → Settings → General → Node.js Version and choose 24.x (or match .nvmrc). The committed vercel.json sets installCommand, buildCommand, and outputDirectory for the VitePress output under docs/.vitepress/dist.