Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
d80df2f
feat(expo/ai): enhance local model management, wire tools & system pr…
mikib0 May 13, 2026
aff5a14
feat(api): add response schemas to all Elysia routes for Eden Treaty …
andrew-bierman May 13, 2026
4464646
refactor(api): extract constants to types/constants.ts and slim down …
andrew-bierman May 13, 2026
eaf2fb4
refactor(app): consolidate entity schemas to re-export from @packrat/…
andrew-bierman May 13, 2026
95ac908
fix(catalog): strip embedding from responses and use admin macro for …
andrew-bierman May 13, 2026
0b9404c
refactor(expo): delete duplicate types/index.ts, redirect imports to …
andrew-bierman May 13, 2026
b59605c
fix(api): correct HTTP status codes and soft-delete trips
andrew-bierman May 14, 2026
ad8167a
refactor: extract @packrat/db and @packrat/schemas from @packrat/api
andrew-bierman May 14, 2026
957fe34
fix: use catalog: for drizzle-zod in packages/api
andrew-bierman May 14, 2026
a4eda7b
refactor: migrate all consumer imports from @packrat/api shims to @pa…
andrew-bierman May 14, 2026
51628ab
refactor: extract @packrat/constants and @packrat/types packages
andrew-bierman May 14, 2026
0154b87
refactor: delete all backward-compat re-export shims
andrew-bierman May 14, 2026
13e6d21
fix(expo): enable unstable_enablePackageExports for @packrat/schemas …
andrew-bierman May 14, 2026
c9e64fa
fix(schemas): include .ts extension in subpath exports for Metro reso…
andrew-bierman May 14, 2026
2b667fb
fix: add .ts extension to all wildcard subpath exports
andrew-bierman May 14, 2026
52c289e
refactor: convert admin schemas from TypeBox to Zod, move to @packrat…
andrew-bierman May 14, 2026
6b574d8
fix: sort apps/admin/package.json
andrew-bierman May 14, 2026
5de8ff1
Merge branch 'main' into refactor/extract-db-schemas-packages
andrew-bierman May 14, 2026
0d84cb6
fix: address CodeRabbit review comments
andrew-bierman May 14, 2026
1b17b83
refactor: delete env.ts shim, export Env alias from env-validation di…
andrew-bierman May 14, 2026
7b7ae2c
fix: UserAvatar uses Pick<MockUser>, correct userId string type, remo…
andrew-bierman May 14, 2026
4a07c0a
refactor(types): make @packrat/types a pure z.infer layer; fix status…
andrew-bierman May 14, 2026
41e287c
refactor(schemas): centralize all route/service schemas in @packrat/s…
andrew-bierman May 14, 2026
536ea8a
Initial plan
Copilot Aug 20, 2025
1b9043b
Initial plan
Copilot Aug 20, 2025
4221777
Initial plan
Copilot Aug 20, 2025
ebfe3c5
Initial plan
Copilot Aug 20, 2025
227baef
Initial plan
Copilot Aug 22, 2025
f9b5f2f
Initial plan
Copilot Aug 22, 2025
e89b7bb
Initial plan
Copilot Aug 23, 2025
d8c8cdd
Initial plan
Copilot Aug 23, 2025
4321eb9
Initial plan
Copilot Aug 20, 2025
4a99c3b
Initial plan
Copilot Aug 23, 2025
2609e15
Initial plan
Copilot Aug 24, 2025
72f3fc5
Initial plan
Copilot Aug 23, 2025
865a7e5
Initial plan
Copilot Aug 23, 2025
4a0579d
Initial plan
Copilot Sep 9, 2025
2a85a13
Initial plan
Copilot Sep 11, 2025
792e268
Initial plan
Copilot Sep 10, 2025
aa13ebb
Initial plan
Copilot Sep 11, 2025
7d3e87c
Initial plan
Copilot Sep 12, 2025
d9b1dc3
Initial plan
Copilot Oct 4, 2025
fe6d04a
Initial plan
Copilot Oct 17, 2025
e944700
Initial plan
Copilot Oct 17, 2025
09d4b15
Initial plan
Copilot Oct 18, 2025
a440888
Initial plan
Copilot Oct 20, 2025
e902552
Initial plan
Copilot Oct 25, 2025
b89a1de
Initial plan
Copilot Oct 26, 2025
235b49b
Initial plan
Copilot Nov 18, 2025
f0ac70d
Initial plan
Copilot Nov 6, 2025
a91051f
Initial plan
Copilot Nov 6, 2025
f97d50c
Initial plan
Copilot Nov 8, 2025
e9d2b06
Initial plan
Copilot Nov 8, 2025
14c768b
Initial plan
Copilot Nov 9, 2025
6a4e774
Initial plan
Copilot Nov 9, 2025
77e4059
Initial plan
Copilot Nov 11, 2025
380858e
Initial plan
Copilot Nov 11, 2025
3972884
Initial plan
Copilot Nov 11, 2025
c2b30d8
Initial plan
Copilot Nov 11, 2025
fdeced1
Initial plan
Copilot Nov 18, 2025
a7a1c73
Initial plan
Copilot Nov 18, 2025
7c32e6e
Initial plan
Copilot Nov 18, 2025
5cb1155
Initial plan
Copilot Nov 18, 2025
32aed96
Initial plan
Copilot Nov 18, 2025
02d7013
Initial plan
Copilot Nov 18, 2025
02611a2
Initial plan
Copilot Nov 18, 2025
00db2d8
Initial plan
Copilot Nov 18, 2025
b5b028a
Initial plan
Copilot Nov 18, 2025
e282d3b
Initial plan
Copilot Nov 18, 2025
c506000
Initial plan
Copilot Nov 18, 2025
beff25c
Initial plan
Copilot Nov 18, 2025
343c0cd
Initial plan
Copilot Nov 18, 2025
b26f32d
Initial plan
Copilot Dec 2, 2025
8dc222f
Initial plan
Copilot Dec 13, 2025
e2e9409
Initial plan
Copilot Mar 9, 2026
b4a147e
Initial plan
Copilot Mar 9, 2026
edbb6d2
Initial plan
Copilot Mar 9, 2026
4f9092b
Initial plan
Copilot Mar 10, 2026
c0e7dd2
Initial plan
Copilot Mar 9, 2026
c0083ef
Initial plan
Copilot Mar 10, 2026
b0f7e4c
Initial plan
Copilot Feb 21, 2026
e3c4a62
Initial plan
Copilot Feb 27, 2026
e0233d1
Initial plan
Copilot Mar 10, 2026
414f2d2
Initial plan
Copilot Mar 7, 2026
14cd051
Initial plan
Copilot Mar 10, 2026
28f2ebd
Initial plan
Copilot Mar 11, 2026
00e19ec
Initial plan
Copilot Mar 9, 2026
9c99414
Initial plan
Copilot Mar 9, 2026
2e5396c
Initial plan
Copilot Mar 13, 2026
0f005f1
Initial plan
Copilot Mar 13, 2026
b6c9765
Initial plan
Copilot Mar 13, 2026
28872f6
Initial plan
Copilot Mar 13, 2026
32489fa
fix(expo/CreatePackItemForm): default quantity to 1 instead of 0
mikib0 Mar 13, 2026
a151463
Initial plan
Copilot Mar 13, 2026
94ada9d
Initial plan
Copilot Mar 16, 2026
65151ae
Initial plan
Copilot Mar 9, 2026
2a038db
Initial plan
Copilot Mar 13, 2026
6434404
Initial plan
Copilot Mar 13, 2026
9382211
Initial plan
Copilot Mar 9, 2026
25d7b58
Initial plan
Copilot Mar 9, 2026
cbded7a
Initial plan
Copilot Apr 1, 2026
6ed13f8
Initial plan
Copilot Mar 21, 2026
cae1103
Initial plan
Copilot Mar 9, 2026
1aebad7
Initial plan
Copilot Mar 9, 2026
142fecb
Initial plan
Copilot Mar 9, 2026
cea16a0
Initial plan
Copilot Mar 9, 2026
5677d4d
Initial plan
Copilot Mar 9, 2026
6e307d3
Initial plan
Copilot Mar 9, 2026
36450a4
Initial plan
Copilot Mar 9, 2026
1a68f2f
Initial plan
Copilot Mar 9, 2026
ebd601f
Initial plan
Copilot Mar 9, 2026
b646ff4
Initial plan
Copilot Mar 9, 2026
9a3e8d0
Initial plan
Copilot Aug 22, 2025
5eb59f7
Initial plan
Copilot Feb 27, 2026
2b7dde2
chore: reopen trigger (no-op commit to restore PR state)
andrew-bierman Apr 11, 2026
2744d3e
ci: trigger biome check
andrew-bierman Apr 11, 2026
4ddf88f
ci: retrigger CI after biome fixes
andrew-bierman Apr 11, 2026
8d28564
Initial plan
Copilot Mar 9, 2026
a216ec3
ci: trigger checks for dependabot merges
andrew-bierman Apr 13, 2026
30ab5cc
Initial plan
Copilot Apr 13, 2026
93dad92
ci: retrigger checks after copilot merge-conflict fix
andrew-bierman Apr 14, 2026
6180c2a
ci: trigger CI on Copilot bot's expo-symbols type fixes
andrew-bierman Apr 14, 2026
2d979d4
Initial plan
Copilot Apr 14, 2026
4e0a10d
trigger: retrigger CI after node_modules clean install verified vites…
andrew-bierman Apr 15, 2026
d3c575e
Initial plan
Copilot Apr 14, 2026
dcbfa26
trigger: retrigger CI after node_modules clean install verified vites…
andrew-bierman Apr 15, 2026
7228f91
ci: re-trigger checks after @types/react alignment fix
claude Apr 16, 2026
e5cb0d6
Initial plan
Copilot Apr 14, 2026
698f705
Initial plan
Copilot Apr 16, 2026
4efb2e5
ci: trigger CI run on updated branch
claude Apr 16, 2026
b964271
Initial plan
Copilot Sep 22, 2025
e75c31d
Initial plan
Copilot Sep 22, 2025
a41e127
ci: trigger workflows
andrew-bierman Apr 14, 2026
9a5c7d3
✨ feat(web): add platform shims and web layout adapters for MVP
andrew-bierman Apr 30, 2026
115b545
🐛 fix(web): resolve runtime errors blocking web MVP boot
andrew-bierman Apr 30, 2026
b95f078
🏷️ replace TestIds/T with unified testIds registry
andrew-bierman May 1, 2026
26bcb35
✅ use testIds in add-item test; drop fragile waitForResponse
andrew-bierman May 1, 2026
ff62acf
🐛 fix(trips): useDeleteTrip returns fn directly, not object
andrew-bierman May 1, 2026
246b4be
✅ add e2e specs for packs, trips, and profile CRUD
andrew-bierman May 1, 2026
7375556
✅ fix(e2e): await item POST before navigating to prevent request abort
andrew-bierman May 1, 2026
6368f42
🌐 fix(web): replace native Alert.alert no-ops + add missing testIDs f…
andrew-bierman May 1, 2026
5983036
✅ fix(e2e): harden trips + profile web tests for NativeWindUI and SPA…
andrew-bierman May 1, 2026
a8e5e00
🐛 fix(web): replace typeof === 'function' with isFunction guard
andrew-bierman May 1, 2026
1574c2d
🔧 chore(env-lint): exempt apps/expo/e2e-web from process.env check
andrew-bierman May 1, 2026
db33ed1
🔧 chore(checks): exempt e2e-web from check:casts:strict + annotate fi…
andrew-bierman May 1, 2026
40d398e
🔧 chore(web): add safe-cast annotations to web shims and mock files
andrew-bierman May 1, 2026
d652847
fix(ci): biome unused import + coverage threshold for web-only files
andrew-bierman May 1, 2026
0042f74
refactor(web): delete useAuthActions.web.ts; add google-signin + appl…
andrew-bierman May 1, 2026
491b6f2
refactor(auth): consolidate token atoms + Treaty client; delete .web.…
andrew-bierman May 1, 2026
3eade65
refactor(web): eliminate feature-layer .web.ts via lib/storage/persis…
andrew-bierman May 1, 2026
f18387f
fix: resolve all type errors surfaced by ignoreDeprecations 5.0
andrew-bierman May 1, 2026
c5873c1
ci: add Playwright web E2E workflow
andrew-bierman May 1, 2026
cb7684d
ci(web-e2e): follow iOS/Android E2E pattern for auth and secrets
andrew-bierman May 1, 2026
a951d82
ci: retrigger CI after suspected transient runner failure
claude Apr 26, 2026
ef5bd01
chore: remove orphaned lib/storage/persistPlugin files
andrew-bierman May 1, 2026
7118ddd
refactor: rename e2e-web/ → playwright/ for clarity
andrew-bierman May 1, 2026
ab5e306
refactor(web): replace Metro stubs with lib/ platform abstractions
andrew-bierman May 1, 2026
2e48375
fix: add safe-cast annotation in Picker.web.tsx
andrew-bierman May 1, 2026
4291d59
fix: use isValidElement<ItemProps> to avoid cast in Picker.web.tsx
andrew-bierman May 1, 2026
9a71fe4
refactor: move testID onto DataItem instead of hardcoding in render fn
andrew-bierman May 1, 2026
0ca2b49
fix(auth): remove unused onFocus from OTPField
andrew-bierman May 14, 2026
96126ea
fix(web): import RefObject/ReactNode instead of using React namespace
andrew-bierman May 14, 2026
305fdd6
fix(web): format globalSetup.ts and sort providers imports
andrew-bierman May 14, 2026
1a4ec3f
Fix OG/Twitter image metadata and add coverage
andrew-bierman May 16, 2026
d1e2f82
Use Next metadata image routes for OG/Twitter URLs
andrew-bierman May 16, 2026
05abe74
api: finish chat rate-limiting rollout and enable test coverage
andrew-bierman May 16, 2026
953d1ce
fix(expo/ai): fix local model tool calling by bypassing broken @react…
mikib0 May 16, 2026
ed81051
fix(ai/tools): trim weather data to just the essentials to avoid cont…
mikib0 May 16, 2026
f56d767
fix(ai/WeatherGenerativeUI): resolve field mismatches
mikib0 May 16, 2026
32185c3
fix(ai/tools): trim catalog tool responses to avoid local model conte…
mikib0 May 16, 2026
7e04e2d
fix(ai/tools): wrap catalog tool results in { items } to match Genera…
mikib0 May 16, 2026
3f3723d
fix(api/catalog): use isAuthenticated on vector-search route instead …
mikib0 May 16, 2026
9f63223
feat(ai/GuidesRAGGenerativeUI): add dark mode support
mikib0 May 16, 2026
d6e12ed
chore(ai): replace raw typeof checks and unsafe casts to pass pre-pus…
mikib0 May 16, 2026
ad389aa
fix(ai): update on-device model references from SmolLM3 to Qwen2.5-3B
mikib0 May 16, 2026
ddee18b
fix(config): enable local AI feature
mikib0 May 16, 2026
b888deb
Merge pull request #2432 from PackRat-AI/fix/stabilize-ondevice-ai
mikib0 May 16, 2026
bc5baa5
♻️ mcp: migrate to Eden Treaty + scoped tools (admin, flag)
May 16, 2026
a9713ac
✨ cli: thin Eden Treaty wrapper for user + admin API
May 16, 2026
4b0446a
🛂 cli: admin command tree (stats, users, packs, catalog, trails, anal…
May 16, 2026
4f1d25e
🩹 mcp,cli: biome auto-fixes (formatting, useMaxParams, import order)
May 16, 2026
adfde8f
🚸 cli,mcp,env: satisfy pre-push lints
May 16, 2026
bd2e48b
♻️ guards: consolidate narrow helpers under to* naming
May 16, 2026
2d70fab
🩹 cli: load config when ~/.packrat/config.json is missing
May 16, 2026
b14f4db
Merge branch 'development' into refactor/extract-db-schemas-packages
andrew-bierman May 16, 2026
26f4f60
fix(merge): update imports broken by db/schemas extraction
andrew-bierman May 16, 2026
1cb8d84
🛂 api: relax query schemas so Treaty sees them as truly optional
May 16, 2026
5d8ab30
🚸 cli,mcp: drop workarounds now that API schemas are Treaty-friendly
May 16, 2026
ffc929e
✨ api: GET /weather/by-name?q=X — search + forecast in one call
May 16, 2026
4e79c18
✨ api: GET /packs/:packId/weight-breakdown — per-category totals
May 16, 2026
2fcc4c4
✨ api: POST /catalog/compare — multi-item side-by-side comparison
May 16, 2026
089af14
✨ api: POST /packs/:packId/items/from-catalog — hydrate item from cat…
May 16, 2026
c8f23e9
fix(api): address remaining CodeRabbit review comments on #2414
andrew-bierman May 16, 2026
df0cfac
✨ api: server-side ID minting (optional, preserves offline-first)
May 16, 2026
31a0a69
🛂 api: POST /admin/login — body-credential variant of /admin/token
May 16, 2026
6b0206c
Merge origin/development
andrew-bierman May 16, 2026
c627e35
Move metadata tests to __tests__ dir so vitest picks them up
andrew-bierman May 16, 2026
40095d4
Merge origin/development
andrew-bierman May 16, 2026
ba03da9
🩹 fix typecheck regressions from PR review
May 16, 2026
73c755a
fix(lint): organize imports in passwordReset.ts
andrew-bierman May 16, 2026
dda500c
🩹 fix admin SPA callsites broken by includeDeleted boolean coercion
May 16, 2026
61536f6
🔒 fix(api): security/correctness issues from PR review
May 16, 2026
e42a053
🩹 fix(cli): unwrap paginated/nested response shapes
May 16, 2026
ec8ea7f
🚸 polish PR review feedback — passwords, config, network errors, MCP doc
May 16, 2026
279b217
🩹 cli: import toRecord in admin/packs.ts
May 16, 2026
1ead2e7
Add drizzle migration generation lint check (#2430)
andrew-bierman May 17, 2026
c47a4c8
Merge pull request #2431 from PackRat-AI/codex/audit-and-complete-hal…
andrew-bierman May 17, 2026
3d1cfe1
fix(lint): organize imports in passwordResetService.ts
andrew-bierman May 17, 2026
67c74cf
Merge remote-tracking branch 'origin/development' into worktree-mcp-c…
May 17, 2026
2800282
🩹 address CodeRabbit review on PR #2433 — fixes for real bugs
May 17, 2026
4c342a8
Merge pull request #2428 from PackRat-AI/codex/fix-open-graph-images-…
andrew-bierman May 17, 2026
2fb5f4e
Merge pull request #2363 from PackRat-AI/feat/web-e2e-testids
andrew-bierman May 17, 2026
50e7818
📝 design: client-uuid-split follow-up to PR #2433
May 16, 2026
78b71a9
Merge remote-tracking branch 'origin/development' into worktree-mcp-c…
May 17, 2026
b8a9e72
Merge branch 'development' into refactor/extract-db-schemas-packages …
andrew-bierman May 17, 2026
cb4181c
chore(ci): retrigger CF Pages after transient build failure
andrew-bierman May 17, 2026
a14bdf0
Merge pull request #2435 from PackRat-AI/design/client-uuid-split
andrew-bierman May 17, 2026
7b8ae26
Merge pull request #2423 from PackRat-AI/refactor/extract-db-schemas-…
andrew-bierman May 17, 2026
2462f81
Merge pull request #2377 from PackRat-AI/copilot/disable-sentry-local…
andrew-bierman May 17, 2026
83c9992
🐛 fix: drop ★ from landing OG image + harden font fallback
May 17, 2026
df70874
🚨 lint: swap raw typeof for @packrat/guards isString in OG fetch shim
May 17, 2026
29d44a5
🔒 security: parse URL hostname for font intercept (CodeQL)
May 17, 2026
3cd4af4
Merge branch 'development' into refactor/unify-schema-type-system
andrew-bierman May 17, 2026
e5a8f95
Merge pull request #2414 from PackRat-AI/refactor/unify-schema-type-s…
andrew-bierman May 17, 2026
e0dcc36
⬆️ chore: pin bun 1.3.14 via .bun-version + packageManager + engines
May 17, 2026
71eec22
chore: pin Bun version via .bun-version
andrew-bierman May 17, 2026
a59dfc4
fix(guides): swap build order so OG images are generated for all 504 …
andrew-bierman May 17, 2026
024938c
🔀 merge: development into worktree-mcp-cli-eden (post-#2414 schema re…
May 17, 2026
9b71b69
🚚 schemas: move AddPackItemFromCatalogBodySchema into @packrat/schemas
May 17, 2026
2004ddc
fix(guides): bump beforeAll timeout in og-image.test.ts
andrew-bierman May 17, 2026
d3bdd22
chore(guides): harden OG image generation + add web-build CI
andrew-bierman May 17, 2026
67e6afe
⏪ revert: T8/T9 — defer client-vs-server ID split to feat/client-uuid…
andrew-bierman May 17, 2026
8aa9079
🚸 api: body-schema cleanup — drop redundant .optional().default() (#2…
andrew-bierman May 17, 2026
dc66a96
chore(env): allowlist OG pipeline test for raw process.env check
andrew-bierman May 17, 2026
575e103
Merge remote-tracking branch 'origin/development' into worktree-mcp-c…
andrew-bierman May 17, 2026
cc3b2dc
chore(ci): rename web-builds.yml → builds.yml
andrew-bierman May 17, 2026
56ad9ea
🔥 fix: typecheck failures after T9 revert
andrew-bierman May 17, 2026
db2a0bc
🔀 chore(cli): use uuid npm package (v7) instead of Bun.randomUUIDv7
andrew-bierman May 17, 2026
47f3786
Merge pull request #2436 from PackRat-AI/fix/og-images-build-order
andrew-bierman May 17, 2026
c0e0f66
Merge pull request #2433 from PackRat-AI/worktree-mcp-cli-eden
andrew-bierman May 17, 2026
b262063
Merge pull request #2437 from PackRat-AI/chore/og-lighthouse-hardening
andrew-bierman May 17, 2026
7f67396
Merge pull request #2304 from PackRat-AI/copilot/improve-lighthouse-s…
andrew-bierman May 17, 2026
64637fc
Merge branch 'main' into development (resolve auth conflicts from #2427)
andrew-bierman May 17, 2026
c72e5bc
chore(guides): programmatic OG meta validation
andrew-bierman May 17, 2026
8ddaac3
chore(landing): programmatic OG meta validation + LHCI in Builds work…
andrew-bierman May 17, 2026
9bfafc9
chore(engines): pin node to ^24.0.0 (current LTS)
andrew-bierman May 17, 2026
20cfdd1
Merge branch 'development' of https://github.com/PackRat-AI/PackRat i…
andrew-bierman May 17, 2026
c10521f
fix(ci): exclude error pages from Lighthouse + upload artifacts + rem…
andrew-bierman May 17, 2026
dd81e3f
Merge pull request #2439 from PackRat-AI/chore/og-meta-validation
andrew-bierman May 17, 2026
b0a75b0
Merge pull request #2440 from PackRat-AI/chore/engines-node-lts
andrew-bierman May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3.14
310 changes: 310 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
name: Builds

# Build packrat apps on every PR. Currently web only (guides + landing); native
# builds (Expo / macOS) may slot in here later under the same workflow.
#
# Gives us inspectable build signal (post counts, OG image counts, `out/`
# artifact) independent of the Cloudflare Pages dashboard, so a stale
# `lib/content.ts` or a missing OG image surfaces directly in PR checks.
#
# Each job:
# 1. Installs deps with the private @packrat-ai/nativewindui token.
# 2. Runs `bun run --cwd apps/<name> build`.
# 3. Surfaces post count + OG image count + `out/` size as a GitHub Step
# Summary so reviewers see it without clicking through to logs.
# 4. Uploads `out/` as a downloadable artifact (7-day retention).

on:
pull_request:
branches: ['**']
paths:
- 'apps/guides/**'
- 'apps/landing/**'
- 'packages/web-ui/**'
- 'package.json'
- 'bun.lock'
- '.github/workflows/builds.yml'
push:
branches: ['main', 'development']
paths:
- 'apps/guides/**'
- 'apps/landing/**'
- 'packages/web-ui/**'
- 'package.json'
- 'bun.lock'
- '.github/workflows/builds.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
guides:
name: Builds (guides)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install --frozen-lockfile

- name: Build guides app
id: build
run: |
set -o pipefail
bun run --cwd apps/guides build 2>&1 | tee /tmp/guides-build.log

- name: Validate OG meta in built HTML
# Parse out/index.html + every out/guide/<slug>.html and assert the
# OG / Twitter meta tags expected by social previewers (LinkedIn,
# FB, microlink). A regression here — missing meta tag, relative
# og:image, wrong twitter:card — fails the workflow before the
# artifact is uploaded so reviewers see the failure on the PR check.
run: bun run --cwd apps/guides test:og-meta

- name: Lighthouse CI
# Runs `lhci autorun` against the already-built `out/` directory
# (staticDistDir in .lighthouserc.js). Error pages (404/500) are
# excluded via assertMatrix. Real failures fail the workflow so
# regressions are caught at PR time.
id: lhci
run: bun run --cwd apps/guides lighthouse:ci 2>&1 | tee /tmp/guides-lhci.log

- name: Summarize Lighthouse scores
if: always()
run: |
set -euo pipefail
LOG=/tmp/guides-lhci.log
{
echo ""
echo "## Guides Lighthouse CI"
echo ""
if [ -f "$LOG" ]; then
if grep -q "All results processed!" "$LOG" 2>/dev/null; then
echo '<details><summary>LHCI output (tail)</summary>'
echo ''
echo '```'
tail -n 80 "$LOG"
echo '```'
echo '</details>'
else
echo '> LHCI did not finish cleanly — see job log.'
echo ''
echo '```'
tail -n 60 "$LOG" 2>/dev/null || echo '(no log)'
echo '```'
fi
else
echo '> No LHCI log captured.'
fi
} >> "$GITHUB_STEP_SUMMARY"

- name: Summarize build output
if: always()
run: |
set -euo pipefail
GUIDES_DIR="apps/guides"
OUT_DIR="${GUIDES_DIR}/out"
OG_DIR="${GUIDES_DIR}/public/og"
CONTENT_FILE="${GUIDES_DIR}/lib/content.ts"
POSTS_DIR="${GUIDES_DIR}/content/posts"

mdx_count=$(find "$POSTS_DIR" -maxdepth 1 -name '*.mdx' 2>/dev/null | wc -l | tr -d ' ')
content_count=0
if [ -f "$CONTENT_FILE" ]; then
# Tolerate both `slug:` and `"slug":` shapes — build-content has emitted both.
content_count=$(grep -cE '^[[:space:]]+"?slug"?[[:space:]]*:' "$CONTENT_FILE" || true)
fi
og_count=0
if [ -d "$OG_DIR" ]; then
og_count=$(find "$OG_DIR" -maxdepth 1 -name '*.png' 2>/dev/null | wc -l | tr -d ' ')
fi
out_size="(missing)"
out_html=0
if [ -d "$OUT_DIR" ]; then
out_size=$(du -sh "$OUT_DIR" 2>/dev/null | cut -f1)
out_html=$(find "$OUT_DIR" -maxdepth 3 -name '*.html' 2>/dev/null | wc -l | tr -d ' ')
fi
root_og="missing"
if [ -f "${GUIDES_DIR}/public/og-image.png" ]; then
root_og="ok ($(stat -c%s "${GUIDES_DIR}/public/og-image.png" 2>/dev/null || stat -f%z "${GUIDES_DIR}/public/og-image.png") bytes)"
fi

{
echo "## Guides build summary"
echo ""
echo "| Metric | Value |"
echo "|---|---|"
echo "| MDX source files (\`content/posts/*.mdx\`) | $mdx_count |"
echo "| Posts in \`lib/content.ts\` | $content_count |"
echo "| Per-post OG PNGs (\`public/og/*.png\`) | $og_count |"
echo "| Root \`public/og-image.png\` | $root_og |"
echo "| Static HTML pages in \`out/\` | $out_html |"
echo "| \`out/\` directory size | $out_size |"
echo ""
if [ "$mdx_count" -gt 0 ] && [ "$content_count" -lt "$mdx_count" ]; then
echo "> WARNING: \`lib/content.ts\` reports fewer posts than there are MDX files on disk."
echo "> This indicates \`build-content\` did not run (or ran before MDX changes were committed)."
echo "> See PR #2436."
fi
if [ "$mdx_count" -gt 0 ] && [ "$og_count" -lt "$mdx_count" ]; then
echo "> WARNING: fewer OG images than MDX files — \`generate-og-images\` may have read a stale \`lib/content.ts\`."
fi
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload Lighthouse reports (guides)
if: always()
uses: actions/upload-artifact@v7
with:
name: guides-lighthouse
path: apps/guides/.lighthouseci
retention-days: 14
if-no-files-found: warn

- name: Upload guides static export
if: always()
uses: actions/upload-artifact@v7
with:
name: guides-out
path: apps/guides/out
retention-days: 7
if-no-files-found: warn

- name: Upload guides build log
if: always()
uses: actions/upload-artifact@v7
with:
name: guides-build-log
path: /tmp/guides-build.log
retention-days: 7
if-no-files-found: ignore

landing:
name: Builds (landing)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install --frozen-lockfile

- name: Build landing app
id: build
run: |
set -o pipefail
bun run --cwd apps/landing build 2>&1 | tee /tmp/landing-build.log

- name: Validate OG meta in built HTML
# Parse every out/*.html + out/<slug>/index.html and assert the
# OG / Twitter meta tags every social previewer (LinkedIn, FB,
# microlink, Slack) expects. Catches relative og:image URLs,
# missing twitter:card, and similar regressions before the
# artifact is uploaded.
run: bun run --cwd apps/landing test:og-meta

- name: Lighthouse CI
# Runs `lhci autorun` against the already-built `out/` directory.
# Budgets in .lighthouserc.js: perf >=0.8, a11y/best-practices/seo
# >=0.9, LCP <2500ms, CLS <0.1. Error pages (404/500) are excluded
# via assertMatrix. Real failures fail the workflow.
id: lhci
run: bun run --cwd apps/landing lighthouse:ci 2>&1 | tee /tmp/landing-lhci.log

- name: Summarize Lighthouse scores
if: always()
run: |
set -euo pipefail
LOG=/tmp/landing-lhci.log
{
echo ""
echo "## Landing Lighthouse CI"
echo ""
if [ -f "$LOG" ]; then
if grep -q "All results processed!" "$LOG" 2>/dev/null; then
echo '<details><summary>LHCI output (tail)</summary>'
echo ''
echo '```'
tail -n 80 "$LOG"
echo '```'
echo '</details>'
else
echo '> LHCI did not finish cleanly — see job log.'
echo ''
echo '```'
tail -n 60 "$LOG" 2>/dev/null || echo '(no log)'
echo '```'
fi
else
echo '> No LHCI log captured.'
fi
} >> "$GITHUB_STEP_SUMMARY"

- name: Summarize build output
if: always()
run: |
set -euo pipefail
OUT_DIR="apps/landing/out"
out_size="(missing)"
out_html=0
if [ -d "$OUT_DIR" ]; then
out_size=$(du -sh "$OUT_DIR" 2>/dev/null | cut -f1)
out_html=$(find "$OUT_DIR" -maxdepth 3 -name '*.html' 2>/dev/null | wc -l | tr -d ' ')
fi
root_og="missing"
if [ -f "apps/landing/public/og-image.png" ]; then
root_og="ok ($(stat -c%s apps/landing/public/og-image.png 2>/dev/null || stat -f%z apps/landing/public/og-image.png) bytes)"
fi
{
echo "## Landing build summary"
echo ""
echo "| Metric | Value |"
echo "|---|---|"
echo "| Static HTML pages in \`out/\` | $out_html |"
echo "| \`out/\` directory size | $out_size |"
echo "| Root \`public/og-image.png\` | $root_og |"
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload Lighthouse reports (landing)
if: always()
uses: actions/upload-artifact@v7
with:
name: landing-lighthouse
path: apps/landing/.lighthouseci
retention-days: 14
if-no-files-found: warn

- name: Upload landing static export
if: always()
uses: actions/upload-artifact@v7
with:
name: landing-out
path: apps/landing/out
retention-days: 7
if-no-files-found: warn

- name: Upload landing build log
if: always()
uses: actions/upload-artifact@v7
with:
name: landing-build-log
path: /tmp/landing-build.log
retention-days: 7
if-no-files-found: ignore
Loading
Loading