From 9623bee869563d43b0d25091d1eee30de3244545 Mon Sep 17 00:00:00 2001 From: John Gee Date: Wed, 26 Mar 2025 12:19:02 +1300 Subject: [PATCH 1/3] Docs: add n as community download option --- apps/site/snippets/en/download/n.bash | 8 +++++ apps/site/types/release.ts | 3 +- apps/site/util/downloadUtils.tsx | 9 +++++ packages/i18n/locales/en.json | 1 + .../Icons/InstallationMethod/N.tsx | 34 +++++++++++++++++++ .../Icons/InstallationMethod/index.ts | 3 +- 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 apps/site/snippets/en/download/n.bash create mode 100644 packages/ui-components/Icons/InstallationMethod/N.tsx diff --git a/apps/site/snippets/en/download/n.bash b/apps/site/snippets/en/download/n.bash new file mode 100644 index 0000000000000..4ced5d55f7bcd --- /dev/null +++ b/apps/site/snippets/en/download/n.bash @@ -0,0 +1,8 @@ +# Download and install n and Node.js: +curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s ${props.release.major} + +# Node.js already installs during n-install, but you can also install it manually: +# n install ${props.release.major} + +# Verify the Node.js version: +node -v # Should print "${props.release.versionWithPrefix}". diff --git a/apps/site/types/release.ts b/apps/site/types/release.ts index c5d050b05dfe5..c06919cac9a8a 100644 --- a/apps/site/types/release.ts +++ b/apps/site/types/release.ts @@ -9,7 +9,8 @@ export type InstallationMethod = | 'BREW' | 'DEVBOX' | 'DOCKER' - | 'CHOCO'; + | 'CHOCO' + | 'N'; export type PackageManager = 'NPM' | 'YARN' | 'PNPM'; // Items with a pipe/default value mean that they are auto inferred diff --git a/apps/site/util/downloadUtils.tsx b/apps/site/util/downloadUtils.tsx index e61a0ff004dac..3b5fe5b3dee9c 100644 --- a/apps/site/util/downloadUtils.tsx +++ b/apps/site/util/downloadUtils.tsx @@ -34,6 +34,7 @@ export enum InstallationMethodLabel { CHOCO = 'Chocolatey', DEVBOX = 'Devbox', DOCKER = 'Docker', + N = 'n', VOLTA = 'Volta', } @@ -210,6 +211,14 @@ export const INSTALL_METHODS: Array< url: 'https://docs.docker.com/get-started/get-docker/', info: 'layouts.download.codeBox.platformInfo.docker', }, + { + label: InstallationMethodLabel.N, + value: 'N', + compatibility: { os: ['MAC', 'LINUX'] }, + iconImage: , + url: 'https://github.com/tj/n', + info: 'layouts.download.codeBox.platformInfo.n', + }, { label: InstallationMethodLabel.VOLTA, value: 'VOLTA', diff --git a/packages/i18n/locales/en.json b/packages/i18n/locales/en.json index ef968567df4bc..43d3f91c69204 100644 --- a/packages/i18n/locales/en.json +++ b/packages/i18n/locales/en.json @@ -288,6 +288,7 @@ "choco": "Chocolatey is a package manager for Windows.", "devbox": "Devbox creates isolated, reproducible development environments.", "docker": "Docker is a containerization platform.", + "n": "\"n\" is a cross-platform Node.js version manager.", "volta": "\"Volta\" is a cross-platform Node.js version manager." } } diff --git a/packages/ui-components/Icons/InstallationMethod/N.tsx b/packages/ui-components/Icons/InstallationMethod/N.tsx new file mode 100644 index 0000000000000..e4571166d8411 --- /dev/null +++ b/packages/ui-components/Icons/InstallationMethod/N.tsx @@ -0,0 +1,34 @@ +import type { FC, SVGProps } from 'react'; + +const N: FC> = props => ( + + // terminal background (with border for on black background) + + // close, minimize, maximize buttons + + + + // text with outline + + $n + + +); + +export default N; diff --git a/packages/ui-components/Icons/InstallationMethod/index.ts b/packages/ui-components/Icons/InstallationMethod/index.ts index a44debeb655f0..e85544bbaa928 100644 --- a/packages/ui-components/Icons/InstallationMethod/index.ts +++ b/packages/ui-components/Icons/InstallationMethod/index.ts @@ -3,7 +3,8 @@ import Devbox from '@node-core/ui-components/Icons/InstallationMethod/Devbox'; import Docker from '@node-core/ui-components/Icons/InstallationMethod/Docker'; import FNM from '@node-core/ui-components/Icons/InstallationMethod/FNM'; import Homebrew from '@node-core/ui-components/Icons/InstallationMethod/Homebrew'; +import N from '@node-core/ui-components/Icons/InstallationMethod/N'; import NVM from '@node-core/ui-components/Icons/InstallationMethod/NVM'; import Volta from '@node-core/ui-components/Icons/InstallationMethod/Volta'; -export { Choco, Devbox, Docker, FNM, Homebrew, NVM, Volta }; +export { Choco, Devbox, Docker, FNM, Homebrew, N, NVM, Volta }; From e4235a9d65152dd668eea286742ad934f4dcc689 Mon Sep 17 00:00:00 2001 From: John Gee Date: Wed, 26 Mar 2025 12:33:22 +1300 Subject: [PATCH 2/3] Chore: add new download methods to stories --- packages/ui-components/__design__/platform-logos.stories.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ui-components/__design__/platform-logos.stories.tsx b/packages/ui-components/__design__/platform-logos.stories.tsx index fa457bf7d6142..9b311dda28b7f 100644 --- a/packages/ui-components/__design__/platform-logos.stories.tsx +++ b/packages/ui-components/__design__/platform-logos.stories.tsx @@ -6,6 +6,8 @@ import { NVM, Devbox, Choco, + N, + Volta, } from '@node-core/ui-components/Icons/InstallationMethod'; import { Apple, @@ -15,7 +17,7 @@ import { } from '@node-core/ui-components/Icons/OperatingSystem'; const osIcons = [Apple, Linux, Microsoft, AIX]; -const installMethodIcons = [Docker, Homebrew, NVM, Devbox, Choco]; +const installMethodIcons = [Docker, Homebrew, NVM, Devbox, Choco, N, Volta]; export const PlatformLogos: StoryObj = { render: () => ( From b1f81570635de3e3c01ad5cbb08995146ffaff9c Mon Sep 17 00:00:00 2001 From: John Gee Date: Wed, 26 Mar 2025 12:41:11 +1300 Subject: [PATCH 3/3] Chore: remove inline comments per feedback --- packages/ui-components/Icons/InstallationMethod/N.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/ui-components/Icons/InstallationMethod/N.tsx b/packages/ui-components/Icons/InstallationMethod/N.tsx index e4571166d8411..fc55c4d3af46b 100644 --- a/packages/ui-components/Icons/InstallationMethod/N.tsx +++ b/packages/ui-components/Icons/InstallationMethod/N.tsx @@ -9,7 +9,6 @@ const N: FC> = props => ( xmlns="http://www.w3.org/2000/svg" {...props} > - // terminal background (with border for on black background) > = props => ( strokeWidth="2" rx="5" /> - // close, minimize, maximize buttons