Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions apps/site/app/[locale]/next-data/api-data/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const getPathnameForApiFile = (name: string, version: string) =>
export const GET = async () => {
const releases = provideReleaseData();

const { versionWithPrefix } = releases.find(
release => release.status === 'LTS'
)!;
const { versionWithPrefix } = releases.find(release => release.isLts)!;
Comment thread
avivkeller marked this conversation as resolved.
Outdated

const gitHubApiResponse = await fetch(
getGitHubApiDocsUrl(versionWithPrefix),
Expand Down
15 changes: 4 additions & 11 deletions apps/site/components/Downloads/DownloadReleasesTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,12 @@ import getReleaseData from '#site/next-data/releaseData';

const BADGE_KIND_MAP = {
'End-of-life': 'warning',
Maintenance: 'neutral',
LTS: 'info',
'Maintenance LTS': 'neutral',
'Active LTS': 'info',
Current: 'default',
Pending: 'default',
} as const;

const BADGE_TEXT_MAP = {
'End-of-life': 'End-of-Life (EOL)',
Maintenance: 'Maintenance LTS',
LTS: 'Active LTS',
Current: 'Current',
Pending: 'Pending',
} as const;

const DownloadReleasesTable: FC = async () => {
const releaseData = await getReleaseData();

Expand Down Expand Up @@ -52,7 +44,8 @@ const DownloadReleasesTable: FC = async () => {
</td>
<td data-label="Status">
<Badge kind={BADGE_KIND_MAP[release.status]} size="small">
{BADGE_TEXT_MAP[release.status]}
{release.status}
{release.status === 'End-of-life' ? ' (EoL)' : ''}
</Badge>
</td>
<td className="download-table-last">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const ReleaseCodeBox: FC = () => {
</AlertBox>
)}

{release.status === 'LTS' && (
{release.isLts && (
<AlertBox
title={t('components.common.alertBox.info')}
level="info"
Expand Down
4 changes: 2 additions & 2 deletions apps/site/components/Downloads/Release/VersionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '#site/providers/releaseProvider';

const getDropDownStatus = (version: string, status: string) => {
if (status === 'LTS') {
if (status.endsWith('LTS')) {
return `${version} (LTS)`;
}

Expand All @@ -37,7 +37,7 @@ const VersionDropdown: FC = () => {
({ versionWithPrefix }) => versionWithPrefix === version
);

if (release?.status === 'LTS' && pathname.includes('current')) {
if (release?.isLts && pathname.includes('current')) {
redirect({ href: '/download', locale: locale });
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/Downloads/ReleaseModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ReleaseModal: FC<ReleaseModalProps> = ({
</div>
)}

{release.status === 'LTS' && (
{release.isLts && (
<div className="mb-4">
<AlertBox
title={t('components.common.alertBox.info')}
Expand Down
4 changes: 3 additions & 1 deletion apps/site/components/withDownloadSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const WithDownloadSection: FC<PropsWithChildren> = async ({ children }) => {
.concat(snippets);

// Decides which initial release to use based on the current pathname
const initialRelease = pathname.endsWith('/current') ? 'Current' : 'LTS';
const initialRelease = pathname.endsWith('/current')
? 'Current'
: 'Active LTS';

return (
<WithNodeRelease status={initialRelease}>
Expand Down
6 changes: 3 additions & 3 deletions apps/site/next-data/generators/releaseData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const getNodeReleaseStatus = (now, support) => {
}

if (maintenanceStart && now >= new Date(maintenanceStart)) {
return 'Maintenance';
return 'Maintainence LTS';
Comment thread
avivkeller marked this conversation as resolved.
Outdated
}

if (ltsStart && now >= new Date(ltsStart)) {
return 'LTS';
return 'Active LTS';
}

if (currentStart && now >= new Date(currentStart)) {
Expand Down Expand Up @@ -96,7 +96,7 @@ const generateReleaseData = async () => {
version: latestVersion.semver.raw,
versionWithPrefix: `v${latestVersion.semver.raw}`,
codename: major.support.codename || '',
isLts: status === 'LTS',
isLts: status.endsWith('LTS'),
npm: latestVersion.dependencies.npm || '',
v8: latestVersion.dependencies.v8,
releaseDate: latestVersion.releaseDate,
Expand Down
2 changes: 1 addition & 1 deletion apps/site/pages/en/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ layout: home
</Button>

<div className="flex flex-col xs:flex-row gap-2 justify-center xs:mt-6">
<WithNodeRelease status="LTS">
<WithNodeRelease status="Active LTS">
{({ release }) =>
<BadgeGroup size="small" kind="info" badgeText={release.versionWithPrefix} href={`/blog/release/${release.versionWithPrefix}`}>
Node.js LTS
Expand Down
4 changes: 2 additions & 2 deletions apps/site/types/releases.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type NodeReleaseStatus =
| 'LTS'
| 'Maintenance'
| 'Active LTS'
| 'Maintenance LTS'
| 'Current'
| 'End-of-life'
| 'Pending';
Expand Down
2 changes: 1 addition & 1 deletion apps/site/util/download/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"name": "Brew",
"compatibility": {
"os": ["MAC", "LINUX"],
"releases": ["Current", "LTS"]
"releases": ["Current", "Active LTS", "Maintenance LTS"]
},
"url": "https://brew.sh/",
"info": "layouts.download.codeBox.platformInfo.brew"
Expand Down
Loading