Skip to content

Commit

Permalink
Add missing os from website redesign (#6575)
Browse files Browse the repository at this point in the history
* Add missing os from website redesign

Refs: #6479

Adds back the ability to download Node.js binaries for AIX

Signed-off-by: Michael Dawson <[email protected]>

* Update components/Downloads/Release/BitnessDropdown.tsx

Co-authored-by: Caner Akdas <[email protected]>
Signed-off-by: Michael Dawson <[email protected]>

* Update util/detectOS.ts

Co-authored-by: Richard Lau <[email protected]>
Signed-off-by: Michael Dawson <[email protected]>

* Update util/downloadUtils.ts

Co-authored-by: Richard Lau <[email protected]>
Signed-off-by: Michael Dawson <[email protected]>

* chore: fixed prettier

---------

Signed-off-by: Michael Dawson <[email protected]>
Signed-off-by: Michael Dawson <[email protected]>
Co-authored-by: Caner Akdas <[email protected]>
Co-authored-by: Richard Lau <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
  • Loading branch information
4 people authored Apr 1, 2024
1 parent b36f123 commit 327356b
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 5 deletions.
4 changes: 4 additions & 0 deletions components/Downloads/Release/BitnessDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 2 additions & 0 deletions components/Downloads/Release/OperatingSystemDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -75,6 +76,7 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = ({
WIN: <Microsoft width={16} height={16} />,
MAC: <Apple width={16} height={16} />,
LINUX: <Linux width={16} height={16} />,
AIX: <Aix width={16} height={16} />,
},
})}
defaultValue={os}
Expand Down
2 changes: 1 addition & 1 deletion pages/en/download/current.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want.
---

<section>
I want the <Release.VersionDropdown /> version of Node.js for <Release.OperatingSystemDropdown exclude={["LINUX"]} /> running <Release.BitnessDropdown />
I want the <Release.VersionDropdown /> version of Node.js for <Release.OperatingSystemDropdown exclude={["LINUX", "AIX"]} /> running <Release.BitnessDropdown />

<Release.DownloadButton kind={"installer"} />
</section>
Expand Down
2 changes: 1 addition & 1 deletion pages/en/download/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want.
---

<section>
I want the <Release.VersionDropdown /> version of Node.js for <Release.OperatingSystemDropdown exclude={["LINUX"]} /> running <Release.BitnessDropdown />
I want the <Release.VersionDropdown /> version of Node.js for <Release.OperatingSystemDropdown exclude={["LINUX", "AIX"]} /> running <Release.BitnessDropdown />

<Release.DownloadButton kind={"installer"} />
</section>
Expand Down
2 changes: 1 addition & 1 deletion pages/en/download/package-manager/current.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want.
---

<section>
Install Node.js <Release.VersionDropdown /> on <Release.OperatingSystemDropdown /> using <Release.PlatformDropdown />
Install Node.js <Release.VersionDropdown /> on <Release.OperatingSystemDropdown exclude={["AIX"]} /> using <Release.PlatformDropdown />

<Release.ReleaseCodeBox />
</section>
Expand Down
2 changes: 1 addition & 1 deletion pages/en/download/package-manager/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subtitle: Download Node.js the way you want.
---

<section>
Install Node.js <Release.VersionDropdown /> on <Release.OperatingSystemDropdown /> using <Release.PlatformDropdown />
Install Node.js <Release.VersionDropdown /> on <Release.OperatingSystemDropdown exclude={["AIX"]} /> using <Release.PlatformDropdown />

<Release.ReleaseCodeBox />
</section>
Expand Down
2 changes: 1 addition & 1 deletion types/userOS.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type UserOS = 'MAC' | 'WIN' | 'LINUX' | 'OTHER' | 'LOADING';
export type UserOS = 'MAC' | 'WIN' | 'LINUX' | 'AIX' | 'OTHER' | 'LOADING';
2 changes: 2 additions & 0 deletions util/detectOS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export const detectOsInUserAgent = (userAgent: string | undefined): UserOS => {
return 'MAC';
case 'Linux':
return 'LINUX';
case 'AIX':
return 'AIX';
default:
return 'OTHER';
}
Expand Down
11 changes: 11 additions & 0 deletions util/downloadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum OperatingSystem {
WIN = 'Windows',
MAC = 'macOS',
LINUX = 'Linux',
AIX = 'AIX',
OTHER = 'Other',
}

Expand All @@ -22,6 +23,10 @@ export const operatingSystemItems = [
label: OperatingSystem.LINUX,
value: 'LINUX' as UserOS,
},
{
label: OperatingSystem.AIX,
value: 'AIX' as UserOS,
},
];

export const platformItems = [
Expand Down Expand Up @@ -90,6 +95,12 @@ export const bitnessItems = {
value: 's390x',
},
],
AIX: [
{
label: 'Power',
value: 'ppc64',
},
],
OTHER: [],
LOADING: [],
};
Expand Down
7 changes: 7 additions & 0 deletions util/getNodeDownloadUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit 327356b

Please sign in to comment.