Skip to content

Commit 6faa960

Browse files
shirakabaNathanWalker
authored andcommitted
add publishing/contributing instructions
1 parent 81699f3 commit 6faa960

File tree

5 files changed

+68
-6
lines changed

5 files changed

+68
-6
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
> [!NOTE]
2+
> The instructions below detail how to get started developing NativeScript's V8-based iOS runtime, `@nativescript/ios`.
3+
>
4+
> If you are interested in building the standalone Node-API libraries, instructions for those can be found as follows:
5+
>
6+
> - `@nativescript/ios-node-api`: [packages/ios/README.md](packages/ios/README.md)
7+
> - `@nativescript/macos-node-api`: [packages/macos/README.md](packages/macos/README.md)
8+
19
# Getting Started
210

311
**Prerequisites**:

packages/ios/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,32 @@ Next, embed the xcframework provided at `build/ios-universal/NativeScript.xcfram
1616

1717
## Usage
1818

19-
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).
19+
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).
20+
21+
## Contributing
22+
23+
To build `@nativescript/ios-node-api` for yourself:
24+
25+
```sh
26+
git clone [email protected]:NativeScript/napi-ios.git
27+
cd napi-ios
28+
npm install
29+
30+
# This script does the following:
31+
# 1. Builds the metadata generator, which consists of the following steps:
32+
# - Download LLVM
33+
# - Inside ./metadata-generator, run cmake to produce:
34+
# - ./metadata-generator/dist/arm64/bin/objc-metadata-generator
35+
# - ./metadata-generator/dist/x86_64/bin/objc-metadata-generator
36+
# 2. Generates metadata for iOS and macOS:
37+
# - ./metadata-generator/metadata/metadata.ios.arm64.{h,nsmd}
38+
# - ./metadata-generator/metadata/metadata.ios-sim.{arm64,x86_64}.{h,nsmd}
39+
# - ./metadata-generator/metadata/metadata.macos.{arm64,x86_64}.{h,nsmd}
40+
# 3. Builds the NativeScript iOS XCFramework:
41+
# - ./packages/ios/build/RelWithDebInfo/NativeScript.apple.node
42+
# 4. Builds the NativeScript macOS XCFramework:
43+
# - ./packages/macos/build/RelWithDebInfo/NativeScript.apple.node
44+
./build_all_react_native.sh
45+
```
46+
47+
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.

packages/ios/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
"types"
1616
],
1717
"scripts": {
18-
"build": "deno task build",
19-
"prepublishOnly": "rimraf build && npm run build"
18+
"build": "cd ../.. && ./build_all_react_native.sh"
2019
},
2120
"keywords": [
2221
"iOS",

packages/macos/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,32 @@ npm install @nativescript/macos-node-api
1010

1111
## Usage
1212

13-
See [examples](https://github.com/NativeScript/runtime-node-api/tree/main/examples) in the repo. Best run on Node.js for now.
13+
See [examples](https://github.com/NativeScript/runtime-node-api/tree/main/examples) in the repo. Best run on Node.js for now.
14+
15+
## Contributing
16+
17+
To build `@nativescript/macos-node-api` for yourself:
18+
19+
```sh
20+
git clone [email protected]:NativeScript/napi-ios.git
21+
cd napi-ios
22+
npm install
23+
24+
# This script does the following:
25+
# 1. Builds the metadata generator, which consists of the following steps:
26+
# - Download LLVM
27+
# - Inside ./metadata-generator, run cmake to produce:
28+
# - ./metadata-generator/dist/arm64/bin/objc-metadata-generator
29+
# - ./metadata-generator/dist/x86_64/bin/objc-metadata-generator
30+
# 2. Generates metadata for iOS and macOS:
31+
# - ./metadata-generator/metadata/metadata.ios.arm64.{h,nsmd}
32+
# - ./metadata-generator/metadata/metadata.ios-sim.{arm64,x86_64}.{h,nsmd}
33+
# - ./metadata-generator/metadata/metadata.macos.{arm64,x86_64}.{h,nsmd}
34+
# 3. Builds the NativeScript iOS XCFramework:
35+
# - ./packages/ios/build/RelWithDebInfo/NativeScript.apple.node
36+
# 4. Builds the NativeScript macOS XCFramework:
37+
# - ./packages/macos/build/RelWithDebInfo/NativeScript.apple.node
38+
./build_all_react_native.sh
39+
```
40+
41+
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.

packages/macos/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
],
1818
"scripts": {
1919
"test": "node ../../examples/foundation.js",
20-
"build": "deno task build",
21-
"prepublishOnly": "npx rimraf build && npm run build"
20+
"build": "cd ../.. && ./build_all_react_native.sh"
2221
},
2322
"keywords": [
2423
"AppKit",

0 commit comments

Comments
 (0)