rn-document-scanner-vision 1.0.4 → 1.0.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.
@@ -14,16 +14,38 @@ def safeExtGet(prop, fallback) {
14
14
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
15
15
  }
16
16
 
17
+ def resolveReactNativeDirectory() {
18
+ // Try multiple possible locations for react-native
19
+ def locations = [
20
+ // When used as a dependency in another project
21
+ "${rootProject.projectDir}/../node_modules/react-native/android",
22
+ // Fallback for monorepos
23
+ "${rootProject.projectDir}/../../node_modules/react-native/android",
24
+ // Direct parent node_modules
25
+ new File(projectDir, "../../../node_modules/react-native/android").canonicalPath
26
+ ]
27
+
28
+ for (location in locations) {
29
+ def dir = file(location)
30
+ if (dir.exists()) {
31
+ return dir
32
+ }
33
+ }
34
+ return null
35
+ }
36
+
17
37
  repositories {
18
38
  google()
19
39
  mavenCentral()
20
40
 
21
- // Add React Native's maven repository to resolve react-android
22
- // This is critical for the library to work as a dependency
23
- def reactNativeAndroidDir = file("${rootProject.projectDir}/../node_modules/react-native/android")
24
- if (reactNativeAndroidDir.exists()) {
25
- maven { url reactNativeAndroidDir }
41
+ // React Native's maven repository
42
+ def reactNativeDir = resolveReactNativeDirectory()
43
+ if (reactNativeDir != null) {
44
+ maven { url reactNativeDir }
26
45
  }
46
+
47
+ // Maven Central hosts react-android for newer RN versions
48
+ maven { url "https://repo1.maven.org/maven2/" }
27
49
  }
28
50
 
29
51
  android {
@@ -57,9 +79,8 @@ android {
57
79
 
58
80
  dependencies {
59
81
  // Use compileOnly for react-android to avoid bundling React Native
60
- // The host app will provide the React Native runtime
61
- // compileOnly 'com.facebook.react:react-android'
62
- implementation("com.facebook.react:react-android:+")
82
+ // The host app will provide the React Native runtime at build time
83
+ compileOnly "com.facebook.react:react-android:+"
63
84
 
64
85
  implementation "androidx.appcompat:appcompat:1.7.0"
65
86
  implementation "com.websitebeaver:documentscanner:1.3.4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-document-scanner-vision",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A React Native library for scanning documents on iOS and Android",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",