From a59dfc41651ba8a923858dbd46b030dd30e2e341 Mon Sep 17 00:00:00 2001 From: Andrew Bierman Date: Sat, 16 May 2026 23:51:09 -0600 Subject: [PATCH 1/2] fix(guides): swap build order so OG images are generated for all 504 posts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build script ran 'generate-og-images' BEFORE 'build-content', so OG generation read the stale committed lib/content.ts (39 posts) instead of the freshly-built 504-post list. Result: only 39 of 504 guides had OG/Twitter images on the deployed site. Fix: run build-content first to regenerate lib/content.ts, then generate-og-images reads the up-to-date 504 posts. Verified locally: Built 504 posts and 29 categories Done — generated 1 root + 504 post OG images. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/guides/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/guides/package.json b/apps/guides/package.json index d8e0ffd7af..c973c2d772 100644 --- a/apps/guides/package.json +++ b/apps/guides/package.json @@ -3,7 +3,7 @@ "version": "2.0.25", "private": true, "scripts": { - "build": "bun run generate-og-images && bun run build-content && next build", + "build": "bun run build-content && bun run generate-og-images && next build", "build-content": "bun run scripts/build-content.ts", "clean": "bunx rimraf .next node_modules out", "demo-enhancement": "bun run scripts/demo-enhancement.ts", From 2004ddc7789919783e91ad795ab32d61a5d44309 Mon Sep 17 00:00:00 2001 From: Andrew Bierman Date: Sun, 17 May 2026 00:04:36 -0600 Subject: [PATCH 2/2] fix(guides): bump beforeAll timeout in og-image.test.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Default vitest hook timeout is 5s; generating per-post PNGs takes 30-60s for the full set, so the beforeAll() that runs generate-og-images.ts was killed mid-run. Raising to 180s. Bundled with the build-order fix in this PR because the test only becomes meaningful once the build runs in the right order — with the prior order, the test still passed on the stale 39-post snapshot, masking the real bug. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/guides/__tests__/og-image.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/guides/__tests__/og-image.test.ts b/apps/guides/__tests__/og-image.test.ts index c910e48988..418ea2d9b8 100644 --- a/apps/guides/__tests__/og-image.test.ts +++ b/apps/guides/__tests__/og-image.test.ts @@ -28,12 +28,14 @@ function assertValidPng(filePath: string): void { } describe('guides OG image generation', () => { + // Generating per-post PNGs takes ~30-60s for the full set; + // default vitest hook timeout is 5s. beforeAll(() => { execSync('bun run scripts/generate-og-images.ts', { cwd: APP_DIR, stdio: 'inherit', }); - }); + }, 180_000); it('generates public/og-image.png', () => { expect(fs.existsSync(ROOT_OG_PATH)).toBe(true);