Skip to content

Create a single stable boundary for mock API exports #384

Description

@Lakes41

Difficulty

Intermediate

Type

refactor, consistency, structure

Background

The current compilation trace shows components/nav.tsx importing through lib/api/index.ts, which in turn depends on lib/api/mock.ts. The mock implementation is therefore part of the application's API dependency boundary.

Problem

A large mock implementation exposed through the API layer can make consumers unnecessarily dependent on implementation details. Structural changes inside mock.ts can consequently break unrelated UI modules.

Expected outcome

Establish a clear API boundary so application components consume mock functionality through stable exports rather than depending on the internal organization of the mock implementation.

Suggested implementation

Review the exports in lib/api/index.ts and the symbols imported by components/nav.tsx. Consolidate mock-facing exports behind the API index and remove unnecessary direct exposure of internal mock structures. Preserve existing consumer behavior and names where they are already part of the application API.

Acceptance criteria

  • components/nav.tsx does not depend on internal mock implementation details.
  • Mock functionality required by the navigation is exported through the intended API boundary.
  • Internal mock modules can be reorganized without requiring UI consumers to change imports.
  • No unused mock exports are retained solely for compatibility unless they are actually consumed elsewhere.
  • The application compiles successfully.

Likely affected files/directories

  • lib/api/index.ts
  • lib/api/mock.ts
  • components/nav.tsx
  • Other files importing symbols directly from lib/api/mock.ts, if present

Metadata

Metadata

Labels

Third CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsconsistencyPattern and convention standardization across the codebase for uniformityintermediateIntermediate difficulty tasks requiring solid experience and some contextrefactorCode restructuring without changing external behavior or API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions