@altairalabs/packc 1.5.3 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/installer.js +2 -2
- package/lib/installer.test.js +6 -6
- package/package.json +1 -1
package/lib/installer.js
CHANGED
|
@@ -31,9 +31,9 @@ export function getPlatformInfo(platform = process.platform, arch = process.arch
|
|
|
31
31
|
return { platform: mappedPlatform, arch: mappedArch };
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export function getDownloadUrl(version, platform, arch, repo = 'AltairaLabs/
|
|
34
|
+
export function getDownloadUrl(version, platform, arch, repo = 'AltairaLabs/promptarena') {
|
|
35
35
|
const archiveExt = platform === 'Windows' ? 'zip' : 'tar.gz';
|
|
36
|
-
const archiveName = `
|
|
36
|
+
const archiveName = `packc_${version}_${platform}_${arch}.${archiveExt}`;
|
|
37
37
|
return `https://github.com/${repo}/releases/download/v${version}/${archiveName}`;
|
|
38
38
|
}
|
|
39
39
|
|
package/lib/installer.test.js
CHANGED
|
@@ -79,42 +79,42 @@ describe('installer', () => {
|
|
|
79
79
|
it('should generate correct URL for Darwin x86_64', () => {
|
|
80
80
|
const url = getDownloadUrl('1.0.0', 'Darwin', 'x86_64');
|
|
81
81
|
expect(url).toBe(
|
|
82
|
-
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/
|
|
82
|
+
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/promptarena_1.0.0_Darwin_x86_64.tar.gz'
|
|
83
83
|
);
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
it('should generate correct URL for Darwin arm64', () => {
|
|
87
87
|
const url = getDownloadUrl('1.0.0', 'Darwin', 'arm64');
|
|
88
88
|
expect(url).toBe(
|
|
89
|
-
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/
|
|
89
|
+
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/promptarena_1.0.0_Darwin_arm64.tar.gz'
|
|
90
90
|
);
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
it('should generate correct URL for Linux x86_64', () => {
|
|
94
94
|
const url = getDownloadUrl('2.1.0', 'Linux', 'x86_64');
|
|
95
95
|
expect(url).toBe(
|
|
96
|
-
'https://github.com/AltairaLabs/PromptKit/releases/download/v2.1.0/
|
|
96
|
+
'https://github.com/AltairaLabs/PromptKit/releases/download/v2.1.0/promptarena_2.1.0_Linux_x86_64.tar.gz'
|
|
97
97
|
);
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
it('should generate correct URL for Windows (zip extension)', () => {
|
|
101
101
|
const url = getDownloadUrl('1.0.0', 'Windows', 'x86_64');
|
|
102
102
|
expect(url).toBe(
|
|
103
|
-
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/
|
|
103
|
+
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/promptarena_1.0.0_Windows_x86_64.zip'
|
|
104
104
|
);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
it('should use custom repository when provided', () => {
|
|
108
108
|
const url = getDownloadUrl('1.0.0', 'Darwin', 'x86_64', 'MyOrg/MyRepo');
|
|
109
109
|
expect(url).toBe(
|
|
110
|
-
'https://github.com/MyOrg/MyRepo/releases/download/v1.0.0/
|
|
110
|
+
'https://github.com/MyOrg/MyRepo/releases/download/v1.0.0/promptarena_1.0.0_Darwin_x86_64.tar.gz'
|
|
111
111
|
);
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
it('should handle prerelease versions', () => {
|
|
115
115
|
const url = getDownloadUrl('1.0.0-beta.1', 'Linux', 'arm64');
|
|
116
116
|
expect(url).toBe(
|
|
117
|
-
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0-beta.1/
|
|
117
|
+
'https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0-beta.1/promptarena_1.0.0-beta.1_Linux_arm64.tar.gz'
|
|
118
118
|
);
|
|
119
119
|
});
|
|
120
120
|
});
|