diff --git a/apps/site/snippets/en/download/asdf.bash b/apps/site/snippets/en/download/asdf.bash new file mode 100644 index 0000000000000..66d1545fbef08 --- /dev/null +++ b/apps/site/snippets/en/download/asdf.bash @@ -0,0 +1,11 @@ +# asdf has specific installation instructions for each operating system. +# Please refer to the official documentation at https://asdf-vm.com/guide/getting-started.html. + +# Install the Node.js plugin +asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git + +# Download and install Node.js ${props.release.version} +asdf install nodejs ${props.release.version} + +# Set global Node.js version to ${props.release.version} +asdf set -u nodejs ${props.release.version} diff --git a/apps/site/types/release.ts b/apps/site/types/release.ts index baa01aa40b38d..9ffc705f73490 100644 --- a/apps/site/types/release.ts +++ b/apps/site/types/release.ts @@ -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 diff --git a/apps/site/util/download/constants.json b/apps/site/util/download/constants.json index 6593acea69ec8..8805ca34010e7 100644 --- a/apps/site/util/download/constants.json +++ b/apps/site/util/download/constants.json @@ -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": [ diff --git a/apps/site/util/download/index.tsx b/apps/site/util/download/index.tsx index 78ad149d1fb15..67225df8967fd 100644 --- a/apps/site/util/download/index.tsx +++ b/apps/site/util/download/index.tsx @@ -78,9 +78,11 @@ export const parseCompat = < */ const createIcon = ( IconModule: Record, - iconName: string + iconName?: string ) => { + if (!iconName) {return undefined;} const IconComponent = IconModule[iconName]; + if (!IconComponent) {return undefined;} return ; }; diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index ddf33a5874e37..ba1fef5948903 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -388,7 +388,8 @@ "choco": "Chocolatey is a package manager for Windows.", "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." + "volta": "\"Volta\" is a cross-platform Node.js version manager.", + "asdf": "\"asdf\" is a cross-platform version manager that supports multiple languages." } } },