ubrn:clean

This commit is contained in:
EthanShoeDev
2025-09-12 23:12:17 -04:00
parent 4248834707
commit da809ba29d
9 changed files with 4869 additions and 269 deletions

View File

@@ -1,23 +0,0 @@
package com.uniffirussh
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.annotations.ReactModule
@ReactModule(name = UniffiRusshModule.NAME)
class UniffiRusshModule(reactContext: ReactApplicationContext) :
NativeUniffiRusshSpec(reactContext) {
override fun getName(): String {
return NAME
}
// Example method
// See https://reactnative.dev/docs/native-modules-android
override fun multiply(a: Double, b: Double): Double {
return a * b
}
companion object {
const val NAME = "UniffiRussh"
}
}

View File

@@ -1,33 +0,0 @@
package com.uniffirussh
import com.facebook.react.BaseReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import java.util.HashMap
class UniffiRusshPackage : BaseReactPackage() {
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
return if (name == UniffiRusshModule.NAME) {
UniffiRusshModule(reactContext)
} else {
null
}
}
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
return ReactModuleInfoProvider {
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
moduleInfos[UniffiRusshModule.NAME] = ReactModuleInfo(
UniffiRusshModule.NAME,
UniffiRusshModule.NAME,
false, // canOverrideExistingModule
false, // needsEagerInit
false, // isCxxModule
true // isTurboModule
)
moduleInfos
}
}
}

View File

@@ -1,5 +0,0 @@
#import <UniffiRusshSpec/UniffiRusshSpec.h>
@interface UniffiRussh : NSObject <NativeUniffiRusshSpec>
@end

View File

@@ -1,18 +0,0 @@
#import "UniffiRussh.h"
@implementation UniffiRussh
RCT_EXPORT_MODULE()
- (NSNumber *)multiply:(double)a b:(double)b {
NSNumber *result = @(a * b);
return result;
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return std::make_shared<facebook::react::NativeUniffiRusshSpecJSI>(params);
}
@end

View File

@@ -32,7 +32,11 @@
"!**/.*"
],
"scripts": {
"example": "yarn workspace react-native-uniffi-russh-example",
"ubrn:ios": "ubrn build ios --and-generate && (cd example/ios && pod install)",
"ubrn:android": "ubrn build android --and-generate",
"ubrn:web": "ubrn build web",
"ubrn:checkout": "ubrn checkout",
"ubrn:clean": "rm -rfv cpp/ android/CMakeLists.txt android/src/main/java android/*.cpp ios/ src/Native* src/index.*ts* src/generated/",
"test": "jest",
"typecheck": "tsc",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
@@ -63,8 +67,7 @@
"@eslint/compat": "^1.3.2",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.35.0",
"@evilmartians/lefthook": "^1.12.3",
"@react-native-community/cli": "20.0.1",
"@react-native-community/cli": "20.0.2",
"@react-native/babel-preset": "0.81.1",
"@react-native/eslint-config": "^0.81.1",
"@release-it/conventional-changelog": "^10.0.1",
@@ -91,7 +94,7 @@
"workspaces": [
"example"
],
"packageManager": "yarn@3.6.1",
"packageManager": "pnpm@10.15.1",
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
@@ -160,5 +163,8 @@
"languages": "kotlin-objc",
"type": "turbo-module",
"version": "0.54.3"
},
"dependencies": {
"uniffi-bindgen-react-native": "0.29.3-1"
}
}

View File

@@ -1,7 +0,0 @@
import { TurboModuleRegistry, type TurboModule } from 'react-native';
export interface Spec extends TurboModule {
multiply(a: number, b: number): number;
}
export default TurboModuleRegistry.getEnforcing<Spec>('UniffiRussh');

View File

@@ -1,5 +0,0 @@
import UniffiRussh from './NativeUniffiRussh';
export function multiply(a: number, b: number): number {
return UniffiRussh.multiply(a, b);
}

5033
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff