@@ -15,9 +15,7 @@ import {
1515 isAppleTarget ,
1616} from "./targets.js" ;
1717
18- const WEAK_NODE_API_PATH = fileURLToPath (
19- import . meta. resolve ( "react-native-node-api/weak-node-api" )
20- ) ;
18+ import { weakNodeApiPath } from "react-native-node-api" ;
2119
2220const APPLE_XCFRAMEWORK_CHILDS_PER_TARGET : Record < AppleTargetName , string > = {
2321 "aarch64-apple-darwin" : "macos-arm64_x86_64" , // Universal
@@ -126,18 +124,16 @@ export function getTargetAndroidPlatform(target: AndroidTargetName) {
126124}
127125
128126export function getWeakNodeApiFrameworkPath ( target : AppleTargetName ) {
129- assert ( fs . existsSync ( WEAK_NODE_API_PATH ) , "Expected weak-node-api to exist" ) ;
130127 return joinPathAndAssertExistence (
131- WEAK_NODE_API_PATH ,
128+ weakNodeApiPath ,
132129 "weak-node-api.xcframework" ,
133130 APPLE_XCFRAMEWORK_CHILDS_PER_TARGET [ target ]
134131 ) ;
135132}
136133
137134export function getWeakNodeApiAndroidLibraryPath ( target : AndroidTargetName ) {
138- assert ( fs . existsSync ( WEAK_NODE_API_PATH ) , "Expected weak-node-api to exist" ) ;
139135 return joinPathAndAssertExistence (
140- WEAK_NODE_API_PATH ,
136+ weakNodeApiPath ,
141137 "weak-node-api.android.node" ,
142138 ANDROID_ARCH_PR_TARGET [ target ]
143139 ) ;
@@ -202,7 +198,10 @@ export function getTargetEnvironmentVariables({
202198 toolchainBinPath ,
203199 `${ targetArch } -linux-${ targetPlatform } -clang++${ cmdMaybe } `
204200 ) ,
205- TARGET_AR : joinPathAndAssertExistence ( toolchainBinPath , `llvm-ar${ exeMaybe } ` ) ,
201+ TARGET_AR : joinPathAndAssertExistence (
202+ toolchainBinPath ,
203+ `llvm-ar${ exeMaybe } `
204+ ) ,
206205 TARGET_RANLIB : joinPathAndAssertExistence (
207206 toolchainBinPath ,
208207 `llvm-ranlib${ exeMaybe } `
0 commit comments