@rnpack/utils 0.1.12 → 0.1.13
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/README.md +5 -0
- package/android/CMakeLists.txt +3 -3
- package/android/build.gradle +2 -2
- package/android/src/main/cpp/cpp-adapter.cpp +2 -2
- package/android/src/main/java/com/margelo/nitro/{rnpack/utils → rnpackutils}/RNPackUtils.kt +1 -1
- package/android/src/main/java/com/margelo/nitro/{rnpack/utils → rnpackutils}/RNPackUtilsPackage.kt +2 -2
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/nitro.json +5 -5
- package/nitrogen/generated/android/c++/JHybridRNPackUtilsSpec.cpp +2 -2
- package/nitrogen/generated/android/c++/JHybridRNPackUtilsSpec.hpp +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rnpack/utils → rnpackutils}/HybridRNPackUtilsSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rnpack/utils/RNPackUtilsOnLoad.kt → rnpackutils/rnpackutilsOnLoad.kt} +9 -9
- package/nitrogen/generated/android/{RNPackUtils+autolinking.cmake → rnpackutils+autolinking.cmake} +8 -8
- package/nitrogen/generated/android/{RNPackUtils+autolinking.gradle → rnpackutils+autolinking.gradle} +3 -3
- package/nitrogen/generated/android/{RNPackUtilsOnLoad.cpp → rnpackutilsOnLoad.cpp} +8 -8
- package/nitrogen/generated/android/{RNPackUtilsOnLoad.hpp → rnpackutilsOnLoad.hpp} +5 -5
- package/nitrogen/generated/ios/RNPackUtils-Swift-Cxx-Bridge.cpp +4 -4
- package/nitrogen/generated/ios/RNPackUtils-Swift-Cxx-Bridge.hpp +3 -3
- package/nitrogen/generated/ios/RNPackUtils-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/RNPackUtilsAutolinking.mm +1 -1
- package/nitrogen/generated/ios/RNPackUtilsAutolinking.swift +1 -1
- package/nitrogen/generated/ios/c++/HybridRNPackUtilsSpecSwift.cpp +2 -2
- package/nitrogen/generated/ios/c++/HybridRNPackUtilsSpecSwift.hpp +2 -2
- package/nitrogen/generated/ios/swift/HybridRNPackUtilsSpec_cxx.swift +2 -2
- package/nitrogen/generated/shared/c++/HybridRNPackUtilsSpec.cpp +2 -2
- package/nitrogen/generated/shared/c++/HybridRNPackUtilsSpec.hpp +2 -2
- package/package.json +44 -22
- package/src/index.tsx +2 -2
- package/__mocks__/jestSetupFile.js +0 -0
- package/__mocks__/rnpack-utils-mock.js +0 -17
- package/example/node_modules/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +0 -34
- package/example/node_modules/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +0 -88
- package/example/node_modules/react-native/Libraries/Blob/React-RCTBlob.podspec +0 -59
- package/example/node_modules/react-native/Libraries/FBLazyVector/FBLazyVector.podspec +0 -31
- package/example/node_modules/react-native/Libraries/Image/React-RCTImage.podspec +0 -57
- package/example/node_modules/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec +0 -51
- package/example/node_modules/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec +0 -54
- package/example/node_modules/react-native/Libraries/Network/React-RCTNetwork.podspec +0 -56
- package/example/node_modules/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +0 -53
- package/example/node_modules/react-native/Libraries/Required/RCTRequired.podspec +0 -30
- package/example/node_modules/react-native/Libraries/Settings/React-RCTSettings.podspec +0 -53
- package/example/node_modules/react-native/Libraries/Text/React-RCTText.podspec +0 -37
- package/example/node_modules/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec +0 -39
- package/example/node_modules/react-native/Libraries/Vibration/React-RCTVibration.podspec +0 -53
- package/example/node_modules/react-native/React/CoreModules/React-CoreModules.podspec +0 -67
- package/example/node_modules/react-native/React/React-RCTFBReactNativeSpec.podspec +0 -95
- package/example/node_modules/react-native/React/React-RCTFabric.podspec +0 -107
- package/example/node_modules/react-native/React/Runtime/React-RCTRuntime.podspec +0 -70
- package/example/node_modules/react-native/React-Core-prebuilt.podspec +0 -78
- package/example/node_modules/react-native/React-Core.podspec +0 -137
- package/example/node_modules/react-native/React.podspec +0 -56
- package/example/node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +0 -25
- package/example/node_modules/react-native/ReactCommon/React-Fabric.podspec +0 -207
- package/example/node_modules/react-native/ReactCommon/React-FabricComponents.podspec +0 -170
- package/example/node_modules/react-native/ReactCommon/React-FabricImage.podspec +0 -79
- package/example/node_modules/react-native/ReactCommon/React-Mapbuffer.podspec +0 -40
- package/example/node_modules/react-native/ReactCommon/ReactCommon.podspec +0 -72
- package/example/node_modules/react-native/ReactCommon/callinvoker/React-callinvoker.podspec +0 -30
- package/example/node_modules/react-native/ReactCommon/cxxreact/React-cxxreact.podspec +0 -56
- package/example/node_modules/react-native/ReactCommon/hermes/React-hermes.podspec +0 -52
- package/example/node_modules/react-native/ReactCommon/hermes/executor/React-jsitracing.podspec +0 -38
- package/example/node_modules/react-native/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +0 -52
- package/example/node_modules/react-native/ReactCommon/jsi/React-jsi.podspec +0 -50
- package/example/node_modules/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +0 -45
- package/example/node_modules/react-native/ReactCommon/jsinspector-modern/React-jsinspector.podspec +0 -63
- package/example/node_modules/react-native/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +0 -48
- package/example/node_modules/react-native/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +0 -53
- package/example/node_modules/react-native/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +0 -51
- package/example/node_modules/react-native/ReactCommon/jsitooling/React-jsitooling.podspec +0 -47
- package/example/node_modules/react-native/ReactCommon/logger/React-logger.podspec +0 -34
- package/example/node_modules/react-native/ReactCommon/oscompat/React-oscompat.podspec +0 -31
- package/example/node_modules/react-native/ReactCommon/react/debug/React-debug.podspec +0 -34
- package/example/node_modules/react-native/ReactCommon/react/featureflags/React-featureflags.podspec +0 -44
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +0 -54
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +0 -54
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +0 -60
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +0 -53
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +0 -55
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +0 -52
- package/example/node_modules/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +0 -63
- package/example/node_modules/react-native/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +0 -50
- package/example/node_modules/react-native/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +0 -43
- package/example/node_modules/react-native/ReactCommon/react/renderer/css/React-renderercss.podspec +0 -47
- package/example/node_modules/react-native/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +0 -48
- package/example/node_modules/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec +0 -55
- package/example/node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +0 -56
- package/example/node_modules/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +0 -59
- package/example/node_modules/react-native/ReactCommon/react/runtime/React-RuntimeCore.podspec +0 -56
- package/example/node_modules/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec +0 -53
- package/example/node_modules/react-native/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +0 -72
- package/example/node_modules/react-native/ReactCommon/react/timing/React-timing.podspec +0 -43
- package/example/node_modules/react-native/ReactCommon/react/utils/React-utils.podspec +0 -55
- package/example/node_modules/react-native/ReactCommon/reactperflogger/React-perflogger.podspec +0 -42
- package/example/node_modules/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +0 -56
- package/example/node_modules/react-native/ReactCommon/yoga/Yoga.podspec +0 -66
- package/example/node_modules/react-native/react-native.config.js +0 -139
- package/example/node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec +0 -165
- package/example/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec +0 -34
- package/example/node_modules/react-native/third-party-podspecs/RCT-Folly.podspec +0 -132
- package/example/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec +0 -99
- package/example/node_modules/react-native/third-party-podspecs/boost.podspec +0 -34
- package/example/node_modules/react-native/third-party-podspecs/fast_float.podspec +0 -29
- package/example/node_modules/react-native/third-party-podspecs/fmt.podspec +0 -29
- package/example/node_modules/react-native/third-party-podspecs/glog.podspec +0 -47
- package/example/node_modules/react-native-nitro-modules/NitroModules.podspec +0 -90
- package/example/node_modules/react-native-nitro-modules/react-native.config.js +0 -16
- package/example/react-native.config.js +0 -21
- package/lib/typescript/__tests__/utils/string.test.d.ts +0 -2
- package/lib/typescript/__tests__/utils/string.test.d.ts.map +0 -1
- /package/{Utils.podspec → RNPackUtils.podspec} +0 -0
package/README.md
CHANGED
|
@@ -11,6 +11,11 @@ npm install @rnpack/utils react-native-nitro-modules
|
|
|
11
11
|
> `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## Required dependencies
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
yarn add buffer
|
|
18
|
+
```
|
|
14
19
|
|
|
15
20
|
## Usage
|
|
16
21
|
|
package/android/CMakeLists.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
project(
|
|
1
|
+
project(rnpackutils)
|
|
2
2
|
cmake_minimum_required(VERSION 3.9.0)
|
|
3
3
|
|
|
4
|
-
set(PACKAGE_NAME
|
|
4
|
+
set(PACKAGE_NAME rnpackutils)
|
|
5
5
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
6
6
|
set(CMAKE_CXX_STANDARD 20)
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD 20)
|
|
|
9
9
|
add_library(${PACKAGE_NAME} SHARED src/main/cpp/cpp-adapter.cpp)
|
|
10
10
|
|
|
11
11
|
# Add Nitrogen specs :)
|
|
12
|
-
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/
|
|
12
|
+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/rnpackutils+autolinking.cmake)
|
|
13
13
|
|
|
14
14
|
# Set up local includes
|
|
15
15
|
include_directories("src/main/cpp" "../cpp")
|
package/android/build.gradle
CHANGED
|
@@ -22,7 +22,7 @@ def reactNativeArchitectures() {
|
|
|
22
22
|
|
|
23
23
|
apply plugin: "com.android.library"
|
|
24
24
|
apply plugin: "kotlin-android"
|
|
25
|
-
apply from: '../nitrogen/generated/android/
|
|
25
|
+
apply from: '../nitrogen/generated/android/rnpackutils+autolinking.gradle'
|
|
26
26
|
|
|
27
27
|
apply plugin: "com.facebook.react"
|
|
28
28
|
|
|
@@ -31,7 +31,7 @@ def getExtOrIntegerDefault(name) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
android {
|
|
34
|
-
namespace "com.margelo.nitro.
|
|
34
|
+
namespace "com.margelo.nitro.rnpackutils"
|
|
35
35
|
|
|
36
36
|
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
37
37
|
|
package/android/src/main/java/com/margelo/nitro/{rnpack/utils → rnpackutils}/RNPackUtilsPackage.kt
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.margelo.nitro.
|
|
1
|
+
package com.margelo.nitro.rnpackutils
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.BaseReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
@@ -16,7 +16,7 @@ class RNPackUtilsPackage : BaseReactPackage() {
|
|
|
16
16
|
|
|
17
17
|
companion object {
|
|
18
18
|
init {
|
|
19
|
-
System.loadLibrary("
|
|
19
|
+
System.loadLibrary("rnpackutils")
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
package/lib/module/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
|
-
const
|
|
4
|
+
const RNPackUtilsHybridObject = NitroModules.createHybridObject('RNPackUtils');
|
|
5
5
|
export function multiply(a, b) {
|
|
6
|
-
return
|
|
6
|
+
return RNPackUtilsHybridObject.multiply(a, b);
|
|
7
7
|
}
|
|
8
8
|
export * from "./utils/index.js";
|
|
9
9
|
export * from "./hooks/index.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","
|
|
1
|
+
{"version":3,"names":["NitroModules","RNPackUtilsHybridObject","createHybridObject","multiply","a","b"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,MAAMC,uBAAuB,GAC3BD,YAAY,CAACE,kBAAkB,CAAc,aAAa,CAAC;AAE7D,OAAO,SAASC,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOJ,uBAAuB,CAACE,QAAQ,CAACC,CAAC,EAAEC,CAAC,CAAC;AAC/C;AAEA,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,kBAAS","ignoreList":[]}
|
package/nitro.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"cxxNamespace": [
|
|
3
|
-
"
|
|
3
|
+
"rnpackutils"
|
|
4
4
|
],
|
|
5
5
|
"ios": {
|
|
6
6
|
"iosModuleName": "RNPackUtils"
|
|
7
7
|
},
|
|
8
8
|
"android": {
|
|
9
9
|
"androidNamespace": [
|
|
10
|
-
"
|
|
11
|
-
"utils"
|
|
10
|
+
"rnpackutils"
|
|
12
11
|
],
|
|
13
|
-
"androidCxxLibName": "
|
|
12
|
+
"androidCxxLibName": "rnpackutils"
|
|
14
13
|
},
|
|
15
14
|
"autolinking": {
|
|
16
15
|
"RNPackUtils": {
|
|
@@ -19,6 +18,7 @@
|
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
20
|
"ignorePaths": [
|
|
22
|
-
"node_modules"
|
|
21
|
+
"node_modules",
|
|
22
|
+
"example/node_modules"
|
|
23
23
|
]
|
|
24
24
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
namespace margelo::nitro::
|
|
14
|
+
namespace margelo::nitro::rnpackutils {
|
|
15
15
|
|
|
16
16
|
jni::local_ref<JHybridRNPackUtilsSpec::jhybriddata> JHybridRNPackUtilsSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
17
17
|
return makeCxxInstance(jThis);
|
|
@@ -49,4 +49,4 @@ namespace margelo::nitro::RNPackUtils {
|
|
|
49
49
|
return __result;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
} // namespace margelo::nitro::
|
|
52
|
+
} // namespace margelo::nitro::rnpackutils
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
namespace margelo::nitro::
|
|
17
|
+
namespace margelo::nitro::rnpackutils {
|
|
18
18
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
21
21
|
class JHybridRNPackUtilsSpec: public jni::HybridClass<JHybridRNPackUtilsSpec, JHybridObject>,
|
|
22
22
|
public virtual HybridRNPackUtilsSpec {
|
|
23
23
|
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/rnpackutils/HybridRNPackUtilsSpec;";
|
|
25
25
|
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
26
|
static void registerNatives();
|
|
27
27
|
|
|
@@ -62,4 +62,4 @@ namespace margelo::nitro::RNPackUtils {
|
|
|
62
62
|
jni::global_ref<JHybridRNPackUtilsSpec::javaobject> _javaPart;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
} // namespace margelo::nitro::
|
|
65
|
+
} // namespace margelo::nitro::rnpackutils
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// rnpackutilsOnLoad.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
package com.margelo.nitro.
|
|
8
|
+
package com.margelo.nitro.rnpackutils
|
|
9
9
|
|
|
10
10
|
import android.util.Log
|
|
11
11
|
|
|
12
|
-
internal class
|
|
12
|
+
internal class rnpackutilsOnLoad {
|
|
13
13
|
companion object {
|
|
14
|
-
private const val TAG = "
|
|
14
|
+
private const val TAG = "rnpackutilsOnLoad"
|
|
15
15
|
private var didLoad = false
|
|
16
16
|
/**
|
|
17
|
-
* Initializes the native part of "
|
|
17
|
+
* Initializes the native part of "rnpackutils".
|
|
18
18
|
* This method is idempotent and can be called more than once.
|
|
19
19
|
*/
|
|
20
20
|
@JvmStatic
|
|
21
21
|
fun initializeNative() {
|
|
22
22
|
if (didLoad) return
|
|
23
23
|
try {
|
|
24
|
-
Log.i(TAG, "Loading
|
|
25
|
-
System.loadLibrary("
|
|
26
|
-
Log.i(TAG, "Successfully loaded
|
|
24
|
+
Log.i(TAG, "Loading rnpackutils C++ library...")
|
|
25
|
+
System.loadLibrary("rnpackutils")
|
|
26
|
+
Log.i(TAG, "Successfully loaded rnpackutils C++ library!")
|
|
27
27
|
didLoad = true
|
|
28
28
|
} catch (e: Error) {
|
|
29
|
-
Log.e(TAG, "Failed to load
|
|
29
|
+
Log.e(TAG, "Failed to load rnpackutils C++ library! Is it properly installed and linked? " +
|
|
30
30
|
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
31
|
throw e
|
|
32
32
|
}
|
package/nitrogen/generated/android/{RNPackUtils+autolinking.cmake → rnpackutils+autolinking.cmake}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
#
|
|
2
|
+
# rnpackutils+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
5
|
# Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#
|
|
11
11
|
# To use it, add this to your CMakeLists.txt:
|
|
12
12
|
# ```cmake
|
|
13
|
-
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/
|
|
13
|
+
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/rnpackutils+autolinking.cmake)
|
|
14
14
|
# ```
|
|
15
15
|
|
|
16
16
|
# Define a flag to check if we are building properly
|
|
@@ -29,9 +29,9 @@ include_directories(
|
|
|
29
29
|
# Add all .cpp sources that were generated by Nitrogen
|
|
30
30
|
target_sources(
|
|
31
31
|
# CMake project name (Android C++ library name)
|
|
32
|
-
|
|
32
|
+
rnpackutils PRIVATE
|
|
33
33
|
# Autolinking Setup
|
|
34
|
-
../nitrogen/generated/android/
|
|
34
|
+
../nitrogen/generated/android/rnpackutilsOnLoad.cpp
|
|
35
35
|
# Shared Nitrogen C++ sources
|
|
36
36
|
../nitrogen/generated/shared/c++/HybridRNPackUtilsSpec.cpp
|
|
37
37
|
# Android-specific Nitrogen C++ sources
|
|
@@ -41,7 +41,7 @@ target_sources(
|
|
|
41
41
|
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
42
42
|
# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
|
|
43
43
|
target_compile_definitions(
|
|
44
|
-
|
|
44
|
+
rnpackutils PRIVATE
|
|
45
45
|
-DFOLLY_NO_CONFIG=1
|
|
46
46
|
-DFOLLY_HAVE_CLOCK_GETTIME=1
|
|
47
47
|
-DFOLLY_USE_LIBCPP=1
|
|
@@ -61,7 +61,7 @@ find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all Hybri
|
|
|
61
61
|
|
|
62
62
|
# Link all libraries together
|
|
63
63
|
target_link_libraries(
|
|
64
|
-
|
|
64
|
+
rnpackutils
|
|
65
65
|
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
|
66
66
|
ReactAndroid::jsi # <-- RN: JSI
|
|
67
67
|
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
|
@@ -70,12 +70,12 @@ target_link_libraries(
|
|
|
70
70
|
# Link react-native (different prefab between RN 0.75 and RN 0.76)
|
|
71
71
|
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
|
72
72
|
target_link_libraries(
|
|
73
|
-
|
|
73
|
+
rnpackutils
|
|
74
74
|
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
|
|
75
75
|
)
|
|
76
76
|
else()
|
|
77
77
|
target_link_libraries(
|
|
78
|
-
|
|
78
|
+
rnpackutils
|
|
79
79
|
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
|
80
80
|
)
|
|
81
81
|
endif()
|
package/nitrogen/generated/android/{RNPackUtils+autolinking.gradle → rnpackutils+autolinking.gradle}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// rnpackutils+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
///
|
|
11
11
|
/// To use it, add this to your build.gradle:
|
|
12
12
|
/// ```gradle
|
|
13
|
-
/// apply from: '../nitrogen/generated/android/
|
|
13
|
+
/// apply from: '../nitrogen/generated/android/rnpackutils+autolinking.gradle'
|
|
14
14
|
/// ```
|
|
15
15
|
|
|
16
|
-
logger.warn("[NitroModules] 🔥
|
|
16
|
+
logger.warn("[NitroModules] 🔥 rnpackutils is boosted by nitro!")
|
|
17
17
|
|
|
18
18
|
android {
|
|
19
19
|
sourceSets {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// rnpackutilsOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_RNPACKUTILS_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
-
#error
|
|
9
|
+
#error rnpackutilsOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
10
|
#endif
|
|
11
11
|
|
|
12
|
-
#include "
|
|
12
|
+
#include "rnpackutilsOnLoad.hpp"
|
|
13
13
|
|
|
14
14
|
#include <jni.h>
|
|
15
15
|
#include <fbjni/fbjni.h>
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
#include "JHybridRNPackUtilsSpec.hpp"
|
|
19
19
|
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
20
20
|
|
|
21
|
-
namespace margelo::nitro::
|
|
21
|
+
namespace margelo::nitro::rnpackutils {
|
|
22
22
|
|
|
23
23
|
int initialize(JavaVM* vm) {
|
|
24
24
|
using namespace margelo::nitro;
|
|
25
|
-
using namespace margelo::nitro::
|
|
25
|
+
using namespace margelo::nitro::rnpackutils;
|
|
26
26
|
using namespace facebook;
|
|
27
27
|
|
|
28
28
|
return facebook::jni::initialize(vm, [] {
|
|
29
29
|
// Register native JNI methods
|
|
30
|
-
margelo::nitro::
|
|
30
|
+
margelo::nitro::rnpackutils::JHybridRNPackUtilsSpec::registerNatives();
|
|
31
31
|
|
|
32
32
|
// Register Nitro Hybrid Objects
|
|
33
33
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
34
34
|
"RNPackUtils",
|
|
35
35
|
[]() -> std::shared_ptr<HybridObject> {
|
|
36
|
-
static DefaultConstructableObject<JHybridRNPackUtilsSpec::javaobject> object("com/margelo/nitro/
|
|
36
|
+
static DefaultConstructableObject<JHybridRNPackUtilsSpec::javaobject> object("com/margelo/nitro/rnpackutils/RNPackUtils");
|
|
37
37
|
auto instance = object.create();
|
|
38
38
|
return instance->cthis()->shared();
|
|
39
39
|
}
|
|
@@ -41,4 +41,4 @@ int initialize(JavaVM* vm) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
} // namespace margelo::nitro::
|
|
44
|
+
} // namespace margelo::nitro::rnpackutils
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// rnpackutilsOnLoad.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
#include <jni.h>
|
|
9
9
|
#include <NitroModules/NitroDefines.hpp>
|
|
10
10
|
|
|
11
|
-
namespace margelo::nitro::
|
|
11
|
+
namespace margelo::nitro::rnpackutils {
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Initializes the native (C++) part of
|
|
14
|
+
* Initializes the native (C++) part of rnpackutils, and autolinks all Hybrid Objects.
|
|
15
15
|
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
|
|
16
16
|
* Example:
|
|
17
17
|
* ```cpp (cpp-adapter.cpp)
|
|
18
18
|
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
19
|
-
* return margelo::nitro::
|
|
19
|
+
* return margelo::nitro::rnpackutils::initialize(vm);
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
int initialize(JavaVM* vm);
|
|
24
24
|
|
|
25
|
-
} // namespace margelo::nitro::
|
|
25
|
+
} // namespace margelo::nitro::rnpackutils
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
#include "RNPackUtils-Swift-Cxx-Umbrella.hpp"
|
|
13
13
|
#include <NitroModules/NitroDefines.hpp>
|
|
14
14
|
|
|
15
|
-
namespace margelo::nitro::
|
|
15
|
+
namespace margelo::nitro::rnpackutils::bridge::swift {
|
|
16
16
|
|
|
17
17
|
// pragma MARK: std::shared_ptr<HybridRNPackUtilsSpec>
|
|
18
18
|
std::shared_ptr<HybridRNPackUtilsSpec> create_std__shared_ptr_HybridRNPackUtilsSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
19
19
|
RNPackUtils::HybridRNPackUtilsSpec_cxx swiftPart = RNPackUtils::HybridRNPackUtilsSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
20
|
-
return std::make_shared<margelo::nitro::
|
|
20
|
+
return std::make_shared<margelo::nitro::rnpackutils::HybridRNPackUtilsSpecSwift>(swiftPart);
|
|
21
21
|
}
|
|
22
22
|
void* NON_NULL get_std__shared_ptr_HybridRNPackUtilsSpec_(std__shared_ptr_HybridRNPackUtilsSpec_ cppType) {
|
|
23
|
-
std::shared_ptr<margelo::nitro::
|
|
23
|
+
std::shared_ptr<margelo::nitro::rnpackutils::HybridRNPackUtilsSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rnpackutils::HybridRNPackUtilsSpecSwift>(cppType);
|
|
24
24
|
#ifdef NITRO_DEBUG
|
|
25
25
|
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
26
26
|
throw std::runtime_error("Class \"HybridRNPackUtilsSpec\" is not implemented in Swift!");
|
|
@@ -30,4 +30,4 @@ namespace margelo::nitro::RNPackUtils::bridge::swift {
|
|
|
30
30
|
return swiftPart.toUnsafe();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
} // namespace margelo::nitro::
|
|
33
|
+
} // namespace margelo::nitro::rnpackutils::bridge::swift
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `HybridRNPackUtilsSpec` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::
|
|
12
|
+
namespace margelo::nitro::rnpackutils { class HybridRNPackUtilsSpec; }
|
|
13
13
|
|
|
14
14
|
// Forward declarations of Swift defined types
|
|
15
15
|
// Forward declaration of `HybridRNPackUtilsSpec_cxx` to properly resolve imports.
|
|
@@ -25,7 +25,7 @@ namespace RNPackUtils { class HybridRNPackUtilsSpec_cxx; }
|
|
|
25
25
|
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
26
26
|
* as well as helper functions to interact with those C++ types from Swift.
|
|
27
27
|
*/
|
|
28
|
-
namespace margelo::nitro::
|
|
28
|
+
namespace margelo::nitro::rnpackutils::bridge::swift {
|
|
29
29
|
|
|
30
30
|
// pragma MARK: std::shared_ptr<HybridRNPackUtilsSpec>
|
|
31
31
|
/**
|
|
@@ -48,4 +48,4 @@ namespace margelo::nitro::RNPackUtils::bridge::swift {
|
|
|
48
48
|
return Result<double>::withError(error);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
} // namespace margelo::nitro::
|
|
51
|
+
} // namespace margelo::nitro::rnpackutils::bridge::swift
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `HybridRNPackUtilsSpec` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::
|
|
12
|
+
namespace margelo::nitro::rnpackutils { class HybridRNPackUtilsSpec; }
|
|
13
13
|
|
|
14
14
|
// Include C++ defined types
|
|
15
15
|
#include "HybridRNPackUtilsSpec.hpp"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
public final class RNPackUtilsAutolinking {
|
|
9
|
-
public typealias bridge = margelo.nitro.
|
|
9
|
+
public typealias bridge = margelo.nitro.rnpackutils.bridge.swift
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates an instance of a Swift class that implements `HybridRNPackUtilsSpec`,
|
|
@@ -18,7 +18,7 @@ namespace RNPackUtils { class HybridRNPackUtilsSpec_cxx; }
|
|
|
18
18
|
|
|
19
19
|
#include "RNPackUtils-Swift-Cxx-Umbrella.hpp"
|
|
20
20
|
|
|
21
|
-
namespace margelo::nitro::
|
|
21
|
+
namespace margelo::nitro::rnpackutils {
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* The C++ part of HybridRNPackUtilsSpec_cxx.swift.
|
|
@@ -73,4 +73,4 @@ namespace margelo::nitro::RNPackUtils {
|
|
|
73
73
|
RNPackUtils::HybridRNPackUtilsSpec_cxx _swiftPart;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
} // namespace margelo::nitro::
|
|
76
|
+
} // namespace margelo::nitro::rnpackutils
|
|
@@ -19,11 +19,11 @@ import NitroModules
|
|
|
19
19
|
*/
|
|
20
20
|
open class HybridRNPackUtilsSpec_cxx {
|
|
21
21
|
/**
|
|
22
|
-
* The Swift <> C++ bridge's namespace (`margelo::nitro::
|
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::rnpackutils::bridge::swift`)
|
|
23
23
|
* from `RNPackUtils-Swift-Cxx-Bridge.hpp`.
|
|
24
24
|
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
25
25
|
*/
|
|
26
|
-
public typealias bridge = margelo.nitro.
|
|
26
|
+
public typealias bridge = margelo.nitro.rnpackutils.bridge.swift
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Holds an instance of the `HybridRNPackUtilsSpec` Swift protocol.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#include "HybridRNPackUtilsSpec.hpp"
|
|
9
9
|
|
|
10
|
-
namespace margelo::nitro::
|
|
10
|
+
namespace margelo::nitro::rnpackutils {
|
|
11
11
|
|
|
12
12
|
void HybridRNPackUtilsSpec::loadHybridMethods() {
|
|
13
13
|
// load base methods/properties
|
|
@@ -18,4 +18,4 @@ namespace margelo::nitro::RNPackUtils {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
} // namespace margelo::nitro::
|
|
21
|
+
} // namespace margelo::nitro::rnpackutils
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::rnpackutils {
|
|
21
21
|
|
|
22
22
|
using namespace margelo::nitro;
|
|
23
23
|
|
|
@@ -59,4 +59,4 @@ namespace margelo::nitro::RNPackUtils {
|
|
|
59
59
|
static constexpr auto TAG = "RNPackUtils";
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
} // namespace margelo::nitro::
|
|
62
|
+
} // namespace margelo::nitro::rnpackutils
|