Skip to content

feat: standardize route modules to export default with RouteKind brand#162

Merged
qantrepreneur merged 2 commits into
mainfrom
158-routekind-brand-export-default
May 15, 2026
Merged

feat: standardize route modules to export default with RouteKind brand#162
qantrepreneur merged 2 commits into
mainfrom
158-routekind-brand-export-default

Conversation

@qantrepreneur
Copy link
Copy Markdown
Contributor

Summary

  • Add RouteKind symbol brand (Symbol.for("sundayceo.routeKind")) to PageModule and HandlerModule types, stamped by definePage, defineHandler, and defineErrorPage
  • Standardize all route files to use export default instead of named exports (export const page/export const handler)
  • Simplify extractModule to a single namespace.default read, and isPageModule to a RouteKind brand check — fixing the handler unwrapping bug (Bug: extractModule doesn't unwrap handler exports → all handler routes return 405 #157)
  • Update CONTEXT.md glossary and add ADR-0007

Test plan

  • All 252 framework tests pass
  • All 25 playground tests pass
  • Build succeeds (ESM + DTS)
  • Type checking passes across monorepo
  • Prettier and ESLint pass

Closes #158, closes #159, closes #160, closes #161

🤖 Generated with Claude Code

Lorenzo and others added 2 commits May 16, 2026 00:31
…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>
@qantrepreneur qantrepreneur merged commit 4228a11 into main May 15, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request May 15, 2026
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 was referenced May 23, 2026
@qantrepreneur qantrepreneur deleted the 158-routekind-brand-export-default branch May 24, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant