Skip to content

Commit

Permalink
List fmn first as the only cross-platform option
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Apr 21, 2024
1 parent 3a0cb84 commit 73d363e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion components/Downloads/Release/PlatformDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const PlatformDropdown: FC = () => {
values={formatDropdownItems({
items: platformItems,
icons: {
NVM: <NVM width={16} height={16} />,
FNM: <FNM width={16} height={16} />,
NVM: <NVM width={16} height={16} />,
BREW: <Homebrew width={16} height={16} />,
DOCKER: <Docker width={16} height={16} />,
CHOCO: <Choco width={16} height={16} />,
Expand Down
2 changes: 1 addition & 1 deletion providers/releaseProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const initialState: ReleaseState = {
release: {} as NodeRelease,
os: 'OTHER',
bitness: '',
platform: 'NVM',
platform: 'FNM',
modalOpen: false,
};

Expand Down
2 changes: 1 addition & 1 deletion types/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
import type { NodeRelease } from '@/types/releases';
import type { UserOS } from '@/types/userOS';

export type PackageManager = 'NVM' | 'FNM' | 'BREW' | 'DOCKER' | 'CHOCO';
export type PackageManager = 'FNM' | 'NVM' | 'BREW' | 'DOCKER' | 'CHOCO';

export interface ReleaseState {
os: UserOS;
Expand Down
8 changes: 4 additions & 4 deletions util/downloadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export const operatingSystemItems = [
];

export const platformItems = [
{
label: 'NVM',
value: 'NVM' as PackageManager,
},
{
label: 'fnm',
value: 'FNM' as PackageManager,
},
{
label: 'NVM',
value: 'NVM' as PackageManager,
},
{
label: 'Brew',
value: 'BREW' as PackageManager,
Expand Down
18 changes: 9 additions & 9 deletions util/getNodeDownloadSnippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { UserOS } from '@/types/userOS';

export const getNodeDownloadSnippet = (release: NodeRelease, os: UserOS) => {
const snippets: Record<PackageManager, string> = {
NVM: '',
FNM: '',
NVM: '',
BREW: '',
DOCKER: '',
CHOCO: '',
Expand All @@ -26,25 +26,25 @@ export const getNodeDownloadSnippet = (release: NodeRelease, os: UserOS) => {
}

if (os === 'MAC' || os === 'LINUX') {
snippets.NVM = dedent`
# installs NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
snippets.FNM = dedent`
# installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash
# download and install Node.js
nvm install ${release.major}
fnm use --install-if-missing ${release.major}
# verifies the right Node.js version is in the environment
node -v # should print \`${release.versionWithPrefix}\`
# verifies the right NPM version is in the environment
npm -v # should print \`${release.npm}\``;

snippets.FNM = dedent`
# installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash
snippets.NVM = dedent`
# installs NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# download and install Node.js
fnm use --install-if-missing ${release.major}
nvm install ${release.major}
# verifies the right Node.js version is in the environment
node -v # should print \`${release.versionWithPrefix}\`
Expand Down

0 comments on commit 73d363e

Please sign in to comment.