@nativescript/types-swiftui 0.0.3 → 0.0.4

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/index.js CHANGED
@@ -18,10 +18,20 @@ function loadSwift() {
18
18
  const mainBundle = NSBundle.mainBundle;
19
19
  const resourcePath = mainBundle.resourcePath;
20
20
  if (resourcePath) {
21
- const nodeFilePath = resourcePath + "/libSwiftBridge.node";
22
- module.exports = runtimeRequire(nodeFilePath);
23
- globalThis.SwiftLoaded = true;
24
- return;
21
+ const candidatePaths = [
22
+ resourcePath + "/app/libSwiftBridge.node",
23
+ resourcePath + "/libSwiftBridge.node",
24
+ ];
25
+
26
+ for (const nodeFilePath of candidatePaths) {
27
+ try {
28
+ module.exports = runtimeRequire(nodeFilePath);
29
+ globalThis.SwiftLoaded = true;
30
+ return;
31
+ } catch {
32
+ // try next candidate path
33
+ }
34
+ }
25
35
  }
26
36
  }
27
37
 
@@ -3,13 +3,13 @@ const { resolve } = require("path");
3
3
  module.exports = function (webpack) {
4
4
  webpack.Utils.addCopyRule({
5
5
  from: resolve(__dirname, "dist/libSwiftBridge.node"),
6
- to: "../libSwiftBridge.node",
6
+ to: "libSwiftBridge.node",
7
7
  noErrorOnMissing: true,
8
8
  });
9
9
 
10
10
  webpack.Utils.addCopyRule({
11
11
  from: resolve(__dirname, "dist/libNodeAPI.dylib"),
12
- to: "../libNodeAPI.dylib",
12
+ to: "libNodeAPI.dylib",
13
13
  noErrorOnMissing: true,
14
14
  });
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/types-swiftui",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "dj",