-
Notifications
You must be signed in to change notification settings - Fork 38
feat(seo): OpenGraph image generation, SSR improvements, Lighthouse CI #2367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andrew-bierman
merged 12 commits into
development
from
claude/improve-lighthouse-opengraph-xv7VL
May 1, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2f341d4
feat(seo): add OG image generation, fix metadata, improve SSR for lan…
claude 82697b3
chore: update lockfile with @lhci/cli deps
claude 73d0e47
fix(seo): apply biome formatting fixes to opengraph/twitter image files
claude dcfe5d9
fix(seo): add force-static to OG image routes for output: export compat
claude 4f0ff9b
fix(expo): update TestIds → testIds after enum-to-object migration
claude e53fba6
fix(seo): address review comments
claude e36e367
fix: update primary domain to packratai.com and add mobile Lighthouse…
claude 2a82315
ci: add Lighthouse CI workflow for guides and landing apps
claude 344da0c
fix(ci): add explicit permissions to lighthouse workflow
claude c29d174
chore(lighthouse): promote all assertions to error for hard pass/fail
claude 031097e
fix(lighthouse): split desktop/mobile into separate config files
claude a234006
chore(lighthouse): set continue-on-error while establishing baselines
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: Lighthouse CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ['**'] | ||
| paths: | ||
| - 'apps/guides/**' | ||
| - 'apps/landing/**' | ||
| - 'packages/web-ui/**' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lighthouse-guides: | ||
| name: Lighthouse (guides) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: apps/guides | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| cache: true | ||
|
|
||
| - name: Install dependencies | ||
| env: | ||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||
| run: bun install --frozen-lockfile | ||
| working-directory: . | ||
|
|
||
| - name: Build | ||
| run: bun run build | ||
|
|
||
| - name: Lighthouse — desktop | ||
| run: bunx lhci autorun --config=.lighthouserc.js | ||
| continue-on-error: true | ||
|
|
||
| - name: Lighthouse — mobile | ||
| run: bunx lhci autorun --config=.lighthouserc.mobile.js | ||
| continue-on-error: true | ||
|
|
||
| lighthouse-landing: | ||
| name: Lighthouse (landing) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: apps/landing | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| cache: true | ||
|
|
||
| - name: Install dependencies | ||
| env: | ||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||
| run: bun install --frozen-lockfile | ||
| working-directory: . | ||
|
|
||
| - name: Build | ||
| run: bun run build | ||
|
|
||
| - name: Lighthouse — desktop | ||
| run: bunx lhci autorun --config=.lighthouserc.js | ||
| continue-on-error: true | ||
|
|
||
| - name: Lighthouse — mobile | ||
| run: bunx lhci autorun --config=.lighthouserc.mobile.js | ||
| continue-on-error: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /** @type {import('@lhci/cli').LhciConfig} */ | ||
| module.exports = { | ||
| ci: { | ||
| collect: { | ||
| staticDistDir: './out', | ||
| numberOfRuns: 3, | ||
| settings: { | ||
| formFactor: 'desktop', | ||
| screenEmulation: { | ||
| mobile: false, | ||
| width: 1350, | ||
| height: 940, | ||
| deviceScaleFactor: 1, | ||
| disabled: false, | ||
| }, | ||
| throttling: { rttMs: 40, throughputKbps: 10240, cpuSlowdownMultiplier: 1 }, | ||
| }, | ||
| }, | ||
| assert: { | ||
| assertions: { | ||
| 'categories:performance': ['error', { minScore: 0.8 }], | ||
| 'categories:accessibility': ['error', { minScore: 0.9 }], | ||
| 'categories:best-practices': ['error', { minScore: 0.9 }], | ||
| 'categories:seo': ['error', { minScore: 0.9 }], | ||
| 'first-contentful-paint': ['error', { maxNumericValue: 2000 }], | ||
| 'largest-contentful-paint': ['error', { maxNumericValue: 2500 }], | ||
| 'total-blocking-time': ['error', { maxNumericValue: 300 }], | ||
| 'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }], | ||
| 'meta-description': 'error', | ||
| 'document-title': 'error', | ||
| 'html-has-lang': 'error', | ||
| 'image-alt': 'error', | ||
| }, | ||
| }, | ||
| upload: { | ||
| target: 'temporary-public-storage', | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /** @type {import('@lhci/cli').LhciConfig} */ | ||
| module.exports = { | ||
| ci: { | ||
| collect: { | ||
| staticDistDir: './out', | ||
| numberOfRuns: 3, | ||
| settings: { | ||
| formFactor: 'mobile', | ||
| screenEmulation: { | ||
| mobile: true, | ||
| width: 390, | ||
| height: 844, | ||
| deviceScaleFactor: 3, | ||
| disabled: false, | ||
| }, | ||
| throttling: { rttMs: 150, throughputKbps: 1638.4, cpuSlowdownMultiplier: 4 }, | ||
| }, | ||
| }, | ||
| assert: { | ||
| assertions: { | ||
| 'categories:performance': ['error', { minScore: 0.8 }], | ||
| 'categories:accessibility': ['error', { minScore: 0.9 }], | ||
| 'categories:best-practices': ['error', { minScore: 0.9 }], | ||
| 'categories:seo': ['error', { minScore: 0.9 }], | ||
| 'first-contentful-paint': ['error', { maxNumericValue: 3000 }], | ||
| 'largest-contentful-paint': ['error', { maxNumericValue: 4000 }], | ||
| 'total-blocking-time': ['error', { maxNumericValue: 600 }], | ||
| 'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }], | ||
| 'meta-description': 'error', | ||
| 'document-title': 'error', | ||
| 'html-has-lang': 'error', | ||
| 'image-alt': 'error', | ||
| }, | ||
| }, | ||
| upload: { | ||
| target: 'temporary-public-storage', | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| import { getAllPosts, getPostBySlug } from 'guides-app/lib/mdx-static'; | ||
| import { ImageResponse } from 'next/og'; | ||
|
|
||
| export const dynamic = 'force-static'; | ||
| export const size = { width: 1200, height: 630 }; | ||
| export const contentType = 'image/png'; | ||
|
|
||
| export async function generateStaticParams() { | ||
| return getAllPosts().map((post) => ({ slug: post.slug })); | ||
| } | ||
|
|
||
| export default async function Image({ params }: { params: Promise<{ slug: string }> }) { | ||
| const { slug } = await params; | ||
| const post = getPostBySlug(slug); | ||
|
|
||
| const title = post?.title ?? 'PackRat Guides'; | ||
| const description = post?.description ?? 'Expert hiking and outdoor guides'; | ||
| const categories = post?.categories ?? []; | ||
|
|
||
| return new ImageResponse( | ||
| <div | ||
| style={{ | ||
| background: 'linear-gradient(135deg, #1E3A5F 0%, #1a56a0 60%, #0284C7 100%)', | ||
| width: '100%', | ||
| height: '100%', | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| justifyContent: 'space-between', | ||
| fontFamily: 'system-ui, -apple-system, sans-serif', | ||
| padding: '64px', | ||
| }} | ||
| > | ||
| <div | ||
| style={{ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: '12px', | ||
| }} | ||
| > | ||
| <div style={{ fontSize: '28px' }}>🏔️</div> | ||
| <div | ||
| style={{ | ||
| fontSize: '26px', | ||
| fontWeight: 600, | ||
| color: 'rgba(255,255,255,0.8)', | ||
| }} | ||
| > | ||
| PackRat Guides | ||
| </div> | ||
| </div> | ||
|
|
||
| <div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}> | ||
| {categories.length > 0 && ( | ||
| <div style={{ display: 'flex', gap: '12px' }}> | ||
| {categories.slice(0, 3).map((cat) => ( | ||
| <div | ||
| key={cat} | ||
| style={{ | ||
| background: 'rgba(255,255,255,0.18)', | ||
| color: 'rgba(255,255,255,0.9)', | ||
| fontSize: '18px', | ||
| fontWeight: 500, | ||
| padding: '6px 16px', | ||
| borderRadius: '100px', | ||
| }} | ||
| > | ||
| {cat} | ||
| </div> | ||
| ))} | ||
| </div> | ||
| )} | ||
| <div | ||
| style={{ | ||
| fontSize: title.length > 50 ? '44px' : '56px', | ||
| fontWeight: 700, | ||
| color: 'white', | ||
| lineHeight: 1.15, | ||
| letterSpacing: '-1px', | ||
| maxWidth: '900px', | ||
| }} | ||
| > | ||
| {title} | ||
| </div> | ||
| <div | ||
| style={{ | ||
| fontSize: '24px', | ||
| color: 'rgba(255,255,255,0.8)', | ||
| lineHeight: 1.4, | ||
| maxWidth: '820px', | ||
| }} | ||
| > | ||
| {description.length > 120 ? `${description.slice(0, 117)}...` : description} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div | ||
| style={{ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: '8px', | ||
| color: 'rgba(255,255,255,0.6)', | ||
| fontSize: '18px', | ||
| }} | ||
| > | ||
| guides.packratai.com | ||
| </div> | ||
| </div>, | ||
| { ...size }, | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.