Skip to content

Commit fc42445

Browse files
authored
docs: readme (#6)
1 parent 29151c4 commit fc42445

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,58 @@ An embeddable, engine-agnostic NativeScript runtime based on [Node-API](https://
44

55
This library allows any JavaScript engine or runtime that supports Node-API to access native APIs directly from JavaScript. At present, it supports accessing Objective-C APIs (thus most of the iOS and macOS SDKs). We hope to support other native APIs, such as the Java-based Android SDK, in future.
66

7-
## Initializing repo
7+
## Initializing the repo
88

99
The repo makes use of npm [workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces), so installation is straightforward.
1010

1111
```sh
1212
npm install
1313
```
1414

15-
## Generating metadata
15+
## Generating the metadata
1616

1717
```sh
18+
# ① Build the metadata generator.
19+
deno task build-metagen
20+
# Output:
21+
# metadata/build/Release/MetadataGenerator
22+
23+
# ② Generate metadata for iOS.
1824
deno task metagen ios
25+
# Output:
26+
# metadata/metadata.ios.arm64.nsmd
27+
# metadata/metadata.ios.x86_64.nsmd
28+
# packages/ios/types/*.d.ts
29+
30+
# ③ Generate metadata for macOS.
1931
deno task metagen macos
32+
# Output:
33+
# metadata/metadata.macos.arm64.nsmd
34+
# metadata/metadata.macos.x86_64.nsmd
35+
# packages/macos/types/*.d.ts
2036
```
2137

22-
## Building
38+
## Building the runtimes
2339

2440
```sh
41+
# Build the runtime for macOS.
2542
deno task build macos
26-
# or build for iOS
43+
# Output:
44+
# packages/macos/build/macos/Release/libNativeScript.dylib
45+
# packages/macos/dist/macos/NativeScript.node
46+
47+
# Build the runtime for iOS as a universal binary.
2748
deno task build ios-universal
49+
# Output:
50+
# packages/ios/build/ios/Release-iphoneos/NativeScript.framework/NativeScript
51+
# packages/ios/build/ios-sim/Release-iphonesimulator/NativeScript.framework/NativeScript
52+
# packages/ios/dist/ios-universal/NativeScript.xcframework
2853
```
2954

3055
## Run examples
3156

57+
These macOS AppKit examples depend upon having run the "Generating metadata" and "Building the runtimes" for macOS already.
58+
3259
```sh
3360
node examples/foundation.js
3461
# or
@@ -46,7 +73,7 @@ node examples/spritekit.js
4673

4774
## Copyright notice
4875

49-
Copyright [OpenJS Foundation](https://openjsf.org) and `NativeScript` contributors. All rights reserved. The [OpenJS Foundation](https://openjsf.org) has registered trademarks and uses trademarks. For a list of trademarks of the [OpenJS Foundation](https://openjsf.org), please see our [Trademark Policy](https://trademark-policy.openjsf.org/) and [Trademark List](https://trademark-list.openjsf.org/). Trademarks and logos not indicated on the [list of OpenJS Foundation trademarks](https://trademark-list.openjsf.org) are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
76+
Copyright [OpenJS Foundation](https://openjsf.org) and `NativeScript` contributors. All rights reserved. The [OpenJS Foundation](https://openjsf.org) has registered trademarks and uses trademarks. For a list of trademarks of the [OpenJS Foundation](https://openjsf.org), please see our [Trademark Policy](https://trademark-policy.openjsf.org/) and [Trademark List](https://trademark-list.openjsf.org/). Trademarks and logos not indicated on the [list of OpenJS Foundation trademarks](https://trademark-list.openjsf.org) are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
5077

5178
[The OpenJS Foundation](https://openjsf.org/) | [Terms of Use](https://terms-of-use.openjsf.org/) | [Privacy Policy](https://privacy-policy.openjsf.org/) | [OpenJS Foundation Bylaws](https://bylaws.openjsf.org/) | [Trademark Policy](https://trademark-policy.openjsf.org/) | [Trademark List](https://trademark-list.openjsf.org/) | [Cookie Policy](https://www.linuxfoundation.org/cookies/)
5279

0 commit comments

Comments
 (0)