feat: standardize route modules to export default with RouteKind brand#162
Merged
Conversation
…teKind brand
Route files now use `export default` instead of named exports, and
definePage/defineHandler/defineErrorPage stamp a RouteKind symbol brand
on the config. This replaces structural type checks ("template" in module)
with nominal discrimination, and simplifies extractModule to a single
namespace.default read — fixing the handler unwrapping bug (#157).
Closes #158, closes #159, closes #160, closes #161
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accept our RouteNamespace type and isPageModule changes, remove create-request-handler files deleted in main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Closed
qantrepreneur
added a commit
that referenced
this pull request
May 21, 2026
…teKind brand (#162) Route files now use `export default` instead of named exports, and definePage/defineHandler/defineErrorPage stamp a RouteKind symbol brand on the config. This replaces structural type checks ("template" in module) with nominal discrimination, and simplifies extractModule to a single namespace.default read — fixing the handler unwrapping bug (#157). Closes #158, closes #159, closes #160, closes #161 Co-authored-by: Lorenzo <lorenzofkramer@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RouteKindsymbol brand (Symbol.for("sundayceo.routeKind")) toPageModuleandHandlerModuletypes, stamped bydefinePage,defineHandler, anddefineErrorPageexport defaultinstead of named exports (export const page/export const handler)extractModuleto a singlenamespace.defaultread, andisPageModuleto aRouteKindbrand check — fixing the handler unwrapping bug (Bug: extractModule doesn't unwrap handler exports → all handler routes return 405 #157)Test plan
Closes #158, closes #159, closes #160, closes #161
🤖 Generated with Claude Code