Skip to content

Commit 8a6cc65

Browse files
committed
fix: separate logic for markdown vs app page
refactor to more precise naming. Create getAppPageLastCommitDate for react page history fetches. Throw error at build if contributor information not available.
1 parent c622521 commit 8a6cc65

File tree

16 files changed

+83
-70
lines changed

16 files changed

+83
-70
lines changed

app/[locale]/bug-bounty/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang, Params } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -27,7 +27,7 @@ export default async function Page({ params }: { params: Promise<Params> }) {
2727

2828
const commitHistoryCache: CommitHistory = {}
2929
const { contributors, lastEditLocaleTimestamp } =
30-
await getPageContributorInfo(
30+
await getAppPageContributorInfo(
3131
"bug-bounty",
3232
locale as Lang,
3333
commitHistoryCache

app/[locale]/dapps/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang, Params } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -25,7 +25,7 @@ export default async function Page({ params }: { params: Promise<Params> }) {
2525

2626
const commitHistoryCache: CommitHistory = {}
2727
const { contributors, lastEditLocaleTimestamp } =
28-
await getPageContributorInfo("dapps", locale as Lang, commitHistoryCache)
28+
await getAppPageContributorInfo("dapps", locale as Lang, commitHistoryCache)
2929

3030
return (
3131
<I18nProvider locale={locale} messages={pickedMessages}>

app/[locale]/eth/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -31,7 +31,7 @@ export default async function Page({
3131

3232
const commitHistoryCache: CommitHistory = {}
3333
const { contributors, lastEditLocaleTimestamp } =
34-
await getPageContributorInfo("eth", locale as Lang, commitHistoryCache)
34+
await getAppPageContributorInfo("eth", locale as Lang, commitHistoryCache)
3535

3636
return (
3737
<I18nProvider locale={locale} messages={pickedMessages}>

app/[locale]/gas/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -27,7 +27,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
2727

2828
const commitHistoryCache: CommitHistory = {}
2929
const { contributors, lastEditLocaleTimestamp } =
30-
await getPageContributorInfo("gas", locale as Lang, commitHistoryCache)
30+
await getAppPageContributorInfo("gas", locale as Lang, commitHistoryCache)
3131

3232
return (
3333
<I18nProvider locale={locale} messages={messages}>

app/[locale]/get-eth/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getLastModifiedDateByPath } from "@/lib/utils/gh"
1414
import { getMetadata } from "@/lib/utils/metadata"
1515
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
@@ -38,7 +38,11 @@ export default async function Page({
3838

3939
const commitHistoryCache: CommitHistory = {}
4040
const { contributors, lastEditLocaleTimestamp } =
41-
await getPageContributorInfo("get-eth", locale as Lang, commitHistoryCache)
41+
await getAppPageContributorInfo(
42+
"get-eth",
43+
locale as Lang,
44+
commitHistoryCache
45+
)
4246

4347
return (
4448
<I18nProvider locale={locale} messages={pickedMessages}>

app/[locale]/layer-2/learn/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -27,7 +27,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
2727

2828
const commitHistoryCache: CommitHistory = {}
2929
const { contributors, lastEditLocaleTimestamp } =
30-
await getPageContributorInfo(
30+
await getAppPageContributorInfo(
3131
"layer-2/learn",
3232
locale as Lang,
3333
commitHistoryCache

app/[locale]/learn/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang, Params } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -27,7 +27,7 @@ export default async function Page({ params }: { params: Promise<Params> }) {
2727

2828
const commitHistoryCache: CommitHistory = {}
2929
const { contributors, lastEditLocaleTimestamp } =
30-
await getPageContributorInfo("learn", locale as Lang, commitHistoryCache)
30+
await getAppPageContributorInfo("learn", locale as Lang, commitHistoryCache)
3131

3232
return (
3333
<I18nProvider locale={locale} messages={messages}>

app/[locale]/roadmap/vision/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -27,7 +27,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
2727

2828
const commitHistoryCache: CommitHistory = {}
2929
const { contributors, lastEditLocaleTimestamp } =
30-
await getPageContributorInfo(
30+
await getAppPageContributorInfo(
3131
"roadmap/vision",
3232
locale as Lang,
3333
commitHistoryCache

app/[locale]/run-a-node/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CommitHistory, Lang } from "@/lib/types"
99

1010
import I18nProvider from "@/components/I18nProvider"
1111

12-
import { getPageContributorInfo } from "@/lib/utils/contributors"
12+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1313
import { getMetadata } from "@/lib/utils/metadata"
1414
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1515

@@ -27,7 +27,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
2727

2828
const commitHistoryCache: CommitHistory = {}
2929
const { contributors, lastEditLocaleTimestamp } =
30-
await getPageContributorInfo(
30+
await getAppPageContributorInfo(
3131
"run-a-node",
3232
locale as Lang,
3333
commitHistoryCache

app/[locale]/staking/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515

1616
import I18nProvider from "@/components/I18nProvider"
1717

18-
import { getPageContributorInfo } from "@/lib/utils/contributors"
18+
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
1919
import { dataLoader } from "@/lib/utils/data/dataLoader"
2020
import { getMetadata } from "@/lib/utils/metadata"
2121
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
@@ -75,7 +75,11 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
7575

7676
const commitHistoryCache: CommitHistory = {}
7777
const { contributors, lastEditLocaleTimestamp } =
78-
await getPageContributorInfo("staking", locale as Lang, commitHistoryCache)
78+
await getAppPageContributorInfo(
79+
"staking",
80+
locale as Lang,
81+
commitHistoryCache
82+
)
7983

8084
return (
8185
<I18nProvider locale={locale} messages={messages}>

0 commit comments

Comments
 (0)