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 2 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
15 changes: 15 additions & 0 deletions apps/site/components/Icons/InstallationMethod/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { FC, SVGProps } from 'react';

// This is an empty placeholder for layout purposes.
const Placeholder: FC<SVGProps<SVGSVGElement>> = props => (
<svg
width="32"
height="32"
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
></svg>
);

export default Placeholder;
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 @@ -4,5 +4,6 @@ import Docker from '@/components/Icons/InstallationMethod/Docker';
import FNM from '@/components/Icons/InstallationMethod/FNM';
import Homebrew from '@/components/Icons/InstallationMethod/Homebrew';
import NVM from '@/components/Icons/InstallationMethod/NVM';
import Placeholder from '@/components/Icons/InstallationMethod/Placeholder';

export default { Choco, Devbox, Docker, FNM, Homebrew, NVM };
export default { Choco, Devbox, Docker, FNM, Homebrew, NVM, Placeholder };
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.Placeholder width={64} height={64} />
</div>
<div className="flex flex-col items-center gap-4">
<InstallMethodIcons.Choco width={64} height={64} />
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, including other ways to install n: https://github.com/tj/n

# Download and install n and Node.js with a single command:
curl -L https://bit.ly/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 @@ -8,7 +8,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',
}

export enum PackageManagerLabel {
Expand Down Expand Up @@ -209,6 +210,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.Placeholder width={16} height={16} />,
url: 'https://github.com/tj/n',
info: 'layouts.download.codeBox.platformInfo.n',
},
];

export const PACKAGE_MANAGERS: Array<
Expand Down
3 changes: 2 additions & 1 deletion packages/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@
"brew": "Homebrew is a package manager for macOS and Linux.",
"choco": "Chocolatey is a package manager for Windows.",
"devbox": "Devbox creates isolated, reproducible development environments.",
"docker": "Docker is a containerization platform."
"docker": "Docker is a containerization platform.",
"n": "\"n\" is a cross-platform Node.js version manager."
}
}
},
Expand Down
Loading