Skip to content

feat: static mock-api layer for browser-only deploys#13

Draft
d3v07 wants to merge 21 commits into
mainfrom
fix/seed-boot-integration-test
Draft

feat: static mock-api layer for browser-only deploys#13
d3v07 wants to merge 21 commits into
mainfrom
fix/seed-boot-integration-test

Conversation

@d3v07

@d3v07 d3v07 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

  • no code changes made in this step
  • no additional tests run; this PR is for review of the existing branch state

d3v07 added 21 commits May 24, 2026 14:39
Addresses Copilot's only review finding on PR #11: the boot path that
wires loadSeeds() → buildApp({ seedChangeReports: getSeededChangeReports() })
had no automated test. Without this, the regression that PR #11 fixed
(lifecycle endpoints 404'ing on every seeded change id) could silently
reappear because:

- changes.lifecycle.test.ts seeds its own in-memory repo (doesn't touch
  loadSeeds or getSeededChangeReports)
- billing.test.ts uses loadSeeds for org/user data but not change reports
- the --seed CLI integration test only covers createDevSeed()

New file: tests/api/seed-boot.test.ts (3 tests)
1. acknowledge succeeds on a seeded id when seedChangeReports is passed
2. acknowledge returns 404 when seedChangeReports is omitted (regression
   guard — confirms the boot wiring is the only path keeping data flowing)
3. getSeededChangeReports() exposes the parsed seed contents

Full suite: 101/101 passing (was 98) · typecheck clean.
Bundles seed JSON into the frontend and patches window.fetch to serve
/v1/* requests in-memory. Enables the Vercel static deploy to render
real seeded data on every in-app screen without a backend.

- 56 endpoints across 11 domains (vendors, inbox, changes, renewals,
  requests, findings, reports, integrations, billing, team, misc)
- Mutations are session-local; refresh resets state
- EventSource for /v1/stream short-circuits to a no-op shim
- Mock only installs when VITE_API_BASE is unset/empty
- +30 KB gzipped bundle impact

Also adds the non-interactive Vercel deploy runbook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant