-
Notifications
You must be signed in to change notification settings - Fork 96
Add parser-safe validation for mock API module structure #386
Copy link
Copy link
Closed
Labels
Third CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsintermediateIntermediate difficulty tasks requiring solid experience and some contextIntermediate difficulty tasks requiring solid experience and some contextstructureCode structural organization, architecture changes, and module boundary improvementsCode structural organization, architecture changes, and module boundary improvementstech-debtTechnical debt reduction, maintenance improvements, and deferred cleanup workTechnical debt reduction, maintenance improvements, and deferred cleanup work
Description
Activity
Metadata
Metadata
Assignees
Labels
Third CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsintermediateIntermediate difficulty tasks requiring solid experience and some contextIntermediate difficulty tasks requiring solid experience and some contextstructureCode structural organization, architecture changes, and module boundary improvementsCode structural organization, architecture changes, and module boundary improvementstech-debtTechnical debt reduction, maintenance improvements, and deferred cleanup workTechnical debt reduction, maintenance improvements, and deferred cleanup work
Difficulty
Intermediate
Type
tech-debt, structure, error-handling
Background
A syntax error in
lib/api/mock.tscurrently prevents the entire Next.js application from compiling. Because the file is a large mock API module, structural mistakes can have a wide application-level impact.Problem
The current mock API structure provides little local isolation when a syntax or module-boundary error is introduced. A single malformed section causes consumers such as
lib/api/index.tsandcomponents/nav.tsxto fail.Expected outcome
Reduce the scope and detectability of structural failures by organizing the mock API into independently understandable modules and adding focused validation where appropriate.
Suggested implementation
After identifying the actual mock API domains in
lib/api/mock.ts, introduce small modules with clear exports and keep the aggregation layer minimal. Add focused tests or executable module-level checks for the exported mock API functions where the repository's existing test conventions support them. Do not introduce CI configuration as part of this issue.Acceptance criteria
Likely affected files/directories
lib/api/mock.tslib/api/