-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs: add guide for edit docs and preview in local #5005
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
docs: add guide for edit docs and preview in local #5005
Conversation
Signed-off-by: leesb971204 <leesb971204@gmail.com>
WalkthroughUpdates CONTRIBUTING.md to replace a brief docs note with a detailed local workflow for editing and previewing TanStack/router docs using the tanstack.com site. Adds cloning instructions, directory structure, dev server commands, preview URL, and notes about production docs fetching and config updates for new pages. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
View your CI Pipeline Execution ↗ for commit 7d3b690
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
CONTRIBUTING.md (6)
26-31
: Tighten wording, fix grammar, and format links in the new docs section.
- “The documentations” → “Documentation”.
- Prefer Markdown links over bare URLs.
- Clarify sibling-repo requirement and format paths as code.
- - Editing the docs locally and previewing the changes - - The documentations for all the TanStack projects are hosted on [tanstack.com](https://tanstack.com), which is a TanStack Start application (https://github.com/TanStack/tanstack.com). You need to run this app locally to preview your changes in the `TanStack/router` docs. + - Editing the docs locally and previewing the changes + - Documentation for all TanStack projects is hosted on [tanstack.com](https://tanstack.com), a TanStack Start application ([TanStack/tanstack.com](https://github.com/TanStack/tanstack.com)). To preview your `TanStack/router` docs changes locally, run the site alongside this repository. > [!NOTE] -> The website fetches the doc pages from GitHub in production, and searches for them at `../router/docs` in development. Your local clone of `TanStack/router` needs to be in the same directory as the local clone of `TanStack/tanstack.com`. +> In production the website fetches doc pages from GitHub. In development it looks for them at `../router/docs` relative to the `tanstack.com` repo. Ensure your local clones of `TanStack/router` and `TanStack/tanstack.com` are sibling directories.
34-51
: Unify clone approach and offer HTTPS/GH alternatives to avoid SSH friction.Earlier guidance uses
gh repo clone
, while this section switches togit clone
via SSH. Propose consistent options and keep shallow-clone note.-2. Enter that directory and clone the [`TanStack/router`](https://github.com/TanStack/router) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos. +2. Enter that directory and clone the [`TanStack/router`](https://github.com/TanStack/router) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos. ```sh cd tanstack -git clone git@github.com:TanStack/router.git -# We probably don't need all the branches and commit history -# from the `tanstack.com` repo, so let's just create a shallow -# clone of the latest version of the `main` branch. -# Read more about shallow clones here: -# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones -git clone git@github.com:TanStack/tanstack.com.git --depth=1 --single-branch --branch=main +# Option A (GitHub CLI) +gh repo clone TanStack/router +# Shallow clone the site repo to speed things up: +gh repo clone TanStack/tanstack.com -- --depth=1 --single-branch --branch=main + +# Option B (HTTPS) +# git clone https://github.com/TanStack/router.git +# git clone https://github.com/TanStack/tanstack.com.git --depth=1 --single-branch --branch=main + +# Learn more about shallow clones: +# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones
53-63
: Specify a language for the directory tree code fence and clarify the naming constraint.Adds a language identifier to satisfy MD040 and briefly explains why “router” must be the folder name.
> Your `tanstack` directory should look like this: > -> ``` +> ```text > tanstack/ > | -> +-- router/ (<-- this directory cannot be called anything else!) +> +-- router/ # must be named exactly "router" because tanstack.com resolves ../router/docs in dev > | > +-- tanstack.com/ > ```
64-71
: Use consistent install command and verify the dev server protocol (http vs https).
- Earlier you use
pnpm install
; here it’spnpm i
. Pick one for consistency.- The comment says “https://localhost:3000 by default,” but the example below uses http. Most dev servers default to http. Please confirm and align both lines.
cd tanstack.com -pnpm i -# The app will run on https://localhost:3000 by default +pnpm install +# The app will run on http://localhost:3000 by default pnpm devTo verify, run the dev server and confirm whether it serves on HTTP or HTTPS by default, then update both this comment and the preview URL below to match.
73-74
: Linkify the preview URL and consider a version placeholder.
- Replace the bare URL with a Markdown link to satisfy MD034.
- If versioning changes, “latest” may vary. Consider noting that you can swap “latest” with a specific version.
-4. Now you can visit http://localhost:3000/router/latest/docs/framework/react/overview in the browser and see the changes you make in `tanstack/router/docs` there. +4. Now visit [http://localhost:3000/router/latest/docs/framework/react/overview](http://localhost:3000/router/latest/docs/framework/react/overview) to preview changes made under `tanstack/router/docs`. + Tip: Replace `latest` with a specific version if needed.Please verify the exact path segment (e.g.,
framework/react/overview
) matches the current docs structure.
80-80
: Avoid bare URL for the screen capture and provide descriptive text.Converts the bare link to a labeled Markdown link to satisfy MD034 and improve accessibility.
-https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b +[Screen capture: local docs preview workflow](https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
CONTRIBUTING.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md
[grammar] ~29-~29: There might be a mistake here.
Context: ...n the TanStack/router
docs. > [!NOTE] > The website fetches the doc pages from...
(QB_NEW_EN)
[grammar] ~53-~53: There might be a mistake here.
Context: ...ngle-branch --branch=main ``` > [!NOTE] > Your tanstack
directory should look ...
(QB_NEW_EN)
[grammar] ~75-~75: There might be a mistake here.
Context: ...nstack/router/docsthere. > [!WARNING] > You will need to update the
docs/(rou...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md
27-27: Bare URL used
(MD034, no-bare-urls)
56-56: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
73-73: Bare URL used
(MD034, no-bare-urls)
80-80: Bare URL used
(MD034, no-bare-urls)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Preview
> [!WARNING] | ||
> You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page! | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Disambiguate the config file path for new pages.
“docs/(router or start)config.json
” is unclear within this repo. Please name the exact file(s) to edit, e.g., docs/router.config.json
. Use the script below to verify actual config files present.
-> You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page!
+> If you add a new documentation page, update the appropriate docs config file (e.g., `docs/router.config.json`) in `TanStack/router`.
🏁 Script executed:
#!/bin/bash
# Locate likely docs config files to mention precisely in CONTRIBUTING.md
fd -t f '.config.json' docs -0 | xargs -0 -I {} echo "Found: {}"
rg -nP --glob 'docs/**' '(config\.json|\.config\.json)' -S
Length of output: 3713
🏁 Script executed:
#!/bin/bash
# Locate all docs directories
find . -type d -iname docs
# List JSON files directly under any docs directory
find . -type f -path "*/docs/*.json"
# Find any files ending with "config.json" anywhere in the repo
find . -type f -iname '*config.json'
Length of output: 8612
Clarify docs config file path in CONTRIBUTING.md
The placeholder docs/(router or start)config.json
is ambiguous. Replace it with the exact paths to the two existing config files in the docs
directory:
docs/router/config.json
docs/start/config.json
Update CONTRIBUTING.md
at lines 75–77 accordingly:
> [!WARNING]
- You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page!
+ If you add a new documentation page, update the appropriate config file in the `docs` directory:
+ - `docs/router/config.json` (for Router docs)
+ - `docs/start/config.json` (for Start docs)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
> [!WARNING] | |
> You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page! | |
> [!WARNING] | |
> If you add a new documentation page, update the appropriate config file in the `docs` directory: | |
> - `docs/router/config.json` (for Router docs) | |
> - `docs/start/config.json` (for Start docs) |
🧰 Tools
🪛 LanguageTool
[grammar] ~75-~75: There might be a mistake here.
Context: ...nstack/router/docsthere. > [!WARNING] > You will need to update the
docs/(rou...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In CONTRIBUTING.md around lines 75 to 77, the docs config path text is
ambiguous; replace the placeholder `docs/(router or start)config.json` with the
two exact config file paths `docs/router/config.json` and
`docs/start/config.json` so contributors know the precise files to update; edit
the line to list both paths separated clearly (e.g., bullet or comma) and ensure
formatting matches surrounding Markdown.
Recently, while working on several docs update, I felt uneasy because I couldn’t find a good way to confirm that the changes were being applied correctly.
I found some relevant docs in the tanstack/query repository, and I thought it would be useful to add it here as well — so I went ahead and made that update.
Summary by CodeRabbit