roxify 1.5.4 → 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/dist/utils/native.js
CHANGED
|
@@ -9,21 +9,26 @@ function getNativePath() {
|
|
|
9
9
|
const platformMap = {
|
|
10
10
|
linux: 'x86_64-unknown-linux-gnu',
|
|
11
11
|
darwin: arch() === 'arm64' ? 'aarch64-apple-darwin' : 'x86_64-apple-darwin',
|
|
12
|
+
win32: 'x86_64-pc-windows-gnu',
|
|
13
|
+
};
|
|
14
|
+
const platformAltMap = {
|
|
12
15
|
win32: 'x86_64-pc-windows-msvc',
|
|
13
16
|
};
|
|
14
17
|
const extMap = {
|
|
15
18
|
linux: 'so',
|
|
16
19
|
darwin: 'dylib',
|
|
17
|
-
win32: '
|
|
20
|
+
win32: 'node',
|
|
18
21
|
};
|
|
19
22
|
const currentPlatform = platform();
|
|
20
23
|
const target = platformMap[currentPlatform];
|
|
24
|
+
const targetAlt = platformAltMap[currentPlatform];
|
|
21
25
|
const ext = extMap[currentPlatform];
|
|
22
26
|
if (!target || !ext) {
|
|
23
27
|
throw new Error(`Unsupported platform: ${currentPlatform}`);
|
|
24
28
|
}
|
|
25
29
|
const prebuiltPath = join(__dirname, '../../libroxify_native.node');
|
|
26
30
|
const targetPath = join(__dirname, `../../libroxify_native-${target}.${ext}`);
|
|
31
|
+
const targetAltPath = targetAlt ? join(__dirname, `../../libroxify_native-${targetAlt}.${ext}`) : null;
|
|
27
32
|
try {
|
|
28
33
|
return require.resolve(prebuiltPath);
|
|
29
34
|
}
|
|
@@ -32,6 +37,15 @@ function getNativePath() {
|
|
|
32
37
|
return require.resolve(targetPath);
|
|
33
38
|
}
|
|
34
39
|
catch {
|
|
40
|
+
if (targetAltPath) {
|
|
41
|
+
try {
|
|
42
|
+
return require.resolve(targetAltPath);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
throw new Error(`Native module not found for ${currentPlatform}-${arch()}. ` +
|
|
46
|
+
`Expected: ${prebuiltPath} or ${targetPath} or ${targetAltPath}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
35
49
|
throw new Error(`Native module not found for ${currentPlatform}-${arch()}. ` +
|
|
36
50
|
`Expected: ${prebuiltPath} or ${targetPath}`);
|
|
37
51
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roxify",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"description": "Ultra-lightweight PNG steganography with native Rust acceleration. Encode binary data into PNG images with zstd compression.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"libroxify_native-*.so",
|
|
16
16
|
"libroxify_native-*.dylib",
|
|
17
17
|
"libroxify_native-*.dll",
|
|
18
|
+
"libroxify_native-x86_64-pc-windows-gnu.node",
|
|
19
|
+
"libroxify_native-x86_64-pc-windows-msvc.node",
|
|
18
20
|
"README.md",
|
|
19
21
|
"LICENSE"
|
|
20
22
|
],
|