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
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,49 @@ stable releases published under `latest`.

## Unreleased

### Added

- Monorepo support. Running shadscan at a workspace root now audits every
React application it finds and pools their findings into one score,
rather than failing with "the nearest package does not declare React".
Workspaces are discovered by walking the tree for `package.json` files,
so pnpm, npm, yarn, bun, Turborepo, Nx and Lerna all work without
configuration and without adding a YAML parser to the CLI.
- Each package is classified as an application or a library, and only
applications feed the score. A React library has no document shell, so
it fails rules about page titles and favicons it should never satisfy;
pooling those would penalise a repository for owning a design system.
Libraries are still scanned and reported with their own score. The
deciding signal is an application entry point rather than a
`main`/`exports` field, because internal workspace packages are
routinely consumed from source through a path alias and declare no
entry at all.
- The report lists every package with its own score, adapter and
classification reason, plus any packages that were skipped and why, so
the pooled number is explicable rather than mysterious.
- `--list-projects` prints what discovery found without scanning, and
`--project <path>` scans a single package.
- A workspace containing one application takes the single-package path
unchanged, so the common "app at the root plus shared packages" layout
keeps its existing score.

### Changed

- The JSON report schema version is now 9. Findings and agent actionables
gain `packageDir`, agent work items gain `packageDir`, the report gains
`workspace` (null for single-package scans), and `framework.adapter`
accepts `mixed` when pooled applications use different adapters. The
GitHub Action (which reads `score` and `grade`) is unaffected.

### Fixed

- Agent work items are now grouped per package. Grouping matched one
actionable per rule id, so a pooled report silently dropped grouped
items for every package after the first and emitted the remainder as
duplicate entries with no way to tell which package they referred to.
- The scan result page keys findings by package and rule rather than rule
alone, which in a pooled report collapsed rows and could resolve a work
item to another package's finding.
- `no-nested-interactive-controls` no longer reports a false positive for
Base UI's `render` composition (ruleset `2026.07.41`). `<Button render={<Link
/>}>` passes the link through the owner's attributes, and the owner renders
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ pnpm dlx @shadscan/cli@0.6.1 --fail-under 80 --no-interactive --no-roast

# Audit one category while investigating a focused area
pnpm dlx @shadscan/cli --category accessibility

# See which workspace packages shadscan found, without scanning
pnpm dlx @shadscan/cli --list-projects

# Scan one package of a monorepo instead of pooling every application
pnpm dlx @shadscan/cli --project apps/web
```

Use `--format human`, `--format json`, or `--format prompt` when output selection
Expand Down Expand Up @@ -190,6 +196,27 @@ 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.

### Monorepos

Run shadscan at a workspace root and it audits every React application it
finds, pooling their findings into one score. The report lists each package
with its own score so the pooled number is explicable, and `--list-projects`
prints that list without scanning.

Packages are classified as **applications** or **libraries**. A library — a
React package with no application entry point — is scanned and reported, but
its findings do not count toward the score: it has no document shell, so it
would fail rules about page titles and favicons that it should never satisfy,
and pooling those would punish you for owning a design system. Packages that
shadscan cannot audit at all, such as one that does not declare React, are
listed as skipped with the reason.

Workspaces are found by walking the tree for `package.json` files, so pnpm,
npm, yarn, bun, Turborepo, Nx and Lerna all work without configuration. A
workspace containing a single application is scanned exactly as before, so the
common "app at the root plus shared packages" layout keeps its existing score.
Use `--project <path>` to scan one package on its own.

## Web Scanner And Hosted API

The [web scanner](https://www.shadscan.com/scan) audits a public GitHub
Expand Down
22 changes: 18 additions & 4 deletions app/scan/result-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function WorkItemArticle({
<h4>Related findings</h4>
<ul>
{workItem.findingIds.map((findingId) => (
<li key={findingId}>
<li key={getFindingKey(workItem.packageDir, findingId)}>
<code>{findingId}</code>
</li>
))}
Expand Down Expand Up @@ -299,7 +299,10 @@ function ActionablesReport({
}

const findingsById = new Map(
findings.map((finding) => [finding.id, finding])
findings.map((finding) => [
getFindingKey(finding.packageDir, finding.id),
finding,
])
);

return (
Expand All @@ -309,7 +312,9 @@ function ActionablesReport({
{index > 0 ? <Separator className="not-typeset my-8" /> : null}
<WorkItemArticle
findings={workItem.findingIds.flatMap((findingId) => {
const finding = findingsById.get(findingId);
const finding = findingsById.get(
getFindingKey(workItem.packageDir, findingId)
);
return finding ? [finding] : [];
})}
workItem={workItem}
Expand Down Expand Up @@ -369,11 +374,20 @@ function FindingArticle({ finding }: { finding: Finding }) {
);
}

/**
* A pooled workspace report contains the same rule once per package, so a
* bare rule id is no longer unique — it collapses React rows and resolves a
* work item to another package's finding.
*/
function getFindingKey(packageDir: string | null, findingId: string): string {
return `${packageDir ?? "."}:${findingId}`;
}

function FindingsReport({ findings }: FindingsReportProps) {
return (
<div className="typeset typeset-report">
{findings.map((finding, index) => (
<Fragment key={finding.id}>
<Fragment key={getFindingKey(finding.packageDir, finding.id)}>
{index > 0 ? <Separator className="not-typeset my-8" /> : null}
<FindingArticle finding={finding} />
</Fragment>
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 @@ -20,6 +20,7 @@ const FRAMEWORK_LABELS = {
"astro-react": "Astro",
"generic-react": "React",
"laravel-inertia-react": "Laravel + Inertia",
mixed: "Multiple frameworks",
"next-app-router": "Next.js App Router",
"next-hybrid-router": "Next.js App + Pages Router",
"next-pages-router": "Next.js Pages Router",
Expand Down
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: 8,
report: 9,
scan: HOSTED_SCAN_SCHEMA_VERSION,
} as const;

Expand Down
Loading