Skip to content

Consolidate the mock data files into lib/mock/ with a factory pattern #210

Description

@Benjtalkshow

The mock data layer is spread across several top-level files: lib/mock-bounty.ts, lib/mock-model4.ts, lib/mock-leaderboard.ts, lib/mock-wallet.ts, lib/mock-project.ts, lib/mock-data.ts. They're imported from random places across the codebase with no consistent convention, and there's no single place to flip between data sources.

Move them into lib/mock/ and expose factory functions so we can swap data sources in one place later.

What to do

Create lib/mock/ with subfiles per domain:

  • lib/mock/bounties.ts
  • lib/mock/leaderboard.ts
  • lib/mock/wallet.ts
  • lib/mock/projects.ts
  • lib/mock/model4.ts

Each file should export factory functions (makeMockBounty(overrides?), makeMockLeaderboardEntry(...), etc.) rather than static arrays where possible, so tests and stories can build fixtures inline.

Add lib/mock/index.ts that re-exports everything.

Find and replace all imports across the codebase. Delete the old top-level files.

Acceptance criteria

  • All mock imports come from @/lib/mock/... or @/lib/mock
  • No remaining lib/mock-*.ts files at the top level
  • pnpm tsc --noEmit and pnpm lint pass
  • No behavioral change in the app

Files

  • lib/mock-*.ts (delete)
  • lib/mock/* (new)
  • All importers across app/, components/, hooks/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions