Skip to content

feat(framework): partition error pages in route scanner and codegen#145

Merged
qantrepreneur merged 3 commits into
mainfrom
104-partition-error-pages
May 15, 2026
Merged

feat(framework): partition error pages in route scanner and codegen#145
qantrepreneur merged 3 commits into
mainfrom
104-partition-error-pages

Conversation

@qantrepreneur
Copy link
Copy Markdown
Contributor

Summary

  • scanRoutes now returns { routes, errorPages } instead of a flat array
  • Error pages identified by 3-digit 4xx–5xx basename convention (e.g. 404.tsx, 500.tsx)
  • generateRouteManifest emits separate errorPages export with lazy imports keyed by status code
  • generateRouteMap excludes error pages from the RouteMap TypeScript interface
  • Non-error numeric files (200.tsx, 42.tsx) remain regular routes

Closes #104

Test plan

  • scanRoutes excludes error page files from regular routes array
  • Error pages returned as { status, filePath } entries
  • Non-error numeric files stay as regular routes
  • Codegen emits errorPages export in manifest
  • RouteMap type codegen excludes error page patterns
  • All callers (vite plugin, dev middleware) updated for new return shape

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

CI failed for this pull request.

View the failed run

@github-actions
Copy link
Copy Markdown

CI failed for this pull request.

View the failed run

Lorenzo and others added 3 commits May 15, 2026 18:39
… and codegen

scanRoutes now returns { routes, errorPages } where error pages are files
whose basename is a 3-digit 4xx/5xx HTTP status code. generateRouteManifest
emits a separate errorPages export with lazy imports keyed by status code.
generateRouteMap excludes error pages from the RouteMap type interface.
All callers updated to handle the new return shape.

Closes #104

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use .at(1) instead of match[1] to satisfy custom/no-bracket-access
ESLint rule, with proper undefined check to avoid non-null assertion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qantrepreneur qantrepreneur force-pushed the 104-partition-error-pages branch from d104a04 to 80d1c53 Compare May 15, 2026 16:40
@qantrepreneur qantrepreneur merged commit 1ee91b2 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
…145)

* feat(framework): partition error pages from regular routes in scanner and codegen

scanRoutes now returns { routes, errorPages } where error pages are files
whose basename is a 3-digit 4xx/5xx HTTP status code. generateRouteManifest
emits a separate errorPages export with lazy imports keyed by status code.
generateRouteMap excludes error pages from the RouteMap type interface.
All callers updated to handle the new return shape.

Closes #104

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(framework): replace bracket notation with .at() in route-scanner

Use .at(1) instead of match[1] to satisfy custom/no-bracket-access
ESLint rule, with proper undefined check to avoid non-null assertion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style(framework): fix prettier formatting in generate-route-manifest

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

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.

feat(framework): partition error pages in route scanner and codegen

1 participant