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
54 changes: 54 additions & 0 deletions app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ type Summary = {
}>;
totals: { last_week: number; last_month: number };
};
marketplace?: {
extensions: Array<{
extension: string;
installs: number;
downloads: number;
rating: number;
rating_count: number;
}>;
totals: { installs: number; downloads: number };
};
generated_at: string;
};

Expand All @@ -71,7 +81,12 @@ export default function AdminPage() {
const [loading, setLoading] = useState(false);

useEffect(() => {
// Read the saved admin token AFTER mount (not via a lazy useState
// initializer) so the server and initial client render match — reading
// localStorage during render would cause a hydration mismatch on the
// controlled password input below.
const saved = window.localStorage.getItem(TOKEN_KEY);
// eslint-disable-next-line react-hooks/set-state-in-effect
if (saved) setToken(saved);
}, []);

Expand Down Expand Up @@ -166,6 +181,45 @@ export default function AdminPage() {
</table>
</section>
)}
{data.marketplace && data.marketplace.extensions.length > 0 && (
<section>
<h2 className="text-lg font-semibold">VS Code Marketplace</h2>
<div className="mt-3 grid grid-cols-2 gap-3 sm:grid-cols-2">
<Stat
label="Total installs"
value={fmt(data.marketplace.totals.installs)}
/>
<Stat
label="Total downloads"
value={fmt(data.marketplace.totals.downloads)}
/>
</div>
<table className="mt-4 w-full text-sm">
<thead className="text-left text-xs uppercase text-slate-500">
<tr>
<th className="py-2">Extension</th>
<th className="text-right">Installs</th>
<th className="text-right">Downloads</th>
<th className="text-right">Rating</th>
</tr>
</thead>
<tbody>
{data.marketplace.extensions.map((e) => (
<tr key={e.extension} className="border-t border-slate-100">
<td className="py-2 font-mono text-xs">{e.extension}</td>
<td className="text-right">{fmt(e.installs)}</td>
<td className="text-right">{fmt(e.downloads)}</td>
<td className="text-right">
{e.rating_count > 0
? `${e.rating.toFixed(1)}★ (${e.rating_count})`
: "—"}
</td>
</tr>
))}
</tbody>
</table>
</section>
)}
<section>
<h2 className="text-lg font-semibold">Revenue (Polar)</h2>
{polarError && (
Expand Down
58 changes: 58 additions & 0 deletions app/api/admin/summary/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,68 @@ export async function GET(req: Request) {
{ last_week: 0, last_month: 0 }
);

// VS Code Marketplace — the one distribution channel npm can't see. Public
// gallery API; resilient (any failure yields zeros, never breaks the page).
const VSCODE_EXTENSIONS = ["asafamos.axle-a11y"];
const marketplaceData = await Promise.all(
VSCODE_EXTENSIONS.map(async (ext) => {
try {
const res = await fetch(
"https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery",
{
method: "POST",
cache: "no-store",
headers: {
"Content-Type": "application/json",
Accept: "application/json;api-version=3.0-preview.1",
},
body: JSON.stringify({
filters: [{ criteria: [{ filterType: 7, value: ext }] }],
flags: 914,
}),
}
);
const json = (await res.json()) as {
results?: Array<{
extensions?: Array<{
statistics?: Array<{ statisticName: string; value: number }>;
}>;
}>;
};
const stats = json?.results?.[0]?.extensions?.[0]?.statistics ?? [];
const stat = (name: string) =>
Number(stats.find((s) => s.statisticName === name)?.value ?? 0);
return {
extension: ext,
installs: stat("install"),
downloads: stat("downloadCount"),
rating: stat("averagerating"),
rating_count: stat("ratingcount"),
};
} catch {
return {
extension: ext,
installs: 0,
downloads: 0,
rating: 0,
rating_count: 0,
};
}
})
);
const marketplaceTotals = marketplaceData.reduce(
(acc, row) => ({
installs: acc.installs + row.installs,
downloads: acc.downloads + row.downloads,
}),
{ installs: 0, downloads: 0 }
);

return NextResponse.json({
stats: kvData,
polar: polarData,
npm: { packages: npmData, totals: npmTotals },
marketplace: { extensions: marketplaceData, totals: marketplaceTotals },
generated_at: new Date().toISOString(),
});
}
4 changes: 2 additions & 2 deletions packages/axle-raycast/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# axle — Accessibility Scanner Changelog
# AsafAmos — Accessibility Scanner Changelog

## [Initial Release] - 2026-04-20

- Scan URL for Accessibility: run axe-core 4.11 against any public URL and render violations in a Raycast list grouped by severity, with links to axe-core docs.
- Open Hebrew Accessibility Statement Generator: opens the free axle generator aligned with Israeli תקנה 35.
- Open Hebrew Accessibility Statement Generator: opens the free accessibility statement generator aligned with Israeli תקנה 35.
6 changes: 3 additions & 3 deletions packages/axle-raycast/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# axle for Raycast
# AsafAmos — Accessibility Scanner (Raycast)

Scan any URL for WCAG 2.1 / 2.2 AA violations without leaving Raycast.

## Commands

- **Scan URL for Accessibility** — prompt for a URL, run the axle scanner, show a filterable list of violations with severity and affected-element counts. Press Enter on any row for the offending HTML and a link to the WCAG reference.
- **Scan URL for Accessibility** — prompt for a URL, run the scanner, show a filterable list of violations with severity and affected-element counts. Press Enter on any row for the offending HTML and a link to the WCAG reference.
- **Open Hebrew Accessibility Statement Generator** — one-click open of the free `תקנה 35`-aligned statement generator.

## Under the hood
Expand All @@ -13,7 +13,7 @@ Commands call the public axle API at `https://axle-iota.vercel.app/api/scan`. No

## Install

Once listed in the Raycast Store: search "axle".
Once listed in the Raycast Store: search "accessibility scanner".

## Dev

Expand Down
8 changes: 4 additions & 4 deletions packages/axle-raycast/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "axle",
"title": "Axle — Accessibility Scanner",
"name": "asafamos-accessibility-scanner",
"title": "AsafAmos — Accessibility Scanner",
"description": "Scan any URL for WCAG 2.1 / 2.2 AA accessibility violations without leaving Raycast. Results appear as a list; pick any violation to see the offending element and suggested fix.",
"icon": "command-icon.png",
"author": "asafamos",
Expand All @@ -14,7 +14,7 @@
{
"name": "scan",
"title": "Scan URL for Accessibility",
"subtitle": "axle",
"subtitle": "AsafAmos",
"description": "Run an axe-core scan against any public URL and show violations.",
"mode": "view",
"arguments": [
Expand All @@ -29,7 +29,7 @@
{
"name": "statement",
"title": "Open Hebrew Accessibility Statement Generator",
"subtitle": "axle",
"subtitle": "AsafAmos",
"description": "Opens the free Hebrew statement generator — aligned with Israeli תקנה 35.",
"mode": "no-view"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/axle-raycast/src/statement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { open, showHUD } from "@raycast/api";

export default async function Statement() {
await open("https://axle-iota.vercel.app/statement");
await showHUD("Opened axle Hebrew statement generator");
await showHUD("Opened the Hebrew accessibility statement generator");
}
Loading