From 1d70c588e4e533dd894d66b12753f73fb7d90621 Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Wed, 28 Feb 2024 19:11:07 +0100 Subject: [PATCH] chore: apply hotfixes requested by the TSC --- app/[locale]/next-data/api-data/route.ts | 11 ++++++++++- util/downloadUtils.ts | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/[locale]/next-data/api-data/route.ts b/app/[locale]/next-data/api-data/route.ts index 5392b97901ce1..3c37494f2f6a8 100644 --- a/app/[locale]/next-data/api-data/route.ts +++ b/app/[locale]/next-data/api-data/route.ts @@ -1,5 +1,6 @@ import { deflateSync } from 'node:zlib'; +import getReleaseData from '@/next-data/releaseData'; import { VERCEL_REVALIDATE } from '@/next.constants.mjs'; import { defaultLocale } from '@/next.locales.mjs'; import type { GitHubApiFile } from '@/types'; @@ -13,7 +14,15 @@ const getPathnameForApiFile = (name: string) => // for a digest and metadata of all API pages from the Node.js Website // @see https://nextjs.org/docs/app/building-your-application/routing/router-handlers export const GET = async () => { - const gitHubApiResponse = await fetch(getGitHubApiDocsUrl('main')); + const releases = await getReleaseData(); + + const latestLTSRelease = releases.find(release => + ['Active LTS', 'Maintenance LTS'].includes(release.status) + ); + + const gitHubApiResponse = await fetch( + getGitHubApiDocsUrl(latestLTSRelease!.versionWithPrefix) + ); return gitHubApiResponse.json().then((apiDocsFiles: Array) => { // maps over each api file and get the download_url, fetch the content and deflates it diff --git a/util/downloadUtils.ts b/util/downloadUtils.ts index 7567bcb64d089..890f4d8fd5246 100644 --- a/util/downloadUtils.ts +++ b/util/downloadUtils.ts @@ -43,11 +43,11 @@ export const platformItems = [ export const bitnessItems = { WIN: [ { - label: '64-bit', + label: 'x64', value: '64', }, { - label: '32-bit', + label: 'x86', value: '86', }, { @@ -57,7 +57,7 @@ export const bitnessItems = { ], MAC: [ { - label: '64-bit', + label: 'x64', value: '64', }, { @@ -67,7 +67,7 @@ export const bitnessItems = { ], LINUX: [ { - label: '64-bit', + label: 'x64', value: '64', }, {