@qntx/nostr-native 0.15.2 → 0.15.3

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.
@@ -20,6 +20,7 @@ def isNewArchitectureEnabled() {
20
20
  apply plugin: "com.android.library"
21
21
  apply plugin: 'org.jetbrains.kotlin.android'
22
22
  apply from: '../nitrogen/generated/android/NostrNative+autolinking.gradle'
23
+ apply from: './fix-prefab.gradle'
23
24
 
24
25
  if (isNewArchitectureEnabled()) {
25
26
  apply plugin: "com.facebook.react"
@@ -0,0 +1,57 @@
1
+ // Fixes the AGP ordering problem where prefab<Variant>ConfigurePackage runs before
2
+ // externalNativeBuild<Variant>, publishing a header-only (INTERFACE) package and
3
+ // leaving consumers' cached prefab_config.json stale. Ported from
4
+ // react-native-nitro-modules' android/fix-prefab.gradle (MIT):
5
+ // https://github.com/mrousavy/nitro/blob/main/packages/react-native-nitro-modules/android/fix-prefab.gradle
6
+
7
+ tasks.configureEach { task ->
8
+ // Make sure that we generate our prefab publication file only after having built the native library
9
+ // so that not a header publication file, but a full configuration publication will be generated, which
10
+ // will include the .so file
11
+
12
+ def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/
13
+ def matcher = task.name =~ prefabConfigurePattern
14
+ if (matcher.matches()) {
15
+ def variantName = matcher[0][1]
16
+ task.outputs.upToDateWhen { false }
17
+ task.dependsOn("externalNativeBuild${variantName}")
18
+ }
19
+ }
20
+
21
+ afterEvaluate {
22
+ def abis = reactNativeArchitectures()
23
+ rootProject.allprojects.each { proj ->
24
+ if (proj === rootProject) return
25
+
26
+ def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config ->
27
+ config.dependencies.any { dep ->
28
+ dep.group == project.group && dep.name == project.name
29
+ }
30
+ }
31
+ if (!dependsOnThisLib && proj != project) return
32
+
33
+ if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) {
34
+ return
35
+ }
36
+
37
+ def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants
38
+ // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to
39
+ // generate a libnameConfig.cmake file that will contain our native library (.so).
40
+ // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue
41
+ variants.all { variant ->
42
+ def variantName = variant.name
43
+ abis.each { abi ->
44
+ def searchDir = new File(proj.projectDir, ".cxx/${variantName}")
45
+ if (!searchDir.exists()) return
46
+ def matches = []
47
+ searchDir.eachDir { randomDir ->
48
+ def prefabFile = new File(randomDir, "${abi}/prefab_config.json")
49
+ if (prefabFile.exists()) matches << prefabFile
50
+ }
51
+ matches.each { prefabConfig ->
52
+ prefabConfig.setLastModified(System.currentTimeMillis())
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qntx/nostr-native",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Native libsecp256k1 (Nitro) verification and signing backend for @qntx/nostr on React Native",
5
5
  "keywords": [
6
6
  "bip340",
@@ -25,6 +25,7 @@
25
25
  "cpp",
26
26
  "include",
27
27
  "android/build.gradle",
28
+ "android/fix-prefab.gradle",
28
29
  "android/CMakeLists.txt",
29
30
  "android/gradle.properties",
30
31
  "android/src",
@@ -62,7 +63,7 @@
62
63
  "@arethetypeswrong/cli": "0.18.5",
63
64
  "@noble/curves": "2.4.0",
64
65
  "@noble/hashes": "2.4.0",
65
- "@qntx/nostr": "0.15.2",
66
+ "@qntx/nostr": "0.15.3",
66
67
  "@qntx/tsconfig": "1.0.1",
67
68
  "@types/node": "26.6.5",
68
69
  "nitrogen": "0.37.1",
@@ -72,7 +73,7 @@
72
73
  "vite-plus": "1.3.0"
73
74
  },
74
75
  "peerDependencies": {
75
- "@qntx/nostr": "^0.15.2",
76
+ "@qntx/nostr": "^0.15.3",
76
77
  "react-native": "*",
77
78
  "react-native-nitro-modules": "^0.37.1"
78
79
  },