Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ stable releases published under `latest`.

## Unreleased

### Added

- A `react-router-framework` adapter (ruleset `2026.07.38`): 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. Declarative and data-mode routers keep using the
Vite or generic adapter, since `react-router` alone is a plain SPA
router. Document rules read `app/root.tsx`; metadata comes from the
`meta` export; not-found coverage accepts an `ErrorBoundary` handling
`isRouteErrorResponse` or a splat route; `error-boundary-present`
understands the `ErrorBoundary` export convention; loader-backed route
modules need `HydrateFallback`, `useNavigation` pending UI, or a
Suspense fallback. The render graph seeds one surface per route module
— read from literal `routes.ts` entries when possible, otherwise from
directory discovery with a boundary reason — and treats `ErrorBoundary`
and `HydrateFallback` exports as rendered surfaces in their own right.

### Changed

- The JSON report schema version is now 8: `framework.adapter` accepts
`react-router-framework` and `versions` includes `reactRouter`. The
GitHub Action (which reads `score` and `grade`) is unaffected.

## 0.4.0 - 2026-07-25

### Added
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ Low-confidence checks stay visible as score-neutral advisories instead of
pretending static analysis can prove rendered behavior.

Rules only run where they apply. Shadscan supports Next.js App Router, Pages
Router, hybrid Next.js projects, TanStack Start, Laravel with Inertia and
React, Astro with React islands, Vite React, and generic React applications.
Router, hybrid Next.js projects, React Router framework mode, TanStack Start,
Laravel with Inertia and React, Astro with React islands, Vite React, and
generic React applications.

## Web Scanner And Hosted API

Expand Down
1 change: 1 addition & 0 deletions app/scan/scan-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const FRAMEWORK_LABELS = {
"next-app-router": "Next.js App Router",
"next-hybrid-router": "Next.js App + Pages Router",
"next-pages-router": "Next.js Pages Router",
"react-router-framework": "React Router",
"tanstack-start": "TanStack Start",
"vite-react": "Vite React",
} as const satisfies Record<
Expand Down
3 changes: 2 additions & 1 deletion components/supported-frameworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ function SupportedFrameworks({ className }: SupportedFrameworksProps) {
<TooltipTrigger className="flex cursor-default items-center rounded-none text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-4">
<svg
aria-hidden="true"
className="h-5 w-auto"
className="w-auto"
fill="currentColor"
style={{ height: mark.opticalHeight ?? 20 }}
viewBox={mark.viewBox}
>
<path d={mark.d} />
Expand Down
10 changes: 5 additions & 5 deletions docs/rules.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Generated by packages/cli/scripts/generate-rule-catalog.ts. Do not edit by hand. -->
# shadscan Rule Catalog

Bundled ruleset `2026.07.37` contains 59 deterministic static-analysis rules across 6 categories.
Bundled ruleset `2026.07.38` contains 59 deterministic static-analysis rules across 6 categories.

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.

Expand All @@ -15,11 +15,11 @@ Rules only run for matching adapters. A rule can also return `not-applicable` wh
| `theme-provider-configured` | Checks for a mounted theme provider or theme class management. | high | 5 raw points when applicable | `core` |
| `metadata-configured` | Checks for framework-appropriate metadata or head basics. | high | 3 raw points when applicable | `core` |
| `favicon-present` | Checks for a favicon or app icon. | high | 2 raw points when applicable | `core` |
| `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` |
| `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` |
| `error-boundary-present` | Checks for an app-level error boundary. | high | 3 raw points when applicable | `core` |
| `components-aliases-resolve` | Checks whether shadcn aliases can be resolved through TypeScript or JavaScript path mappings. | high | 2 raw points when applicable | `core` |
| `theme-provider-mounted-in-shell` | Checks whether a theme provider is rendered by the application shell. | high | 3 raw points when applicable | `core` |
| `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` |
| `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` |

## Interaction (8)

Expand All @@ -39,7 +39,7 @@ Rules only run for matching adapters. A rule can also return `not-applicable` wh
| Rule | What it checks | Confidence | Score behavior | Adapters |
| --- | --- | --- | --- | --- |
| `toast-provider-present` | Checks for a mounted toast provider or toaster. | high | 3 raw points when applicable | `core` |
| `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` |
| `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` |
| `suspense-fallback-useful` | Checks every Suspense boundary for a non-empty fallback. | high | 3 raw points when applicable | `core` |
| `empty-state-present` | Checks recognizable data-backed collections for an explicit empty state. | medium | 4 raw points when applicable | `core` |
| `error-state-retry-present` | Checks detected error UI for a wired retry control. | high | 4 raw points when applicable | `core` |
Expand Down Expand Up @@ -93,5 +93,5 @@ Rules only run for matching adapters. A rule can also return `not-applicable` wh
| `button-icons-have-data-icon` | Checks inline icons in shadcn Buttons for position-correct data-icon attributes. | high | 2 raw points when applicable | `core` |
| `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` |
| `responsive-shell-present` | Looks for responsive breakpoint behavior in the application's top-level shell. | low | Advisory | `core` |
| `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` |
| `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` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Adapter list is out of order for this rule only.

react-router-framework is inserted between laravel-inertia-react and next-app-router, while every other updated row (Lines 18, 22, 42) stays alphabetical. Since this catalog is generated, the source array in packages/cli/src/rules/public-app-seo-files-present.ts likely needs the entry moved and the docs regenerated.

🤖 Prompt for 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.

In `@docs/rules.md` at line 96, Update the adapter ordering for the
public-app-seo-files-present rule in its source array so entries remain
alphabetical, then regenerate docs/rules.md to reflect the corrected order. Use
the rule definition in public-app-seo-files-present.ts as the source of truth
and preserve all listed adapters.

| `mobile-overflow-absent` | Marks uncontained fixed or viewport widths in layout-bearing contexts for rendered horizontal-overflow verification. | low | Advisory | `core` |
14 changes: 14 additions & 0 deletions lib/framework-marks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
interface FrameworkMark {
d: string;
label: string;
/**
* Rendered height in pixels. Square marks use the 20px default; wide marks
* take a smaller height so they carry comparable optical weight instead of
* dominating the row.
*/
opticalHeight?: number;
viewBox: string;
}

Expand Down Expand Up @@ -41,12 +47,20 @@ const ASTRO_MARK: FrameworkMark = {
viewBox: "2.4 0 19.21 24",
};

const REACT_ROUTER_MARK: FrameworkMark = {
d: "M12.118 5.466a2.306 2.306 0 00-.623.08c-.278.067-.702.332-.953.583-.41.423-.49.609-.662 1.469-.08.423.41 1.43.847 1.734.45.317 1.085.502 2.065.608 1.429.16 1.84.636 1.84 2.197 0 1.377-.385 1.747-1.96 1.906-1.707.172-2.58.834-2.765 2.117-.106.781.41 1.76 1.125 2.091 1.627.768 3.15-.198 3.467-2.196.211-1.284.622-1.642 1.998-1.747 1.588-.133 2.409-.675 2.713-1.787.278-1.02-.304-2.157-1.297-2.554-.264-.106-.873-.238-1.35-.291-1.495-.16-1.879-.424-2.038-1.39-.225-1.337-.317-1.562-.794-2.09a2.174 2.174 0 00-1.613-.73zm-4.785 4.36a2.145 2.145 0 00-.497.048c-1.469.318-2.17 2.051-1.35 3.295 1.178 1.774 3.944.953 3.97-1.177.012-1.193-.98-2.143-2.123-2.166zM2.089 14.19a2.22 2.22 0 00-.427.052c-2.158.476-2.237 3.626-.106 4.182.53.145.582.145 1.111.013 1.191-.318 1.866-1.456 1.549-2.607-.278-1.02-1.144-1.664-2.127-1.64zm19.824.008c-.233.002-.477.058-.784.162-1.39.477-1.866 2.092-.98 3.336.557.794 1.96 1.058 2.82.516 1.416-.874 1.363-3.057-.093-3.746-.38-.186-.663-.271-.963-.268z",
label: "React Router",
opticalHeight: 15,
viewBox: "0 5.47 24 13.07",
};

const FRAMEWORK_MARKS = [
NEXT_MARK,
VITE_MARK,
TANSTACK_MARK,
LARAVEL_MARK,
ASTRO_MARK,
REACT_ROUTER_MARK,
] as const;

export type { FrameworkMark };
Expand Down
8 changes: 6 additions & 2 deletions lib/generated/rule-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@
"next-app-router",
"next-hybrid-router",
"next-pages-router",
"react-router-framework",
"tanstack-start"
],
"category": "foundation",
"confidence": "high",
"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.",
"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.",
"id": "not-found-route-present",
"maxScore": 3,
"severity": "warning",
Expand Down Expand Up @@ -155,6 +156,7 @@
"adapters": [
"next-app-router",
"next-hybrid-router",
"react-router-framework",
"tanstack-start"
],
"category": "foundation",
Expand Down Expand Up @@ -278,6 +280,7 @@
"laravel-inertia-react",
"next-app-router",
"next-hybrid-router",
"react-router-framework",
"tanstack-start"
],
"category": "states",
Expand Down Expand Up @@ -630,6 +633,7 @@
"adapters": [
"astro-react",
"laravel-inertia-react",
"react-router-framework",
"next-app-router",
"next-hybrid-router",
"next-pages-router",
Expand Down Expand Up @@ -753,5 +757,5 @@
"title": "dialogs have accessible names"
}
],
"rulesetVersion": "2026.07.37"
"rulesetVersion": "2026.07.38"
}
2 changes: 1 addition & 1 deletion lib/shadscan-api/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const JSON_MEDIA_TYPE = "application/json";

const PUBLIC_CONTRACT_VERSIONS = {
prompt: 5,
report: 7,
report: 8,
scan: HOSTED_SCAN_SCHEMA_VERSION,
} as const;

Expand Down
5 changes: 3 additions & 2 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ checks stay visible as score-neutral advisories instead of pretending static
analysis can prove rendered behavior.

Rules only run where they apply. Shadscan supports Next.js App Router, Pages
Router, hybrid Next.js projects, TanStack Start, Laravel with Inertia and
React, Astro with React islands, Vite React, and generic React applications.
Router, hybrid Next.js projects, React Router framework mode, TanStack Start,
Laravel with Inertia and React, Astro with React islands, Vite React, and
generic React applications.

## Privacy And Exit Status

Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const AUDIT_CATEGORIES = [
"production-polish",
] as const;

const AUDIT_REPORT_SCHEMA_VERSION = 7 as const;
const AUDIT_REPORT_SCHEMA_VERSION = 8 as const;
const ENGINE_VERSION = packageJson.version;
const CUSTOM_RULESET_VERSION = "custom";
const WINDOWS_ABSOLUTE_PATH_PATTERN = /^[a-zA-Z]:[\\/]/;
Expand Down Expand Up @@ -329,6 +329,7 @@ const AuditReportSchema = z.object({
"next-app-router",
"next-hybrid-router",
"next-pages-router",
"react-router-framework",
"tanstack-start",
"vite-react",
]),
Expand Down Expand Up @@ -360,6 +361,7 @@ const AuditReportSchema = z.object({
laravel: z.string().nullable(),
next: z.string().nullable(),
react: z.string().nullable(),
reactRouter: z.string().nullable(),
tanstackStart: z.string().nullable(),
vite: z.string().nullable(),
}),
Expand Down
Loading