From d799df919fec554c4e748bb504d6df0658bce31e Mon Sep 17 00:00:00 2001 From: Jamie Birch <14055146+shirakaba@users.noreply.github.com> Date: Sun, 12 Oct 2025 01:11:27 +0900 Subject: [PATCH 1/2] add publishing/contributing instructions --- README.md | 8 ++++++++ packages/ios/README.md | 30 +++++++++++++++++++++++++++++- packages/ios/package.json | 3 +-- packages/macos/README.md | 30 +++++++++++++++++++++++++++++- packages/macos/package.json | 3 +-- 5 files changed, 68 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5b61081c..427e5103 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +> [!NOTE] +> The instructions below detail how to get started developing NativeScript's V8-based iOS runtime, `@nativescript/ios`. +> +> If you are interested in building the standalone Node-API libraries, instructions for those can be found as follows: +> +> - `@nativescript/ios-node-api`: [packages/ios/README.md](packages/ios/README.md) +> - `@nativescript/macos-node-api`: [packages/macos/README.md](packages/macos/README.md) + # Getting Started **Prerequisites**: diff --git a/packages/ios/README.md b/packages/ios/README.md index bd2f39a8..7371e009 100644 --- a/packages/ios/README.md +++ b/packages/ios/README.md @@ -16,4 +16,32 @@ Next, embed the xcframework provided at `build/ios-universal/NativeScript.xcfram ## Usage -Until we have some example projects to provide, a few example usages in an Expo app are shown in this [tweet](https://x.com/birch_js/status/1773401773266604240). \ No newline at end of file +Until we have some example projects to provide, a few example usages in an Expo app are shown in this [tweet](https://x.com/birch_js/status/1773401773266604240). + +## Contributing + +To build `@nativescript/ios-node-api` for yourself: + +```sh +git clone git@github.com:NativeScript/napi-ios.git +cd napi-ios +npm install + +# This script does the following: +# 1. Builds the metadata generator, which consists of the following steps: +# - Download LLVM +# - Inside ./metadata-generator, run cmake to produce: +# - ./metadata-generator/dist/arm64/bin/objc-metadata-generator +# - ./metadata-generator/dist/x86_64/bin/objc-metadata-generator +# 2. Generates metadata for iOS and macOS: +# - ./metadata-generator/metadata/metadata.ios.arm64.{h,nsmd} +# - ./metadata-generator/metadata/metadata.ios-sim.{arm64,x86_64}.{h,nsmd} +# - ./metadata-generator/metadata/metadata.macos.{arm64,x86_64}.{h,nsmd} +# 3. Builds the NativeScript iOS XCFramework: +# - ./packages/ios/build/RelWithDebInfo/NativeScript.apple.node +# 4. Builds the NativeScript macOS XCFramework: +# - ./packages/macos/build/RelWithDebInfo/NativeScript.apple.node +./build_all_react_native.sh +``` + +Currently, we are following a convention of committing most, if not all, of these build files to source, so you may find that it's ready set up to begin with. \ No newline at end of file diff --git a/packages/ios/package.json b/packages/ios/package.json index e0de7f3d..9290dbfd 100644 --- a/packages/ios/package.json +++ b/packages/ios/package.json @@ -15,8 +15,7 @@ "types" ], "scripts": { - "build": "deno task build", - "prepublishOnly": "rimraf build && npm run build" + "build": "cd ../.. && ./build_all_react_native.sh" }, "keywords": [ "iOS", diff --git a/packages/macos/README.md b/packages/macos/README.md index 4afaa365..9f999080 100644 --- a/packages/macos/README.md +++ b/packages/macos/README.md @@ -10,4 +10,32 @@ npm install @nativescript/macos-node-api ## Usage -See [examples](https://github.com/NativeScript/runtime-node-api/tree/main/examples) in the repo. Best run on Node.js for now. \ No newline at end of file +See [examples](https://github.com/NativeScript/runtime-node-api/tree/main/examples) in the repo. Best run on Node.js for now. + +## Contributing + +To build `@nativescript/macos-node-api` for yourself: + +```sh +git clone git@github.com:NativeScript/napi-ios.git +cd napi-ios +npm install + +# This script does the following: +# 1. Builds the metadata generator, which consists of the following steps: +# - Download LLVM +# - Inside ./metadata-generator, run cmake to produce: +# - ./metadata-generator/dist/arm64/bin/objc-metadata-generator +# - ./metadata-generator/dist/x86_64/bin/objc-metadata-generator +# 2. Generates metadata for iOS and macOS: +# - ./metadata-generator/metadata/metadata.ios.arm64.{h,nsmd} +# - ./metadata-generator/metadata/metadata.ios-sim.{arm64,x86_64}.{h,nsmd} +# - ./metadata-generator/metadata/metadata.macos.{arm64,x86_64}.{h,nsmd} +# 3. Builds the NativeScript iOS XCFramework: +# - ./packages/ios/build/RelWithDebInfo/NativeScript.apple.node +# 4. Builds the NativeScript macOS XCFramework: +# - ./packages/macos/build/RelWithDebInfo/NativeScript.apple.node +./build_all_react_native.sh +``` + +Currently, we are following a convention of committing most, if not all, of these build files to source, so you may find that it's ready set up to begin with. diff --git a/packages/macos/package.json b/packages/macos/package.json index 49d75507..99b606ff 100644 --- a/packages/macos/package.json +++ b/packages/macos/package.json @@ -17,8 +17,7 @@ ], "scripts": { "test": "node ../../examples/foundation.js", - "build": "deno task build", - "prepublishOnly": "npx rimraf build && npm run build" + "build": "cd ../.. && ./build_all_react_native.sh" }, "keywords": [ "AppKit", From 4ba799a808f7d9b1808328875a6ef52bea44fabb Mon Sep 17 00:00:00 2001 From: Jamie Birch <14055146+shirakaba@users.noreply.github.com> Date: Sun, 12 Oct 2025 01:11:32 +0900 Subject: [PATCH 2/2] bump to 0.2.0 --- packages/ios/package.json | 2 +- packages/macos/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ios/package.json b/packages/ios/package.json index 9290dbfd..3a08e961 100644 --- a/packages/ios/package.json +++ b/packages/ios/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/ios-node-api", - "version": "0.1.1", + "version": "0.2.0", "description": "An embeddable, engine-agnostic NativeScript runtime for iOS based on Node-API", "repository": { "type": "git", diff --git a/packages/macos/package.json b/packages/macos/package.json index 99b606ff..f5861236 100644 --- a/packages/macos/package.json +++ b/packages/macos/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/macos-node-api", - "version": "0.1.4", + "version": "0.2.0", "description": "An embeddable, engine-agnostic NativeScript runtime for macOS based on Node-API", "repository": { "type": "git",