Skip to content

Commit 7754280

Browse files
authored
Docs: add n as community download option (#7498)
* Docs: add n as community download option * Chore: add new download methods to stories * Chore: remove inline comments per feedback
1 parent 642c2c2 commit 7754280

File tree

7 files changed

+57
-3
lines changed

7 files changed

+57
-3
lines changed

apps/site/snippets/en/download/n.bash

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Download and install n and Node.js:
2+
curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s ${props.release.major}
3+
4+
# Node.js already installs during n-install, but you can also install it manually:
5+
# n install ${props.release.major}
6+
7+
# Verify the Node.js version:
8+
node -v # Should print "${props.release.versionWithPrefix}".

apps/site/types/release.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export type InstallationMethod =
99
| 'BREW'
1010
| 'DEVBOX'
1111
| 'DOCKER'
12-
| 'CHOCO';
12+
| 'CHOCO'
13+
| 'N';
1314
export type PackageManager = 'NPM' | 'YARN' | 'PNPM';
1415

1516
// Items with a pipe/default value mean that they are auto inferred

apps/site/util/downloadUtils.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export enum InstallationMethodLabel {
3434
CHOCO = 'Chocolatey',
3535
DEVBOX = 'Devbox',
3636
DOCKER = 'Docker',
37+
N = 'n',
3738
VOLTA = 'Volta',
3839
}
3940

@@ -210,6 +211,14 @@ export const INSTALL_METHODS: Array<
210211
url: 'https://docs.docker.com/get-started/get-docker/',
211212
info: 'layouts.download.codeBox.platformInfo.docker',
212213
},
214+
{
215+
label: InstallationMethodLabel.N,
216+
value: 'N',
217+
compatibility: { os: ['MAC', 'LINUX'] },
218+
iconImage: <InstallMethodIcons.N width={16} height={16} />,
219+
url: 'https://github.com/tj/n',
220+
info: 'layouts.download.codeBox.platformInfo.n',
221+
},
213222
{
214223
label: InstallationMethodLabel.VOLTA,
215224
value: 'VOLTA',

packages/i18n/locales/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
"choco": "Chocolatey is a package manager for Windows.",
289289
"devbox": "Devbox creates isolated, reproducible development environments.",
290290
"docker": "Docker is a containerization platform.",
291+
"n": "\"n\" is a cross-platform Node.js version manager.",
291292
"volta": "\"Volta\" is a cross-platform Node.js version manager."
292293
}
293294
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { FC, SVGProps } from 'react';
2+
3+
const N: FC<SVGProps<SVGSVGElement>> = props => (
4+
<svg
5+
width="32"
6+
height="32"
7+
viewBox="0 0 32 32"
8+
fill="none"
9+
xmlns="http://www.w3.org/2000/svg"
10+
{...props}
11+
>
12+
<rect
13+
x="0"
14+
y="0"
15+
width="32"
16+
height="32"
17+
fill="#1e1e1e"
18+
stroke="#ffffff"
19+
strokeWidth="2"
20+
rx="5"
21+
/>
22+
<circle cx="5" cy="5" r="2" fill="#ff5f56" />
23+
<circle cx="10" cy="5" r="2" fill="#ffbd2e" />
24+
<circle cx="15" cy="5" r="2" fill="#27c93f" />
25+
// text with outline
26+
<text x="6" y="24" fontFamily="monospace" fontSize="14" fill="#00ff00">
27+
$n
28+
</text>
29+
</svg>
30+
);
31+
32+
export default N;

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import Devbox from '@node-core/ui-components/Icons/InstallationMethod/Devbox';
33
import Docker from '@node-core/ui-components/Icons/InstallationMethod/Docker';
44
import FNM from '@node-core/ui-components/Icons/InstallationMethod/FNM';
55
import Homebrew from '@node-core/ui-components/Icons/InstallationMethod/Homebrew';
6+
import N from '@node-core/ui-components/Icons/InstallationMethod/N';
67
import NVM from '@node-core/ui-components/Icons/InstallationMethod/NVM';
78
import Volta from '@node-core/ui-components/Icons/InstallationMethod/Volta';
89

9-
export { Choco, Devbox, Docker, FNM, Homebrew, NVM, Volta };
10+
export { Choco, Devbox, Docker, FNM, Homebrew, N, NVM, Volta };

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
NVM,
77
Devbox,
88
Choco,
9+
N,
10+
Volta,
911
} from '@node-core/ui-components/Icons/InstallationMethod';
1012
import {
1113
Apple,
@@ -15,7 +17,7 @@ import {
1517
} from '@node-core/ui-components/Icons/OperatingSystem';
1618

1719
const osIcons = [Apple, Linux, Microsoft, AIX];
18-
const installMethodIcons = [Docker, Homebrew, NVM, Devbox, Choco];
20+
const installMethodIcons = [Docker, Homebrew, NVM, Devbox, Choco, N, Volta];
1921

2022
export const PlatformLogos: StoryObj = {
2123
render: () => (

0 commit comments

Comments
 (0)