You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 97a874c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(cli): add a React Router framework mode adapter (#15)
Implements plan 012. React Router v7 applications running in framework
mode — one of the official shadcn templates — are detected from the
react-router dependency plus a framework marker (@react-router/dev or
react-router.config.*) and an app/root module.
That three-part requirement is deliberate: react-router appears in a
large number of ordinary Vite SPAs, so keying on the package alone would
reclassify many existing users. Declarative and data-mode routers keep
resolving to the vite or generic adapter, with tests pinning both.
Framework mode also keeps its code in app/, the same directory name
Next's App Router uses. Rather than overload paths.appDir, this adds
separate reactRouterAppDir and reactRouterRoot paths populated only when
the adapter wins detection, with regression tests proving a Next project
sharing the directory name still resolves next-app-router and that
error-state-retry-present — the one core rule reading appDir unguarded —
stays not-applicable on React Router.
Rules read app/root.tsx as the document shell (language, theme provider,
toast mount, and hydration safety, which applies here because framework
mode is SSR by default), metadata from the route meta export, not-found
coverage from an ErrorBoundary handling isRouteErrorResponse or a splat
route, and pending coverage for loader-backed route modules from
HydrateFallback, useNavigation, or Suspense. The render graph seeds one
surface per route module — from literal routes.ts entries when readable,
otherwise directory discovery with a boundary reason — and treats
ErrorBoundary and HydrateFallback exports as rendered surfaces.
Burn-in against the official react-router-templates default, an auth
app on 7.7, and a declarative SPA as a negative control found no false
positives; every finding traced to real source and the SPA correctly
stayed on vite-react.
The hero row gains a sixth mark. React Router's glyph is wide and short,
so FrameworkMark takes an optional opticalHeight and wide marks now
balance by area instead of rendering half-height.
Report schema version is now 8 (adapter enum plus versions.reactRouter)
with the hosted API contract pin updated in lockstep; ruleset version is
2026.07.38.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Raw rule points are normalized inside each weighted category to produce the 100-point score. Low-confidence failures and zero-point rules are advisories: they appear in the report but do not lower the score.
7
7
@@ -15,11 +15,11 @@ Rules only run for matching adapters. A rule can also return `not-applicable` wh
15
15
|`theme-provider-configured`| Checks for a mounted theme provider or theme class management. | high | 5 raw points when applicable |`core`|
16
16
|`metadata-configured`| Checks for framework-appropriate metadata or head basics. | high | 3 raw points when applicable |`core`|
17
17
|`favicon-present`| Checks for a favicon or app icon. | high | 2 raw points when applicable |`core`|
18
-
|`not-found-route-present`| Checks for a framework-appropriate not-found surface: a Next boundary or 404 page, a TanStack Start not-found component, a Laravel error page, or an Astro 404 page. | high | 3 raw points when applicable |`astro-react`<br>`laravel-inertia-react`<br>`next-app-router`<br>`next-hybrid-router`<br>`next-pages-router`<br>`tanstack-start`|
18
+
|`not-found-route-present`| Checks for a framework-appropriate not-found surface: a Next boundary or 404 page, a TanStack Start not-found component, a Laravel error page, an Astro 404 page, or React Router route-error handling. | high | 3 raw points when applicable |`astro-react`<br>`laravel-inertia-react`<br>`next-app-router`<br>`next-hybrid-router`<br>`next-pages-router`<br>`react-router-framework`<br>`tanstack-start`|
19
19
|`error-boundary-present`| Checks for an app-level error boundary. | high | 3 raw points when applicable |`core`|
20
20
|`components-aliases-resolve`| Checks whether shadcn aliases can be resolved through TypeScript or JavaScript path mappings. | high | 2 raw points when applicable |`core`|
21
21
|`theme-provider-mounted-in-shell`| Checks whether a theme provider is rendered by the application shell. | high | 3 raw points when applicable |`core`|
22
-
|`theme-hydration-safe`| Checks next-themes hydration safeguards in a Next App Router or TanStack Start document shell. | high | 2 raw points when applicable |`next-app-router`<br>`next-hybrid-router`<br>`tanstack-start`|
22
+
|`theme-hydration-safe`| Checks next-themes hydration safeguards in a Next App Router or TanStack Start document shell. | high | 2 raw points when applicable |`next-app-router`<br>`next-hybrid-router`<br>`react-router-framework`<br>`tanstack-start`|
23
23
24
24
## Interaction (8)
25
25
@@ -39,7 +39,7 @@ Rules only run for matching adapters. A rule can also return `not-applicable` wh
39
39
| Rule | What it checks | Confidence | Score behavior | Adapters |
40
40
| --- | --- | --- | --- | --- |
41
41
|`toast-provider-present`| Checks for a mounted toast provider or toaster. | high | 3 raw points when applicable |`core`|
42
-
|`route-loading-boundary-present`| Checks runtime-dynamic Next pages, loader-backed TanStack Start routes, and Inertia navigation for loading coverage. | medium | 4 raw points when applicable |`laravel-inertia-react`<br>`next-app-router`<br>`next-hybrid-router`<br>`tanstack-start`|
42
+
|`route-loading-boundary-present`| Checks runtime-dynamic Next pages, loader-backed TanStack Start routes, and Inertia navigation for loading coverage. | medium | 4 raw points when applicable |`laravel-inertia-react`<br>`next-app-router`<br>`next-hybrid-router`<br>`react-router-framework`<br>`tanstack-start`|
43
43
|`suspense-fallback-useful`| Checks every Suspense boundary for a non-empty fallback. | high | 3 raw points when applicable |`core`|
44
44
|`empty-state-present`| Checks recognizable data-backed collections for an explicit empty state. | medium | 4 raw points when applicable |`core`|
45
45
|`error-state-retry-present`| Checks detected error UI for a wired retry control. | high | 4 raw points when applicable |`core`|
@@ -93,5 +93,5 @@ Rules only run for matching adapters. A rule can also return `not-applicable` wh
93
93
|`button-icons-have-data-icon`| Checks inline icons in shadcn Buttons for position-correct data-icon attributes. | high | 2 raw points when applicable |`core`|
94
94
|`alert-anatomy`| Checks that Alert is composed from its anatomy: at most one icon, a required AlertTitle, and parts exported by the project's alert module. | medium | Advisory |`core`|
95
95
|`responsive-shell-present`| Looks for responsive breakpoint behavior in the application's top-level shell. | low | Advisory |`core`|
96
-
|`public-app-seo-files-present`| Looks for robots and sitemap files in web apps that appear publicly indexable. | low | Advisory |`astro-react`<br>`laravel-inertia-react`<br>`next-app-router`<br>`next-hybrid-router`<br>`next-pages-router`<br>`tanstack-start`<br>`vite-react`|
96
+
|`public-app-seo-files-present`| Looks for robots and sitemap files in web apps that appear publicly indexable. | low | Advisory |`astro-react`<br>`laravel-inertia-react`<br>`react-router-framework`<br>`next-app-router`<br>`next-hybrid-router`<br>`next-pages-router`<br>`tanstack-start`<br>`vite-react`|
97
97
|`mobile-overflow-absent`| Marks uncontained fixed or viewport widths in layout-bearing contexts for rendered horizontal-overflow verification. | low | Advisory |`core`|
Copy file name to clipboardExpand all lines: lib/generated/rule-catalog.json
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -93,11 +93,12 @@
93
93
"next-app-router",
94
94
"next-hybrid-router",
95
95
"next-pages-router",
96
+
"react-router-framework",
96
97
"tanstack-start"
97
98
],
98
99
"category": "foundation",
99
100
"confidence": "high",
100
-
"description": "Checks for a framework-appropriate not-found surface: a Next boundary or 404 page, a TanStack Start not-found component, a Laravel error page, or an Astro 404 page.",
101
+
"description": "Checks for a framework-appropriate not-found surface: a Next boundary or 404 page, a TanStack Start not-found component, a Laravel error page, an Astro 404 page, or React Router route-error handling.",
0 commit comments