refactor: dead-code cleanup + drop the lib/types shim (slice 9)
- Delete orphaned components (theme-provider, task-claim-button), the unused roleDisplayName helper, the fully-dead cleanupRateLimits, the 6 never-imported validation schemas (signIn/signUp/createSpace/joinSpace — a replaced auth flow; proposalStatuses; updateAreaLeadRoleSchema). - Migrate all @/lib/types importers to the canonical @/types/domain and delete the compatibility shim. tsc 0, 635 tests green, lint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
71ba558522
commit
f775f954ad
@@ -1,30 +0,0 @@
|
||||
import { z } from 'zod'
|
||||
import { emailField } from './primitives'
|
||||
|
||||
export const signInSchema = z.object({
|
||||
email: emailField(),
|
||||
password: z.string().min(1, 'Password is required'),
|
||||
})
|
||||
|
||||
export const signUpSchema = z.object({
|
||||
email: emailField(),
|
||||
password: z.string().min(8, 'Password must be at least 8 characters'),
|
||||
fullName: z.string().min(1, 'Full name is required').max(100, 'Name is too long'),
|
||||
action: z.enum(['create', 'join']),
|
||||
spaceName: z.string().max(100).optional(),
|
||||
spaceSlug: z.string().regex(/^[a-z0-9]+$/, 'Slug must be lowercase letters and numbers only').max(50).optional(),
|
||||
city: z.string().max(100).optional(),
|
||||
inviteCode: z.string().max(20).optional(),
|
||||
})
|
||||
|
||||
export const createSpaceSchema = z.object({
|
||||
spaceName: z.string().min(1, 'Space name is required').max(100, 'Name is too long'),
|
||||
spaceSlug: z.string().min(1, 'Slug is required').max(50).regex(/^[a-z0-9]+$/, 'Slug must be lowercase letters and numbers only'),
|
||||
spaceCity: z.string().max(100).optional(),
|
||||
displayName: z.string().min(1, 'Display name is required').max(100),
|
||||
})
|
||||
|
||||
export const joinSpaceSchema = z.object({
|
||||
inviteCode: z.string().min(1, 'Invite code is required').max(20),
|
||||
displayName: z.string().min(1, 'Display name is required').max(100),
|
||||
})
|
||||
@@ -4,7 +4,6 @@ import { flexibleDateTime } from './primitives'
|
||||
// ─── Governance: proposals ───────────────────────────────────────────────────
|
||||
|
||||
export const proposalTypes = ['bylaw_change','board_action','membership_vote','advisory_poll','recall','budget'] as const
|
||||
export const proposalStatuses = ['draft','open','decided','withdrawn','expired'] as const
|
||||
export const thresholdRules = ['simple_majority','two_thirds','three_fourths','unanimous'] as const
|
||||
export const votePositions = ['yes','no','abstain','recused'] as const
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export * from './primitives'
|
||||
export * from './auth'
|
||||
export * from './tasks'
|
||||
export * from './projects'
|
||||
export * from './members'
|
||||
|
||||
@@ -24,11 +24,6 @@ export const createAreaLeadRoleSchema = z.object({
|
||||
color: z.string().max(20).optional().nullable(),
|
||||
})
|
||||
|
||||
export const updateAreaLeadRoleSchema = z.object({
|
||||
name: z.string().min(1).max(100).optional(),
|
||||
color: z.string().max(20).optional().nullable(),
|
||||
})
|
||||
|
||||
export const assignAreaLeadSchema = z.object({
|
||||
area_lead_role_id: z.string().uuid('Invalid role ID'),
|
||||
member_id: z.string().uuid('Invalid member ID'),
|
||||
|
||||
Reference in New Issue
Block a user