From 327356b75da29771ce7d8369cfba631a0e1011c7 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 1 Apr 2024 06:44:48 -0400 Subject: [PATCH] Add missing os from website redesign (#6575) * Add missing os from website redesign Refs: https://github.com/nodejs/nodejs.org/issues/6479 Adds back the ability to download Node.js binaries for AIX Signed-off-by: Michael Dawson * Update components/Downloads/Release/BitnessDropdown.tsx Co-authored-by: Caner Akdas Signed-off-by: Michael Dawson * Update util/detectOS.ts Co-authored-by: Richard Lau Signed-off-by: Michael Dawson * Update util/downloadUtils.ts Co-authored-by: Richard Lau Signed-off-by: Michael Dawson * chore: fixed prettier --------- Signed-off-by: Michael Dawson Signed-off-by: Michael Dawson Co-authored-by: Caner Akdas Co-authored-by: Richard Lau Co-authored-by: Claudio Wunder --- components/Downloads/Release/BitnessDropdown.tsx | 4 ++++ .../Downloads/Release/OperatingSystemDropdown.tsx | 2 ++ pages/en/download/current.mdx | 2 +- pages/en/download/index.mdx | 2 +- pages/en/download/package-manager/current.mdx | 2 +- pages/en/download/package-manager/index.mdx | 2 +- types/userOS.ts | 2 +- util/detectOS.ts | 2 ++ util/downloadUtils.ts | 11 +++++++++++ util/getNodeDownloadUrl.ts | 7 +++++++ 10 files changed, 31 insertions(+), 5 deletions(-) diff --git a/components/Downloads/Release/BitnessDropdown.tsx b/components/Downloads/Release/BitnessDropdown.tsx index caa523ca5af17..e17ca0d2e78ff 100644 --- a/components/Downloads/Release/BitnessDropdown.tsx +++ b/components/Downloads/Release/BitnessDropdown.tsx @@ -52,6 +52,10 @@ const BitnessDropdown: FC = () => { disabledItems.push('s390x'); } + if (os === 'AIX' && semVer.satisfies(release.version, '< 6.7.0')) { + disabledItems.push('ppc64'); + } + return disabledItems; }, [os, release.version]); diff --git a/components/Downloads/Release/OperatingSystemDropdown.tsx b/components/Downloads/Release/OperatingSystemDropdown.tsx index 3b602cb5f637c..d8dc04999a103 100644 --- a/components/Downloads/Release/OperatingSystemDropdown.tsx +++ b/components/Downloads/Release/OperatingSystemDropdown.tsx @@ -6,6 +6,7 @@ import type { FC } from 'react'; import Select from '@/components/Common/Select'; import Apple from '@/components/Icons/Platform/Apple'; +import Aix from '@/components/Icons/Platform/Generic'; import Linux from '@/components/Icons/Platform/Linux'; import Microsoft from '@/components/Icons/Platform/Microsoft'; import { useDetectOS } from '@/hooks/react-client'; @@ -75,6 +76,7 @@ const OperatingSystemDropdown: FC = ({ WIN: , MAC: , LINUX: , + AIX: , }, })} defaultValue={os} diff --git a/pages/en/download/current.mdx b/pages/en/download/current.mdx index 764ed0c3ee56e..7454c98b16f98 100644 --- a/pages/en/download/current.mdx +++ b/pages/en/download/current.mdx @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want. ---
-I want the version of Node.js for running +I want the version of Node.js for running
diff --git a/pages/en/download/index.mdx b/pages/en/download/index.mdx index 764ed0c3ee56e..7454c98b16f98 100644 --- a/pages/en/download/index.mdx +++ b/pages/en/download/index.mdx @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want. ---
-I want the version of Node.js for running +I want the version of Node.js for running
diff --git a/pages/en/download/package-manager/current.mdx b/pages/en/download/package-manager/current.mdx index b1df735f28000..c7ec0a6b073f1 100644 --- a/pages/en/download/package-manager/current.mdx +++ b/pages/en/download/package-manager/current.mdx @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want. ---
-Install Node.js on using +Install Node.js on using
diff --git a/pages/en/download/package-manager/index.mdx b/pages/en/download/package-manager/index.mdx index 53cef9690e467..31915b0993e5a 100644 --- a/pages/en/download/package-manager/index.mdx +++ b/pages/en/download/package-manager/index.mdx @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want. ---
-Install Node.js on using +Install Node.js on using
diff --git a/types/userOS.ts b/types/userOS.ts index aac34009c3c00..3c3ea522e213d 100644 --- a/types/userOS.ts +++ b/types/userOS.ts @@ -1 +1 @@ -export type UserOS = 'MAC' | 'WIN' | 'LINUX' | 'OTHER' | 'LOADING'; +export type UserOS = 'MAC' | 'WIN' | 'LINUX' | 'AIX' | 'OTHER' | 'LOADING'; diff --git a/util/detectOS.ts b/util/detectOS.ts index c588ab406cf4c..92b8f2277e39e 100644 --- a/util/detectOS.ts +++ b/util/detectOS.ts @@ -9,6 +9,8 @@ export const detectOsInUserAgent = (userAgent: string | undefined): UserOS => { return 'MAC'; case 'Linux': return 'LINUX'; + case 'AIX': + return 'AIX'; default: return 'OTHER'; } diff --git a/util/downloadUtils.ts b/util/downloadUtils.ts index f61a5b1b52675..de6af4173dae0 100644 --- a/util/downloadUtils.ts +++ b/util/downloadUtils.ts @@ -6,6 +6,7 @@ export enum OperatingSystem { WIN = 'Windows', MAC = 'macOS', LINUX = 'Linux', + AIX = 'AIX', OTHER = 'Other', } @@ -22,6 +23,10 @@ export const operatingSystemItems = [ label: OperatingSystem.LINUX, value: 'LINUX' as UserOS, }, + { + label: OperatingSystem.AIX, + value: 'AIX' as UserOS, + }, ]; export const platformItems = [ @@ -90,6 +95,12 @@ export const bitnessItems = { value: 's390x', }, ], + AIX: [ + { + label: 'Power', + value: 'ppc64', + }, + ], OTHER: [], LOADING: [], }; diff --git a/util/getNodeDownloadUrl.ts b/util/getNodeDownloadUrl.ts index 59a48cc93b014..12ad77e8e02c9 100644 --- a/util/getNodeDownloadUrl.ts +++ b/util/getNodeDownloadUrl.ts @@ -59,6 +59,13 @@ export const getNodeDownloadUrl = ( // Since the x86 platform is not officially supported, returns the x64 // link as the default value. return `${baseURL}/node-${versionWithPrefix}-linux-x64.tar.xz`; + case 'AIX': + // Prepares a downloadable Node.js link for AIX + if (typeof bitness === 'string') { + return `${baseURL}/node-${versionWithPrefix}-aix-${bitness}.tar.gz`; + } + + return `${baseURL}/node-${versionWithPrefix}-aix-ppc64.tar.gz`; default: // Prepares a downloadable Node.js source code link return `${baseURL}/node-${versionWithPrefix}.tar.gz`;