@runanywhere/core 0.16.2 → 0.16.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.
@@ -1,3 +1,39 @@
1
+ // =============================================================================
2
+ // Node Binary Detection for Android Studio Compatibility
3
+ // Android Studio doesn't inherit terminal PATH, so we need to find node explicitly
4
+ // =============================================================================
5
+ def findNodeBinary() {
6
+ // Check local.properties first (user can override)
7
+ def localProperties = new Properties()
8
+ def localPropertiesFile = rootProject.file("local.properties")
9
+ if (localPropertiesFile.exists()) {
10
+ localPropertiesFile.withInputStream { localProperties.load(it) }
11
+ def nodePath = localProperties.getProperty("node.path")
12
+ if (nodePath && new File(nodePath).exists()) {
13
+ return nodePath
14
+ }
15
+ }
16
+
17
+ // Check common node installation paths
18
+ def homeDir = System.getProperty("user.home")
19
+ def nodePaths = [
20
+ "/opt/homebrew/bin/node", // macOS ARM (Apple Silicon)
21
+ "/usr/local/bin/node", // macOS Intel / Linux
22
+ "/usr/bin/node", // Linux system
23
+ "${homeDir}/.nvm/current/bin/node", // nvm
24
+ "${homeDir}/.volta/bin/node", // volta
25
+ "${homeDir}/.asdf/shims/node" // asdf
26
+ ]
27
+ for (path in nodePaths) {
28
+ if (new File(path).exists()) {
29
+ return path
30
+ }
31
+ }
32
+
33
+ // Fallback to 'node' (works if PATH is set correctly in terminal builds)
34
+ return "node"
35
+ }
36
+
1
37
  def getExtOrDefault(name) {
2
38
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RunAnywhereCore_' + name]
3
39
  }
@@ -12,6 +48,11 @@ apply plugin: 'kotlin-android'
12
48
  apply from: '../nitrogen/generated/android/runanywherecore+autolinking.gradle'
13
49
  apply plugin: 'com.facebook.react'
14
50
 
51
+ // Configure node path for Android Studio builds
52
+ react {
53
+ nodeExecutableAndArgs = [findNodeBinary()]
54
+ }
55
+
15
56
  def getExtOrIntegerDefault(name) {
16
57
  if (rootProject.ext.has(name)) {
17
58
  return rootProject.ext.get(name)
@@ -167,6 +208,14 @@ task downloadNativeLibs {
167
208
  return
168
209
  }
169
210
 
211
+ // Check if libs are already bundled (npm install case)
212
+ def bundledLibsDir = file("${jniLibsDir}/arm64-v8a")
213
+ def bundledLibs = bundledLibsDir.exists() ? bundledLibsDir.listFiles()?.findAll { it.name.endsWith(".so") } : []
214
+ if (bundledLibs?.size() > 0) {
215
+ logger.lifecycle("[RunAnywhereCore] ✅ Using bundled native libraries from npm package (${bundledLibs.size()} .so files)")
216
+ return
217
+ }
218
+
170
219
  def currentVersion = versionFile.exists() ? versionFile.text.trim() : ""
171
220
  if (currentVersion == expectedVersion) {
172
221
  logger.lifecycle("[RunAnywhereCore] RACommons version $expectedVersion already downloaded")
@@ -19,7 +19,7 @@
19
19
  #include <string>
20
20
  #include <optional>
21
21
  #include <functional>
22
- #include <NitroModules/Null.hpp>
22
+ // #include <NitroModules/Null.hpp> // Removed - file does not exist in nitro-modules 0.31.3
23
23
  #include <variant>
24
24
 
25
25
  namespace margelo::nitro::runanywhere {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runanywhere/core",
3
- "version": "0.16.2",
3
+ "version": "0.16.4",
4
4
  "description": "Core SDK for RunAnywhere React Native - includes RACommons bindings, native bridges, and public API",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -28,9 +28,9 @@
28
28
  "typecheck": "tsc --noEmit",
29
29
  "lint": "eslint \"src/**/*.ts\"",
30
30
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
31
- "nitrogen": "nitrogen",
32
- "postnitrogen": "node scripts/fix-nitrogen-output.js",
33
- "prepare": "nitrogen"
31
+ "nitrogen": "nitrogen && node scripts/fix-nitrogen-output.js",
32
+ "prepare": "npm run nitrogen",
33
+ "prepublishOnly": "node scripts/fix-nitrogen-output.js"
34
34
  },
35
35
  "keywords": [
36
36
  "react-native",