Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store

node_modules/
dist/

Expand Down
1 change: 0 additions & 1 deletion apps/test-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.hprof
*.xcworkspace/
*.zip
.DS_Store
.gradle/
.idea/
.vs/
Expand Down
200 changes: 199 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/node-addon-examples/scripts/build-examples.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ for (const projectDirectory of projectDirectories) {
cwd: projectDirectory,
stdio: "inherit",
});
console.log();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Is this empty call on purpose or accidental leftover?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-04-26 at 19 35 07

On purpose - I wanted a bit of space to separate the executions 🙂

}
5 changes: 4 additions & 1 deletion packages/react-native-node-api-cmake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
},
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
"bufout": "^0.3.1",
"chalk": "^5.4.1",
"cmake-js": "^7.3.1",
"commander": "^13.1.0"
"commander": "^13.1.0",
"ora": "^8.2.0"
},
"peerDependencies": {
"node-addon-api": "^8.3.1",
Expand Down
11 changes: 4 additions & 7 deletions packages/react-native-node-api-cmake/src/apple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fs from "node:fs";
import path from "node:path";

import type { SupportedTriplet } from "./triplets.js";
import { spawn } from "bufout";

export const APPLE_TRIPLETS = [
"arm64;x86_64-apple-darwin",
Expand Down Expand Up @@ -123,7 +124,6 @@ export function getAppleBuildArgs() {
}

type XCframeworkOptions = {
libraryPaths: string[];
frameworkPaths: string[];
outputPath: string;
};
Expand Down Expand Up @@ -168,8 +168,7 @@ export function createFramework(libraryPath: string) {
return frameworkPath;
}

export function createXCframework({
libraryPaths,
export async function createXCframework({
frameworkPaths,
outputPath,
}: XCframeworkOptions) {
Expand All @@ -178,20 +177,18 @@ export function createXCframework({
// Ideally, it would only be necessary to delete the specific platform+arch, to allow selectively building from source.
fs.rmSync(outputPath, { recursive: true, force: true });

const { status } = cp.spawnSync(
await spawn(
"xcodebuild",
[
"-create-xcframework",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Is there a real use-case for using -library PATH in -create-xcframework? While it will work on both simulator and iOS device, it will be rejected during App Store review if the dylib won't be wrapped into a framework

Copy link
Collaborator Author

@kraenhansen kraenhansen Apr 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - I'll remove that. It was likely a leftover from my copying out of this file 😬

...libraryPaths.flatMap((p) => ["-library", p]),
...frameworkPaths.flatMap((p) => ["-framework", p]),
"-output",
outputPath,
],
{
stdio: "inherit",
outputMode: "buffered",
}
);
assert.equal(status, 0, "Failed to create xcframework");
// Write a file to mark the xcframework is a Node-API module
// TODO: Consider including this in the Info.plist file instead
fs.writeFileSync(
Expand Down
Loading