Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: add n as community download option #7498

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
34 changes: 34 additions & 0 deletions apps/site/components/Icons/InstallationMethod/N.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { FC, SVGProps } from 'react';

const N: FC<SVGProps<SVGSVGElement>> = props => (
<svg
width="32"
height="32"
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
// terminal background (with border for on black background)
<rect
x="0"
y="0"
width="32"
height="32"
fill="#1e1e1e"
stroke="#ffffff"
strokeWidth="2"
rx="5"
/>
// close, minimize, maximize buttons
<circle cx="5" cy="3" r="3" fill="#ff5f56" />
<circle cx="12" cy="3" r="3" fill="#ffbd2e" />
<circle cx="19" cy="3" r="3" fill="#27c93f" />
// text with outline
<text x="6" y="22" fontFamily="monospace" fontSize="14" fill="#00ff00">
$n
</text>
</svg>
);

export default N;
3 changes: 2 additions & 1 deletion apps/site/components/Icons/InstallationMethod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Devbox from '@/components/Icons/InstallationMethod/Devbox';
import Docker from '@/components/Icons/InstallationMethod/Docker';
import FNM from '@/components/Icons/InstallationMethod/FNM';
import Homebrew from '@/components/Icons/InstallationMethod/Homebrew';
import N from '@/components/Icons/InstallationMethod/N';
import NVM from '@/components/Icons/InstallationMethod/NVM';
import Volta from '@/components/Icons/InstallationMethod/Volta';

export default { Choco, Devbox, Docker, FNM, Homebrew, NVM, Volta };
export default { Choco, Devbox, Docker, FNM, Homebrew, N, NVM, Volta };
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const PlatformLogos: StoryObj = {
<InstallMethodIcons.Homebrew width={64} height={64} />
<InstallMethodIcons.NVM width={64} height={64} />
<InstallMethodIcons.Devbox width={64} height={64} />
<InstallMethodIcons.N width={64} height={64} />
<InstallMethodIcons.Volta width={64} height={64} />
</div>
<div className="flex flex-col items-center gap-4">
Expand Down
11 changes: 11 additions & 0 deletions apps/site/snippets/en/download/n.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# For more about n-install: https://github.com/mklement0/n-install
# For more about n and other ways to install: https://github.com/tj/n

# Download and install n and Node.js with a single command:
curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s ${props.release.major}

# Download and install Node.js, done for you by n-install:
# n install ${props.release.major}

# Verify the Node.js version:
node -v # Should print "${props.release.versionWithPrefix}".
3 changes: 2 additions & 1 deletion apps/site/types/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions apps/site/util/downloadUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export enum InstallationMethodLabel {
CHOCO = 'Chocolatey',
DEVBOX = 'Devbox',
DOCKER = 'Docker',
N = 'n',
VOLTA = 'Volta',
}

Expand Down Expand Up @@ -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: <InstallMethodIcons.N width={16} height={16} />,
url: 'https://github.com/tj/n',
info: 'layouts.download.codeBox.platformInfo.n',
},
{
label: InstallationMethodLabel.VOLTA,
value: 'VOLTA',
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,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."
}
}
Expand Down
Loading