style(13-03): apply Prettier formatting across repo

Mechanical reformat — no logic changes. 398 files changed, 19125
insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc
(singleQuote:true, semi:true, tabWidth:2, trailingComma:all,
printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
Lucas Berger
2026-06-11 20:35:18 -04:00
parent 4bc0445173
commit 982438dc10
398 changed files with 19050 additions and 16382 deletions
@@ -5,11 +5,35 @@ subsystem: api/push-foundation
tags: [web-push, vapid, schema, migration, test-scaffolds, red-tests]
dependency_graph:
requires: [04-shared-lists-live-sync]
provides: [push_subscriptions table, calendar_events.title column, Wave-0 RED test scaffolds, VAPID env wiring]
affects: [apps/api/src/db/schema.ts, apps/api/src/db/migrations/, apps/api/test/setup.ts, docker-compose.yml]
provides:
[
push_subscriptions table,
calendar_events.title column,
Wave-0 RED test scaffolds,
VAPID env wiring,
]
affects:
[
apps/api/src/db/schema.ts,
apps/api/src/db/migrations/,
apps/api/test/setup.ts,
docker-compose.yml,
]
tech_stack:
added: [web-push@3.6.7, "@types/web-push@3.6.4", workbox-core@7.4.1, workbox-precaching@7.4.1, workbox-routing@7.4.1]
patterns: [drizzle-kit generate+migrate (never push), mysqlTable FK+unique+index pattern, RED test scaffold pattern]
added:
[
web-push@3.6.7,
'@types/web-push@3.6.4',
workbox-core@7.4.1,
workbox-precaching@7.4.1,
workbox-routing@7.4.1,
]
patterns:
[
drizzle-kit generate+migrate (never push),
mysqlTable FK+unique+index pattern,
RED test scaffold pattern,
]
key_files:
created:
- apps/api/src/db/migrations/0003_same_xavin.sql
@@ -29,13 +53,13 @@ key_files:
- pnpm-lock.yaml
- docker-compose.yml
decisions:
- "VAPID config is env-injected at runtime (docker-compose.yml environment block); no key baked into image"
- "pushSubscriptions endpoint column uses text (not varchar) — push endpoints can exceed 512 chars"
- "calendarEvents.title is nullable varchar(500); pre-existing rows stay NULL until Phase 5 sync update"
- "Test VAPID keypair inlined in tests/fixtures/vapid.ts for offline-safe unit tests"
- 'VAPID config is env-injected at runtime (docker-compose.yml environment block); no key baked into image'
- 'pushSubscriptions endpoint column uses text (not varchar) — push endpoints can exceed 512 chars'
- 'calendarEvents.title is nullable varchar(500); pre-existing rows stay NULL until Phase 5 sync update'
- 'Test VAPID keypair inlined in tests/fixtures/vapid.ts for offline-safe unit tests'
metrics:
duration: 20
completed_date: "2026-06-10"
completed_date: '2026-06-10'
tasks_completed: 4
files_changed: 15
---
@@ -47,15 +71,18 @@ Web Push Wave-0 foundation: push dependencies installed, VAPID keypair env-injec
## Tasks Executed
### Task 1: Package legitimacy gate + install push dependencies
**Status:** Done by orchestrator before this agent spawned.
Installed packages verified in package.json:
- `apps/api`: web-push@^3.6.7 (prod), @types/web-push@^3.6.4 (dev)
- `apps/pwa`: workbox-core@^7.4.1, workbox-precaching@^7.4.1, workbox-routing@^7.4.1 (dev)
Commit: `80bbdc1``chore(05-01): install web-push and workbox push dependencies`
### Task 2: Generate VAPID keypair + record in env
**Status:** Done by orchestrator before this agent spawned.
VAPID keypair generated and stored in gitignored `.env` (VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT). Real keys never committed.
@@ -63,9 +90,11 @@ VAPID keypair generated and stored in gitignored `.env` (VAPID_PUBLIC_KEY, VAPID
(No dedicated commit — keys in .env only; .env.example documenting placeholders committed in Task 3.)
### Task 3: Schema — push_subscriptions table + calendar_events.title, generate+migrate
**Status:** Completed.
Added `pushSubscriptions` mysqlTable to `apps/api/src/db/schema.ts`:
- `user_id` INT NOT NULL FK → users.id ON DELETE CASCADE
- `endpoint` TEXT NOT NULL (globally unique — `uniq_push_endpoint`)
- `p256dh` TEXT NOT NULL
@@ -82,6 +111,7 @@ VAPID container-transposability: added VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPI
Commit: `73fcdaf``feat(05-01): add push_subscriptions table + calendar_events.title column; VAPID env wiring`
### Task 4: Wave-0 RED test scaffolds + VAPID fixture + setup truncation
**Status:** Completed.
Created `tests/fixtures/vapid.ts` — exports `TEST_VAPID` const with a statically inlined P-256 keypair (generated once; no runtime network call; offline-safe).
@@ -95,6 +125,7 @@ Created five RED test scaffolds (all fail on `Cannot find module` — correct RE
5. **tests/routes/push.test.ts** — POST 201/401; DELETE removes rows; GET /api/push/vapid-public-key returns `{ publicKey }`
Updated `test/setup.ts`:
- Added `pushSubscriptions` to import from schema
- Added `await db.delete(pushSubscriptions)` in afterEach (before lists delete; no FK to lists)
@@ -136,6 +167,7 @@ No new threat surface introduced. VAPID private key is in gitignored `.env` only
- [x] .env.example — exists
**Commits verified:**
- 80bbdc1: chore(05-01): install web-push and workbox push dependencies
- 73fcdaf: feat(05-01): add push_subscriptions table + calendar_events.title column; VAPID env wiring
- ef558b6: test(05-01): add Wave-0 RED scaffolds + VAPID fixture + setup truncation