Skip to content

feat(framework): add defineHandler curried API (#10)#39

Merged
qantrepreneur merged 1 commit into
mainfrom
10-define-handler
May 14, 2026
Merged

feat(framework): add defineHandler curried API (#10)#39
qantrepreneur merged 1 commit into
mainfrom
10-define-handler

Conversation

@qantrepreneur
Copy link
Copy Markdown
Contributor

Summary

  • Implement defineHandler with curried defineHandler("/path")({ GET, POST, ... }) signature for API routes
  • Supports all HTTP methods (GET, POST, PUT, PATCH, DELETE) with typed params inferred from RouteMap
  • Runtime behavior is identity (returns config unchanged); type-level only for param inference
  • 7 tests covering runtime identity, all HTTP methods, optional methods, typed params, async handlers, and paramless routes

Test plan

  • pnpm --filter @sundayceo/framework test — all 16 tests pass (9 existing + 7 new)
  • pnpm --filter @sundayceo/framework check-types — no type errors
  • pnpm lint — no lint errors
  • pnpm format — all files formatted

Closes #10

🤖 Generated with Claude Code

Implement defineHandler with curried path → config signature for API
routes. Supports GET, POST, PUT, PATCH, DELETE method handlers with
typed params from RouteMap. Runtime behavior is identity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qantrepreneur qantrepreneur merged commit d16199c into main May 14, 2026
2 checks passed
@qantrepreneur qantrepreneur deleted the 10-define-handler branch May 14, 2026 15:48
@github-actions github-actions Bot mentioned this pull request May 14, 2026
qantrepreneur added a commit that referenced this pull request May 21, 2026
Implement defineHandler with curried path → config signature for API
routes. Supports GET, POST, PUT, PATCH, DELETE method handlers with
typed params from RouteMap. Runtime behavior is identity.

Co-authored-by: Lorenzo <lorenzofkramer@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced May 23, 2026
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.

defineHandler curried API with method handlers

1 participant