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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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**:
Expand Down
30 changes: 29 additions & 1 deletion packages/ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
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.
5 changes: 2 additions & 3 deletions packages/ios/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
30 changes: 29 additions & 1 deletion packages/macos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
5 changes: 2 additions & 3 deletions packages/macos/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
Loading