@aguacerowx/react-native 0.0.0 → 0.0.2

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,4 +1,4 @@
1
- #Mon Nov 03 18:30:57 EST 2025
1
+ #Tue Nov 04 18:55:58 EST 2025
2
2
  com.aguacerowx.reactnative.aguacerowx_react-native-main-6\:/raw/fragment_shader.glsl=C\:\\Users\\my41m\\aguacero\\ReactNativeApp\\node_modules\\@aguacerowx\\react-native\\android\\build\\intermediates\\packaged_res\\debug\\packageDebugResources\\raw\\fragment_shader.glsl
3
3
  com.aguacerowx.reactnative.aguacerowx_react-native-main-6\:/raw/debug_vertex_shader.glsl=C\:\\Users\\my41m\\aguacero\\ReactNativeApp\\node_modules\\@aguacerowx\\react-native\\android\\build\\intermediates\\packaged_res\\debug\\packageDebugResources\\raw\\debug_vertex_shader.glsl
4
4
  com.aguacerowx.reactnative.aguacerowx_react-native-main-6\:/raw/vertex_shader.glsl=C\:\\Users\\my41m\\aguacero\\ReactNativeApp\\node_modules\\@aguacerowx\\react-native\\android\\build\\intermediates\\packaged_res\\debug\\packageDebugResources\\raw\\vertex_shader.glsl
@@ -1,28 +1,30 @@
1
- // build.gradle for @aguacerowx/react-native
2
-
3
- apply plugin: 'com.android.library'
1
+ // @aguacerowx/react-native/android/build.gradle
4
2
 
3
+ // This block is correct and necessary.
5
4
  repositories {
6
- mavenCentral()
7
5
  google()
6
+ mavenCentral()
8
7
  maven {
9
8
  url 'https://api.mapbox.com/downloads/v2/releases/maven'
10
9
  authentication {
11
10
  basic(BasicAuthentication)
12
11
  }
13
12
  credentials {
13
+ // It's good practice to check for the property on the root project
14
14
  username = "mapbox"
15
15
  password = project.rootProject.findProperty("MAPBOX_DOWNLOADS_TOKEN") ?: System.getenv("MAPBOX_DOWNLOADS_TOKEN")
16
16
  }
17
17
  }
18
18
  }
19
19
 
20
+ apply plugin: 'com.android.library'
21
+
20
22
  android {
21
23
  namespace 'com.aguacerowx.reactnative'
22
- compileSdk 34
24
+ compileSdk 34 // Consider using rootProject.ext.compileSdkVersion for consistency
23
25
 
24
26
  defaultConfig {
25
- minSdk 23
27
+ minSdk 23 // Consider using rootProject.ext.minSdkVersion
26
28
  targetSdk 34
27
29
  }
28
30
 
@@ -38,10 +40,46 @@ android {
38
40
  }
39
41
  }
40
42
 
43
+ // These dependencies can be declared immediately.
41
44
  dependencies {
42
45
  implementation 'com.facebook.react:react-native:+'
43
- implementation 'com.mapbox.maps:android:10.16.1'
44
46
  api 'org.locationtech.proj4j:proj4j:1.1.5'
45
- // Use compileOnly with latest version
46
47
  compileOnly 'com.github.luben:zstd-jni:1.5.7-6@aar'
48
+ }
49
+
50
+
51
+ // --- THIS IS THE ENHANCED, SELF-CONFIGURING BLOCK ---
52
+ // This block delays dependency resolution until the whole project is configured.
53
+ // It detects the environment and chooses the correct Mapbox artifact automatically.
54
+ project.afterEvaluate {
55
+ // 1. Resolve the Mapbox Version (your existing logic)
56
+ def resolvedMapboxVersion
57
+ if (project.rootProject.hasProperty('mapboxMapsVersion')) {
58
+ resolvedMapboxVersion = project.rootProject.mapboxMapsVersion
59
+ println "[aguacerowx] Found mapboxMapsVersion: ${resolvedMapboxVersion}"
60
+ } else {
61
+ resolvedMapboxVersion = "11.15.2" // A known-good fallback
62
+ println "[aguacerowx] WARNING: Could not find 'mapboxMapsVersion' property. Falling back to ${resolvedMapboxVersion}."
63
+ }
64
+
65
+ // 2. Detect if @rnmapbox/maps is present in the user's project
66
+ // We check the root project to see all included modules.
67
+ def rnMapboxIsPresent = project.rootProject.findProject(':rnmapbox_maps') != null
68
+ def mapboxArtifact
69
+
70
+ // 3. Choose the correct Mapbox artifact based on the detection
71
+ if (rnMapboxIsPresent) {
72
+ // If @rnmapbox/maps is present, we MUST use the ndk27 variant to avoid conflicts.
73
+ mapboxArtifact = "android-ndk27"
74
+ println "[aguacerowx] @rnmapbox/maps detected. Using Mapbox artifact: '${mapboxArtifact}' to ensure compatibility."
75
+ } else {
76
+ // If it's not present, use the standard 'android' variant.
77
+ mapboxArtifact = "android"
78
+ println "[aguacerowx] @rnmapbox/maps not detected. Using standard Mapbox artifact: '${mapboxArtifact}'."
79
+ }
80
+
81
+ // 4. Add the chosen Mapbox dependency using the version and artifact we just determined.
82
+ dependencies {
83
+ implementation "com.mapbox.maps:${mapboxArtifact}:${resolvedMapboxVersion}"
84
+ }
47
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aguacerowx/react-native",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "description": "Native weather rendering for React Native",
5
5
  "main": "index.js",
6
6
  "react-native": "index.js",