docs: sync release credit surfaces

This commit is contained in:
Hunter B
2026-05-31 17:43:46 -07:00
parent 7eb740bd86
commit 6f295e9961
15 changed files with 255 additions and 98 deletions
+19 -3
View File
@@ -18,8 +18,8 @@ export interface RepoFacts {
}
export const FACTS: RepoFacts = {
"generatedAt": "2026-05-26T17:03:21.939Z",
"version": "0.8.46",
"generatedAt": "2026-06-01T00:40:33.053Z",
"version": "0.8.48",
"crates": [
"agent",
"app-server",
@@ -30,6 +30,7 @@ export const FACTS: RepoFacts = {
"hooks",
"mcp",
"protocol",
"release",
"secrets",
"state",
"tools",
@@ -69,11 +70,21 @@ export const FACTS: RepoFacts = {
"label": "Wanjie Ark",
"env": "WANJIE_ARK_API_KEY / WANJIE_API_KEY / WANJIE_MAAS_API_KEY"
},
{
"id": "volcengine",
"label": "Volcengine Ark",
"env": "VOLCENGINE_API_KEY / VOLCENGINE_ARK_API_KEY / ARK_API_KEY"
},
{
"id": "openrouter",
"label": "OpenRouter",
"env": "OPENROUTER_API_KEY"
},
{
"id": "xiaomi-mimo",
"label": "Xiaomi MiMo",
"env": "XIAOMI_MIMO_API_KEY / XIAOMI_API_KEY / MIMO_API_KEY"
},
{
"id": "novita",
"label": "Novita AI",
@@ -84,6 +95,11 @@ export const FACTS: RepoFacts = {
"label": "Fireworks AI",
"env": "FIREWORKS_API_KEY"
},
{
"id": "siliconflow",
"label": "SiliconFlow",
"env": "SILICONFLOW_API_KEY"
},
{
"id": "moonshot",
"label": "Moonshot/Kimi",
@@ -107,7 +123,7 @@ export const FACTS: RepoFacts = {
],
"defaultModel": "deepseek-v4-pro",
"nodeEngines": ">=18",
"toolCount": 70,
"toolCount": 75,
"license": "MIT",
"latestRelease": null
};
+3 -32
View File
@@ -1,24 +1,11 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { lastPageFromLink, relativeTime } from "./github";
// We test the pure helper functions directly.
// The async fetch functions require mocking the global fetch.
// ── relativeTime ──────────────────────────────────────────────────────
function relativeTime(iso: string): string {
const diff = Date.now() - +new Date(iso);
const mins = Math.round(diff / 60000);
if (mins < 1) return "just now";
if (mins < 60) return `${mins}m`;
const hrs = Math.round(mins / 60);
if (hrs < 24) return `${hrs}h`;
const days = Math.round(hrs / 24);
if (days < 30) return `${days}d`;
const months = Math.round(days / 30);
if (months < 12) return `${months}mo`;
return `${Math.round(months / 12)}y`;
}
describe("relativeTime", () => {
beforeEach(() => {
vi.useFakeTimers();
@@ -45,7 +32,7 @@ describe("relativeTime", () => {
it("returns days for < 30 days", () => {
expect(relativeTime("2026-05-25T12:00:00Z")).toBe("7d");
expect(relativeTime("2026-05-02T12:00:00Z")).toBe("30d");
expect(relativeTime("2026-05-03T12:00:00Z")).toBe("29d");
});
it("returns months for < 12 months", () => {
@@ -55,28 +42,12 @@ describe("relativeTime", () => {
it("returns years for >= 12 months", () => {
expect(relativeTime("2024-06-01T12:00:00Z")).toBe("2y");
expect(relativeTime("2025-01-01T00:00:00Z")).toBe("2y");
expect(relativeTime("2025-01-01T00:00:00Z")).toBe("1y");
});
});
// ── lastPageFromLink (via re-export test) ──────────────────────────────
function lastPageFromLink(link: string | null): number | undefined {
if (!link) return undefined;
for (const part of link.split(",")) {
const [rawUrl, rawRel] = part
.split(";")
.map((segment: string) => segment.trim());
if (rawRel !== 'rel="last"') continue;
const match = rawUrl.match(/^<(.+)>$/);
if (!match) continue;
const page = new URL(match[1]).searchParams.get("page");
const parsed = page ? Number.parseInt(page, 10) : NaN;
if (Number.isFinite(parsed) && parsed > 0) return parsed;
}
return undefined;
}
describe("lastPageFromLink", () => {
it("returns undefined for null input", () => {
expect(lastPageFromLink(null)).toBeUndefined();
+1 -1
View File
@@ -2,7 +2,7 @@ import type { FeedItem, RepoStats } from "./types";
const REPO = process.env.GITHUB_REPO ?? "Hmbown/CodeWhale";
const GH = "https://api.github.com";
const MIN_KNOWN_CONTRIBUTORS = 99;
const MIN_KNOWN_CONTRIBUTORS = 141;
function headers(token?: string): HeadersInit {
const h: Record<string, string> = {