Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .changeset/add-nvm-windows-install-method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
7 changes: 7 additions & 0 deletions apps/site/snippets/en/download/nvmwindows.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NOTICE: This is not nvm. This is a separate version manager dedicated to Windows.

# Download and install NVM for Windows:
winget install nvm-windows

# Download and install Node.js:
nvm install ${props.release.major}
1 change: 1 addition & 0 deletions apps/site/types/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { OperatingSystem, Platform } from '#site/types/userAgent';

export type InstallationMethod =
| 'NVM'
| 'NVMWINDOWS'
| 'FNM'
| 'BREW'
| 'DOCKER'
Expand Down
4 changes: 4 additions & 0 deletions apps/site/util/__tests__/download.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,13 @@ describe('nextItem', () => {
describe('INSTALL_METHODS', () => {
it('should create icons only when an icon is configured', () => {
const nvmMethod = INSTALL_METHODS.find(method => method.value === 'NVM');
const nvmWindowsMethod = INSTALL_METHODS.find(
method => method.value === 'NVMWINDOWS'
);
const asdfMethod = INSTALL_METHODS.find(method => method.value === 'ASDF');

assert.ok(nvmMethod?.iconImage);
assert.ok(nvmWindowsMethod?.iconImage);
assert.equal(asdfMethod?.iconImage, undefined);
});
});
10 changes: 10 additions & 0 deletions apps/site/util/download/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@
"url": "https://github.com/nvm-sh/nvm",
"info": "layouts.download.codeBox.platformInfo.nvm"
},
{
"id": "NVMWINDOWS",
"icon": "NVMWindows",
"name": "nvm-windows",
"compatibility": {
"os": ["WIN"]
},
"url": "https://github.com/nvm-windows/nvm",
"info": "layouts.download.codeBox.platformInfo.nvmWindows"
},
{
"id": "FNM",
"icon": "FNM",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
"platformInfo": {
"default": "{platform} and their installation scripts are not maintained by the Node.js project.",
"nvm": "\"nvm\" is a cross-platform Node.js version manager.",
"nvmWindows": "\"nvm-windows\" is a Node.js version manager dedicated to Windows.",
"fnm": "\"fnm\" is a cross-platform Node.js version manager.",
"brew": "Homebrew is a package manager for macOS and Linux.",
"choco": "Chocolatey is a package manager for Windows.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Docker,
Homebrew,
NVM,
NVMWindows,
Choco,
N,
VitePlus,
Expand All @@ -17,6 +18,7 @@ const installMethodIcons = [
Docker,
Homebrew,
NVM,
NVMWindows,
Choco,
N,
VitePlus,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Ref: https://github.com/nvm-windows/docs/blob/main/static/img/logo.svg
import type { FC, SVGProps } from 'react';

const NVMWindows: FC<SVGProps<SVGSVGElement>> = props => (
<svg
width="32"
height="32"
viewBox="0 0 3293 3750"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
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"
fill="#4B5ADD"
/>
</svg>
);

export default NVMWindows;
14 changes: 13 additions & 1 deletion packages/ui-components/src/Icons/InstallationMethod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ import FNM from '#ui/Icons/InstallationMethod/FNM';
import Homebrew from '#ui/Icons/InstallationMethod/Homebrew';
import N from '#ui/Icons/InstallationMethod/N';
import NVM from '#ui/Icons/InstallationMethod/NVM';
import NVMWindows from '#ui/Icons/InstallationMethod/NVMWindows';
import VitePlus from '#ui/Icons/InstallationMethod/VitePlus';
import Volta from '#ui/Icons/InstallationMethod/Volta';
import ZeroInstall from '#ui/Icons/InstallationMethod/ZeroInstall';

export { Choco, Docker, FNM, Homebrew, N, NVM, VitePlus, Volta, ZeroInstall };
export {
Choco,
Docker,
FNM,
Homebrew,
N,
NVM,
NVMWindows,
VitePlus,
Volta,
ZeroInstall,
};
Loading