fix: resolve TypeScript build errors and code quality issues#104
Merged
support371 merged 2 commits intomainfrom May 7, 2026
Merged
fix: resolve TypeScript build errors and code quality issues#104support371 merged 2 commits intomainfrom
support371 merged 2 commits intomainfrom
Conversation
…ration - Fix type definitions for GateResult union type to enable proper type narrowing - Remove unused Supabase integration files (client.ts, types.ts) - Fix RSS parser type error by removing reference to non-existent 'id' property - Fix Prisma type casting for profile update/create operations - Ensure clean build with all type checks passing
- The declare global block doesn't trigger no-var rule, so directive was unnecessary - Add clarifying comment about why we use var for global state persistence
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR resolves TypeScript build and type-narrowing issues, cleans up code quality concerns, and removes an unused Supabase integration to make the codebase production-ready. Sequence diagram for admin campaign PATCH guard flowsequenceDiagram
actor Admin
participant RoutePatch as AdminCampaignsPatchHandler
participant Auth as requireAdmin
participant DB
Admin->>RoutePatch: PATCH /api/admin/campaigns/:id
RoutePatch->>Auth: requireAdmin()
Auth-->>RoutePatch: GateResult
alt gate.ok is false
RoutePatch-->>Admin: gate.response
else gate.ok is true
RoutePatch->>DB: updateCampaign()
DB-->>RoutePatch: updated campaign
RoutePatch-->>Admin: 200 OK
end
Class diagram for updated GateResult auth typesclassDiagram
class SessionPayload
class NextResponse
class GateOk {
+boolean ok
+SessionPayload session
-never response
}
class GateErr {
+boolean ok
+NextResponse response
-never session
}
class GateResult
class AuthHelpers {
+GateResult requireAdmin()
}
class AdminCampaignsPatchHandler {
+PATCH(req: NextRequest, params: PromiseIdParam)
}
class NextRequest
class PromiseIdParam {
+string id
}
GateResult <|.. GateOk
GateResult <|.. GateErr
AuthHelpers ..> GateResult : returns
AdminCampaignsPatchHandler ..> AuthHelpers : calls requireAdmin
AdminCampaignsPatchHandler ..> GateOk : uses when ok is true
AdminCampaignsPatchHandler ..> GateErr : uses when ok is false
Flow diagram for updated RSS guid selection logicflowchart TD
A[Parser.Item and fallbackUrl] --> B{item.guid is non-empty after trim?}
B -- Yes --> C[Return trimmed item.guid]
B -- No --> D[Return fallbackUrl]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
|
Deployment failed with the following error: Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
data as anycasts in the profileupsertcall weaken type safety; consider aligningdatato the appropriate PrismaProfileUpdateInput/ProfileCreateInput(or a narrowed subtype) so the upsert is fully typed withoutany. - In
pickGuid, removing theitem.idfallback changes behavior for feeds that may provide anidfield even if it's not in the type; if that field exists at runtime, consider accessing it via a narrowed orunknown/anycast rather than dropping it entirely to preserve previous behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `data as any` casts in the profile `upsert` call weaken type safety; consider aligning `data` to the appropriate Prisma `ProfileUpdateInput`/`ProfileCreateInput` (or a narrowed subtype) so the upsert is fully typed without `any`.
- In `pickGuid`, removing the `item.id` fallback changes behavior for feeds that may provide an `id` field even if it's not in the type; if that field exists at runtime, consider accessing it via a narrowed or `unknown`/`any` cast rather than dropping it entirely to preserve previous behavior.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
This PR consolidates all critical fixes needed for production deployment:
Changes
Testing
Deployment
This PR aligns the gem-enterprise repository with the v0 feature branch and ensures all code is production-ready for immediate deployment on Vercel.
Summary by Sourcery
Resolve TypeScript build and type-narrowing issues to make the API and news ingestion code production-ready.
Bug Fixes:
Enhancements:
Chores: