diff --git a/bun.lockb b/bun.lockb index bc04427..4900552 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 44be3ac..ea9550d 100644 --- a/package.json +++ b/package.json @@ -9,27 +9,27 @@ "lint": "next lint" }, "dependencies": { - "@radix-ui/react-separator": "^1.1.1", - "@radix-ui/react-slot": "^1.1.1", - "@radix-ui/react-tabs": "^1.1.2", + "@radix-ui/react-separator": "^1.1.2", + "@radix-ui/react-slot": "^1.1.2", + "@radix-ui/react-tabs": "^1.1.3", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.468.0", "next": "15.1.0", "react": "^19.0.0", "react-dom": "^19.0.0", - "tailwind-merge": "^2.5.5", + "tailwind-merge": "^2.6.0", "tailwindcss-animate": "^1.0.7" }, "devDependencies": { - "typescript": "^5", - "@types/node": "^20", - "@types/react": "^19", - "@types/react-dom": "^19", - "postcss": "^8", - "tailwindcss": "^3.4.1", - "eslint": "^9", + "typescript": "^5.7.3", + "@types/node": "^20.17.19", + "@types/react": "^19.0.10", + "@types/react-dom": "^19.0.4", + "postcss": "^8.5.3", + "tailwindcss": "^3.4.17", + "eslint": "^9.21.0", "eslint-config-next": "15.1.0", - "@eslint/eslintrc": "^3" + "@eslint/eslintrc": "^3.3.0" } } diff --git a/src/app/page.tsx b/src/app/page.tsx index 95e4cea..cb50ba9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -21,7 +21,7 @@ const calculateAge = (birthdate: Date): number => { return age; }; -const getRepos = async (username: string) => { +const getRepos = async (username: string, options: RequestInit = {}) => { let repos: Repository[] = []; let page = 1; let hasNextPage = true; @@ -31,6 +31,7 @@ const getRepos = async (username: string) => { headers: { Accept: 'application/vnd.github+json', }, + ...options, }); const data = await response.json(); @@ -46,11 +47,12 @@ const getRepos = async (username: string) => { return repos; }; -const getLanguages = async (repo: Repository) => { +const getLanguages = async (repo: Repository, options: RequestInit = {}) => { const response = await fetch(repo.languages_url, { headers: { Accept: 'application/vnd.github+json', }, + ...options, }); return await response.json(); }; @@ -59,7 +61,7 @@ const accumulateLanguages = async (repos: Repository[]) => { const languages: { [key: string]: number } = {}; for (const repo of repos) { - const repoLanguages = await getLanguages(repo); + const repoLanguages = await getLanguages(repo, { next: { revalidate: 3600 } }); for (const lang in repoLanguages) { languages[lang] = (languages[lang] || 0) + repoLanguages[lang]; } @@ -80,11 +82,11 @@ const accumulateStars = (repos: Repository[]) => { export default async function Home() { - const profileResponse = await fetch('https://api.github.com/users/markusthielker'); + const profileResponse = await fetch('https://api.github.com/users/markusthielker', { next: { revalidate: 3600 } }); const profile = await profileResponse.json() as PublicUser; const username = 'markusthielker'; - const repos = await getRepos(username); + const repos = await getRepos(username, { next: { revalidate: 3600 } }); const languages = await accumulateLanguages(repos); const stars = accumulateStars(repos); const totalBytes = Object.values(languages).reduce((sum, bytes) => sum + bytes, 0); @@ -98,7 +100,7 @@ export default async function Home() { .slice(0, 3); const age = calculateAge(new Date('2001-03-04')); - const year = new Date().getFullYear() + const year = new Date().getFullYear(); return (