Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

feat: aot daily leaderboard functionality (#1583)

Amanuel Odichocb707ab004ef
diff --git a/apps/admin/package.json b/apps/admin/package.json
index 1717d7e4..bbe5e4bd 100644
--- a/apps/admin/package.json
+++ b/apps/admin/package.json
@@ -22,7 +22,7 @@
"@repo/monaco": "workspace:*",
"@repo/ui": "workspace:*",
"@tanstack/react-query": "5.51.21",
- "@tanstack/react-table": "^8.9.3",
+ "@tanstack/react-table": "^8.20.5",
"clsx": "^2.0.0",
"million": "2.6.0-beta.12",
"next": "14.2.5",
diff --git a/apps/aot/package.json b/apps/aot/package.json
index e4369b43..d7c942fc 100644
--- a/apps/aot/package.json
+++ b/apps/aot/package.json
@@ -16,6 +16,7 @@
},
"dependencies": {
"@tanstack/react-query": "5.51.21",
+ "@tanstack/react-table": "^8.20.5",
"@trpc/client": "^11.0.0-rc.446",
"@trpc/react-query": "^11.0.0-rc.446",
"@trpc/server": "^11.0.0-rc.446",
diff --git a/apps/aot/src/app/globals.css b/apps/aot/src/app/globals.css
index 39ca32cf..7a067936 100644
--- a/apps/aot/src/app/globals.css
+++ b/apps/aot/src/app/globals.css
@@ -8,3 +8,91 @@
text-wrap: balance;
}
}
+
+@layer base {
+ :root {
+ --gradient-angle: 360deg;
+
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%;
+
+ --muted: 240 4.8% 95.9%;
+ --muted-foreground: 240 3.8% 46.1%;
+
+ --popover: 0 0% 100%;
+ --popover-foreground: 240 10% 3.9%;
+
+ --card: 0 0% 100%;
+ --card-hovered: 0 0% 98%;
+ --card-foreground: 240 10% 3.9%;
+
+ --border: 240 5.9% 90%;
+ --input: 240 5.9% 90%;
+
+ --primary: 240 5.9% 10%;
+ --primary-foreground: 0 0% 98%;
+
+ --secondary: 240 4.8% 95.9%;
+ --secondary-foreground: 240 5.9% 10%;
+
+ --accent: 240 4.8% 95.9%;
+ --accent-foreground: ;
+
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+
+ --ring: 240 5% 64.9%;
+
+ --radius: 0.5rem;
+ }
+
+ .dark {
+ --background: 240 10% 3.9%;
+ --foreground: 0 0% 98%;
+
+ --muted: 240 3.7% 15.9%;
+ --muted-foreground: 240 5% 64.9%;
+
+ --popover: 240 10% 3.9%;
+ --popover-foreground: 0 0% 98%;
+
+ --card: 240 10% 3.9%;
+ --card-hovered: 240 10% 6.9%;
+ --card-foreground: 0 0% 98%;
+
+ --border: 240 3.7% 15.9%;
+ --input: 240 3.7% 15.9%;
+
+ --primary: 0 0% 98%;
+ --primary-foreground: 240 5.9% 10%;
+
+ --secondary: 240 3.7% 15.9%;
+ --secondary-foreground: 0 0% 98%;
+
+ --accent: 240 3.7% 15.9%;
+ --accent-foreground: ;
+
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 85.7% 97.3%;
+
+ --ring: 240 3.7% 15.9%;
+ }
+}
+
+@layer base {
+ * {
+ @apply border-border;
+ }
+ body {
+ @apply bg-background text-foreground;
+ }
+}
+
+html,
+body,
+#__next,
+main {
+ scroll-padding-top: 64px;
+ scroll-behavior: smooth;
+ height: 100%;
+}
diff --git a/apps/aot/src/app/layout.tsx b/apps/aot/src/app/layout.tsx
index f46f390d..86b3b4b0 100644
--- a/apps/aot/src/app/layout.tsx
+++ b/apps/aot/src/app/layout.tsx
@@ -22,7 +22,7 @@ export default async function RootLayout({
if (!enableAotPlatform) {
return (
- <html lang="en" className="bg-black text-white">
+ <html lang="en">
<body className={inter.className}>
<main>
<ComingSoon />
@@ -32,7 +32,7 @@ export default async function RootLayout({
);
}
return (
- <html lang="en" className="bg-black text-white">
+ <html lang="en">
<body className={inter.className}>
<Providers>
<Navigation />
diff --git a/apps/aot/src/app/leaderboard/_components/advent-days-row.tsx b/apps/aot/src/app/leaderboard/_components/advent-days-row.tsx
new file mode 100644
index 00000000..a1075a15
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/_components/advent-days-row.tsx
@@ -0,0 +1,29 @@
+import Link from 'next/link';
+import { getCurrentAdventDay } from '~/utils/time-utils';
+
+export default function AdventDaysRow({ selectedDay }: { selectedDay?: number }) {
+ const currentAdventDay = getCurrentAdventDay();
+
+ return (
+ <div className="flex w-full gap-2 text-xl">
+ <p>Per day:</p>
+ <ul className="flex flex-wrap gap-2">
+ {Array.from({ length: currentAdventDay }, (_, index) => {
+ const day = index + 1;
+ return (
+ <li key={day}>
+ <Link
+ href={`/leaderboard/day/${day}`}
+ className={`hover:text-blue-400 ${
+ day === selectedDay ? 'font-bold text-blue-600' : ''
+ }`}
+ >
+ {day}
+ </Link>
+ </li>
+ );
+ })}
+ </ul>
+ </div>
+ );
+}
diff --git a/apps/aot/src/app/leaderboard/_components/columns.tsx b/apps/aot/src/app/leaderboard/_components/columns.tsx
new file mode 100644
index 00000000..16b6a2fc
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/_components/columns.tsx
@@ -0,0 +1,93 @@
+'use client';
+
+import { createColumnHelper } from '@tanstack/react-table';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
+
+/*
+ * Overall Leaderboard Table Columns
+ */
+
+export interface OverallLeaderboardEntry {
+ totalPoints: number;
+ name: string;
+ image: string | null;
+}
+
+const overallLeaderboardColumnHelper = createColumnHelper<OverallLeaderboardEntry>();
+
+export const overallLeaderboardColumns = [
+ overallLeaderboardColumnHelper.display({
+ id: 'ranking',
+ header: '#',
+ cell: (props) => props.row.index + 1,
+ }),
+ overallLeaderboardColumnHelper.accessor('name', {
+ header: 'User',
+ cell: (info) => (
+ <div className="flex flex-wrap items-center justify-start gap-2 sm:gap-4">
+ <Avatar className="h-8 w-8 md:h-12 md:w-12">
+ <AvatarImage alt="github profile picture" src={info.row.original.image ?? ''} />
+ <AvatarFallback>
+ <DefaultAvatar />
+ </AvatarFallback>
+ </Avatar>
+ <span>@{info.getValue()}</span>
+ </div>
+ ),
+ }),
+ overallLeaderboardColumnHelper.accessor('totalPoints', {
+ header: 'Points',
+ cell: (info) => Number(info.getValue()),
+ }),
+];
+
+/*
+ * Daily Leaderboard Table Columns
+ */
+
+export interface DailyLeaderboardEntry {
+ createdAt: Date;
+ user: { name: string; image: string | null };
+}
+
+const dailyLeaderboardColumnHelper = createColumnHelper<DailyLeaderboardEntry>();
+
+export const dailyLeaderboardColumns = [
+ dailyLeaderboardColumnHelper.display({
+ id: 'ranking',
+ header: '#',
+ cell: (props) => props.row.index + 1,
+ }),
+ dailyLeaderboardColumnHelper.accessor('user', {
+ header: 'User',
+ cell: (info) => (
+ <div className="flex flex-wrap items-center justify-start gap-2 sm:gap-4">
+ <Avatar className="h-8 w-8 md:h-12 md:w-12">
+ <AvatarImage alt="github profile picture" src={info.getValue().image ?? ''} />
+ <AvatarFallback>
+ <DefaultAvatar />
+ </AvatarFallback>
+ </Avatar>
+ <span>@{info.getValue().name}</span>
+ </div>
+ ),
+ }),
+ dailyLeaderboardColumnHelper.accessor('createdAt', {
+ header: 'Time solved',
+ cell: (info) => formatDate(info.getValue()),
+ }),
+];
+
+/*
+ * Utilities - will move later
+ */
+const formatDate = (date: Date) => {
+ return new Intl.DateTimeFormat('en-US', {
+ month: 'short',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit',
+ hourCycle: 'h23',
+ }).format(new Date(date));
+};
diff --git a/apps/aot/src/app/leaderboard/_components/daily-leaderboard.tsx b/apps/aot/src/app/leaderboard/_components/daily-leaderboard.tsx
new file mode 100644
index 00000000..b39afd53
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/_components/daily-leaderboard.tsx
@@ -0,0 +1,31 @@
+import { prisma } from '@repo/db';
+import { DataTableLeaderboard } from '@repo/ui/components/data-table-leaderboard';
+import { ADVENT_CHALLENGE_IDS, LEADERBOARD_RANKING_LIMIT } from '~/app/leaderboard/constants';
+import { dailyLeaderboardColumns } from './columns';
+
+const getFirst100SubmissionsRanked = async (adventDay: number) => {
+ const challengeId = ADVENT_CHALLENGE_IDS[adventDay - 1];
+ const submissions = await prisma.submission.findMany({
+ select: { id: true, createdAt: true, user: { select: { name: true, image: true } } },
+ where: {
+ challengeId,
+ isSuccessful: true,
+ },
+ distinct: ['userId'],
+ orderBy: {
+ createdAt: 'asc',
+ },
+ take: LEADERBOARD_RANKING_LIMIT,
+ });
+ return submissions;
+};
+
+export default async function DailyLeaderboard({ adventDay }: { adventDay: number }) {
+ const first100SubmissionsRanked = await getFirst100SubmissionsRanked(adventDay);
+
+ return (
+ <div className="p-4">
+ <DataTableLeaderboard data={first100SubmissionsRanked} columns={dailyLeaderboardColumns} />
+ </div>
+ );
+}
diff --git a/apps/aot/src/app/leaderboard/_components/overall-leaderboard.tsx b/apps/aot/src/app/leaderboard/_components/overall-leaderboard.tsx
new file mode 100644
index 00000000..ca73398c
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/_components/overall-leaderboard.tsx
@@ -0,0 +1,50 @@
+import { Prisma, prisma } from '@repo/db';
+import { ADVENT_CHALLENGE_IDS, LEADERBOARD_RANKING_LIMIT } from '../constants';
+import { DataTableLeaderboard } from '@repo/ui/components/data-table-leaderboard';
+import { overallLeaderboardColumns, type OverallLeaderboardEntry } from './columns';
+import { getCurrentAdventDay } from '~/utils/time-utils';
+
+async function getOverallLeaderboard(currentAdventDay: number) {
+ const challengeIdsSoFar = ADVENT_CHALLENGE_IDS.slice(0, currentAdventDay);
+
+ const ranking = await prisma.$queryRaw<OverallLeaderboardEntry[]>`
+ SELECT
+ u.name,
+ u.image,
+ SUM(r.points) AS totalPoints
+ FROM
+ User u
+ JOIN
+ (
+ SELECT
+ userId,
+ 101 - \`rank\` AS points
+ FROM
+ (
+ SELECT
+ userId,
+ challengeId,
+ ROW_NUMBER() OVER (PARTITION BY challengeId ORDER BY MIN(createdAt)) AS \`rank\`
+ FROM Submission
+ WHERE challengeId IN (${Prisma.join(challengeIdsSoFar)}) AND isSuccessful = 1
+ GROUP BY userId, challengeId
+ ) AS RankedSubmissions
+ WHERE \`rank\` <= ${LEADERBOARD_RANKING_LIMIT}
+ ) r ON u.id = r.userId
+ GROUP BY r.userId, u.name, u.image
+ ORDER BY totalPoints DESC
+ LIMIT ${LEADERBOARD_RANKING_LIMIT};
+`;
+
+ return ranking;
+}
+
+export default async function OverallLeaderboard() {
+ const currentAdventDay = getCurrentAdventDay();
+ const top100Ranking = await getOverallLeaderboard(currentAdventDay);
+ return (
+ <div className="p-4">
+ <DataTableLeaderboard data={top100Ranking} columns={overallLeaderboardColumns} />
+ </div>
+ );
+}
diff --git a/apps/aot/src/app/leaderboard/constants.ts b/apps/aot/src/app/leaderboard/constants.ts
new file mode 100644
index 00000000..3b9e949a
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/constants.ts
@@ -0,0 +1,5 @@
+export const LEADERBOARD_RANKING_LIMIT = 100;
+
+export const ADVENT_CHALLENGE_IDS = [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+] as const;
diff --git a/apps/aot/src/app/leaderboard/day/[day]/layout.tsx b/apps/aot/src/app/leaderboard/day/[day]/layout.tsx
new file mode 100644
index 00000000..2979ec5c
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/day/[day]/layout.tsx
@@ -0,0 +1,21 @@
+import { isValidAdventDay } from '~/utils/time-utils';
+import { notFound } from 'next/navigation';
+import AdventDaysRow from '../../_components/advent-days-row';
+
+export default function DailyLeaderboardLayout({
+ params: { day },
+ children,
+}: {
+ params: { day: string };
+ children: React.ReactNode;
+}) {
+ const routeDayNum = Number(day);
+ if (!isValidAdventDay(routeDayNum)) return notFound();
+
+ return (
+ <>
+ <AdventDaysRow selectedDay={routeDayNum} />
+ {children}
+ </>
+ );
+}
diff --git a/apps/aot/src/app/leaderboard/day/[day]/page.tsx b/apps/aot/src/app/leaderboard/day/[day]/page.tsx
new file mode 100644
index 00000000..c292f29b
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/day/[day]/page.tsx
@@ -0,0 +1,9 @@
+import DailyLeaderboard from '../../_components/daily-leaderboard';
+
+// export const revalidate = 10; Need next.js v15
+
+export default function Page({ params: { day } }: { params: { day: string } }) {
+ const routeDayNum = Number(day);
+
+ return <DailyLeaderboard adventDay={routeDayNum} />;
+}
diff --git a/apps/aot/src/app/leaderboard/day/_1/layout.tsx b/apps/aot/src/app/leaderboard/day/_1/layout.tsx
new file mode 100644
index 00000000..80e3fa8a
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/day/_1/layout.tsx
@@ -0,0 +1,10 @@
+import AdventDaysRow from '../../_components/advent-days-row';
+
+export default function LeaderboardLayout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ <AdventDaysRow selectedDay={1} />
+ {children}
+ </>
+ );
+}
diff --git a/apps/aot/src/app/leaderboard/day/_1/page.tsx b/apps/aot/src/app/leaderboard/day/_1/page.tsx
new file mode 100644
index 00000000..577828e7
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/day/_1/page.tsx
@@ -0,0 +1,12 @@
+/*
+
+ Once AoT starts, and all the implementation is finalized
+ we can generate folders [_1, _25]
+ each day we change from _1 -> 1 to make it valid and statically built
+*/
+
+import DailyLeaderboard from '../../_components/daily-leaderboard';
+
+export default async function Page() {
+ return <DailyLeaderboard adventDay={1} />;
+}
diff --git a/apps/aot/src/app/leaderboard/layout.tsx b/apps/aot/src/app/leaderboard/layout.tsx
new file mode 100644
index 00000000..978d14d0
--- /dev/null
+++ b/apps/aot/src/app/leaderboard/layout.tsx
@@ -0,0 +1,17 @@
+import { getCurrentAdventDay, isValidAdventDay } from '~/utils/time-utils';
+import { notFound } from 'next/navigation';
+import { getAllFlags } from '~/utils/feature-flag';
+import { ComingSoon } from '../coming-soon';
+
+export default async function LeaderboardLayout({ children }: { children: React.ReactNode }) {
+ const { enableAotPlatform } = await getAllFlags();
+
+ if (!enableAotPlatform) {
+ return <ComingSoon />;
+ }
+
+ const currentAdventDay = getCurrentAdventDay();
+ if (!isValidAdventDay(currentAdventDay)) return notFound();
+
+ return <>{children}</>;
+}
diff --git a/apps/aot/src/app/leaderboard/page.tsx b/apps/aot/src/app/leaderboard/page.tsx
index 4841ad99..88ad5d9a 100644
--- a/apps/aot/src/app/leaderboard/page.tsx
+++ b/apps/aot/src/app/leaderboard/page.tsx
@@ -1,4 +1,11 @@
-// `app/page.tsx` is the UI for the `/` URL
-export default function Page() {
- return <h1>leaderboard</h1>;
+import AdventDaysRow from './_components/advent-days-row';
+import OverallLeaderboard from './_components/overall-leaderboard';
+
+export default function LeaderboardPage() {
+ return (
+ <>
+ <AdventDaysRow />
+ <OverallLeaderboard />
+ </>
+ );
}
diff --git a/apps/aot/src/utils/time-utils.ts b/apps/aot/src/utils/time-utils.ts
new file mode 100644
index 00000000..bf4b3fbb
--- /dev/null
+++ b/apps/aot/src/utils/time-utils.ts
@@ -0,0 +1,24 @@
+export function getCurrentAdventDay() {
+ const MS_PER_DAY = 24 * 60 * 60 * 1000;
+ // Midnight EST
+ // const startDate = new Date('2024-12-01T05:00:00.000Z').getTime();
+
+ // Midnight EDT
+ const today = Date.now();
+ const startDate = new Date('2024-10-01T04:00:00.000Z').getTime();
+
+ if (today < startDate) {
+ return 0; // not advent yet!
+ }
+
+ const adventDay = Math.floor((today - startDate) / MS_PER_DAY) + 1;
+
+ return adventDay;
+}
+
+export function isValidAdventDay(selectedDay: number) {
+ if (selectedDay < 1 && selectedDay > 25) return false;
+
+ const currentAdventDay = getCurrentAdventDay();
+ return selectedDay <= currentAdventDay;
+}
diff --git a/apps/web/package.json b/apps/web/package.json
index 809bbac5..2d342ed8 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -39,7 +39,7 @@
"@t3-oss/env-nextjs": "^0.6.0",
"@tanstack/react-query": "5.51.21",
"@tanstack/react-query-devtools": "5.51.21",
- "@tanstack/react-table": "^8.9.3",
+ "@tanstack/react-table": "^8.20.5",
"@uiw/react-md-editor": "^3.23.3",
"@uploadthing/react": "^6.2.2",
"@vercel/analytics": "^1.1.1",
diff --git a/apps/web/src/app/challenge/[slug]/solutions/_components/solution-detail.tsx b/apps/web/src/app/challenge/[slug]/solutions/_components/solution-detail.tsx
index e64fde44..5c1ba025 100644
--- a/apps/web/src/app/challenge/[slug]/solutions/_components/solution-detail.tsx
+++ b/apps/web/src/app/challenge/[slug]/solutions/_components/solution-detail.tsx
@@ -2,7 +2,7 @@
import { useSession } from '@repo/auth/react';
import { ActionMenu } from '@repo/ui/components/action-menu';
-import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/avatar';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
import { Button } from '@repo/ui/components/button';
import { Markdown } from '@repo/ui/components/markdown';
import { Tooltip, TooltipContent, TooltipTrigger } from '@repo/ui/components/tooltip';
@@ -24,7 +24,6 @@ import { EditSolution } from './edit-solution';
import { useGetQueryString } from './useGetQueryString';
import { UserBadge } from '~/app/challenge/_components/comments/enhanced-user-badge';
import { useQueryClient } from '@tanstack/react-query';
-import { DefaultAvatar } from '~/components/default-avatar';
interface Props {
solution: ChallengeSolution;
diff --git a/apps/web/src/app/challenge/_components/comments/comment.tsx b/apps/web/src/app/challenge/_components/comments/comment.tsx
index 9524e7c3..f7acf2a3 100644
--- a/apps/web/src/app/challenge/_components/comments/comment.tsx
+++ b/apps/web/src/app/challenge/_components/comments/comment.tsx
@@ -26,7 +26,7 @@ import { Vote } from '../vote';
import { CommentInput } from './comment-input';
import { CommentDeleteDialog } from './delete';
import { type PaginatedComments, type PreselectedCommentMetadata } from './getCommentRouteData';
-import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/avatar';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
import { Button } from '@repo/ui/components/button';
import { CommentSkeleton } from './comment-skeleton';
import { isAdminOrModerator } from '~/utils/auth-guards';
@@ -34,7 +34,6 @@ import { useCommentsReplies } from './comments.hooks';
import { UserBadge } from './enhanced-user-badge';
import type { ChallengeRouteData } from '../../[slug]/getChallengeRouteData';
import type { SolutionRouteData } from '../../[slug]/solutions/[solutionId]/getSolutionIdRouteData';
-import { DefaultAvatar } from '~/components/default-avatar';
interface SingleCommentProps {
comment: PaginatedComments['comments'][number];
diff --git a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
index bdaf84d0..467023a1 100644
--- a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
+++ b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/avatar';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
import Link from 'next/link';
import { Badge } from '@repo/ui/components/badge';
import { Shield, Sword, Wand2, type LucideIcon } from '@repo/ui/icons';
@@ -15,7 +15,6 @@ import { Button } from '@repo/ui/components/button';
import { HoverCard, HoverCardContent, HoverCardTrigger } from '@repo/ui/components/hover-card';
import { getTitles, type TitleInfo } from './enhanced-user-badge.getTitles';
import { Skeleton } from '@repo/ui/components/skeleton';
-import { DefaultAvatar } from '~/components/default-avatar';
import { Tooltip, TooltipContent, TooltipTrigger } from '@repo/ui/components/tooltip';
interface UserBadgeProps {
diff --git a/apps/web/src/app/notifications/notfication-item.tsx b/apps/web/src/app/notifications/notfication-item.tsx
index 092951be..5c830c45 100644
--- a/apps/web/src/app/notifications/notfication-item.tsx
+++ b/apps/web/src/app/notifications/notfication-item.tsx
@@ -1,7 +1,7 @@
'use client';
import type { NotificationType } from '@repo/db/types';
-import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/avatar';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
import { Markdown } from '@repo/ui/components/markdown';
import { AlertCircle, AtSign, Heart, MessageCircle, ShieldAlert } from '@repo/ui/icons';
import Link from 'next/link';
@@ -10,7 +10,6 @@ import { useInView } from 'react-intersection-observer';
import { getRelativeTime } from '~/utils/relativeTime';
import type { Notification } from './notification.actions';
import { cn } from '@repo/ui/cn';
-import { DefaultAvatar } from '~/components/default-avatar';
const BLURBS = {
MENTION: 'mentioned you in a comment',
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index 3ec46ee7..35292ac2 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -21,9 +21,8 @@ import { SkipToCodeEditor } from './skip-to-code-editor';
import { auth } from '~/server/auth';
import { NotificationLink } from './notification-link';
import { getNotificationCount } from './navigation.actions';
-import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/avatar';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
import { ThemeButton } from './theme-button';
-import { DefaultAvatar } from '../default-avatar';
export function getAdminUrl() {
// reference for vercel.com
diff --git a/apps/web/src/components/mention/user-results.tsx b/apps/web/src/components/mention/user-results.tsx
index a5e45c07..cf2672fc 100644
--- a/apps/web/src/components/mention/user-results.tsx
+++ b/apps/web/src/components/mention/user-results.tsx
@@ -1,14 +1,13 @@
'use client';
import { cn } from '@repo/ui/cn';
-import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/avatar';
+import { Avatar, AvatarFallback, AvatarImage, DefaultAvatar } from '@repo/ui/components/avatar';
import { Popover, PopoverAnchor, PopoverContent } from '@repo/ui/components/popover';
import { useQuery } from '@tanstack/react-query';
import { useEffect, useRef, useState } from 'react';
import { searchUsers } from './actions';
import { useToast } from '@repo/ui/components/use-toast';
import { Loader } from '../loader';
-import { DefaultAvatar } from '../default-avatar';
interface Props {
isOpen: boolean;
diff --git a/packages/db/package.json b/packages/db/package.json
index 5aa915f6..fd544df3 100644
--- a/packages/db/package.json
+++ b/packages/db/package.json
@@ -24,6 +24,7 @@
"db:reset": "dotenv -e ../../.env prisma db push -- --force-reset",
"db:seed": "dotenv -e ../../.env tsx ./seed/dev.ts",
"db:prod:seed": "dotenv -e ../../.env tsx ./temp/populate-aot-challenges.ts && dotenv -e ../../.env tsx ./seed/prod.ts",
+ "db:leaderboard:seed": "dotenv -e ../../.env tsx ./seed/leaderboard.ts",
"db:studio": "dotenv -e ../../.env prisma studio",
"format": "prettier . --check --cache --cache-location=\"node_modules/.cache/prettiercache\"",
"format:fix": "prettier . --write --cache --cache-location=\"node_modules/.cache/prettiercache\" --log-level=warn",
diff --git a/packages/db/seed/leaderboard.ts b/packages/db/seed/leaderboard.ts
new file mode 100644
index 00000000..28ec0b39
--- /dev/null
+++ b/packages/db/seed/leaderboard.ts
@@ -0,0 +1,59 @@
+import { prisma } from '../src';
+
+async function generateMockUsers() {
+ const users = [];
+ for (let i = 0; i < 200; i++) {
+ users.push({
+ name: `User ${i}`,
+ email: `user${i}@example.com`,
+ });
+ }
+
+ try {
+ await prisma.user.createMany({ data: users });
+ console.log('Generated 200 mock users');
+ } catch (e) {
+ console.log('mock users already generated');
+ }
+}
+
+function getRandomTimeAfterFive(day: number) {
+ const date = new Date(`2024-01-${String(day).padStart(2, '0')}T06:00:00.000Z`);
+
+ const maxAdditionalTime = 18 * 60 * 60 * 1000 - 1;
+ const randomAdditionalTime = Math.floor(Math.random() * maxAdditionalTime);
+
+ const randomTime = new Date(date.getTime() + randomAdditionalTime);
+ return randomTime;
+}
+
+async function generateMockSubmissions() {
+ const users = await prisma.user.findMany();
+ const challenges = Array.from({ length: 25 }, (_, i) => i + 1);
+ const submissions = [];
+
+ for (const user of users) {
+ for (const challengeId of challenges) {
+ submissions.push({
+ code: '',
+ createdAt: getRandomTimeAfterFive(challengeId).toISOString(),
+ isSuccessful: true,
+ userId: user.id,
+ challengeId,
+ });
+ }
+ }
+
+ await prisma.submission.createMany({ data: submissions });
+ console.log('Generated random submissions for each user for each challenge');
+}
+
+try {
+ await generateMockUsers();
+ await generateMockSubmissions();
+} catch (e) {
+ console.error(e);
+ process.exit(1);
+} finally {
+ await prisma.$disconnect();
+}
diff --git a/packages/db/src/index.ts b/packages/db/src/index.ts
index 33c4c2b7..febcab68 100644
--- a/packages/db/src/index.ts
+++ b/packages/db/src/index.ts
@@ -11,3 +11,5 @@ export const prisma =
});
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
+
+export { Prisma } from '@prisma/client';
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 07068fb6..3200397f 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -53,7 +53,7 @@
"@radix-ui/react-toggle": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.6",
"@repo/db": "workspace:*",
- "@tanstack/react-table": "^8.9.3",
+ "@tanstack/react-table": "^8.20.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"lucide-react": "^0.260.0",
diff --git a/packages/ui/src/components/avatar.tsx b/packages/ui/src/components/avatar.tsx
index 67af7e76..4fd9b399 100644
--- a/packages/ui/src/components/avatar.tsx
+++ b/packages/ui/src/components/avatar.tsx
@@ -1,6 +1,7 @@
'use client';
import * as React from 'react';
+import type { ComponentProps } from 'react';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import { cn } from '../cn';
@@ -43,4 +44,37 @@ const AvatarFallback = React.forwardRef<
));
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
-export { Avatar, AvatarImage, AvatarFallback };
+function DefaultAvatar(props: ComponentProps<'svg'>) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 200 200"
+ fill="none"
+ shape-rendering="auto"
+ width={50}
+ height={50}
+ {...props}
+ >
+ <mask id="viewboxMask">
+ <rect width="200" height="200" rx="0" ry="0" x="0" y="0" fill="#fff" />
+ </mask>
+ <g mask="url(#viewboxMask)">
+ <rect fill="#71cf62" width="200" height="200" x="0" y="0" />
+ <g transform="matrix(1.5625 0 0 1.5625 37.5 110.94)">
+ <path
+ d="M40.54 30h-.75c-9.7-.22-20.8-5.3-23.7-16.15a1.36 1.36 0 0 1 .44-1.55 1.41 1.41 0 0 1 2.26.86c2.55 9.46 12.42 13.89 21.06 14.08 8.24.16 19.04-3.84 22.46-14.57a1.47 1.47 0 0 1 1.65-.55A1.44 1.44 0 0 1 65 13.5C61.85 23.31 52.3 30 40.54 30Z"
+ fill="#000"
+ />
+ </g>
+ <g transform="matrix(1.5625 0 0 1.5625 31.25 59.38)">
+ <path
+ d="M75.84 21.11c-2.9.04-5.72-.89-8.04-2.63a13.47 13.47 0 0 1-4.85-7.03 1.75 1.75 0 0 1 1.1-2.26 1.68 1.68 0 0 1 1.86.61c.14.2.24.4.3.64.6 2.11 1.87 3.97 3.61 5.28a9.84 9.84 0 0 0 6.04 1.98c2.17.01 4.29-.68 6.03-2a10.17 10.17 0 0 0 3.65-5.26c.15-.42.46-.75.85-.95a1.68 1.68 0 0 1 2.23.7c.21.38.27.83.17 1.26a13.48 13.48 0 0 1-4.87 7.04 13.17 13.17 0 0 1-8.08 2.62ZM13.84 21.11c-2.9.03-5.73-.9-8.06-2.65a13.54 13.54 0 0 1-4.85-7.05 1.78 1.78 0 0 1 .51-1.88 1.67 1.67 0 0 1 2.4.22c.15.17.25.38.32.6.62 2.1 1.9 3.96 3.64 5.28a9.93 9.93 0 0 0 6.02 2c2.18.03 4.3-.67 6.06-1.99a10.21 10.21 0 0 0 3.66-5.3 1.68 1.68 0 0 1 3.08-.25c.21.4.27.85.17 1.27a13.57 13.57 0 0 1-4.86 7.1 13.19 13.19 0 0 1-8.1 2.65Z"
+ fill="#000"
+ />
+ </g>
+ </g>
+ </svg>
+ );
+}
+
+export { Avatar, AvatarImage, AvatarFallback, DefaultAvatar };
diff --git a/packages/ui/src/components/data-table-leaderboard.tsx b/packages/ui/src/components/data-table-leaderboard.tsx
new file mode 100644
index 00000000..34055470
--- /dev/null
+++ b/packages/ui/src/components/data-table-leaderboard.tsx
@@ -0,0 +1,138 @@
+'use client';
+
+import { flexRender, getCoreRowModel, useReactTable, type ColumnDef } from '@tanstack/react-table';
+import { cn } from '../cn';
+import * as React from 'react';
+
+interface DataTableProps<TData> {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ columns: ColumnDef<TData, any>[];
+ data: TData[];
+}
+
+export function DataTableLeaderboard<TData>({ columns, data }: DataTableProps<TData>) {
+ const table = useReactTable({
+ data,
+ columns,
+ getCoreRowModel: getCoreRowModel(),
+ });
+
+ const getRankColor = (index: number) => {
+ if (index === 0) return 'dark:bg-[#1A1810] bg-[#FFF6E5]'; // First row (gold)
+ if (index === 1) return 'dark:bg-[#202021] bg-[#F0F0F0]'; // Second row (silver)
+ if (index === 2) return 'dark:bg-[#191411] bg-[#FDE9E1]'; // Third row (bronze)
+ };
+
+ return (
+ <Table>
+ <TableHeader>
+ {table.getHeaderGroups().map((headerGroup) => (
+ <TableRow key={headerGroup.id}>
+ {headerGroup.headers.map((header, colIndex) => {
+ return (
+ <TableHead
+ key={header.id}
+ onClick={header.column.getToggleSortingHandler()}
+ className={`text-start ${colIndex === 2 ? 'text-end' : ''}`}
+ >
+ <span>
+ {header.isPlaceholder
+ ? null
+ : flexRender(header.column.columnDef.header, header.getContext())}
+ </span>
+ </TableHead>
+ );
+ })}
+ </TableRow>
+ ))}
+ </TableHeader>
+ <TableBody>
+ {table.getRowModel().rows?.length ? (
+ table.getRowModel().rows.map((row, rowIndex) => (
+ <TableRow
+ key={row.id}
+ data-state={row.getIsSelected() && 'selected'}
+ className={
+ getRankColor(rowIndex) ??
+ 'odd:bg-[#FAFAFA] even:bg-[#F5F5F5] dark:odd:bg-[#101010] dark:even:bg-[#1A1A1A]'
+ }
+ >
+ {row.getVisibleCells().map((cell, colIndex) => (
+ <TableCell
+ key={cell.id}
+ className={`text-start ${colIndex === 0 ? 'w-16' : ''} ${
+ colIndex === 2 ? 'text-end' : ''
+ }`}
+ >
+ {flexRender(cell.column.columnDef.cell, cell.getContext())}
+ </TableCell>
+ ))}
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell colSpan={columns.length} className="h-24 text-center">
+ No results.
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ );
+}
+
+const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
+ ({ className, ...props }, ref) => (
+ <div className="w-full overflow-auto font-mono">
+ <table
+ className={cn(
+ 'w-full border-separate border-spacing-y-1 text-sm md:border-spacing-y-2',
+ className,
+ )}
+ ref={ref}
+ {...props}
+ />
+ </div>
+ ),
+);
+Table.displayName = 'Table';
+
+const TableHeader = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => <thead className={cn(className)} ref={ref} {...props} />);
+TableHeader.displayName = 'TableHeader';
+
+const TableBody = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => <tbody className={cn(className)} ref={ref} {...props} />);
+TableBody.displayName = 'TableBody';
+
+const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(
+ ({ className, ...props }, ref) => <tr className={className} ref={ref} {...props} />,
+);
+TableRow.displayName = 'TableRow';
+
+const TableHead = React.forwardRef<
+ HTMLTableCellElement,
+ React.ThHTMLAttributes<HTMLTableCellElement>
+>(({ className, ...props }, ref) => (
+ <th
+ className={cn(
+ 'text-muted-foreground h-12 border-b px-4 text-left align-middle font-medium',
+ className,
+ )}
+ ref={ref}
+ {...props}
+ />
+));
+TableHead.displayName = 'TableHead';
+
+const TableCell = React.forwardRef<
+ HTMLTableCellElement,
+ React.TdHTMLAttributes<HTMLTableCellElement>
+>(({ className, ...props }, ref) => (
+ <td className={cn('px-4 py-4 align-middle', className)} ref={ref} {...props} />
+));
+TableCell.displayName = 'TableCell';
diff --git a/apps/web/src/components/default-avatar.tsx b/packages/ui/src/components/default-avatar.tsx
similarity index 100%
rename from apps/web/src/components/default-avatar.tsx
rename to packages/ui/src/components/default-avatar.tsx
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d81c0e27..0e17e940 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -81,8 +81,8 @@ importers:
specifier: 5.51.21
version: 5.51.21([email protected])
'@tanstack/react-table':
- specifier: ^8.9.3
+ specifier: ^8.20.5
clsx:
specifier: ^2.0.0
version: 2.0.0
@@ -158,7 +158,7 @@ importers:
eslint-plugin-import:
specifier: ^2.27.5
+ version: 2.27.5([email protected])
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -180,6 +180,9 @@ importers:
'@tanstack/react-query':
specifier: 5.51.21
version: 5.51.21([email protected])
+ '@tanstack/react-table':
+ specifier: ^8.20.5
'@trpc/client':
specifier: ^11.0.0-rc.446
version: 11.0.0-rc.477(@trpc/[email protected])
@@ -400,8 +403,8 @@ importers:
specifier: 5.51.21
'@tanstack/react-table':
- specifier: ^8.9.3
+ specifier: ^8.20.5
'@uiw/react-md-editor':
specifier: ^3.23.3
@@ -582,7 +585,7 @@ importers:
eslint-plugin-import:
specifier: ^2.27.5
+ version: 2.27.5([email protected])
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -831,8 +834,8 @@ importers:
specifier: workspace:*
version: link:../db
'@tanstack/react-table':
- specifier: ^8.9.3
+ specifier: ^8.20.5
class-variance-authority:
specifier: ^0.7.0
version: 0.7.0
@@ -899,7 +902,7 @@ importers:
dependencies:
'@next/eslint-plugin-next':
specifier: canary
- version: 15.0.0-canary.198
+ version: 15.0.1-canary.1
'@repo/tsconfig':
specifier: workspace:*
version: link:../config-typescript
@@ -911,7 +914,7 @@ importers:
'@vercel/style-guide':
specifier: ^4.0.2
eslint:
specifier: ^8.45.0
version: 8.45.0
@@ -1993,8 +1996,8 @@ packages:
resolution: {integrity: sha512-YJqyq6vk39JQfvaNtN83t/p5Jy45+bazRL+V4QI8FPd3FBqFYMEsULiwRLgSJMgFqkk4t4JbeZurz+gILEAFpA==}
- resolution: {integrity: sha512-Iyvdq3xHfaNdO3+/VVBfiJtiwZpEDZgzI9ZadvYb7TGxzLl/1a8ZIUAWp593jwjv1RUB45VhHbBxqi3y+QTx1w==}
+ resolution: {integrity: sha512-JYVXvvhq8wnqtJtT33cj2NqkFr7hW6mIhiYi2Me1WPM/YU1LGjpVhR1UUTx1Hla0eU8D1fEgNZ8urDUR6rmzJQ==}
resolution: {integrity: sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==}
@@ -3377,15 +3380,15 @@ packages:
peerDependencies:
react: ^18.0.0
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-Ng9rdm3JPoSCi6cVZvANsYnF+UoGVRxflMb270tVj0+LjeT/ZtZ9ckxF6oLPLcKesza6VKBqtdF9mQ+vaz24Aw==}
+ '@tanstack/[email protected]':
+ resolution: {integrity: sha512-WEHopKw3znbUZ61s9i0+i9g8drmDo6asTWbrQh8Us63DAk/M0FkmIqERew6P71HI75ksZ2Pxyuf4vvKh9rAkiA==}
engines: {node: '>=12'}
peerDependencies:
- react: '>=16'
- react-dom: '>=16'
+ react: '>=16.8'
+ react-dom: '>=16.8'
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-NpHZBoHTfqyJk0m/s/+CSuAiwtebhYK90mDuf5eylTvgViNOujiaOaxNDxJkQQAsVvHWZftUGAx1EfO1rkKtLg==}
+ '@tanstack/[email protected]':
+ resolution: {integrity: sha512-P9dF7XbibHph2PFRz8gfBKEXEY/HJPOhym8CHmjF8y3q5mWpKx9xtZapXQUWCgkqvsK0R46Azuz+VaxD4Xl+Tg==}
engines: {node: '>=12'}
'@tinyhttp/[email protected]':
@@ -7675,7 +7678,7 @@ packages:
resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==}
engines: {node: '>= 4.0'}
- deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
+ deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==}
@@ -9308,7 +9311,7 @@ snapshots:
dependencies:
glob: 7.1.7
dependencies:
fast-glob: 3.3.1
@@ -10871,19 +10874,19 @@ snapshots:
'@tanstack/query-core': 5.51.21
react: 18.2.0
dependencies:
- '@tanstack/table-core': 8.9.3
+ '@tanstack/table-core': 8.20.5
react: 18.2.0
react-dom: 18.2.0([email protected])
dependencies:
- '@tanstack/table-core': 8.9.3
+ '@tanstack/table-core': 8.20.5
react: 18.2.0
react-dom: 18.3.1([email protected])
- '@tanstack/[email protected]': {}
+ '@tanstack/[email protected]': {}
'@tinyhttp/[email protected]':
dependencies:
@@ -11316,7 +11319,7 @@ snapshots:
react: 18.2.0
dependencies:
'@babel/core': 7.22.10
'@babel/eslint-parser': 7.22.10(@babel/[email protected])([email protected])
@@ -11324,7 +11327,7 @@ snapshots:
'@typescript-eslint/eslint-plugin': 5.59.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint-config-prettier: 8.10.0([email protected])
- eslint-import-resolver-alias: 1.1.2([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))
+ eslint-import-resolver-alias: 1.1.2([email protected])
eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
eslint-plugin-eslint-comments: 3.2.0([email protected])
@@ -11338,7 +11341,7 @@ snapshots:
eslint-plugin-unicorn: 43.0.2([email protected])
prettier-plugin-packagejson: 2.4.3([email protected])
optionalDependencies:
- '@next/eslint-plugin-next': 15.0.0-canary.198
+ '@next/eslint-plugin-next': 15.0.1-canary.1
eslint: 8.45.0
prettier: 3.1.1
typescript: 5.3.3
@@ -12591,8 +12594,8 @@ snapshots:
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
- eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
eslint-plugin-jsx-a11y: 6.7.1([email protected])
eslint-plugin-react: 7.32.2([email protected])
eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705([email protected])
@@ -12629,7 +12632,7 @@ snapshots:
eslint: 8.45.0
eslint-plugin-turbo: 2.0.12([email protected])
dependencies:
@@ -12641,13 +12644,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.45.0
+ eslint-plugin-import: 2.27.5([email protected])
get-tsconfig: 4.6.2
globby: 13.2.2
is-core-module: 2.12.1
@@ -12664,7 +12667,7 @@ snapshots:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.45.0
get-tsconfig: 4.6.2
globby: 13.2.2
@@ -12682,7 +12685,7 @@ snapshots:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.56.0
get-tsconfig: 4.6.2
globby: 13.2.2
@@ -12695,18 +12698,18 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
- eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
@@ -12717,7 +12720,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
@@ -12734,7 +12737,7 @@ snapshots:
eslint: 8.45.0
ignore: 5.2.4
dependencies:
array-includes: 3.1.6
array.prototype.flat: 1.3.1
@@ -12743,7 +12746,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12759,7 +12762,7 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
array-includes: 3.1.6
array.prototype.flat: 1.3.1
@@ -12768,7 +12771,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12793,7 +12796,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.56.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12809,6 +12812,29 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
+ dependencies:
+ array-includes: 3.1.6
+ array.prototype.flat: 1.3.1
+ array.prototype.flatmap: 1.3.1
+ debug: 3.2.7
+ doctrine: 2.1.0
+ eslint: 8.45.0
+ eslint-import-resolver-node: 0.3.7
+ has: 1.0.3
+ is-core-module: 2.12.1
+ is-glob: 4.0.3
+ minimatch: 3.1.2
+ object.values: 1.1.6
+ resolve: 1.22.2
+ semver: 6.3.1
+ tsconfig-paths: 3.14.2
+ transitivePeerDependencies:
+ - eslint-import-resolver-typescript
+ - eslint-import-resolver-webpack
+ - supports-color
+
dependencies:
'@typescript-eslint/utils': 5.59.1([email protected])([email protected])