feat: static mock-api layer for browser-only deploys#13
Draft
d3v07 wants to merge 21 commits into
Draft
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
fix/seed-boot-integration-testbranch state for reviewmainVerification