-
-
Couldn't load subscription status.
- Fork 1.3k
LLM Script Fixes #5483
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
LLM Script Fixes #5483
Conversation
WalkthroughUpdated docs-generation script entries for React Router: added a new “installation” entry, included a “decisions-on-dx” doc under setup-and-architecture, and removed two migration-related docs from that group. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit b3036b8
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/nitro-v2-vite-plugin
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@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-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/llms-generate.mjs(1 hunks)
⏰ 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
🔇 Additional comments (1)
scripts/llms-generate.mjs (1)
40-45: Clarify installation rule scope
The new entry includes the entiredocs/router/framework/react/installationdirectory, re-including the migration guides (migrate-from-react-location.md,migrate-from-react-router.md). Confirm whether these belong under installation or should be excluded/moved.
| paths: [ | ||
| `${DOCS_DIR}/router/framework/react/overview.md`, | ||
| `${DOCS_DIR}/router/framework/react/quick-start.md`, | ||
| `${DOCS_DIR}/router/framework/react/decisions-on-dx.md`, |
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.
🧩 Analysis chain
Verify the file path exists.
The addition looks correct and follows the existing pattern. Please verify that the file exists at the specified path.
Run this script to verify the file exists:
🏁 Script executed:
#!/bin/bash
# Description: Verify the decisions-on-dx.md file exists
# Check if the file exists
if [ -f "../../docs/router/framework/react/decisions-on-dx.md" ]; then
echo "✓ File exists"
ls -lh "../../docs/router/framework/react/decisions-on-dx.md"
else
echo "✗ File not found at: ../../docs/router/framework/react/decisions-on-dx.md"
exit 1
fiLength of output: 73
Missing file: docs/router/framework/react/decisions-on-dx.md
scripts/llms-generate.mjs line 50 references ${DOCS_DIR}/router/framework/react/decisions-on-dx.md, but that file doesn’t exist. Add the file or correct the path accordingly.
🤖 Prompt for AI Agents
In scripts/llms-generate.mjs around line 50 the array includes
`${DOCS_DIR}/router/framework/react/decisions-on-dx.md` which points to a
missing file; either add the missing file at
docs/router/framework/react/decisions-on-dx.md with the intended content or
update the path in scripts/llms-generate.mjs to the correct existing file (or
remove the entry if not needed), and then run a quick existence check
(fs.existsSync or similar) to prevent future broken paths.
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.
docs/router/framework/react/decisions-on-dx.md exists
check again
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify if the decisions-on-dx.md file exists
if [ -f "docs/router/framework/react/decisions-on-dx.md" ]; then
echo "✓ File exists at: docs/router/framework/react/decisions-on-dx.md"
ls -lh "docs/router/framework/react/decisions-on-dx.md"
else
echo "✗ File not found at: docs/router/framework/react/decisions-on-dx.md"
# Let's also check if the docs directory structure exists
echo ""
echo "Checking directory structure:"
ls -la docs/router/framework/react/ 2>/dev/null || echo "Directory does not exist"
fi
Length of output: 159
@schiller-manuel You're absolutely right, I apologize for the incorrect assessment! The file does exist:
✓ File exists at: docs/router/framework/react/decisions-on-dx.md
-rw-r--r-- 1 jailuser jailuser 14K Oct 14 21:53 docs/router/framework/react/decisions-on-dx.md
The addition of ${DOCS_DIR}/router/framework/react/decisions-on-dx.md to the setup-and-architecture paths is correct. The file is present in the repository and the change looks good. Thank you for the correction!
🧬 Code Graph Analysis Results
scripts/llms-generate.mjs
-
summarize: extractFrontMatter(content)
- Description: Extracts front matter and body content from a Markdown file. Parameters: content (string) — the full Markdown content. Returns: an object { frontMatter: string, bodyContent: string } where frontMatter is the portion up to and including the closing ---, and bodyContent is the remainder trimmed.
- Error handling/edge cases: Assumes the front matter is delimited starting after the initial '---'. If the delimiter is missing, behavior is not explicit in the summary; the function relies on content containing front matter as implemented.
-
summarize: sanitizeMarkdown(markdownContent)
- Description: Escapes backticks and ${ for safe embedding in a template literal. Parameters: markdownContent (string). Returns: string with backticks and ${ escaped.
- Error handling/edge cases: Performs straightforward string replacements.
-
summarize: convertMarkdownToTypeScriptESM(markdownContent)
- Description: Wraps sanitized Markdown content as a default export in an ES Module. Parameters: markdownContent (string). Returns: string containing "export default
<sanitized-content>;". - Error handling/edge cases: Assumes input is the sanitized Markdown string.
- Description: Wraps sanitized Markdown content as a default export in an ES Module. Parameters: markdownContent (string). Returns: string containing "export default
-
summarize: mergeFiles(files, outputFile)
- Description: Reads multiple Markdown files, extracts front matter to obtain titles, concatenates sections with titles into a single markdown block, then converts to a TypeScript ES module string and writes to outputFile. Parameters: files (array of paths), outputFile (string). Returns: void; writes a .ts file exporting the merged content as a default export.
- Error handling/edge cases: Reads files synchronously; expects Markdown files with a title in their front matter. If a file cannot be read or lacks title, behavior depends on runtime (not explicitly described here).
-
summarize: build-time logic (high-level)
- Description: For a given package key (e.g., 'react-router'), collects relevant Markdown files from configured paths and globs, merges them into a single rule file under llms/rules, and builds an index.ts that exports a list of rules for the package. It also writes a tsconfig.json for the generated TypeScript project, configured for ESNext output to dist/llms. Parameters: none (driven by package configuration and CLI argument). Returns: void.
- Error handling/edge cases: Creates directories if missing; validates package name against the predefined packages map. Exits with error messages if package not found or no package name provided.
-
note on usage context
- The script includes a package entry that references decisions-on-dx.md among other React router docs. This confirms the script’s behavior of including specific docs (e.g., decisions-on-dx.md) when generating rules for the package, aligning with the user’s note that docs/router/framework/react/decisions-on-dx.md exists.
🧠 Learnings used
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories
Summary by CodeRabbit