Skip to content

refactor(docs): extract typed endpoint registry - #513

Merged
mikewheeleer merged 3 commits into
StableRoute-Org:mainfrom
samjay8:refactor/docs-01-endpoint-registry
Jul 24, 2026
Merged

refactor(docs): extract typed endpoint registry#513
mikewheeleer merged 3 commits into
StableRoute-Org:mainfrom
samjay8:refactor/docs-01-endpoint-registry

Conversation

@samjay8

@samjay8 samjay8 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Closes #476

Related #512

📖 Refactor: Extract Typed Endpoint Registry Consumed by Docs Page

Centralizes all API endpoint definitions into a single typed registry module, eliminating inline hard-coding on the docs page and making documentation automatically stay in sync with the registry. No new dependencies added. Visual output unchanged.

Changes

src/lib/endpoints.ts (new)

  • Defines EndpointParam and Endpoint TypeScript interfaces for consistent structure across all entries
  • Single source of truth for all API endpoints (method, path, description, params)
  • Populated with all endpoints from the project README — easy to update in one place

src/app/docs/page.tsx

  • Removed all hard-coded inline endpoint sections
  • Now imports endpoints array from registry and maps over it to render each endpoint
  • Visual output is identical to the previous version

src/app/docs/page.test.tsx

  • Overhauled test suite to import endpoints registry directly
  • Programmatically asserts every endpoint and its parameters render correctly on the page
  • Added edge case coverage:
    • Endpoint with no parameters
    • Empty registry

Checklist

  • npm run lint — passes
  • npm test — passes
  • npm run build — passes
  • ✅ 95%+ test coverage on impacted modules
  • ✅ No new dependencies
  • ✅ Visual output unchanged

@mikewheeleer

Copy link
Copy Markdown
Contributor

@samjay8 this is clean and complete. merging, thank you! ✨

@mikewheeleer
mikewheeleer merged commit a699f18 into StableRoute-Org:main Jul 24, 2026
2 of 3 checks passed
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.

Extract endpoint metadata into a typed registry consumed by the docs page

2 participants