Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions apps/site/snippets/en/download/asdf.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# asdf has specific installation instructions for each operating system.
# Please refer to the official documentation at https://asdf-vm.com/guide/getting-started.html.
# This snippet uses asdf v0.16+ command syntax.

# Install the Node.js plugin:
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

# Download and install Node.js:
asdf install nodejs ${props.release.version}

# Set Node.js as the global default:
asdf set --home nodejs ${props.release.version}
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'
| 'DOCKER'
| 'CHOCO'
| 'N';
| 'N'
| 'ASDF';
export type PackageManager = 'NPM' | 'YARN' | 'PNPM';

// Items with a pipe/default value mean that they are auto inferred
Expand Down
10 changes: 10 additions & 0 deletions apps/site/util/__tests__/download.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,13 @@ describe('nextItem', () => {
assert.equal(nextItem('valid', items), 'valid');
});
});

describe('INSTALL_METHODS', () => {
it('should create icons only when an icon is configured', () => {
const nvmMethod = INSTALL_METHODS.find(method => method.value === 'NVM');
const asdfMethod = INSTALL_METHODS.find(method => method.value === 'ASDF');

assert.ok(nvmMethod?.iconImage);
assert.equal(asdfMethod?.iconImage, undefined);
});
});
9 changes: 9 additions & 0 deletions apps/site/util/download/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@
},
"url": "https://github.com/tj/n",
"info": "layouts.download.codeBox.platformInfo.n"
},
{
"id": "ASDF",
"name": "asdf",
"compatibility": {
"os": ["MAC", "LINUX"]
},
"url": "https://asdf-vm.com/guide/getting-started.html",
"info": "layouts.download.codeBox.platformInfo.asdf"
}
],
"packageManagers": [
Expand Down
4 changes: 3 additions & 1 deletion apps/site/util/download/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export const INSTALL_METHODS = installMethods.map(method => ({
key: method.id,
value: method.id as Types.InstallationMethod,
label: method.name as IntlMessageKeys,
iconImage: createIcon(InstallMethodIcons, method.icon),
iconImage: method.icon
? createIcon(InstallMethodIcons, method.icon)
: undefined,
recommended: method.recommended,
url: method.url,
info: method.info as IntlMessageKeys,
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
"choco": "Chocolatey is a package manager for Windows.",
"docker": "Docker is a containerization platform.",
"n": "\"n\" is a cross-platform Node.js version manager.",
"asdf": "\"asdf\" is a cross-platform version manager that supports multiple languages.",
"volta": "\"Volta\" is a cross-platform Node.js version manager."
}
}
Expand Down
Loading