Skip to content

Commit 70ca143

Browse files
committed
Ran prettier
1 parent da67ee7 commit 70ca143

File tree

17 files changed

+224
-204
lines changed

17 files changed

+224
-204
lines changed

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge
@@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
1817
Examples of behavior that contributes to a positive environment for our
1918
community include:
2019

21-
* Demonstrating empathy and kindness toward other people
22-
* Being respectful of differing opinions, viewpoints, and experiences
23-
* Giving and gracefully accepting constructive feedback
24-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2524
and learning from the experience
26-
* Focusing on what is best not just for us as individuals, but for the overall
25+
- Focusing on what is best not just for us as individuals, but for the overall
2726
community
2827

2928
Examples of unacceptable behavior include:
3029

31-
* The use of sexualized language or imagery, and sexual attention or advances of
30+
- The use of sexualized language or imagery, and sexual attention or advances of
3231
any kind
33-
* Trolling, insulting or derogatory comments, and personal or political attacks
34-
* Public or private harassment
35-
* Publishing others' private information, such as a physical or email address,
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email address,
3635
without their explicit permission
37-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3837
professional setting
3938

4039
## Enforcement Responsibilities

apps/example-rnta/app.json

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,10 @@
88
}
99
],
1010
"resources": {
11-
"android": [
12-
"dist/res",
13-
"dist/main.android.jsbundle"
14-
],
15-
"ios": [
16-
"dist/assets",
17-
"dist/main.ios.jsbundle"
18-
],
19-
"macos": [
20-
"dist/assets",
21-
"dist/main.macos.jsbundle"
22-
],
23-
"visionos": [
24-
"dist/assets",
25-
"dist/main.visionos.jsbundle"
26-
],
27-
"windows": [
28-
"dist/assets",
29-
"dist/main.windows.bundle"
30-
]
11+
"android": ["dist/res", "dist/main.android.jsbundle"],
12+
"ios": ["dist/assets", "dist/main.ios.jsbundle"],
13+
"macos": ["dist/assets", "dist/main.macos.jsbundle"],
14+
"visionos": ["dist/assets", "dist/main.visionos.jsbundle"],
15+
"windows": ["dist/assets", "dist/main.windows.bundle"]
3116
}
3217
}

apps/example-rnta/metro.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { makeMetroConfig } = require("@rnx-kit/metro-config");
2+
23
module.exports = makeMetroConfig({
34
transformer: {
45
getTransformOptions: async () => ({

docs/HOW-IT-WORKS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# How it works
32

43
This document will outline what happens throughout the various parts of the system, when the app calls the `add` method on the library introduced in the ["usage" document](./USAGE.md).
@@ -51,6 +50,7 @@ If we don't have one for the current `jsi::Runtime` already, one is created, by
5150
## The library's C++ code initialize the `exports` object
5251

5352
An `exports` object is created for the Node-API module and both the `napi_env` and `exports` object is passed to the Node-API module's initialization function and the third party code is able to call the Node-API free functions:
53+
5454
- The engine-specific functions (see [js_native_api.h](https://github.com/nodejs/node/blob/main/src/js_native_api.h)) are implemented by the `jsi::Runtime` (currently only Hermes supports this).
5555
- The runtime-specific functions (see [node_api.h](https://github.com/nodejs/node/blob/main/src/node_api.h)) are implemented by `react-native-node-api-modules`.
5656

docs/PREBUILDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This document will codify the naming and directory structure of prebuilt binaries, expected by the `react-native-node-api-modules` package and tools.
44

5-
To align with prior art and established patterns around the distribution of Node-API modules for Node.js (and other engines supporting this),
5+
To align with prior art and established patterns around the distribution of Node-API modules for Node.js (and other engines supporting this),
66

77
## Apple: XCFrameworks of dynamic libraries in frameworks
88

docs/USAGE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
The purpose of this document is to explain how Node-API modules are supported all the way from an app loading a library package to the library's native code returning a JavaScript value to from a function call.
44

55
For the purpose of the explanation, we'll introduce a two fictitious packages:
6+
67
- `calculator-lib`: A package publishing a Node-API module.
78
- `my-app`: An app depending on `calculator-lib`.
89

@@ -16,12 +17,12 @@ The app developer has to install both `calculator-lib` as well as `react-native-
1617
The reason for the latter is a current limitation of the React Native Community CLI which doesn't consider transitive dependencies when enumerating packages for auto-linking.
1718

1819
> [!WARNING]
19-
> It's important to match the exact version of the `react-native-node-api-modules` declared as peer dependency by `calculator-lib`.
20+
> It's important to match the exact version of the `react-native-node-api-modules` declared as peer dependency by `calculator-lib`.
2021
2122
For the app to resolve the Node-API dynamic library files, the app developer must update their Metro config to use a `resolveRequest` function exported from `react-native-node-api-modules`:
2223

2324
```javascript
24-
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
25+
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
2526
const nodeApi = require("react-native-node-api-modules/metro-config");
2627
module.exports = mergeConfig(getDefaultConfig(__dirname), {
2728
resolver: { resolveRequest: nodeApi.resolveRequest },

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default tseslint.config(
1313
"**/metro-config.js",
1414
"**/react-native.config.js",
1515
"packages/example-cpp-node-api-addon/*.js",
16-
"packages/react-native-node-api-modules/bin/*.js"
16+
"packages/react-native-node-api-modules/bin/*.js",
1717
],
1818
languageOptions: {
1919
parserOptions: {

packages/example-cpp-node-api-addon/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"node-addon-api": "^8.3.1"
2323
},
2424
"binary": {
25-
"napi_versions": [7]
25+
"napi_versions": [
26+
7
27+
]
2628
}
2729
}

packages/example-rust-node-api-addon/.github/workflows/CI.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ name: CI
22
env:
33
DEBUG: napi:*
44
APP_NAME: example-rust-node-api-addon
5-
MACOSX_DEPLOYMENT_TARGET: '10.13'
5+
MACOSX_DEPLOYMENT_TARGET: "10.13"
66
permissions:
77
contents: write
88
id-token: write
9-
'on':
9+
"on":
1010
push:
1111
branches:
1212
- main
1313
tags-ignore:
14-
- '**'
14+
- "**"
1515
paths-ignore:
16-
- '**/*.md'
16+
- "**/*.md"
1717
- LICENSE
18-
- '**/*.gitignore'
18+
- "**/*.gitignore"
1919
- .editorconfig
2020
- docs/**
2121
pull_request: null
@@ -97,7 +97,7 @@ jobs:
9797
if: ${{ matrix.settings.docker }}
9898
with:
9999
image: ${{ matrix.settings.docker }}
100-
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
100+
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build"
101101
run: ${{ matrix.settings.build }}
102102
- name: Build
103103
run: ${{ matrix.settings.build }}
@@ -122,8 +122,8 @@ jobs:
122122
- host: windows-latest
123123
target: x86_64-pc-windows-msvc
124124
node:
125-
- '18'
126-
- '20'
125+
- "18"
126+
- "20"
127127
runs-on: ${{ matrix.settings.host }}
128128
steps:
129129
- uses: actions/checkout@v4
@@ -153,8 +153,8 @@ jobs:
153153
fail-fast: false
154154
matrix:
155155
node:
156-
- '18'
157-
- '20'
156+
- "18"
157+
- "20"
158158
runs-on: ubuntu-latest
159159
steps:
160160
- uses: actions/checkout@v4
@@ -183,8 +183,8 @@ jobs:
183183
fail-fast: false
184184
matrix:
185185
node:
186-
- '18'
187-
- '20'
186+
- "18"
187+
- "20"
188188
runs-on: ubuntu-latest
189189
steps:
190190
- uses: actions/checkout@v4
@@ -210,7 +210,7 @@ jobs:
210210
uses: addnab/docker-run-action@v3
211211
with:
212212
image: node:${{ matrix.node }}-slim
213-
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
213+
options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build"
214214
run: |
215215
set -e
216216
yarn test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodeLinker: node-modules
1+
nodeLinker: node-modules

0 commit comments

Comments
 (0)