mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1075] [MERGED] refactor(check): dedupe status sort and App Router file filters #1072
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#1072
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/1075
Author: @james-elicx
Created: 5/5/2026
Status: ✅ Merged
Merged: 5/5/2026
Merged by: @james-elicx
Base:
main← Head:refactor/cleanup-check-ts-internals📝 Commits (1)
fc7522erefactor(check): dedupe status sort and App Router file filters📊 Changes
1 file changed (+39 additions, -31 deletions)
View changed files
📝
packages/vinext/src/check.ts(+39 -31)📄 Description
Summary
Pure-refactor follow-up to #1058. Two related cleanups in
packages/vinext/src/check.ts:A. Status-ordering comparator
The literal
{ unsupported: 0, partial: 1, supported: 2 }map was inlined inside three separateArray.sortcallbacks (inscanImports,analyzeConfig,checkLibraries). Extracted as a single file-privateSTATUS_ORDERconstant plus acompareByStatus()comparator. Each call site now reads asitems.sort(compareByStatus).B. App Router file convention filters
Five parallel
endsWith(...) || endsWith(...)filter chains forpage,layout,loading,error, andnot-foundfiles were collapsed into a singleAPP_ROUTER_EXTENSIONStable and a smallisAppRouterFile(file, type)predicate. The original asymmetry is preserved:pageandlayoutaccept.tsx | .jsx | .ts | .js, while the React-component-only boundaries (loading,error,not-found) accept only.tsx | .jsx. Theroutefilter is intentionally left alone because its extension set (.tsx | .ts | .js— no.jsx) is unique to it.Both helpers stay file-private. No public API change, no behaviour change.
Files changed
packages/vinext/src/check.ts(+39 / -31)Test plan
pnpm vp test run tests/check.test.ts(97/97 pass)pnpm fmt --writepnpm knip(clean)Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.