-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Refactor middleware exports to named exports for consistency #2973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughConverts middleware functions across the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes This is a consistent, homogeneous refactoring of export/import patterns with no logic or behavior changes. All modifications follow the same straightforward pattern across multiple files, making verification quick. Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
apps/web/lib/middleware/admin.ts
(1 hunks)apps/web/lib/middleware/api.ts
(1 hunks)apps/web/lib/middleware/app.ts
(1 hunks)apps/web/lib/middleware/axiom.ts
(1 hunks)apps/web/lib/middleware/create-link.ts
(1 hunks)apps/web/lib/middleware/embed.ts
(1 hunks)apps/web/lib/middleware/index.ts
(1 hunks)apps/web/lib/middleware/link.ts
(1 hunks)apps/web/lib/middleware/new-link.ts
(1 hunks)apps/web/lib/middleware/partners.ts
(1 hunks)apps/web/lib/middleware/workspaces.ts
(1 hunks)apps/web/middleware.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (12)
apps/web/lib/middleware/embed.ts (1)
4-4
: LGTM! Clean refactoring to named export.The conversion from default export to named export is straightforward and improves consistency across the middleware layer.
apps/web/lib/middleware/admin.ts (1)
7-7
: LGTM! Consistent refactoring.The named export pattern improves code discoverability and aligns with the PR's consistency goal.
apps/web/lib/middleware/partners.ts (1)
19-19
: LGTM! Consistent with the refactoring pattern.The named export enhances import clarity and follows the established pattern across the middleware directory.
apps/web/lib/middleware/axiom.ts (1)
4-4
: LGTM! Clean conversion to named export.The refactoring maintains the function signature and logic while improving module consistency.
apps/web/lib/middleware/link.ts (1)
41-41
: LGTM! Consistent refactoring.The named export pattern is properly applied, maintaining all existing functionality.
apps/web/lib/middleware/new-link.ts (1)
7-7
: LGTM! Proper named export conversion.The refactoring is consistent with the PR objective and maintains the function's signature and behavior.
apps/web/lib/middleware/create-link.ts (1)
5-5
: LGTM! Clean refactoring to named export.The conversion maintains all existing functionality while improving code consistency.
apps/web/lib/middleware/api.ts (1)
4-4
: LGTM! Clean conversion to named export.The change from default export to named export is correct and aligns with the PR objective for consistency.
apps/web/lib/middleware/app.ts (2)
12-12
: LGTM! Clean conversion to named export.The change from default export to named export for
AppMiddleware
is correct and aligns with the PR objective.
3-4
: All middleware files correctly export named exports — verification complete.All three middleware functions are properly exported as named exports:
embed.ts
exportsexport function EmbedMiddleware
new-link.ts
exportsexport async function NewLinkMiddleware
workspaces.ts
exportsexport async function WorkspacesMiddleware
The named imports in
app.ts
(lines 3-4 and line 10) match the exported function names exactly. No issues found.apps/web/middleware.ts (1)
19-19
: No issues found — PartnersMiddleware is correctly exported as a named export.Verification confirms that
apps/web/lib/middleware/partners.ts
exportsPartnersMiddleware
as a named export (line 19:export async function PartnersMiddleware
), and the import statement inmiddleware.ts
correctly uses named import syntax. No default export exists.apps/web/lib/middleware/index.ts (1)
1-6
: All middleware exports verified correctly.Verification confirms:
- ✅ All 6 source middleware files (
admin.ts
,api.ts
,app.ts
,axiom.ts
,create-link.ts
,link.ts
) export functions as named exports usingexport function
orexport async function
- ✅ Barrel export in
index.ts
correctly re-exports all 6 middleware as named exports- ✅ Consumer in
apps/web/middleware.ts
correctly imports using named imports from@/lib/middleware
- ✅ No default exports found in any middleware files
The code changes are correct and properly structured.
Summary by CodeRabbit