Skip to content

Commit a8c94d0

Browse files
committed
Increase changelog limit to 500 commits
1 parent dbdd9c9 commit a8c94d0

3 files changed

Lines changed: 105 additions & 117 deletions

File tree

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@
1313
"git-raw-commits": "^2.0.11",
1414
"jsonwebtoken": "^8.5.1",
1515
"next": "12.1.0",
16-
"node-fetch": "2.6.6",
16+
"node-fetch": "^2.6.7",
1717
"react": "17.0.2",
1818
"react-chartjs-2": "^4.0.1",
1919
"react-cookie-consent": "^7.3.1",
2020
"react-dom": "17.0.2",
21-
"react-markdown": "^7.1.2",
21+
"react-markdown": "^8.0.0",
2222
"react-modal": "^3.14.4",
2323
"react-toastify": "^8.2.0",
24-
"sharp": "^0.29.3"
24+
"sharp": "^0.30.1"
2525
},
2626
"devDependencies": {
2727
"@types/cookie": "^0.4.1",
2828
"@types/git-raw-commits": "^2.0.1",
2929
"@types/jsonwebtoken": "^8.5.8",
30-
"@types/node": "17.0.5",
30+
"@types/node": "17.0.21",
3131
"@types/node-fetch": "^2.6.1",
32-
"@types/react": "17.0.38",
32+
"@types/react": "17.0.39",
3333
"@types/react-modal": "^3.13.1",
3434
"autoprefixer": "^10.4.2",
3535
"babel-plugin-inline-react-svg": "^2.0.1",
36-
"eslint": "8.5.0",
37-
"eslint-config-next": "12.0.7",
36+
"eslint": "8.10.0",
37+
"eslint-config-next": "12.1.0",
3838
"postcss": "^8.4.7",
3939
"tailwindcss": "^3.0.23",
40-
"typescript": "4.5.4"
40+
"typescript": "4.5.5"
4141
}
4242
}

pages/changelog.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ export default function Changelog({ location, commits }: { location: string } &
3333
</h1>
3434

3535
<div>
36-
Check out the full <FormattedLink href="https://github.com/Tibowl/HuTao/commits/master" location={location}>commit history on GitHub</FormattedLink> for the Discord bot / game data.
37-
This page shows 100 most recent bot / game data commits and fills in website commits since the oldest one.
36+
Check us out on GitHub! The Discord bot / game data can be found at <FormattedLink href="https://github.com/Tibowl/HuTao" location={location} target="_blank">HuTao</FormattedLink>, while the site can be found at <FormattedLink href="https://github.com/Tibowl/HuTaoSite" location={location} target="_blank">HuTaoSite</FormattedLink>.
3837
</div>
3938

4039
<h2 className="text-3xl font-bold pb-2">
41-
Commits
40+
Changes
4241
</h2>
4342

4443
{commits.map((commit, i, arr) => <Commit key={commit.hash} commit={commit} prev={arr[i - 1]} />)}
@@ -75,14 +74,23 @@ function Commit({ commit, prev }: { commit: CommitData, prev?: CommitData }) {
7574
</span>
7675

7776
{commit.type == "Bot/Data" ? <FormattedLink href={`https://github.com/Tibowl/HuTao/commit/${commit.hash}`} target="_blank">{child}</FormattedLink> :
78-
commit.type == "Website" ? <FormattedLink href={`https://github.com/Tibowl/HuTaoSite/commit/${commit.hash}`} target="_blank">{child}</FormattedLink> : child}
77+
commit.type == "Website" ? <FormattedLink href={`https://github.com/Tibowl/HuTaoSite/commit/${commit.hash}`} target="_blank">{child}</FormattedLink> : child}
7978
</div>
8079
</>
8180
}
8281

8382
export async function getStaticProps(context: GetStaticPropsContext): Promise<GetStaticPropsResult<Props>> {
8483
const res = await fetch("https://api.github.com/repos/Tibowl/HuTao/commits?per_page=100")
8584
const data = await res.json()
85+
86+
for (let i = 2; i <= 5; i++) {
87+
const res2 = await fetch(`https://api.github.com/repos/Tibowl/HuTao/commits?per_page=100&sha=${data[0].sha}&page=${i}`)
88+
const data2 = await res2.json()
89+
data.push(...data2)
90+
if (data2.length < 100)
91+
break
92+
}
93+
8694
const bot: CommitData[] = data.map((commit: any) => {
8795
return {
8896
hash: commit.sha,

0 commit comments

Comments
 (0)