Skip to content

refactor: remove unused shadcn components, restructured jobs into feature dir and add email verification job#20

Merged
kegren merged 1 commit intomainfrom
refactor-remove-unused-shadcn-components
Jan 4, 2026
Merged

refactor: remove unused shadcn components, restructured jobs into feature dir and add email verification job#20
kegren merged 1 commit intomainfrom
refactor-remove-unused-shadcn-components

Conversation

@kegren
Copy link
Owner

@kegren kegren commented Jan 4, 2026

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Jan 4, 2026

Greptile Summary

This PR accomplishes two main objectives: removing 25 unused shadcn UI components to reduce bundle size and complexity, and refactoring the job queue system to add a new email verification feature with better organization.

Key Changes:

  • Removed unused UI components (accordion, alert, calendar, carousel, chart, etc.) that were scaffolded but never utilized
  • Restructured job definitions from src/lib/server/jobs/ to src/features/jobs/ following feature-based architecture
  • Added comprehensive email verification job with proper type safety, Zod validation, retry logic, and configurable job options (exponential backoff, expiration)
  • Updated all import paths to reference the new job registry location
  • Minor comment cleanup in Nitro config

Quality Observations:

  • All removed components had zero dependencies in the codebase
  • Job refactoring is complete with no broken imports remaining
  • New email job implementation includes proper error handling via Zod validation and sensible queue configuration
  • Dependencies (email components and utilities) are correctly satisfied

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues identified. All removals are verified unused, refactoring is complete with correct import paths, and new functionality is properly implemented.
  • Score of 5 reflects: (1) Complete and verified removal of unused components with zero broken dependencies, (2) Proper refactoring of job system with all import paths updated correctly, (3) Well-implemented email verification job with type safety, validation, and sensible configuration, (4) All required dependencies exist and are correctly referenced, (5) Clean architectural change from lib-based to feature-based organization following best practices.
  • No files require special attention. All changes are straightforward removals or properly organized additions.

Important Files Changed

Filename Overview
src/features/jobs/definitions/email.job.tsx New email verification job implementation with proper type safety, error handling, and job configuration. Uses Zod for payload validation and includes sensible retry/expiration settings. Dependencies on email component and send utility are correctly satisfied.
src/features/jobs/register.ts Clean aggregation file that registers all job definitions. Simple and correct implementation following the existing pattern.
src/lib/server/queue.ts Updated import path from moved job registry file. Change is correct and consistent with the refactoring.

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant Queue as Queue Manager<br/>(queue.ts)
    participant JobReg as Job Registry<br/>(register.ts)
    participant EmailJob as Email Job<br/>(email.job.tsx)
    participant PgBoss as pg-boss
    participant EmailSvc as Email Service

    App->>Queue: initQueue()
    Queue->>PgBoss: new PgBoss(databaseUrl)
    Queue->>PgBoss: start()
    Queue->>JobReg: registerJobs(boss)
    JobReg->>EmailJob: registerEmailJobs(boss)
    EmailJob->>PgBoss: createQueue('email.send-verification')
    EmailJob->>PgBoss: work() - register handler
    PgBoss-->>EmailJob: ready

    Note over App: Later: Enqueue verification email
    App->>EmailJob: enqueueSendVerificationEmail(boss, payload)
    EmailJob->>PgBoss: send('email.send-verification', payload)
    PgBoss->>EmailJob: invoke handler with job data
    EmailJob->>EmailJob: parse & validate payload
    EmailJob->>EmailSvc: sendEmail({to, subject, template})
    EmailSvc-->>EmailJob: { sent: true, timestamp }
    EmailJob-->>PgBoss: { sent: true, timestamp }
Loading

@kegren kegren merged commit affa7b7 into main Jan 4, 2026
2 checks passed
@kegren kegren deleted the refactor-remove-unused-shadcn-components branch January 4, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant