Skip to content

Commit 1aba0ec

Browse files
feat: add asdf download method
Signed-off-by: abhijeet nardele <234410808+abhijeetnardele24-hash@users.noreply.github.com>
1 parent c52de6f commit 1aba0ec

File tree

7 files changed

+50
-6
lines changed

7 files changed

+50
-6
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# asdf has specific installation instructions for each operating system.
2+
# Please refer to the official documentation at https://asdf-vm.com/guide/getting-started.html.
3+
4+
# Install the Node.js plugin
5+
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
6+
7+
# Download and install Node.js ${props.release.version}
8+
asdf install nodejs ${props.release.version}
9+
10+
# Set global Node.js version to ${props.release.version}
11+
asdf set -u nodejs ${props.release.version}

apps/site/types/release.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export type InstallationMethod =
88
| 'BREW'
99
| 'DOCKER'
1010
| 'CHOCO'
11-
| 'N';
11+
| 'N'
12+
| 'ASDF';
1213
export type PackageManager = 'NPM' | 'YARN' | 'PNPM';
1314

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

apps/site/util/__tests__/download.test.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ describe('parseCompat', () => {
4747
});
4848

4949
describe('extended tests', () => {
50+
it('should keep asdf available for macOS', () => {
51+
const asdf = INSTALL_METHODS.find(({ value }) => value === 'ASDF');
52+
53+
const [result] = parseCompat([asdf], {
54+
os: 'MAC',
55+
installMethod: 'ASDF',
56+
platform: 'arm64',
57+
version: 'v24.14.0',
58+
release: { status: 'Current' },
59+
});
60+
61+
assert.equal(result.disabled, false);
62+
});
5063
it('should disable items if OS is not supported', () => {
5164
const items = [
5265
{

apps/site/util/download/constants.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@
187187
},
188188
"url": "https://github.com/tj/n",
189189
"info": "layouts.download.codeBox.platformInfo.n"
190+
},
191+
{
192+
"id": "ASDF",
193+
"name": "asdf",
194+
"compatibility": {
195+
"os": ["MAC", "LINUX"]
196+
},
197+
"url": "https://asdf-vm.com/guide/getting-started.html",
198+
"info": "layouts.download.codeBox.platformInfo.asdf"
190199
}
191200
],
192201
"packageManagers": [

apps/site/util/download/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,18 @@ export const parseCompat = <
7878
*/
7979
const createIcon = (
8080
IconModule: Record<string, ElementType>,
81-
iconName: string
81+
iconName?: string
8282
) => {
83+
if (!iconName) {
84+
return undefined;
85+
}
86+
8387
const IconComponent = IconModule[iconName];
88+
89+
if (!IconComponent) {
90+
return undefined;
91+
}
92+
8493
return <IconComponent width={16} height={16} />;
8594
};
8695

packages/i18n/src/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@
298298
"choco": "Chocolatey is a package manager for Windows.",
299299
"docker": "Docker is a containerization platform.",
300300
"n": "\"n\" is a cross-platform Node.js version manager.",
301-
"volta": "\"Volta\" is a cross-platform Node.js version manager."
301+
"volta": "\"Volta\" is a cross-platform Node.js version manager.",
302+
"asdf": "\"asdf\" is a cross-platform version manager that supports multiple languages."
302303
}
303304
}
304305
},

packages/ui-components/src/Common/Select/index.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@
112112
}
113113

114114
.dropdown:has(.label) .text > span {
115-
&:has(svg) > svg {
115+
&:has(svg) {
116116
@apply ml-3;
117117
}
118118

119-
&:not(&:has(svg)) > span {
120-
@apply ml-3;
119+
&:not(:has(svg)) > span {
120+
@apply ml-[2.25rem];
121121
}
122122
}
123123

0 commit comments

Comments
 (0)