diff --git a/.changeset/add-nvm-windows-install-method.md b/.changeset/add-nvm-windows-install-method.md new file mode 100644 index 0000000000000..a845151cc8400 --- /dev/null +++ b/.changeset/add-nvm-windows-install-method.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/apps/site/snippets/en/download/nvmwindows.bash b/apps/site/snippets/en/download/nvmwindows.bash new file mode 100644 index 0000000000000..81e37eb3ba574 --- /dev/null +++ b/apps/site/snippets/en/download/nvmwindows.bash @@ -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} diff --git a/apps/site/types/release.ts b/apps/site/types/release.ts index 49782c377c020..abdbbf61b8457 100644 --- a/apps/site/types/release.ts +++ b/apps/site/types/release.ts @@ -4,6 +4,7 @@ import type { OperatingSystem, Platform } from '#site/types/userAgent'; export type InstallationMethod = | 'NVM' + | 'NVMWINDOWS' | 'FNM' | 'BREW' | 'DOCKER' diff --git a/apps/site/util/__tests__/download.test.mjs b/apps/site/util/__tests__/download.test.mjs index e64151cee49ad..d0d914a544bed 100644 --- a/apps/site/util/__tests__/download.test.mjs +++ b/apps/site/util/__tests__/download.test.mjs @@ -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); }); }); diff --git a/apps/site/util/download/constants.json b/apps/site/util/download/constants.json index 36b09e1d2ac74..3f48542df5912 100644 --- a/apps/site/util/download/constants.json +++ b/apps/site/util/download/constants.json @@ -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", diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index 4e2ffb67c0394..f59d25f3912fd 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -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.", diff --git a/packages/ui-components/__design__/platform-logos.stories.tsx b/packages/ui-components/__design__/platform-logos.stories.tsx index c330e4aaa3ed8..79a889b373873 100644 --- a/packages/ui-components/__design__/platform-logos.stories.tsx +++ b/packages/ui-components/__design__/platform-logos.stories.tsx @@ -2,6 +2,7 @@ import { Docker, Homebrew, NVM, + NVMWindows, Choco, N, VitePlus, @@ -17,6 +18,7 @@ const installMethodIcons = [ Docker, Homebrew, NVM, + NVMWindows, Choco, N, VitePlus, diff --git a/packages/ui-components/src/Icons/InstallationMethod/NVMWindows.tsx b/packages/ui-components/src/Icons/InstallationMethod/NVMWindows.tsx new file mode 100644 index 0000000000000..4ba44e2130243 --- /dev/null +++ b/packages/ui-components/src/Icons/InstallationMethod/NVMWindows.tsx @@ -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> = props => ( + + + +); + +export default NVMWindows; diff --git a/packages/ui-components/src/Icons/InstallationMethod/index.ts b/packages/ui-components/src/Icons/InstallationMethod/index.ts index df5d0c79f3e83..ab8814b370ac1 100644 --- a/packages/ui-components/src/Icons/InstallationMethod/index.ts +++ b/packages/ui-components/src/Icons/InstallationMethod/index.ts @@ -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, +};