File tree Expand file tree Collapse file tree 4 files changed +9
-15
lines changed
react-native-node-api-modules/src/node Expand file tree Collapse file tree 4 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ Cargo.lock
55/* .android.node /
66
77# Generated files
8- /libferric_example .d.ts
9- /libferric_example .js
8+ /ferric_example .d.ts
9+ /ferric_example .js
Original file line number Diff line number Diff line change 11{
22 "name" : " ferric-example" ,
33 "version" : " 0.1.0" ,
4- "main" : " libferric_example .js" ,
5- "types" : " libferric_example .d.ts" ,
4+ "main" : " ferric_example .js" ,
5+ "types" : " ferric_example .d.ts" ,
66 "scripts" : {
77 "build" : " ferric build --android --apple"
88 },
Original file line number Diff line number Diff line change @@ -313,7 +313,8 @@ export function findNodeApiModulePathsByDependency({
313313 */
314314export function determineLibraryFilename ( libraryPaths : string [ ] ) {
315315 const libraryNames = libraryPaths . map ( ( p ) =>
316- path . basename ( p , path . extname ( p ) )
316+ // Strip the "lib" prefix and any file extension
317+ path . basename ( p , path . extname ( p ) ) . replace ( / ^ l i b / , "" )
317318 ) ;
318319 const candidates = new Set < string > ( libraryNames ) ;
319320 assert ( candidates . size === 1 , "Expected all libraries to have the same name" ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import cp from "node:child_process";
66
77import { spawn } from "bufout" ;
88
9- import { AppleTriplet } from "react-native-node-api-modules" ;
9+ import { AppleTriplet } from "./triplets.js" ;
10+ import { determineLibraryFilename } from "../path-utils.js" ;
1011
1112type AppleArchitecture = "arm64" | "x86_64" | "arm64;x86_64" ;
1213
@@ -122,15 +123,7 @@ export async function createXCframework({
122123 * Ensuring that all framework paths have the same base name.
123124 */
124125export function determineXCFrameworkFilename ( frameworkPaths : string [ ] ) {
125- const frameworkNames = frameworkPaths . map ( ( p ) =>
126- path . basename ( p , path . extname ( p ) )
127- ) ;
128- const candidates = new Set < string > ( frameworkNames ) ;
129- assert (
130- candidates . size === 1 ,
131- "Expected all frameworks to have the same name"
132- ) ;
133- const [ name ] = candidates ;
126+ const name = determineLibraryFilename ( frameworkPaths ) ;
134127 return `${ name } .xcframework` ;
135128}
136129
You can’t perform that action at this time.
0 commit comments