From ac02aae67fefb74fbe953f610a3d77cadc356aa6 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Thu, 12 Mar 2026 15:46:12 -0400 Subject: Fix GitHub scraping for new JSON structure, update TypeScript interfaces GitHub restructured their embedded JSON: tree/blob data is now split across codeViewRepoRoute, codeViewTreeRoute, codeViewBlobLayoutRoute, codeViewBlobLayoutRoute.StyledBlob, codeViewBlobRoute, and the shared codeViewLayoutRoute (repo, refInfo, path). Replace RawPayload and OverviewFile with typed interfaces for each route, add AppPayload as the top-level union, and simplify parsePayload to always extract react-app.embeddedData. --- src/scraper.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/scraper.test.ts') diff --git a/src/scraper.test.ts b/src/scraper.test.ts index 125e6a6..ad3ed46 100644 --- a/src/scraper.test.ts +++ b/src/scraper.test.ts @@ -95,8 +95,11 @@ describe("GitHub scraper", () => { assert.strictEqual(data.language, "Markdown"); assert.strictEqual(data.image, false); - assert.strictEqual(data.textLines, null); - assert.strictEqual(data.htmlLines, null); + assert.strictEqual(data.textLines?.[0], "# deploy-pages 🚀"); + assert.strictEqual( + data.htmlLines?.[0], + '# deploy-pages 🚀deploy-pages 🚀deploy-pages 🚀', + ); const firstLine = /^

deploy-pages 🚀<\/h1>/; assert.match(data.htmlContent ?? "", firstLine); -- cgit v1.3.1