From 75bc26493879d6caeedeb0e28f7460fbfad69902 Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Wed, 25 Dec 2024 17:04:01 +0530 Subject: [PATCH 01/10] Add Feature to Highlight new Contributors --- app/page.tsx | 32 ++++++++++++++++++++++++++-- components/contributors/InfoCard.tsx | 7 ++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 5e69b774..4dfbac9a 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -26,6 +26,31 @@ export default async function Home() { const discussions = await fetchGithubDiscussion(5); const startDate = parseISO(env.NEXT_PUBLIC_ORG_START_DATE); + const today = new Date(); + const lastWeekStart = new Date(today); + lastWeekStart.setDate(today.getDate() - today.getDay() - 7); + + const lastWeekEnd = new Date(lastWeekStart); + lastWeekEnd.setDate(lastWeekStart.getDate() + 6); + + const firstTimePRContributors = contributors.filter((contributor) => { + const { activity } = contributor.activityData; + + if (!activity || activity.length === 0) return false; + + const prMergedActivities = activity + .filter((act) => act.type === "pr_merged") + .sort((a, b) => new Date(a.time).getTime() - new Date(b.time).getTime()); + + if (prMergedActivities.length === 0) return false; + + const firstActivityTime = new Date(prMergedActivities[0].time); + + return ( + firstActivityTime >= lastWeekStart && firstActivityTime <= lastWeekEnd + ); + }); + return (
@@ -166,14 +191,17 @@ export default async function Home() { role="list" className="mt-4 space-y-4 sm:grid sm:grid-cols-2 sm:gap-6 sm:space-y-0 lg:grid-cols-2 lg:gap-8" > - {contributors - .slice(0, 8) + {firstTimePRContributors + .concat(contributors.slice(0, 8)) .map((contributor: any, index: number) => { return ( ); })} diff --git a/components/contributors/InfoCard.tsx b/components/contributors/InfoCard.tsx index d57b9776..be3df2a9 100644 --- a/components/contributors/InfoCard.tsx +++ b/components/contributors/InfoCard.tsx @@ -9,10 +9,12 @@ export default function InfoCard({ contributor, rank = null, isClickable = false, + isFirstTimeContributor = false, }: { contributor: Contributor; rank?: number | null; isClickable?: boolean; + isFirstTimeContributor?: boolean; }) { return (
+ {isFirstTimeContributor && ( +

+ @New Contributor +

+ )} Date: Wed, 25 Dec 2024 17:11:27 +0530 Subject: [PATCH 02/10] Fix:Simplify Prop --- app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/page.tsx b/app/page.tsx index 4dfbac9a..3e93c011 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -200,7 +200,7 @@ export default async function Home() { contributor={contributor} isClickable isFirstTimeContributor={ - !!(index < firstTimePRContributors.length) + index < firstTimePRContributors.length } /> ); From 8ea7ac30732efd6a0b28c5dbb513be35255d6086 Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Fri, 27 Dec 2024 10:22:36 +0530 Subject: [PATCH 03/10] Fix shift logic for reusability --- app/page.tsx | 43 +++++++++------------------- components/contributors/InfoCard.tsx | 18 ++++++------ lib/api.ts | 25 ++++++++++++++++ lib/types.ts | 1 + 4 files changed, 48 insertions(+), 39 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 3e93c011..4f07ab57 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -26,30 +26,16 @@ export default async function Home() { const discussions = await fetchGithubDiscussion(5); const startDate = parseISO(env.NEXT_PUBLIC_ORG_START_DATE); - const today = new Date(); - const lastWeekStart = new Date(today); - lastWeekStart.setDate(today.getDate() - today.getDay() - 7); - - const lastWeekEnd = new Date(lastWeekStart); - lastWeekEnd.setDate(lastWeekStart.getDate() + 6); - - const firstTimePRContributors = contributors.filter((contributor) => { - const { activity } = contributor.activityData; - - if (!activity || activity.length === 0) return false; - - const prMergedActivities = activity - .filter((act) => act.type === "pr_merged") - .sort((a, b) => new Date(a.time).getTime() - new Date(b.time).getTime()); - - if (prMergedActivities.length === 0) return false; - - const firstActivityTime = new Date(prMergedActivities[0].time); + const firstTimeContributors = contributors.filter( + (contributor) => contributor.isNewContributor, + ); - return ( - firstActivityTime >= lastWeekStart && firstActivityTime <= lastWeekEnd - ); - }); + const topContributors = [ + ...firstTimeContributors, + ...contributors + .filter((contributor) => !contributor.isNewContributor) + .slice(0, 8), + ]; return (
@@ -191,20 +177,17 @@ export default async function Home() { role="list" className="mt-4 space-y-4 sm:grid sm:grid-cols-2 sm:gap-6 sm:space-y-0 lg:grid-cols-2 lg:gap-8" > - {firstTimePRContributors - .concat(contributors.slice(0, 8)) - .map((contributor: any, index: number) => { + {topContributors.map( + (contributor: any, index: number) => { return ( ); - })} + }, + )}
- {isFirstTimeContributor && ( -

- @New Contributor -

- )} -

- {contributor.title} -

+ {contributor.isNewContributor ? ( +

+ New Contributor 🎉 +

+ ) : ( +

+ {contributor.title} +

+ )}
    diff --git a/lib/api.ts b/lib/api.ts index 01568e29..105f2bb3 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -10,6 +10,12 @@ const root = join(process.cwd(), "data-repo/contributors"); const slackRoot = join(process.cwd(), "data-repo/data/slack"); const githubRoot = join(process.cwd(), "data-repo/data/github"); +const today = new Date(); +const lastWeekStart = new Date(today); +lastWeekStart.setDate(today.getDate() - today.getDay() - 7); +const lastWeekEnd = new Date(lastWeekStart); +lastWeekEnd.setDate(lastWeekStart.getDate() + 6); + export const points = { comment_created: 1, issue_assigned: 1, @@ -180,6 +186,24 @@ export async function getContributorBySlug(file: string, detail = false) { const calendarData = getCalendarData(weightedActivity.activity); + const isNewContributor = (() => { + const { activity } = activityData; + + if (!activity || activity.length === 0) return false; + + const prMergedActivities = activity + .filter((act) => act.type === "pr_merged") + .sort((a, b) => new Date(a.time).getTime() - new Date(b.time).getTime()); + + if (prMergedActivities.length === 0) return false; + + const firstActivityTime = new Date(prMergedActivities[0].time); + + return ( + firstActivityTime >= lastWeekStart && firstActivityTime <= lastWeekEnd + ); + })(); + const summarize = (start: Date, end: Date) => { return calendarData .filter((day) => { @@ -194,6 +218,7 @@ export async function getContributorBySlug(file: string, detail = false) { slug: formatSlug(file), path: fullPath, content: content, + isNewContributor, activityData: { ...activityData, activity: weightedActivity.activity, diff --git a/lib/types.ts b/lib/types.ts index 2e9ad27a..5ec317f5 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -23,6 +23,7 @@ export interface Contributor { joining_date: string; role: "core" | "intern" | "operations" | "contributor"; courses_completed: string[]; + isNewContributor: boolean; } export interface ActivityData { From cda0ca2dd672c4991aa99b92e7ffd8608378ac4f Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Fri, 27 Dec 2024 10:28:32 +0530 Subject: [PATCH 04/10] Fix Logic --- app/page.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 4f07ab57..389a9101 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -26,12 +26,8 @@ export default async function Home() { const discussions = await fetchGithubDiscussion(5); const startDate = parseISO(env.NEXT_PUBLIC_ORG_START_DATE); - const firstTimeContributors = contributors.filter( - (contributor) => contributor.isNewContributor, - ); - const topContributors = [ - ...firstTimeContributors, + ...contributors.filter((contributor) => contributor.isNewContributor), ...contributors .filter((contributor) => !contributor.isNewContributor) .slice(0, 8), From ec0137dd27ad2374ce18f6c6068ca1dd4bb2d9aa Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Fri, 27 Dec 2024 15:01:32 +0530 Subject: [PATCH 05/10] Fix Logic for more readability --- app/page.tsx | 2 +- lib/api.ts | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 389a9101..2a419d82 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -190,7 +190,7 @@ export default async function Home() { href={"/people"} > {contributors.length > 8 - ? `${contributors.length - 8} contributors more` + ? `${contributors.length - topContributors.length} contributors more` : "Show all contributors"} diff --git a/lib/api.ts b/lib/api.ts index 105f2bb3..b414d60c 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -5,6 +5,7 @@ import { padZero } from "./utils"; import { readFile, readdir } from "fs/promises"; import { existsSync } from "fs"; import { getGithubDiscussions } from "@/lib/discussion"; +import { isAfter, sub } from "date-fns"; const root = join(process.cwd(), "data-repo/contributors"); const slackRoot = join(process.cwd(), "data-repo/data/slack"); @@ -189,19 +190,15 @@ export async function getContributorBySlug(file: string, detail = false) { const isNewContributor = (() => { const { activity } = activityData; - if (!activity || activity.length === 0) return false; + const aWeekAgo = sub(new Date(), { days: 7 }); - const prMergedActivities = activity + const firstActivity = activity .filter((act) => act.type === "pr_merged") - .sort((a, b) => new Date(a.time).getTime() - new Date(b.time).getTime()); + .sort( + (a, b) => new Date(a.time).getTime() - new Date(b.time).getTime(), + )[0]; - if (prMergedActivities.length === 0) return false; - - const firstActivityTime = new Date(prMergedActivities[0].time); - - return ( - firstActivityTime >= lastWeekStart && firstActivityTime <= lastWeekEnd - ); + return isAfter(new Date(firstActivity?.time), aWeekAgo); })(); const summarize = (start: Date, end: Date) => { From ad829fefd4451e79324334e8d0a23dfab1f7912b Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Fri, 27 Dec 2024 15:03:44 +0530 Subject: [PATCH 06/10] Remove Unnecessary code lines --- lib/api.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/api.ts b/lib/api.ts index b414d60c..3eb2d549 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -11,12 +11,6 @@ const root = join(process.cwd(), "data-repo/contributors"); const slackRoot = join(process.cwd(), "data-repo/data/slack"); const githubRoot = join(process.cwd(), "data-repo/data/github"); -const today = new Date(); -const lastWeekStart = new Date(today); -lastWeekStart.setDate(today.getDate() - today.getDay() - 7); -const lastWeekEnd = new Date(lastWeekStart); -lastWeekEnd.setDate(lastWeekStart.getDate() + 6); - export const points = { comment_created: 1, issue_assigned: 1, From dcb95f064f3b1733ebe80ba482f6c2daecf40773 Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Fri, 27 Dec 2024 20:20:25 +0530 Subject: [PATCH 07/10] Fix Reduce this sort function complexity --- lib/api.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/api.ts b/lib/api.ts index 3eb2d549..519276dd 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -5,7 +5,7 @@ import { padZero } from "./utils"; import { readFile, readdir } from "fs/promises"; import { existsSync } from "fs"; import { getGithubDiscussions } from "@/lib/discussion"; -import { isAfter, sub } from "date-fns"; +import { compareAsc, isAfter, sub } from "date-fns"; const root = join(process.cwd(), "data-repo/contributors"); const slackRoot = join(process.cwd(), "data-repo/data/slack"); @@ -188,9 +188,9 @@ export async function getContributorBySlug(file: string, detail = false) { const firstActivity = activity .filter((act) => act.type === "pr_merged") - .sort( - (a, b) => new Date(a.time).getTime() - new Date(b.time).getTime(), - )[0]; + .sort((a, b) => compareAsc(new Date(a.time), new Date(b.time)))[0]; + + if (!firstActivity) return false; return isAfter(new Date(firstActivity?.time), aWeekAgo); })(); From 0b1d22ce3bb36d3095324e96d5be0790de512c3b Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Sat, 4 Jan 2025 10:21:00 +0530 Subject: [PATCH 08/10] Fix Type Annotation and null validation --- app/page.tsx | 3 ++- lib/api.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 2a419d82..4f735ff6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -13,6 +13,7 @@ import { differenceInWeeks, parseISO } from "date-fns"; import { featureIsEnabled, formatDate } from "@/lib/utils"; import { fetchGithubDiscussion } from "../lib/discussion"; import GithubDiscussion from "@/components/discussions/GithubDiscussion"; +import { Contributor } from "@/lib/types"; export default async function Home() { const contributors = (await getContributors()) @@ -174,7 +175,7 @@ export default async function Home() { className="mt-4 space-y-4 sm:grid sm:grid-cols-2 sm:gap-6 sm:space-y-0 lg:grid-cols-2 lg:gap-8" > {topContributors.map( - (contributor: any, index: number) => { + (contributor: Contributor, index: number) => { return ( { From 3e589572171cbaed35849cfe6227097c371d1d59 Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Tue, 7 Jan 2025 17:25:26 +0530 Subject: [PATCH 09/10] Fix Variable name and update to latest version of date-fns --- app/page.tsx | 6 +++--- lib/api.ts | 2 +- package.json | 2 +- pnpm-lock.yaml | 42 +++++++++++++----------------------------- 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 4f735ff6..e6fd432d 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -27,7 +27,7 @@ export default async function Home() { const discussions = await fetchGithubDiscussion(5); const startDate = parseISO(env.NEXT_PUBLIC_ORG_START_DATE); - const topContributors = [ + const featuredContributors = [ ...contributors.filter((contributor) => contributor.isNewContributor), ...contributors .filter((contributor) => !contributor.isNewContributor) @@ -174,7 +174,7 @@ export default async function Home() { role="list" className="mt-4 space-y-4 sm:grid sm:grid-cols-2 sm:gap-6 sm:space-y-0 lg:grid-cols-2 lg:gap-8" > - {topContributors.map( + {featuredContributors.map( (contributor: Contributor, index: number) => { return ( {contributors.length > 8 - ? `${contributors.length - topContributors.length} contributors more` + ? `${contributors.length - featuredContributors.length} contributors more` : "Show all contributors"} diff --git a/lib/api.ts b/lib/api.ts index efd57111..942e017a 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -188,7 +188,7 @@ export async function getContributorBySlug(file: string, detail = false) { const firstActivity = activity .filter((act) => act.type === "pr_merged") - .sort((a, b) => compareAsc(new Date(a.time), new Date(b.time)))[0]; + .sort((a, b) => compareAsc(a.time, b.time))[0]; if (!firstActivity) return false; diff --git a/package.json b/package.json index 77e2c1b8..56b00759 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@t3-oss/env-nextjs": "^0.9.2", "@vercel/kv": "^1.0.1", "clsx": "^1.2.1", - "date-fns": "^2.30.0", + "date-fns": "^4.1.0", "gray-matter": "^4.0.3", "jotai": "^2.10.2", "next": "^14.2.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e665397..6ab3eb51 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^1.2.1 version: 1.2.1 date-fns: - specifier: ^2.30.0 - version: 2.30.0 + specifier: ^4.1.0 + version: 4.1.0 gray-matter: specifier: ^4.0.3 version: 4.0.3 @@ -157,10 +157,6 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - '@babel/runtime@7.24.8': - resolution: {integrity: sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==} - engines: {node: '>=6.9.0'} - '@eslint/eslintrc@1.4.1': resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -847,13 +843,12 @@ packages: resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} engines: {node: '>= 0.4'} - date-fns@2.30.0: - resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} - engines: {node: '>=0.11'} - date-fns@3.6.0: resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==} + date-fns@4.1.0: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -2155,9 +2150,6 @@ packages: resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} engines: {node: '>= 0.4'} - regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} @@ -2612,10 +2604,6 @@ snapshots: '@alloc/quick-lru@5.2.0': {} - '@babel/runtime@7.24.8': - dependencies: - regenerator-runtime: 0.14.1 - '@eslint/eslintrc@1.4.1': dependencies: ajv: 6.12.6 @@ -3360,12 +3348,10 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.1 - date-fns@2.30.0: - dependencies: - '@babel/runtime': 7.24.8 - date-fns@3.6.0: {} + date-fns@4.1.0: {} + debug@3.2.7: dependencies: ms: 2.1.3 @@ -3578,7 +3564,7 @@ snapshots: eslint: 8.16.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.16.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0))(eslint@8.16.0) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.16.0) eslint-plugin-react: 7.35.0(eslint@8.16.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.16.0) @@ -3605,8 +3591,8 @@ snapshots: debug: 4.3.5(supports-color@8.1.1) enhanced-resolve: 5.17.1 eslint: 8.16.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.16.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.16.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0))(eslint@8.16.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0))(eslint@8.16.0) fast-glob: 3.3.2 get-tsconfig: 4.7.6 is-core-module: 2.15.0 @@ -3617,7 +3603,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.16.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0))(eslint@8.16.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -3628,7 +3614,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.16.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0))(eslint@8.16.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -3638,7 +3624,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.16.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.16.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.16.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.16.0))(eslint@8.16.0))(eslint@8.16.0) hasown: 2.0.2 is-core-module: 2.15.0 is-glob: 4.0.3 @@ -4971,8 +4957,6 @@ snapshots: globalthis: 1.0.4 which-builtin-type: 1.1.3 - regenerator-runtime@0.14.1: {} - regexp.prototype.flags@1.5.2: dependencies: call-bind: 1.0.7 From 2c87ceacda035088716bace67d3ae4fc04682117 Mon Sep 17 00:00:00 2001 From: JavidSumra Date: Tue, 7 Jan 2025 17:41:49 +0530 Subject: [PATCH 10/10] Fix Arguments --- lib/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api.ts b/lib/api.ts index 942e017a..8c9b051e 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -192,7 +192,7 @@ export async function getContributorBySlug(file: string, detail = false) { if (!firstActivity) return false; - return isAfter(new Date(firstActivity.time), aWeekAgo); + return isAfter(firstActivity.time, aWeekAgo); })(); const summarize = (start: Date, end: Date) => {