@socketsecurity/lib 5.8.2 → 5.9.0
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/CHANGELOG.md +11 -0
- package/dist/releases/socket-btm.d.ts +2 -1
- package/dist/releases/socket-btm.js +11 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.9.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.9.0) - 2026-03-14
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **releases/socket-btm**: `getPlatformArch()` now normalizes Windows platform to `win` instead of `win32`
|
|
13
|
+
- Returns `win-x64`, `win-arm64` instead of `win32-x64`, `win32-arm64`
|
|
14
|
+
- Consistent with `getBinaryAssetName()` which already uses `win` for Windows assets
|
|
15
|
+
- Aligns with socket-btm and Node.js convention: use `win` for file/folder names, `win32` for platform checks (`process.platform`)
|
|
16
|
+
- Added `PLATFORM_MAP` for explicit platform name mapping (darwin, linux, win32 → win)
|
|
17
|
+
- Now throws `Error: Unsupported platform` for unknown platform values
|
|
18
|
+
|
|
8
19
|
## [5.8.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.8.2) - 2026-03-13
|
|
9
20
|
|
|
10
21
|
### Fixed
|
|
@@ -98,10 +98,11 @@ export declare function getBinaryAssetName(binaryBaseName: string, platform: Pla
|
|
|
98
98
|
export declare function getBinaryName(binaryBaseName: string, platform: Platform): string;
|
|
99
99
|
/**
|
|
100
100
|
* Get platform-arch identifier for directory structure.
|
|
101
|
+
* Uses 'win' instead of 'win32' for file/folder names.
|
|
101
102
|
*
|
|
102
103
|
* @param platform - Target platform
|
|
103
104
|
* @param arch - Target architecture
|
|
104
105
|
* @param libc - Linux libc variant (optional)
|
|
105
|
-
* @returns Platform-arch identifier (e.g., 'darwin-arm64', 'linux-x64-musl')
|
|
106
|
+
* @returns Platform-arch identifier (e.g., 'darwin-arm64', 'linux-x64-musl', 'win-x64')
|
|
106
107
|
*/
|
|
107
108
|
export declare function getPlatformArch(platform: Platform, arch: Arch, libc?: Libc | undefined): string;
|
|
@@ -28,6 +28,12 @@ __export(socket_btm_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(socket_btm_exports);
|
|
29
29
|
var import_platform = require("../constants/platform.js");
|
|
30
30
|
var import_github = require("./github.js");
|
|
31
|
+
const PLATFORM_MAP = {
|
|
32
|
+
__proto__: null,
|
|
33
|
+
darwin: "darwin",
|
|
34
|
+
linux: "linux",
|
|
35
|
+
win32: "win"
|
|
36
|
+
};
|
|
31
37
|
const ARCH_MAP = {
|
|
32
38
|
__proto__: null,
|
|
33
39
|
arm64: "arm64",
|
|
@@ -176,12 +182,16 @@ function getBinaryName(binaryBaseName, platform) {
|
|
|
176
182
|
return platform === "win32" ? `${binaryBaseName}.exe` : binaryBaseName;
|
|
177
183
|
}
|
|
178
184
|
function getPlatformArch(platform, arch, libc) {
|
|
185
|
+
const mappedPlatform = PLATFORM_MAP[platform];
|
|
186
|
+
if (!mappedPlatform) {
|
|
187
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
188
|
+
}
|
|
179
189
|
const mappedArch = ARCH_MAP[arch];
|
|
180
190
|
if (!mappedArch) {
|
|
181
191
|
throw new Error(`Unsupported architecture: ${arch}`);
|
|
182
192
|
}
|
|
183
193
|
const muslSuffix = platform === "linux" && libc === "musl" ? "-musl" : "";
|
|
184
|
-
return `${
|
|
194
|
+
return `${mappedPlatform}-${mappedArch}${muslSuffix}`;
|
|
185
195
|
}
|
|
186
196
|
// Annotate the CommonJS export names for ESM import in node:
|
|
187
197
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.0",
|
|
4
4
|
"packageManager": "pnpm@10.32.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
735
735
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
736
736
|
"@socketregistry/yocto-spinner": "1.0.25",
|
|
737
|
-
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.8.
|
|
737
|
+
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.8.2",
|
|
738
738
|
"@types/node": "24.9.2",
|
|
739
739
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
|
740
740
|
"@vitest/coverage-v8": "4.0.3",
|