Repository navigation
refactor(sets): share SET_TYPES across frontend and edge - #526
Conversation
Pin the sets_set_type_check constraint to SET_TYPES with a unit test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMhMAja3g8dwyMnAjVCLN2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deploy →
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactor preserves validation behavior, adds drift detection, and has no unresolved findings.
0 open findings
What changed in this PR
Centralizes set-type definitions shared by the frontend and edge functions, with a test to detect database constraint drift.
Changes:
- Reuses shared constants, types, and validation through frontend exports.
- Adds a migration-based constraint consistency test.
- Updates documentation to describe the shared definition.
| File | Description |
|---|---|
supabase/functions/_shared/setTypes.ts |
Documents the shared definition and drift test. |
src/lib/setTypeConstraint.test.ts |
Checks constraint values against SET_TYPES. |
src/api/sets/types.ts |
Replaces duplicate definitions with shared exports. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Generated by Claude Code |
Playwright test resultsDetails
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Mb7n65Uv6JK1vgDFZCVPw
|
Generated by Claude Code |
|
The re-run of Generated by Claude Code |
|
CI is red on Generated by Claude Code |
|
CI Generated by Claude Code |
|
Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TL8Yq3Q42iWAE8GCu58TTq
|
Generated by Claude Code |
UPL-50: collapses the two TS copies of
SET_TYPESintosupabase/functions/_shared/setTypes.ts(imported insrc/api/sets/types.tsvia a new@functionsalias).Verification
pnpm test; it passes.🤖 Generated with Claude Code
https://claude.ai/code/session_01TL8Yq3Q42iWAE8GCu58TTq