Skip to content

Commit

Permalink
nitro 0.9.2 -> 0.14.0 & testing
Browse files Browse the repository at this point in the history
  • Loading branch information
boorad committed Nov 3, 2024
1 parent 2797aa4 commit 9a3a8e8
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 284 deletions.
Binary file modified bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PODS:
- hermes-engine (0.74.5):
- hermes-engine/Pre-built (= 0.74.5)
- hermes-engine/Pre-built (0.74.5)
- NitroModules (0.9.2):
- NitroModules (0.14.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1564,16 +1564,16 @@ SPEC CHECKSUMS:
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
hermes-engine: 8c1577f3fdb849cbe7729c2e7b5abc4b845e88f8
NitroModules: 38b7870be128f26cb82a2ef256fa8eea04933fa2
NitroModules: a5daf9eaf57c450d4f464bfe8ec30fe550b0fa68
OpenSSL-Universal: f8a9c4fdab7e21cb70bda471c269e86e9212439c
QuickCrypto: 551d63cf0fdd977e6b8e0e78e853ab47e80de518
QuickCrypto: b7afd2e6f9bd3ea7257896860579c85a9c6984ea
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: 3afceddffa65aee666dafd6f0116f1d975db1584
RCTRequired: ec1239bc9d8bf63e10fb92bd8b26171a9258e0c1
RCTTypeSafety: f5ecbc86c5c5fa163c05acb7a1c5012e15b5f994
React: fc9fa7258eff606f44d58c5b233a82dc9cf09018
React-callinvoker: e3fab14d69607fb7e8e3a57e5a415aed863d3599
React-Codegen: 49efb5917c904b5b01ef708311a2f1773f4fe73e
React-Codegen: 6fa87b7c6b8efcd0cef4bfeaec8c8bc8a6abe75a
React-Core: 3a5fd9e781cecf87803e5b091496a606a3df774a
React-CoreModules: cbf4707dafab8f9f826ac0c63a07d0bf5d01e256
React-cxxreact: 7b188556271e3c7fdf22a04819f6a6225045b9dd
Expand Down Expand Up @@ -1621,6 +1621,6 @@ SPEC CHECKSUMS:
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 950bbfd7e6f04790fdb51149ed51df41f329fcc8

PODFILE CHECKSUM: 684599d0e4b0f60fab3a5ad6c896bb5e77f7b4f2
PODFILE CHECKSUM: 35be88c88b1bb1be062e9004965b962528d32ae6

COCOAPODS: 1.14.3
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"react": "^18.3.1",
"react-native": "^0.74.5",
"react-native-bouncy-checkbox": "4.0.1",
"react-native-nitro-modules": "0.9.2",
"react-native-nitro-modules": "0.14.0",
"react-native-quick-base64": "2.1.2",
"react-native-quick-crypto": "*",
"react-native-quick-crypto": "workspace:*",
"react-native-safe-area-context": "4.10.8",
"react-native-screens": "3.32.0",
"react-native-vector-icons": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-quick-crypto/nitro.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cxxNamespace": ["crypto"],
"ios": {
"iosModulename": "QuickCrypto"
"iosModuleName": "QuickCrypto"
},
"android": {
"androidNamespace": ["crypto"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ target_link_libraries(
QuickCrypto
fbjni::fbjni # <-- Facebook C++ JNI helpers
ReactAndroid::jsi # <-- RN: JSI
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
)

# Link react-native (different prefab between RN 0.75 and RN 0.76)
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(
QuickCrypto
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
)
else()
target_link_libraries(
QuickCrypto
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ def add_nitrogen_files(spec)

spec.dependency "NitroModules"

current_source_files = spec.attributes_hash['source_files'] || []
current_source_files = Array(spec.attributes_hash['source_files'])
spec.source_files = current_source_files + [
# Generated cross-platform specs
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
# Generated bridges for the cross-platform specs
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
]

current_public_header_files = spec.attributes_hash['public_header_files'] || []
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
spec.public_header_files = current_public_header_files + [
# Generated specs
"nitrogen/generated/shared/**/*.{h,hpp}",
# Swift to C++ bridging helpers
"nitrogen/generated/ios/QuickCrypto-Swift-Cxx-Bridge.hpp"
]

current_private_header_files = spec.attributes_hash['private_header_files'] || []
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
spec.private_header_files = current_private_header_files + [
# iOS specific specs
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
Expand All @@ -52,5 +52,7 @@ def add_nitrogen_files(spec)
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
# Enables C++ <-> Swift interop (by default it's only C)
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
# Enables stricter modular headers
"DEFINES_MODULE" => "YES",
})
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
///

#include "QuickCrypto-Swift-Cxx-Bridge.hpp"

// Include C++ implementation defined types


namespace margelo::nitro::crypto::bridge::swift {



} // namespace margelo::nitro::crypto::bridge::swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,217 +8,20 @@
#pragma once

// Forward declarations of C++ defined types
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
namespace NitroModules { class ArrayBufferHolder; }
// Forward declaration of `ArrayBuffer` to properly resolve imports.
namespace NitroModules { class ArrayBuffer; }
// Forward declaration of `JWKkty` to properly resolve imports.
namespace margelo::nitro::crypto { enum class JWKkty; }
// Forward declaration of `JWKuse` to properly resolve imports.
namespace margelo::nitro::crypto { enum class JWKuse; }
// Forward declaration of `KFormatType` to properly resolve imports.
namespace margelo::nitro::crypto { enum class KFormatType; }
// Forward declaration of `KeyEncoding` to properly resolve imports.
namespace margelo::nitro::crypto { enum class KeyEncoding; }
// Forward declaration of `KeyType` to properly resolve imports.
namespace margelo::nitro::crypto { enum class KeyType; }
// Forward declaration of `KeyUsage` to properly resolve imports.
namespace margelo::nitro::crypto { enum class KeyUsage; }
// Forward declaration of `NamedCurve` to properly resolve imports.
namespace margelo::nitro::crypto { enum class NamedCurve; }


// Forward declarations of Swift defined types


// Include C++ defined types
#if __has_include("JWKkty.hpp")
#include "JWKkty.hpp"
#endif
#if __has_include("JWKuse.hpp")
#include "JWKuse.hpp"
#endif
#if __has_include("KFormatType.hpp")
#include "KFormatType.hpp"
#endif
#if __has_include("KeyEncoding.hpp")
#include "KeyEncoding.hpp"
#endif
#if __has_include("KeyType.hpp")
#include "KeyType.hpp"
#endif
#if __has_include("KeyUsage.hpp")
#include "KeyUsage.hpp"
#endif
#if __has_include("NamedCurve.hpp")
#include "NamedCurve.hpp"
#endif
#if __has_include(<NitroModules/ArrayBuffer.hpp>)
#include <NitroModules/ArrayBuffer.hpp>
#endif
#if __has_include(<NitroModules/ArrayBufferHolder.hpp>)
#include <NitroModules/ArrayBufferHolder.hpp>
#endif
#if __has_include(<NitroModules/PromiseHolder.hpp>)
#include <NitroModules/PromiseHolder.hpp>
#endif
#if __has_include(<future>)
#include <future>
#endif
#if __has_include(<optional>)
#include <optional>
#endif
#if __has_include(<string>)
#include <string>
#endif
#if __has_include(<variant>)
#include <variant>
#endif
#if __has_include(<vector>)
#include <vector>
#endif


/**
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
* as well as helper functions to interact with those C++ types from Swift.
*/
namespace margelo::nitro::crypto::bridge::swift {

/**
* Specialized version of `std::optional<KFormatType>`.
*/
using std__optional_KFormatType_ = std::optional<KFormatType>;
inline std::optional<KFormatType> create_std__optional_KFormatType_(const KFormatType& value) {
return std::optional<KFormatType>(value);
}

/**
* Specialized version of `std::optional<KeyEncoding>`.
*/
using std__optional_KeyEncoding_ = std::optional<KeyEncoding>;
inline std::optional<KeyEncoding> create_std__optional_KeyEncoding_(const KeyEncoding& value) {
return std::optional<KeyEncoding>(value);
}

/**
* Specialized version of `std::optional<std::string>`.
*/
using std__optional_std__string_ = std::optional<std::string>;
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) {
return std::optional<std::string>(value);
}

/**
* Specialized version of `std::optional<std::shared_ptr<ArrayBuffer>>`.
*/
using std__optional_std__shared_ptr_ArrayBuffer__ = std::optional<std::shared_ptr<ArrayBuffer>>;
inline std::optional<std::shared_ptr<ArrayBuffer>> create_std__optional_std__shared_ptr_ArrayBuffer__(const std::shared_ptr<ArrayBuffer>& value) {
return std::optional<std::shared_ptr<ArrayBuffer>>(value);
}

/**
* Specialized version of `std::optional<JWKkty>`.
*/
using std__optional_JWKkty_ = std::optional<JWKkty>;
inline std::optional<JWKkty> create_std__optional_JWKkty_(const JWKkty& value) {
return std::optional<JWKkty>(value);
}

/**
* Specialized version of `std::optional<JWKuse>`.
*/
using std__optional_JWKuse_ = std::optional<JWKuse>;
inline std::optional<JWKuse> create_std__optional_JWKuse_(const JWKuse& value) {
return std::optional<JWKuse>(value);
}

/**
* Specialized version of `std::vector<KeyUsage>`.
*/
using std__vector_KeyUsage_ = std::vector<KeyUsage>;
inline std::vector<KeyUsage> create_std__vector_KeyUsage_(size_t size) {
std::vector<KeyUsage> vector;
vector.reserve(size);
return vector;
}

/**
* Specialized version of `std::optional<std::vector<KeyUsage>>`.
*/
using std__optional_std__vector_KeyUsage__ = std::optional<std::vector<KeyUsage>>;
inline std::optional<std::vector<KeyUsage>> create_std__optional_std__vector_KeyUsage__(const std::vector<KeyUsage>& value) {
return std::optional<std::vector<KeyUsage>>(value);
}

/**
* Specialized version of `std::vector<std::string>`.
*/
using std__vector_std__string_ = std::vector<std::string>;
inline std::vector<std::string> create_std__vector_std__string_(size_t size) {
std::vector<std::string> vector;
vector.reserve(size);
return vector;
}

/**
* Specialized version of `std::optional<std::vector<std::string>>`.
*/
using std__optional_std__vector_std__string__ = std::optional<std::vector<std::string>>;
inline std::optional<std::vector<std::string>> create_std__optional_std__vector_std__string__(const std::vector<std::string>& value) {
return std::optional<std::vector<std::string>>(value);
}

/**
* Specialized version of `std::optional<bool>`.
*/
using std__optional_bool_ = std::optional<bool>;
inline std::optional<bool> create_std__optional_bool_(const bool& value) {
return std::optional<bool>(value);
}

/**
* Specialized version of `std::variant<std::string, std::shared_ptr<ArrayBuffer>>`.
*/
using std__variant_std__string__std__shared_ptr_ArrayBuffer__ = std::variant<std::string, std::shared_ptr<ArrayBuffer>>;
inline std::variant<std::string, std::shared_ptr<ArrayBuffer>> create_std__variant_std__string__std__shared_ptr_ArrayBuffer__(const std::string& value) {
return value;
}
inline std::variant<std::string, std::shared_ptr<ArrayBuffer>> create_std__variant_std__string__std__shared_ptr_ArrayBuffer__(const std::shared_ptr<ArrayBuffer>& value) {
return value;
}
inline std::string get_std__variant_std__string__std__shared_ptr_ArrayBuffer___0(const std::variant<std::string, std::shared_ptr<ArrayBuffer>>& variant) {
return std::get<0>(variant);
}
inline std::shared_ptr<ArrayBuffer> get_std__variant_std__string__std__shared_ptr_ArrayBuffer___1(const std::variant<std::string, std::shared_ptr<ArrayBuffer>>& variant) {
return std::get<1>(variant);
}

/**
* Specialized version of `std::optional<KeyType>`.
*/
using std__optional_KeyType_ = std::optional<KeyType>;
inline std::optional<KeyType> create_std__optional_KeyType_(const KeyType& value) {
return std::optional<KeyType>(value);
}

/**
* Specialized version of `std::optional<NamedCurve>`.
*/
using std__optional_NamedCurve_ = std::optional<NamedCurve>;
inline std::optional<NamedCurve> create_std__optional_NamedCurve_(const NamedCurve& value) {
return std::optional<NamedCurve>(value);
}

/**
* Specialized version of `std::optional<double>`.
*/
using std__optional_double_ = std::optional<double>;
inline std::optional<double> create_std__optional_double_(const double& value) {
return std::optional<double>(value);
}

/**
* Specialized version of `PromiseHolder<std::shared_ptr<ArrayBuffer>>`.
*/
using PromiseHolder_std__shared_ptr_ArrayBuffer__ = PromiseHolder<std::shared_ptr<ArrayBuffer>>;
inline PromiseHolder<std::shared_ptr<ArrayBuffer>> create_PromiseHolder_std__shared_ptr_ArrayBuffer__() {
return PromiseHolder<std::shared_ptr<ArrayBuffer>>();
}

} // namespace margelo::nitro::crypto::bridge::swift
Loading

0 comments on commit 9a3a8e8

Please sign in to comment.