mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-11 14:22:51 +00:00
ubrn:clean
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#import <UniffiRusshSpec/UniffiRusshSpec.h>
|
||||
|
||||
@interface UniffiRussh : NSObject <NativeUniffiRusshSpec>
|
||||
|
||||
@end
|
||||
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
@@ -1,5 +0,0 @@
|
||||
import UniffiRussh from './NativeUniffiRussh';
|
||||
|
||||
export function multiply(a: number, b: number): number {
|
||||
return UniffiRussh.multiply(a, b);
|
||||
}
|
||||
0
packages/react-native-uniffi-russh/ubrn.config.yaml
Normal file
0
packages/react-native-uniffi-russh/ubrn.config.yaml
Normal file
Reference in New Issue
Block a user