@howuse/feedback 0.2.0 → 0.3.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/dist/index.cjs +11 -2
- package/dist/index.mjs +11 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21,9 +21,18 @@ function tryLoadNativeLibrary() {
|
|
|
21
21
|
} else {
|
|
22
22
|
throw new Error(`Unsupported platform: ${platform}`);
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
let libPath = path.join(packageRoot, "native", libName);
|
|
25
25
|
if (!fs.existsSync(libPath)) {
|
|
26
|
-
|
|
26
|
+
if (libPath.includes(".asar")) {
|
|
27
|
+
const asarPath = libPath.replace(".asar", ".asar.unpacked");
|
|
28
|
+
if (fs.existsSync(asarPath)) {
|
|
29
|
+
libPath = asarPath;
|
|
30
|
+
} else {
|
|
31
|
+
throw new Error(`Native library asarPath not found: ${asarPath}. Please run 'npm run build:native' first.`);
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
throw new Error(`Native library not found: ${libPath}. Please run 'npm run build:native' first.`);
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
try {
|
|
29
38
|
return koffi.load(libPath);
|
package/dist/index.mjs
CHANGED
|
@@ -19,9 +19,18 @@ function tryLoadNativeLibrary() {
|
|
|
19
19
|
} else {
|
|
20
20
|
throw new Error(`Unsupported platform: ${platform}`);
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
let libPath = path.join(packageRoot, "native", libName);
|
|
23
23
|
if (!fs.existsSync(libPath)) {
|
|
24
|
-
|
|
24
|
+
if (libPath.includes(".asar")) {
|
|
25
|
+
const asarPath = libPath.replace(".asar", ".asar.unpacked");
|
|
26
|
+
if (fs.existsSync(asarPath)) {
|
|
27
|
+
libPath = asarPath;
|
|
28
|
+
} else {
|
|
29
|
+
throw new Error(`Native library asarPath not found: ${asarPath}. Please run 'npm run build:native' first.`);
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
throw new Error(`Native library not found: ${libPath}. Please run 'npm run build:native' first.`);
|
|
33
|
+
}
|
|
25
34
|
}
|
|
26
35
|
try {
|
|
27
36
|
return koffi.load(libPath);
|