Skip to content

Commit 8e41e3b

Browse files
committed
refactor: centralize email constants, optimize Prisma client initialization, and improve image handling.
1 parent e9d3c45 commit 8e41e3b

29 files changed

Lines changed: 132 additions & 74 deletions

.github/workflows/quality-gates.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- name: Install dependencies
3030
run: npm ci
3131

32+
- name: Generate Prisma client
33+
run: npx prisma generate
34+
3235
- name: Run lint
3336
run: npm run lint
3437

@@ -49,6 +52,9 @@ jobs:
4952
- name: Install dependencies
5053
run: npm ci
5154

55+
- name: Generate Prisma client
56+
run: npx prisma generate
57+
5258
- name: Run TypeScript typecheck
5359
run: npx tsc --noEmit
5460

@@ -69,5 +75,8 @@ jobs:
6975
- name: Install dependencies
7076
run: npm ci
7177

78+
- name: Generate Prisma client
79+
run: npx prisma generate
80+
7281
- name: Run tests
7382
run: npm run test

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const eslintConfig = defineConfig([
1111
".next/**",
1212
"out/**",
1313
"build/**",
14+
"coverage/**",
1415
"next-env.d.ts",
1516
]),
1617
]);

next.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ const nextConfig: NextConfig = {
1818
protocol: 'https',
1919
hostname: 'github.com',
2020
},
21+
{
22+
protocol: 'https',
23+
hostname: 'i.pravatar.cc',
24+
},
25+
{
26+
protocol: 'https',
27+
hostname: 'img.shields.io',
28+
},
2129
],
2230
},
2331
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"prisma:generate": "prisma generate",
1919
"prisma:migrate": "prisma migrate dev",
2020
"prisma:deploy": "prisma migrate deploy",
21-
"backfill:kv": "node scripts/backfill-kv-to-postgres.cjs"
21+
"backfill:kv": "node scripts/backfill-kv-to-postgres.mjs"
2222
},
2323
"dependencies": {
2424
"@auth/prisma-adapter": "^2.11.1",
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
const { config } = require("dotenv");
1+
import { config } from "dotenv";
2+
import { kv } from "@vercel/kv";
3+
import { PrismaClient } from "@prisma/client";
24

35
config({ path: ".env.local" });
46
config();
57

6-
const { kv } = require("@vercel/kv");
7-
const { PrismaClient } = require("@prisma/client");
8-
98
const prisma = new PrismaClient();
109
const userIdCache = new Map();
1110

scripts/test-cache-compression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ try {
5252
} catch {
5353
console.log("PASS: gunzip threw error as expected");
5454
}
55-
} catch (e) {
55+
} catch {
5656
console.log("PASS: Buffer/gunzip handled error gracefully");
5757
}
5858

src/app/chat/page.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Suspense } from "react";
2-
import { fetchGitHubData } from "../actions";
31
import { ProfileLoader } from "@/components/ProfileLoader";
42
import { RepoLoader } from "@/components/RepoLoader";
5-
import { RepoLayout } from "@/components/RepoLayout";
6-
import { Loader2, AlertCircle, ArrowLeft, Github, Search } from "lucide-react";
7-
import { GitHubRepo } from "@/lib/github";
3+
import { ArrowLeft, Search } from "lucide-react";
84
import Link from "next/link";
95

10-
import { Metadata } from 'next';
6+
import type { Metadata } from "next";
117

128
export const metadata: Metadata = {
139
alternates: {
14-
canonical: '/chat',
15-
}
10+
canonical: "/chat",
11+
},
1612
};
1713

1814
export default async function ChatPage({

src/components/BentoFeatures.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { motion } from "framer-motion";
4-
import { MessageSquare, GitBranch, Search, Shield, Users, Activity, Layers, Code2 } from "lucide-react";
4+
import { MessageSquare, GitBranch, Shield, Users, Activity, Layers, Code2 } from "lucide-react";
55

66
export default function BentoFeatures() {
77
return (

src/components/ChatInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useRef, useEffect, useState } from "react";
22
import { useSession } from "next-auth/react";
3-
import { toast } from "sonner";
43
import { Send, Zap, Brain, ChevronDown } from "lucide-react";
54
import { cn } from "@/lib/utils";
65
import { motion, AnimatePresence } from "framer-motion";

src/components/CopyBadge.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
import { useState } from 'react';
4+
import Image from 'next/image';
45
import { Copy, Check, Code2 } from 'lucide-react';
56
import { getCanonicalSiteUrl } from '@/lib/site-url';
67

@@ -66,10 +67,13 @@ export function CopyBadge({ owner, repo }: CopyBadgeProps) {
6667
<div className="flex items-center gap-4 mt-1 bg-black/20 p-3 rounded-lg border border-white/5">
6768
<span className="text-zinc-500 uppercase tracking-wider text-xs font-semibold">Preview:</span>
6869
<a href={`${baseUrl}/repo/${owner}/${repo}`} target="_blank" rel="noopener noreferrer" className="block transform hover:scale-105 transition-transform drop-shadow-[0_0_12px_rgba(79,70,229,0.2)] hover:drop-shadow-[0_0_16px_rgba(79,70,229,0.4)]">
69-
<img
70+
<Image
7071
src="https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge"
7172
alt="Analyzed by RepoMind"
73+
width={154}
74+
height={28}
7275
className="h-7"
76+
unoptimized
7377
/>
7478
</a>
7579
</div>

0 commit comments

Comments
 (0)