Skip to content

Commit 5b72ebe

Browse files
committed
feat: add nvm-windows as a Windows install method
Expose nvm-windows on the download page with its own icon, winget snippet, and English platform copy so Windows users can install Node via the dedicated Windows version manager.
1 parent a2db8a5 commit 5b72ebe

9 files changed

Lines changed: 60 additions & 1 deletion

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# NOTICE: This is not nvm. This is a separate version manager dedicated to Windows.
2+
3+
# Download and install NVM for Windows:
4+
winget install nvm-windows
5+
6+
# Download and install Node.js:
7+
nvm install ${props.release.major}

‎apps/site/types/release.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { OperatingSystem, Platform } from '#site/types/userAgent';
44

55
export type InstallationMethod =
66
| 'NVM'
7+
| 'NVMWINDOWS'
78
| 'FNM'
89
| 'BREW'
910
| 'DOCKER'

‎apps/site/util/__tests__/download.test.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,13 @@ describe('nextItem', () => {
234234
describe('INSTALL_METHODS', () => {
235235
it('should create icons only when an icon is configured', () => {
236236
const nvmMethod = INSTALL_METHODS.find(method => method.value === 'NVM');
237+
const nvmWindowsMethod = INSTALL_METHODS.find(
238+
method => method.value === 'NVMWINDOWS'
239+
);
237240
const asdfMethod = INSTALL_METHODS.find(method => method.value === 'ASDF');
238241

239242
assert.ok(nvmMethod?.iconImage);
243+
assert.ok(nvmWindowsMethod?.iconImage);
240244
assert.equal(asdfMethod?.iconImage, undefined);
241245
});
242246
});

‎apps/site/util/download/constants.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@
142142
"url": "https://github.com/nvm-sh/nvm",
143143
"info": "layouts.download.codeBox.platformInfo.nvm"
144144
},
145+
{
146+
"id": "NVMWINDOWS",
147+
"icon": "NVMWindows",
148+
"name": "nvm-windows",
149+
"compatibility": {
150+
"os": ["WIN"]
151+
},
152+
"url": "https://github.com/nvm-windows/nvm",
153+
"info": "layouts.download.codeBox.platformInfo.nvmWindows"
154+
},
145155
{
146156
"id": "FNM",
147157
"icon": "FNM",

‎packages/i18n/src/locales/en.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
"platformInfo": {
257257
"default": "{platform} and their installation scripts are not maintained by the Node.js project.",
258258
"nvm": "\"nvm\" is a cross-platform Node.js version manager.",
259+
"nvmWindows": "\"nvm-windows\" is a Node.js version manager dedicated to Windows.",
259260
"fnm": "\"fnm\" is a cross-platform Node.js version manager.",
260261
"brew": "Homebrew is a package manager for macOS and Linux.",
261262
"choco": "Chocolatey is a package manager for Windows.",

‎packages/ui-components/__design__/platform-logos.stories.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
Docker,
33
Homebrew,
44
NVM,
5+
NVMWindows,
56
Choco,
67
N,
78
VitePlus,
@@ -17,6 +18,7 @@ const installMethodIcons = [
1718
Docker,
1819
Homebrew,
1920
NVM,
21+
NVMWindows,
2022
Choco,
2123
N,
2224
VitePlus,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Ref: https://github.com/nvm-windows/docs/blob/main/static/img/logo.svg
2+
import type { FC, SVGProps } from 'react';
3+
4+
const NVMWindows: FC<SVGProps<SVGSVGElement>> = props => (
5+
<svg
6+
width="32"
7+
height="32"
8+
viewBox="0 0 3293 3750"
9+
fill="none"
10+
xmlns="http://www.w3.org/2000/svg"
11+
{...props}
12+
>
13+
<path
14+
d="M1434.02 1589.08C956.013 1440.02 478.007 1464.527 0 1666.67c0-313.51 7.536-418.686 22.608-729.167 455.676-293.429 930.781-571.622 1411.41-826.551v1478.13Zm416.667-1482.42c483.394 256.099 961.279 535.769 1419.52 830.848 15.073 310.481 22.609 415.658 22.609 729.168-480.709 253.798-961.417 257.858-1442.12 84.296V106.662Zm-416.667 3532.4c-480.631-254.929-955.736-533.122-1411.41-826.551C7.538 2502.028.002 2396.852.002 2083.342c478.007-202.142 956.013-226.649 1434.02-77.589v1633.31Zm416.667-1471.42c480.708 173.563 961.416 169.503 1442.12-84.296 0 313.51-7.536 418.686-22.609 729.166-458.237 295.079-936.122 574.749-1419.52 830.848v-1475.72Z"
15+
fill="#4B5ADD"
16+
/>
17+
</svg>
18+
);
19+
20+
export default NVMWindows;

‎packages/ui-components/src/Icons/InstallationMethod/index.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@ import FNM from '#ui/Icons/InstallationMethod/FNM';
44
import Homebrew from '#ui/Icons/InstallationMethod/Homebrew';
55
import N from '#ui/Icons/InstallationMethod/N';
66
import NVM from '#ui/Icons/InstallationMethod/NVM';
7+
import NVMWindows from '#ui/Icons/InstallationMethod/NVMWindows';
78
import VitePlus from '#ui/Icons/InstallationMethod/VitePlus';
89
import Volta from '#ui/Icons/InstallationMethod/Volta';
910
import ZeroInstall from '#ui/Icons/InstallationMethod/ZeroInstall';
1011

11-
export { Choco, Docker, FNM, Homebrew, N, NVM, VitePlus, Volta, ZeroInstall };
12+
export {
13+
Choco,
14+
Docker,
15+
FNM,
16+
Homebrew,
17+
N,
18+
NVM,
19+
NVMWindows,
20+
VitePlus,
21+
Volta,
22+
ZeroInstall,
23+
};

0 commit comments

Comments
 (0)