@@ -6,9 +6,14 @@ import {
66 isAndroidTriplet ,
77 isAppleTriplet ,
88 SupportedTriplet ,
9- weakNodeApiPath ,
109} from "react-native-node-api" ;
1110
11+ import {
12+ applePrebuildPath ,
13+ androidPrebuildPath ,
14+ weakNodeApiCmakePath ,
15+ } from "weak-node-api" ;
16+
1217import { ANDROID_ARCHITECTURES } from "./platforms/android.js" ;
1318import { getNodeAddonHeadersPath , getNodeApiHeadersPath } from "./headers.js" ;
1419
@@ -20,19 +25,14 @@ export function getWeakNodeApiPath(
2025 triplet : SupportedTriplet | "apple" ,
2126) : string {
2227 if ( triplet === "apple" || isAppleTriplet ( triplet ) ) {
23- const xcframeworkPath = path . join (
24- weakNodeApiPath ,
25- "weak-node-api.xcframework" ,
26- ) ;
2728 assert (
28- fs . existsSync ( xcframeworkPath ) ,
29- `Expected an XCFramework at ${ xcframeworkPath } ` ,
29+ fs . existsSync ( applePrebuildPath ) ,
30+ `Expected an XCFramework at ${ applePrebuildPath } ` ,
3031 ) ;
31- return xcframeworkPath ;
32+ return applePrebuildPath ;
3233 } else if ( isAndroidTriplet ( triplet ) ) {
3334 const libraryPath = path . join (
34- weakNodeApiPath ,
35- "weak-node-api.android.node" ,
35+ androidPrebuildPath ,
3636 ANDROID_ARCHITECTURES [ triplet ] ,
3737 "libweak-node-api.so" ,
3838 ) ;
@@ -59,7 +59,7 @@ export function getWeakNodeApiVariables(
5959) : Record < string , string > {
6060 return {
6161 // Expose an includable CMake config file declaring the weak-node-api target
62- WEAK_NODE_API_CONFIG : path . join ( weakNodeApiPath , "weak-node-api.cmake" ) ,
62+ WEAK_NODE_API_CONFIG : weakNodeApiCmakePath ,
6363 WEAK_NODE_API_INC : getNodeApiIncludePaths ( ) . join ( ";" ) ,
6464 WEAK_NODE_API_LIB : getWeakNodeApiPath ( triplet ) ,
6565 } ;
0 commit comments