react-native-ariel 0.1.0-dev.5 → 0.1.0-dev.7
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/Ariel.podspec +1 -1
- package/android/CMakeLists.txt +4 -1
- package/android/build.gradle +3 -1
- package/lib/module/index.web.js +4 -6
- package/lib/module/index.web.js.map +1 -2
- package/package.json +1 -1
- package/android/src/main/java/com/ariel/ArielModule.kt +0 -43
- package/android/src/main/java/com/ariel/ArielPackage.kt +0 -34
- package/cpp/mermaid_wrapper.cpp +0 -2368
- package/cpp/mermaid_wrapper.hpp +0 -77
- package/cpp/react-native-ariel.cpp +0 -16
- package/cpp/react-native-ariel.h +0 -15
package/Ariel.podspec
CHANGED
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.platforms = { :ios => min_ios_version_supported }
|
|
16
16
|
s.source = { :git => "https://github.com/rinfi/ariel.git", :tag => "#{s.version}" }
|
|
17
17
|
|
|
18
|
-
s.source_files = "ios/**/*.{h,m,mm,swift}", "ios
|
|
18
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}", "ios\generated/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "cpp\generated/**/*.{hpp,cpp,c,h}"
|
|
19
19
|
s.vendored_frameworks = "ArielFramework.xcframework"
|
|
20
20
|
s.dependency "uniffi-bindgen-react-native", "0.31.0-2"
|
|
21
21
|
|
package/android/CMakeLists.txt
CHANGED
|
@@ -40,9 +40,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
|
40
40
|
# Set linker flags for 16KB page size alignment (required for Android 15+)
|
|
41
41
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
|
|
42
42
|
|
|
43
|
+
# ARIEL_DIR is passed from build.gradle via -DARIEL_DIR=${projectDir}
|
|
44
|
+
# This avoids using CMAKE_SOURCE_DIR which resolves to the app root when
|
|
45
|
+
# the library is linked via add_subdirectory.
|
|
43
46
|
cmake_path(
|
|
44
47
|
SET MY_RUST_LIB
|
|
45
|
-
${
|
|
48
|
+
${ARIEL_DIR}/src/main/jniLibs/${ANDROID_ABI}/libmermaid_wrapper.a
|
|
46
49
|
NORMALIZE
|
|
47
50
|
)
|
|
48
51
|
add_library(my_rust_lib STATIC IMPORTED)
|
package/android/build.gradle
CHANGED
|
@@ -74,7 +74,9 @@ android {
|
|
|
74
74
|
}
|
|
75
75
|
externalNativeBuild {
|
|
76
76
|
cmake {
|
|
77
|
-
|
|
77
|
+
// ARIEL_DIR passes the library root to CMake so Rust libs can be found.
|
|
78
|
+
// Cannot use CMAKE_SOURCE_DIR in CMake — it resolves to the app when linked via add_subdirectory.
|
|
79
|
+
arguments '-DANDROID_STL=c++_shared', "-DARIEL_DIR=${projectDir}"
|
|
78
80
|
abiFilters (*reactNativeArchitectures())
|
|
79
81
|
}
|
|
80
82
|
}
|
package/lib/module/index.web.js
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
// Generated by uniffi-bindgen-react-native
|
|
4
4
|
// Export the generated bindings to the app.
|
|
5
5
|
export * from "./generated/web/mermaid_wrapper.js";
|
|
6
|
+
|
|
7
|
+
// Now import the bindings so we can:
|
|
8
|
+
// - intialize them
|
|
9
|
+
// - export them as namespaced objects as the default export.
|
|
6
10
|
import * as mermaid_wrapper from "./generated/web/mermaid_wrapper.js";
|
|
7
11
|
import initAsync from './generated/web/wasm-bindgen/react_native_ariel.js';
|
|
8
12
|
import wasmPath from './generated/web/wasm-bindgen/react_native_ariel_bg.wasm';
|
|
@@ -10,12 +14,6 @@ export async function uniffiInitAsync() {
|
|
|
10
14
|
await initAsync({
|
|
11
15
|
module_or_path: wasmPath
|
|
12
16
|
});
|
|
13
|
-
mermaid_wrapper.default.initialize();
|
|
14
|
-
}
|
|
15
|
-
export default {
|
|
16
|
-
mermaid_wrapper
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=index.web.js.map});
|
|
19
17
|
|
|
20
18
|
// Initialize the generated bindings: mostly checksums, but also callbacks.
|
|
21
19
|
// - the boolean flag ensures this loads exactly once, even if the JS code
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mermaid_wrapper","initAsync","wasmPath","uniffiInitAsync","module_or_path","default","initialize"],"sourceRoot":"../../src","sources":["index.web.
|
|
2
|
-
Ae;EACbN;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["mermaid_wrapper","initAsync","wasmPath","uniffiInitAsync","module_or_path","default","initialize"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;AAAA;AACA;AACA,cAAc,oCAAiC;;AAE/C;AACA;AACA;AACA,OAAO,KAAKA,eAAe,MAAM,oCAAiC;AAElE,OAAOC,SAAS,MAAM,oDAAoD;AAC1E,OAAOC,QAAQ,MAAM,yDAAyD;AAE9E,OAAO,eAAeC,eAAeA,CAAA,EAAG;EACtC,MAAMF,SAAS,CAAC;IAAEG,cAAc,EAAEF;EAAS,CAAC,CAAC;;EAE7C;EACA;EACA;EACAF,eAAe,CAACK,OAAO,CAACC,UAAU,CAAC,CAAC;AACtC;;AAEA;AACA,eAAe;EACbN;AACF,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Generated by uniffi-bindgen-react-native
|
|
2
|
-
package com.ariel
|
|
3
|
-
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
6
|
-
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
|
|
7
|
-
|
|
8
|
-
@ReactModule(name = ArielModule.NAME)
|
|
9
|
-
class ArielModule(reactContext: ReactApplicationContext) :
|
|
10
|
-
NativeArielSpec(reactContext) {
|
|
11
|
-
|
|
12
|
-
override fun getName(): String {
|
|
13
|
-
return NAME
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Two native methods implemented in cpp-adapter.cpp, and ultimately
|
|
17
|
-
// react-native-ariel.cpp
|
|
18
|
-
|
|
19
|
-
external fun nativeInstallRustCrate(runtimePointer: Long, callInvoker: CallInvokerHolder): Boolean
|
|
20
|
-
external fun nativeCleanupRustCrate(runtimePointer: Long): Boolean
|
|
21
|
-
|
|
22
|
-
override fun installRustCrate(): Boolean {
|
|
23
|
-
val context = this.reactApplicationContext
|
|
24
|
-
return nativeInstallRustCrate(
|
|
25
|
-
context.javaScriptContextHolder!!.get(),
|
|
26
|
-
context.jsCallInvokerHolder!!
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
override fun cleanupRustCrate(): Boolean {
|
|
31
|
-
return nativeCleanupRustCrate(
|
|
32
|
-
this.reactApplicationContext.javaScriptContextHolder!!.get()
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
companion object {
|
|
37
|
-
const val NAME = "Ariel"
|
|
38
|
-
|
|
39
|
-
init {
|
|
40
|
-
System.loadLibrary("react-native-ariel")
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Generated by uniffi-bindgen-react-native
|
|
2
|
-
package com.ariel
|
|
3
|
-
|
|
4
|
-
import com.facebook.react.TurboReactPackage
|
|
5
|
-
import com.facebook.react.bridge.NativeModule
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
-
import com.facebook.react.module.model.ReactModuleInfo
|
|
8
|
-
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
9
|
-
import java.util.HashMap
|
|
10
|
-
|
|
11
|
-
class ArielPackage : TurboReactPackage() {
|
|
12
|
-
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
13
|
-
return if (name == ArielModule.NAME) {
|
|
14
|
-
ArielModule(reactContext)
|
|
15
|
-
} else {
|
|
16
|
-
null
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
21
|
-
return ReactModuleInfoProvider {
|
|
22
|
-
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
23
|
-
moduleInfos[ArielModule.NAME] = ReactModuleInfo(
|
|
24
|
-
ArielModule.NAME,
|
|
25
|
-
ArielModule.NAME,
|
|
26
|
-
false, // canOverrideExistingModule
|
|
27
|
-
false, // needsEagerInit
|
|
28
|
-
false, // isCxxModule
|
|
29
|
-
true // isTurboModule
|
|
30
|
-
)
|
|
31
|
-
moduleInfos
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|