diff --git a/README.md b/README.md index 5b61081..427e510 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 bd2f39a..7371e00 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 e0de7f3..3a08e96 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", @@ -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 4afaa36..9f99908 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 49d7550..f586123 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", @@ -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",