Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows ARM64 download buttons #5264

Merged
Merged
Changes from all commits
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
42 changes: 31 additions & 11 deletions components/Downloads/PrimaryDownloadMatrix.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import classNames from 'classnames';
import semVer from 'semver';

import LocalizedLink from '../LocalizedLink';
import { useNextraContext } from '../../hooks/useNextraContext';
Expand All @@ -16,6 +17,7 @@ const PrimaryDownloadMatrix = (props: PrimaryDownloadMatrixProps) => {
const nextraContext = useNextraContext();

const { downloads } = nextraContext.frontMatter as LegacyDownloadsFrontMatter;
const hasWindowsArm64 = semVer.satisfies(props.node, '>= 19.9.0');

const getIsVersionClassName = (isCurrent: boolean) =>
classNames({ 'is-version': isCurrent });
Expand Down Expand Up @@ -112,43 +114,61 @@ const PrimaryDownloadMatrix = (props: PrimaryDownloadMatrixProps) => {
<tbody>
<tr>
<th>{downloads.WindowsInstaller} (.msi)</th>
<td>
<td colSpan={hasWindowsArm64 ? 1 : 2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-x86.msi`}
>
32-bit
</a>
</td>
<td>
<td colSpan={2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-x64.msi`}
>
64-bit
</a>
</td>
{hasWindowsArm64 && (
<td colSpan={1}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-arm64.msi`}
>
ARM64
</a>
</td>
)}
</tr>

<tr>
<th>{downloads.WindowsBinary} (.zip)</th>
<td>
<td colSpan={hasWindowsArm64 ? 1 : 2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-win-x86.zip`}
>
32-bit
</a>
</td>
<td>
<td colSpan={2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-win-x64.zip`}
>
64-bit
</a>
</td>
{hasWindowsArm64 && (
<td colSpan={1}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-win-arm64.zip`}
>
ARM64
</a>
</td>
)}
</tr>

<tr>
<th>{downloads.MacOSInstaller} (.pkg)</th>
<td colSpan={2}>
<td colSpan={4}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}.pkg`}
>
Expand All @@ -158,14 +178,14 @@ const PrimaryDownloadMatrix = (props: PrimaryDownloadMatrixProps) => {
</tr>
<tr>
<th>{downloads.MacOSBinary} (.tar.gz)</th>
<td>
<td colSpan={2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-darwin-x64.tar.gz`}
>
64-bit
</a>
</td>
<td>
<td colSpan={2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-darwin-arm64.tar.gz`}
>
Expand All @@ -176,7 +196,7 @@ const PrimaryDownloadMatrix = (props: PrimaryDownloadMatrixProps) => {

<tr>
<th>{downloads.LinuxBinaries} (x64)</th>
<td colSpan={2}>
<td colSpan={4}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-linux-x64.tar.xz`}
>
Expand All @@ -186,14 +206,14 @@ const PrimaryDownloadMatrix = (props: PrimaryDownloadMatrixProps) => {
</tr>
<tr>
<th>{downloads.LinuxBinaries} (ARM)</th>
<td>
<td colSpan={2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-linux-armv7l.tar.xz`}
>
ARMv7
</a>
</td>
<td>
<td colSpan={2}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}-linux-arm64.tar.xz`}
>
Expand All @@ -204,7 +224,7 @@ const PrimaryDownloadMatrix = (props: PrimaryDownloadMatrixProps) => {

<tr>
<th>{downloads.SourceCode}</th>
<td colSpan={2}>
<td colSpan={4}>
<a
href={`https://nodejs.org/dist/${props.node}/node-${props.node}.tar.gz`}
>
Expand Down