docs: fix sidebar 404s and validate config.json nav targets - #2278
Conversation
…ages Six sidebar entries in docs/config.json referenced reference pages that do not exist, so each rendered as a 404. FieldMeta, FieldState and FieldInfo lost their generated pages in 6a73479 without config.json being updated to match. useTransform is not exported from @tanstack/react-form, and vue/solid never had UseField/CreateField types. Repoint the FieldMeta entry to AnyFieldMeta, the surviving public field-metadata type, and drop the rest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9
verify-links only extracted links written inside .md files, so sidebar entries in docs/config.json were never checked and could point at pages that no longer exist without failing CI. Walk every `to` in the nav config and resolve it the same way markdown links are resolved, including the framework examples directory mapping. Failures report the nav breadcrumb so the offending entry is easy to locate. The shared resolution logic is extracted into resolveDocTarget so the two checks cannot drift apart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe documentation link verifier now checks Markdown links and nested navigation targets from ChangesDocumentation Link Verification
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/verify-links.ts`:
- Line 187: Update the verifyLinks rejection handler so failures from reading or
parsing docs/config.json log the error and set a non-zero process exit status.
Preserve the existing verifyLinks() invocation while ensuring test:docs cannot
succeed when the check rejects.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 28af4de7-5770-478e-94a9-0470f66145db
📒 Files selected for processing (2)
docs/config.jsonscripts/verify-links.ts
The rejection handler only logged, so Node still exited 0. Reading or parsing docs/config.json can now throw, which meant test:docs could pass while the navigation check never ran. Confirmed by pointing the script at malformed and missing config files: both exited 0 before this change and exit 1 after. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9
|
View your CI Pipeline Execution ↗ for commit ca14dee
☁️ Nx Cloud last updated this comment at |
* docs: use the dynamic README header endpoint (#2266) * docs: fix sidebar 404s and validate config.json nav targets (#2278) * docs(config): remove nav entries pointing at non-existent reference pages Six sidebar entries in docs/config.json referenced reference pages that do not exist, so each rendered as a 404. FieldMeta, FieldState and FieldInfo lost their generated pages in 6a73479 without config.json being updated to match. useTransform is not exported from @tanstack/react-form, and vue/solid never had UseField/CreateField types. Repoint the FieldMeta entry to AnyFieldMeta, the surviving public field-metadata type, and drop the rest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9 * chore(scripts): verify docs/config.json nav targets in verify-links verify-links only extracted links written inside .md files, so sidebar entries in docs/config.json were never checked and could point at pages that no longer exist without failing CI. Walk every `to` in the nav config and resolve it the same way markdown links are resolved, including the framework examples directory mapping. Failures report the nav breadcrumb so the offending entry is easy to locate. The shared resolution logic is extracted into resolveDocTarget so the two checks cannot drift apart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9 * fix(scripts): fail verify-links when the check itself throws The rejection handler only logged, so Node still exited 0. Reading or parsing docs/config.json can now throw, which meant test:docs could pass while the navigation check never ran. Confirmed by pointing the script at malformed and missing config files: both exited 0 before this change and exit 1 after. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9 --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> # Conflicts: # docs/config.json --------- Co-authored-by: Irfan fandi <irfanfandi38@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
docs/config.jsoncontains sidebar entries pointing at reference pages that don't exist on disk, so those nav links render as 404s. This removes the dead entries and teachesverify-links.tsto catch them, so they can't come back.Nothing in CI validated
config.jsonbefore:scripts/verify-links.tsonly extracts links written inside.mdfiles, so entries in the nav config were never checked. That's how these drifted out of sync unnoticed.The 6 dead entries
Found by the new check, verified against the source and the generated docs:
toAPI Reference > Types / FieldInforeference/type-aliases/FieldInfoFieldInfois aninterface(packages/form-core/src/types.ts:1253), so typedoc emits notype-aliases/page — and nointerfaces/FieldInfo.mdis generated eitherAPI Reference > Types / FieldMetareference/type-aliases/FieldMetaAPI Reference > Types / FieldStatereference/type-aliases/FieldStateAPI Reference > react > Functions / useTransformframework/react/reference/functions/useTransform@tanstack/react-form; it lives inreact-form-{nextjs,remix,start}, none of which are registered inscripts/generate-docs.tsAPI Reference > vue > Types / UseFieldframework/vue/reference/type-aliases/UseFieldvue-formexportsUseFieldOptions/UseFieldOptionsBound, noUseFieldAPI Reference > solid > Types / CreateFieldframework/solid/reference/type-aliases/CreateFieldsolid-formexportsCreateFieldOptions/CreateFieldOptionsBound, noCreateFieldFieldMeta.md,FieldState.mdandFieldInfo.mdwere dropped by the docs generator in 6a73479 (ci: apply automated fixes and generate docs), butconfig.jsonwas never updated to match.Changes
Removed the 5 entries with no valid target.
Repointed
Types / FieldMeta→Types / AnyFieldMeta(packages/form-core/src/types.ts:834), the surviving public field-metadata type. Its page already exists but wasn't reachable from the sidebar, so this keeps field metadata covered rather than just deleting the entry.verify-links.tsnow walks everytoinconfig.json(childrenandframeworks, recursively) and resolves it the same way markdown links are resolved — including theframework/{fw}/examples/{name}→examples/{fw}/{name}directory mapping. Failures report the nav breadcrumb so the offending entry is easy to find:The example-path and
.mdresolution logic is factored into a sharedresolveDocTarget()used by both checks, so the two paths can't drift apart.Relationship to #2226 and other open PRs
Worth being explicit, since this looks adjacent to work already in flight:
reference/index— anddocs/reference/index.mddoes exist on disk, so the 404 there is a site-routing problem, not a missing page. The new check passes on those entries both before and after. docs: fix API tab 404 by removing broken reference/index links #2253 handles that one.useTransformnav entry as part of splitting the SSR guide. If docs: general docs updates #2118 lands first this hunk conflicts trivially; happy to drop it here if that's preferred.The remaining 5 entries aren't covered by any open PR or issue that I could find.
Not included
The check only validates that nav entries resolve. It deliberately does not flag the reverse — generated pages that exist but aren't in the nav (currently ~150, including
revalidateLogic, which every framework'sdynamic-validationguide references). That's a larger judgment call about what belongs in the sidebar, and better as its own PR.Verification
Confirmed the check actually fails rather than silently passing: injecting a bogus
type-aliases/entry and a bogusexamples/entry makes it report both and exit1; removing them returns exit0. Before this change, the same bogus entries passed CI.✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit
Documentation
Chores