diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index bc9a8dbc..c9708b2e 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -28,7 +28,7 @@ jobs:
node-version: lts/jod
- run: npm ci
- run: npm run build
- - run: npm test --workspace gyp-to-cmake --workspace react-native-node-api-cmake --workspace react-native-node-api-modules
+ - run: npm test --workspace gyp-to-cmake --workspace cmake-rn --workspace react-native-node-api
test-windows:
name: Run tests on Windows
runs-on: windows-latest
@@ -39,7 +39,7 @@ jobs:
node-version: lts/jod
- run: npm ci
- run: npm run build
- - run: npm test --workspace gyp-to-cmake --workspace react-native-node-api-cmake --workspace react-native-node-api-modules
+ - run: npm test --workspace gyp-to-cmake --workspace cmake-rn --workspace react-native-node-api
test-macos:
name: Run tests which requires MacOS
@@ -56,11 +56,11 @@ jobs:
distribution: "temurin"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- # Version here should match the one in React Native template and packages/react-native-node-api-cmake/src/cli.ts
+ # Version here should match the one in React Native template and packages/cmake-rn/src/cli.ts
- run: sdkmanager --install "ndk;27.1.12297006"
- run: npm ci
- run: npm run build
- - run: npm run copy-node-api-headers --workspace react-native-node-api-modules
- - run: npm run build-weak-node-api --workspace react-native-node-api-modules
- - run: npm run generate-weak-node-api-injector --workspace react-native-node-api-modules
- - run: npm test --workspace react-native-node-addon-examples
+ - run: npm run copy-node-api-headers --workspace react-native-node-api
+ - run: npm run build-weak-node-api --workspace react-native-node-api
+ - run: npm run generate-weak-node-api-injector --workspace react-native-node-api
+ - run: npm test --workspace @react-native-node-api/node-addon-examples
diff --git a/README.md b/README.md
index b6f0eff4..141a766f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
-
@@ -32,7 +31,7 @@ See the document on ["how it works"](./docs/HOW_IT_WORKS.md) for a detailed desc
This mono-repository hosts the development of a few packages:
-### `packages/react-native-node-api-modules`
+### `packages/react-native-node-api`
Responsible for adding Node-API support to your React Native application:
@@ -49,7 +48,7 @@ Responsible for adding Node-API support to your React Native application:
Note: We'll sometimes refer to this as the "host package", as it can be seen as a host of Node-API modules in React Native apps.
-### `packages/react-native-node-api-cmake`
+### `packages/cmake-rn`
A wrapper around CMake making it easier to produce [prebuilt binaries](./docs/PREBUILDS.md) targeting iOS and Android matching the [the prebuilt binary specification](./docs/PREBUILDS.md).
@@ -57,11 +56,11 @@ Serves the same purpose as `cmake-js` does for the Node.js community and could p
### `packages/gyp-to-cmake`
-A tool to transform `binding.gyp` files into `CMakeLists.txt` files, intended for `cmake-js` or `react-native-node-api-cmake` to build from.
+A tool to transform `binding.gyp` files into `CMakeLists.txt` files, intended for `cmake-js` or `cmake-rn` to build from.
### `packages/node-addon-examples`
-A wrapper around the examples in the [nodejs/node-addon-examples](https://github.com/nodejs/node-addon-examples) repo, using `gyp-to-cmake` and `react-native-node-api-cmake` to prepare prebuilds and scaffolding for loading the addons.
+A wrapper around the examples in the [nodejs/node-addon-examples](https://github.com/nodejs/node-addon-examples) repo, using `gyp-to-cmake` and `cmake-rn` to prepare prebuilds and scaffolding for loading the addons.
The main purpose is to use these as tests to verify the implementation. We choose to use this as our first signal for compliance, over the [js-native-api tests in the Node.js project](https://github.com/nodejs/node/tree/main/test/js-native-api), because the examples depends much less on Node.js built-in runtime APIs.
diff --git a/apps/test-app/.gitignore b/apps/test-app/.gitignore
index 4550bc8f..7e43539a 100644
--- a/apps/test-app/.gitignore
+++ b/apps/test-app/.gitignore
@@ -11,7 +11,7 @@ build/
local.properties
msbuild.binlog
-# Ignoring the Podfile.lock as the `react-native-node-api-modules` hash updates too frequently
+# Ignoring the Podfile.lock as the `react-native-node-api` hash updates too frequently
Podfile.lock
hermes/
diff --git a/apps/test-app/App.tsx b/apps/test-app/App.tsx
index 59125577..a1aad6be 100644
--- a/apps/test-app/App.tsx
+++ b/apps/test-app/App.tsx
@@ -3,7 +3,7 @@ import { StyleSheet, Text, View, Button } from "react-native";
/* eslint-disable @typescript-eslint/no-require-imports -- We're using require to defer crashes */
-// import { requireNodeAddon } from "react-native-node-api-modules";
+// import { requireNodeAddon } from "react-native-node-api";
import nodeAddonExamples from "react-native-node-addon-examples";
// import * as ferricExample from "ferric-example";
diff --git a/apps/test-app/babel.config.js b/apps/test-app/babel.config.js
index f412b4d6..175e8359 100644
--- a/apps/test-app/babel.config.js
+++ b/apps/test-app/babel.config.js
@@ -1,5 +1,5 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
- // plugins: [['module:react-native-node-api-modules/babel-plugin', { stripPathSuffix: true }]],
- plugins: ['module:react-native-node-api-modules/babel-plugin'],
+ // plugins: [['module:react-native-node-api/babel-plugin', { stripPathSuffix: true }]],
+ plugins: ['module:react-native-node-api/babel-plugin'],
};
diff --git a/apps/test-app/package.json b/apps/test-app/package.json
index ef798be8..9fd3df7c 100644
--- a/apps/test-app/package.json
+++ b/apps/test-app/package.json
@@ -25,7 +25,7 @@
"react": "19.0.0",
"react-native": "0.79.1",
"react-native-node-addon-examples": "*",
- "react-native-node-api-modules": "*",
+ "react-native-node-api": "*",
"react-native-test-app": "^4.3.3"
}
}
diff --git a/apps/test-app/react-native.config.js b/apps/test-app/react-native.config.js
index fd9a56d8..e15e25b5 100644
--- a/apps/test-app/react-native.config.js
+++ b/apps/test-app/react-native.config.js
@@ -12,7 +12,7 @@ const project = (() => {
},
// windows: {
// sourceDir: "windows",
- // solutionFile: "windows/react-native-node-api-modules-example.sln",
+ // solutionFile: "windows/react-native-node-api-example.sln",
// },
});
return {
diff --git a/docs/ANDROID.md b/docs/ANDROID.md
index 2ddca25f..d946cf29 100644
--- a/docs/ANDROID.md
+++ b/docs/ANDROID.md
@@ -5,7 +5,7 @@
Because we're using a version of Hermes patched with Node-API support, we need to build React Native from source.
```
-export REACT_NATIVE_OVERRIDE_HERMES_DIR=`npx react-native-node-api-modules vendor-hermes --silent`
+export REACT_NATIVE_OVERRIDE_HERMES_DIR=`npx react-native-node-api vendor-hermes --silent`
```
## Cleaning your React Native build folders
diff --git a/docs/AUTO-LINKING.md b/docs/AUTO-LINKING.md
index 5cfdb3fc..ed757f1e 100644
--- a/docs/AUTO-LINKING.md
+++ b/docs/AUTO-LINKING.md
@@ -1,6 +1,6 @@
# Auto-linking
-The `react-native-node-api-modules` package (sometimes referred to as "the host package") has mechanisms to automatically find and link prebuilt binaries with Node-API modules.
+The `react-native-node-api` package (sometimes referred to as "the host package") has mechanisms to automatically find and link prebuilt binaries with Node-API modules.
When auto-linking, prebuilt binaries are copied (sometimes referred to as vendored) from dependencies of the app into the host package. As they're copied, they get renamed to avoid conflicts in naming as the library files across multiple dependency packages will be sharing a namespace when building the app.
@@ -15,12 +15,12 @@ The name of the library when linked / copied into the host is based on two thing
## How do I link Node-API module libraries into my app?
-Linking will run when you `pod install` and as part of building your app with Gradle as long as your app has a dependency on the `react-native-node-api-modules` package.
+Linking will run when you `pod install` and as part of building your app with Gradle as long as your app has a dependency on the `react-native-node-api` package.
You can also manually link by running the following in your app directory:
```bash
-npx react-native-node-api-modules link --android --apple
+npx react-native-node-api link --android --apple
```
> [!NOTE]
diff --git a/docs/CLI.md b/docs/CLI.md
index 96355027..9156480f 100644
--- a/docs/CLI.md
+++ b/docs/CLI.md
@@ -1,3 +1,3 @@
-# The `react-native-node-api-modules` command-line interface (CLI)
+# The `react-native-node-api` command-line interface (CLI)
diff --git a/docs/HOW-IT-WORKS.md b/docs/HOW-IT-WORKS.md
index 8c1ffc0f..25b4123f 100644
--- a/docs/HOW-IT-WORKS.md
+++ b/docs/HOW-IT-WORKS.md
@@ -15,12 +15,12 @@ The library has a require call to a `.node` file, which would normally not have
module.exports = require("./prebuild.node");
```
-Since the app developer has added the `react-native-node-api-modules/babel-plugin` to their Babel configuration, the require statement gets transformed when the app is being bundled by Metro, into a `requireNodeAddon` call on our TurboModule.
+Since the app developer has added the `react-native-node-api/babel-plugin` to their Babel configuration, the require statement gets transformed when the app is being bundled by Metro, into a `requireNodeAddon` call on our TurboModule.
The generated code looks something like this:
```javascript
-module.exports = require("react-native-node-api-modules").requireNodeAddon(
+module.exports = require("react-native-node-api").requireNodeAddon(
"calculator-lib--prebuild"
);
```
@@ -37,13 +37,13 @@ In Node.js dynamic libraries sharing names can be disambiguated based off their
To work around this issue, we scan for and copy any library (including its entire xcframework structure with nested framework directories) from the dependency package into our host package when the app builds and reference these from its podspec (as vendored_frameworks). We use a special file in the xcframeworks containing Node-API modules. To avoid collisions we rename xcframework, framework and library files to a unique name, containing a hash. The hash is computed based off the package-name of the containing package and the relative path from the package root to the library file (with any platform specific file extensions replaced with the neutral ".node" extension).
-## Transformed code calls into `react-native-node-api-modules`, loading the platform specific dynamic library
+## Transformed code calls into `react-native-node-api`, loading the platform specific dynamic library
The native implementation of `requireNodeAddon` is responsible for loading the dynamic library and allow the Node-API module to register its initialization function, either by exporting a `napi_register_module_v1` function or by calling the (deprecated) `napi_module_register` function.
In any case the native code stores the initialization function in a data-structure.
-## `react-native-node-api-modules` creates a `node_env` and initialize the Node-API module
+## `react-native-node-api` creates a `node_env` and initialize the Node-API module
The initialization function of a Node-API module expects a `node_env`, which we create by calling `createNodeApiEnv` on the `jsi::Runtime`.
@@ -52,11 +52,11 @@ The initialization function of a Node-API module expects a `node_env`, which we
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:
- 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).
-- 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`.
+- 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`.
## `my-app` regain control and call `add`
-When the `exports` object is populated by `calculator-lib`'s Node-API module, control is returned to `react-native-node-api-modules` which returns the `exports` object to JavaScript, with the `add` function defined on it.
+When the `exports` object is populated by `calculator-lib`'s Node-API module, control is returned to `react-native-node-api` which returns the `exports` object to JavaScript, with the `add` function defined on it.
```javascript
import { add } from "calculator-lib";
diff --git a/docs/PREBUILDS.md b/docs/PREBUILDS.md
index 4930ac91..5f057953 100644
--- a/docs/PREBUILDS.md
+++ b/docs/PREBUILDS.md
@@ -2,7 +2,7 @@
This document codifies the naming and directory structure of prebuilt binaries, expected by the auto-linking mechanism.
-At the time of writing, our auto-linking host package (`react-native-node-api-modules`) support two kinds of prebuilds:
+At the time of writing, our auto-linking host package (`react-native-node-api`) support two kinds of prebuilds:
## `*.android.node` (for Android)
@@ -17,7 +17,7 @@ The name of all the `.so` library files:
> [!NOTE]
> The `SONAME` doesn't have to match and is not updated as the .so is copied into the host package.
> This might cause trouble if you're trying to link with the library from other native code.
-> We're tracking [#14](https://github.com/callstackincubator/react-native-node-api-modules/issues/14) to fix this 🤞
+> We're tracking [#14](https://github.com/callstackincubator/react-native-node-api/issues/14) to fix this 🤞
The directory must have a `react-native-node-api-module` file (the content doesn't matter), to signal that the directory is intended for auto-linking by the `react-native-node-api-module` package.
diff --git a/docs/USAGE.md b/docs/USAGE.md
index 841212ef..e09cf4d1 100644
--- a/docs/USAGE.md
+++ b/docs/USAGE.md
@@ -3,26 +3,27 @@
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.
For the purpose of the explanation, we'll introduce a two fictitious packages:
+
- `calculator-lib`: A package publishing a Node-API module.
- `my-app`: An app depending on `calculator-lib`.
## Steps needed for the app developer
```bash
-npm install --save calculator-lib react-native-node-api-modules
+npm install --save calculator-lib react-native-node-api
```
-The app developer has to install both `calculator-lib` as well as `react-native-node-api-modules`.
+The app developer has to install both `calculator-lib` as well as `react-native-node-api`.
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.
> [!WARNING]
-> It's important to match the exact version of the `react-native-node-api-modules` declared as peer dependency by `calculator-lib`.
+> It's important to match the exact version of the `react-native-node-api` declared as peer dependency by `calculator-lib`.
-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`:
+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`:
```javascript
-const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
-const nodeApi = require("react-native-node-api-modules/metro-config");
+const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
+const nodeApi = require("react-native-node-api/metro-config");
module.exports = mergeConfig(getDefaultConfig(__dirname), {
resolver: { resolveRequest: nodeApi.resolveRequest },
});
@@ -39,17 +40,17 @@ We will be implementing this `add` function.
## Steps needed for the author of the `calculator-lib` library
-### Install `react-native-node-api-modules` as a dev-dependency and declare a peer dependency
+### Install `react-native-node-api` as a dev-dependency and declare a peer dependency
```bash
-npm install react-native-node-api-modules --save-dev --save-exact
+npm install react-native-node-api --save-dev --save-exact
```
Update the package.json of your library to add a peer dependency on the package as well:
```bash
# Update the command to use the exact version you installed as dev-dependency
-npm pkg set peerDependencies.react-native-node-api-modules=1.2.3
+npm pkg set peerDependencies.react-native-node-api=1.2.3
```
### Implement native code
@@ -123,7 +124,7 @@ NAPI_MODULE_INIT(/* napi_env env, napi_value exports */) {
### Build the prebuilt binaries
```
-npx react-native-node-api-modules build ./addon.c
+npx react-native-node-api build ./addon.c
```
This is a shorthand command which generates a CMake project from the single source-file and prebuilds for both the Apple and Android platforms. See the [CLI documentation](./CLI.md) for more information on the options available and [documentation on prebuilds](./PREBUILDS.md) for the specifics on their format and structure.
diff --git a/eslint.config.js b/eslint.config.js
index 3a8f7a5f..360cbeaf 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -6,18 +6,20 @@ import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
+ globalIgnores([".nx/**"]),
globalIgnores(["**/dist/**"]),
globalIgnores(["apps/test-app/ios/**"]),
- globalIgnores(["packages/react-native-node-api-modules/hermes/**"]),
+ globalIgnores(["packages/host/hermes/**"]),
globalIgnores(["packages/node-addon-examples/examples/**"]),
+ globalIgnores(["packages/ferric-example/ferric_example.d.ts"]),
eslint.configs.recommended,
tseslint.configs.recommended,
{
files: [
"apps/test-app/*.js",
"packages/node-addon-examples/*.js",
- "packages/react-native-node-api-modules/babel-plugin.js",
- "packages/react-native-node-api-modules/react-native.config.js"
+ "packages/host/babel-plugin.js",
+ "packages/host/react-native.config.js"
],
languageOptions: {
parserOptions: {
@@ -35,8 +37,8 @@ export default tseslint.config(
{
files: [
"packages/gyp-to-cmake/bin/*.js",
- "packages/react-native-node-api-modules/bin/*.mjs",
- "packages/react-native-node-api-modules/scripts/*.mjs"
+ "packages/host/bin/*.mjs",
+ "packages/host/scripts/*.mjs"
],
languageOptions: {
globals: {
diff --git a/package-lock.json b/package-lock.json
index 2e0d0769..b70ba5f0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,10 +1,10 @@
{
- "name": "react-native-node-api-modules-root",
+ "name": "@react-native-node-api/root",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "react-native-node-api-modules-root",
+ "name": "@react-native-node-api/root",
"license": "MIT",
"workspaces": [
"apps/*",
@@ -42,7 +42,7 @@
"react": "19.0.0",
"react-native": "0.79.1",
"react-native-node-addon-examples": "*",
- "react-native-node-api-modules": "*",
+ "react-native-node-api": "*",
"react-native-test-app": "^4.3.3"
}
},
@@ -4780,6 +4780,10 @@
"node": "^12.20.0 || >=14"
}
},
+ "node_modules/@react-native-node-api/node-addon-examples": {
+ "resolved": "packages/node-addon-examples",
+ "link": true
+ },
"node_modules/@react-native/assets-registry": {
"version": "0.79.1",
"resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.79.1.tgz",
@@ -6473,6 +6477,10 @@
"node": ">= 10.0.0"
}
},
+ "node_modules/cmake-rn": {
+ "resolved": "packages/cmake-rn",
+ "link": true
+ },
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -10053,12 +10061,8 @@
"resolved": "packages/node-addon-examples",
"link": true
},
- "node_modules/react-native-node-api-cmake": {
- "resolved": "packages/react-native-node-api-cmake",
- "link": true
- },
- "node_modules/react-native-node-api-modules": {
- "resolved": "packages/react-native-node-api-modules",
+ "node_modules/react-native-node-api": {
+ "resolved": "packages/host",
"link": true
},
"node_modules/react-native-node-api-test-app": {
@@ -11560,28 +11564,25 @@
"url": "https://github.com/sponsors/colinhacks"
}
},
- "packages/ferric": {
- "name": "ferric-cli",
+ "packages/cmake-rn": {
"version": "0.1.0",
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
- "@napi-rs/cli": "3.0.0-alpha.80",
"bufout": "^0.3.1",
"chalk": "^5.4.1",
+ "cmake-js": "^7.3.1",
"commander": "^13.1.0",
"ora": "^8.2.0"
},
"bin": {
- "ferric": "bin/ferric.js"
- }
- },
- "packages/ferric-example": {
- "version": "0.1.0",
- "devDependencies": {
- "ferric-cli": "^0.1.0"
+ "cmake-rn": "bin/cmake-rn.js"
+ },
+ "peerDependencies": {
+ "node-addon-api": "^8.3.1",
+ "node-api-headers": "^1.5.0"
}
},
- "packages/ferric/node_modules/@commander-js/extra-typings": {
+ "packages/cmake-rn/node_modules/@commander-js/extra-typings": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/@commander-js/extra-typings/-/extra-typings-13.1.0.tgz",
"integrity": "sha512-q5P52BYb1hwVWE6dtID7VvuJWrlfbCv4klj7BjUUOqMz4jbSZD4C9fJ9lRjL2jnBGTg+gDDlaXN51rkWcLk4fg==",
@@ -11590,7 +11591,7 @@
"commander": "~13.1.0"
}
},
- "packages/ferric/node_modules/ansi-regex": {
+ "packages/cmake-rn/node_modules/ansi-regex": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
@@ -11602,7 +11603,7 @@
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
- "packages/ferric/node_modules/chalk": {
+ "packages/cmake-rn/node_modules/chalk": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz",
"integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==",
@@ -11614,7 +11615,7 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
- "packages/ferric/node_modules/cli-cursor": {
+ "packages/cmake-rn/node_modules/cli-cursor": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
"integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
@@ -11629,7 +11630,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/commander": {
+ "packages/cmake-rn/node_modules/commander": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
"integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
@@ -11638,13 +11639,13 @@
"node": ">=18"
}
},
- "packages/ferric/node_modules/emoji-regex": {
+ "packages/cmake-rn/node_modules/emoji-regex": {
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
"integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
"license": "MIT"
},
- "packages/ferric/node_modules/is-interactive": {
+ "packages/cmake-rn/node_modules/is-interactive": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
"integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
@@ -11656,7 +11657,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/is-unicode-supported": {
+ "packages/cmake-rn/node_modules/is-unicode-supported": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
"integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
@@ -11668,7 +11669,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/log-symbols": {
+ "packages/cmake-rn/node_modules/log-symbols": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
"integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
@@ -11684,7 +11685,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "packages/cmake-rn/node_modules/log-symbols/node_modules/is-unicode-supported": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
"integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
@@ -11696,7 +11697,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/onetime": {
+ "packages/cmake-rn/node_modules/onetime": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
"integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
@@ -11711,7 +11712,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/ora": {
+ "packages/cmake-rn/node_modules/ora": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
"integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
@@ -11734,7 +11735,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/restore-cursor": {
+ "packages/cmake-rn/node_modules/restore-cursor": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
"integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
@@ -11750,7 +11751,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/signal-exit": {
+ "packages/cmake-rn/node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
@@ -11762,7 +11763,7 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "packages/ferric/node_modules/string-width": {
+ "packages/cmake-rn/node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
@@ -11779,7 +11780,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/ferric/node_modules/strip-ansi": {
+ "packages/cmake-rn/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
@@ -11794,71 +11795,28 @@
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
- "packages/gyp-to-cmake": {
- "version": "0.1.0",
- "dependencies": {
- "@commander-js/extra-typings": "^13.1.0",
- "commander": "^13.1.0",
- "gyp-parser": "^1.0.4"
- },
- "bin": {
- "gyp-to-cmake": "bin/gyp-to-cmake.js"
- }
- },
- "packages/gyp-to-cmake/node_modules/@commander-js/extra-typings": {
- "version": "13.1.0",
- "resolved": "https://registry.npmjs.org/@commander-js/extra-typings/-/extra-typings-13.1.0.tgz",
- "integrity": "sha512-q5P52BYb1hwVWE6dtID7VvuJWrlfbCv4klj7BjUUOqMz4jbSZD4C9fJ9lRjL2jnBGTg+gDDlaXN51rkWcLk4fg==",
- "license": "MIT",
- "peerDependencies": {
- "commander": "~13.1.0"
- }
- },
- "packages/gyp-to-cmake/node_modules/commander": {
- "version": "13.1.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
- "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- }
- },
- "packages/node-addon-examples": {
- "name": "react-native-node-addon-examples",
- "devDependencies": {
- "gyp-to-cmake": "*",
- "node-addon-examples": "github:nodejs/node-addon-examples#4213d4c9d07996ae68629c67926251e117f8e52a",
- "react-native-node-api-cmake": "*",
- "read-pkg": "^9.0.1"
- }
- },
- "packages/node-addon-examples-tests": {
- "extraneous": true,
- "devDependencies": {
- "gyp-to-cmake": "*",
- "node-addon-examples": "github:nodejs/node-addon-examples#4213d4c9d07996ae68629c67926251e117f8e52a",
- "react-native-node-api-cmake": "*"
- }
- },
- "packages/react-native-node-api-cmake": {
+ "packages/ferric": {
+ "name": "ferric-cli",
"version": "0.1.0",
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
+ "@napi-rs/cli": "3.0.0-alpha.80",
"bufout": "^0.3.1",
"chalk": "^5.4.1",
- "cmake-js": "^7.3.1",
"commander": "^13.1.0",
"ora": "^8.2.0"
},
"bin": {
- "react-native-node-api-cmake": "bin/react-native-node-api-cmake.js"
- },
- "peerDependencies": {
- "node-addon-api": "^8.3.1",
- "node-api-headers": "^1.5.0"
+ "ferric": "bin/ferric.js"
+ }
+ },
+ "packages/ferric-example": {
+ "version": "0.1.0",
+ "devDependencies": {
+ "ferric-cli": "^0.1.0"
}
},
- "packages/react-native-node-api-cmake/node_modules/@commander-js/extra-typings": {
+ "packages/ferric/node_modules/@commander-js/extra-typings": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/@commander-js/extra-typings/-/extra-typings-13.1.0.tgz",
"integrity": "sha512-q5P52BYb1hwVWE6dtID7VvuJWrlfbCv4klj7BjUUOqMz4jbSZD4C9fJ9lRjL2jnBGTg+gDDlaXN51rkWcLk4fg==",
@@ -11867,7 +11825,7 @@
"commander": "~13.1.0"
}
},
- "packages/react-native-node-api-cmake/node_modules/ansi-regex": {
+ "packages/ferric/node_modules/ansi-regex": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
@@ -11879,7 +11837,7 @@
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
- "packages/react-native-node-api-cmake/node_modules/chalk": {
+ "packages/ferric/node_modules/chalk": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz",
"integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==",
@@ -11891,7 +11849,7 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
- "packages/react-native-node-api-cmake/node_modules/cli-cursor": {
+ "packages/ferric/node_modules/cli-cursor": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
"integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
@@ -11906,7 +11864,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/commander": {
+ "packages/ferric/node_modules/commander": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
"integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
@@ -11915,13 +11873,13 @@
"node": ">=18"
}
},
- "packages/react-native-node-api-cmake/node_modules/emoji-regex": {
+ "packages/ferric/node_modules/emoji-regex": {
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
"integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
"license": "MIT"
},
- "packages/react-native-node-api-cmake/node_modules/is-interactive": {
+ "packages/ferric/node_modules/is-interactive": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
"integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
@@ -11933,7 +11891,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/is-unicode-supported": {
+ "packages/ferric/node_modules/is-unicode-supported": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
"integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
@@ -11945,7 +11903,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/log-symbols": {
+ "packages/ferric/node_modules/log-symbols": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
"integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
@@ -11961,7 +11919,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "packages/ferric/node_modules/log-symbols/node_modules/is-unicode-supported": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
"integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
@@ -11973,7 +11931,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/onetime": {
+ "packages/ferric/node_modules/onetime": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
"integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
@@ -11988,7 +11946,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/ora": {
+ "packages/ferric/node_modules/ora": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
"integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
@@ -12011,7 +11969,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/restore-cursor": {
+ "packages/ferric/node_modules/restore-cursor": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
"integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
@@ -12027,7 +11985,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/signal-exit": {
+ "packages/ferric/node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
@@ -12039,7 +11997,7 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "packages/react-native-node-api-cmake/node_modules/string-width": {
+ "packages/ferric/node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
@@ -12056,7 +12014,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-cmake/node_modules/strip-ansi": {
+ "packages/ferric/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
@@ -12071,7 +12029,37 @@
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
- "packages/react-native-node-api-modules": {
+ "packages/gyp-to-cmake": {
+ "version": "0.1.0",
+ "dependencies": {
+ "@commander-js/extra-typings": "^13.1.0",
+ "commander": "^13.1.0",
+ "gyp-parser": "^1.0.4"
+ },
+ "bin": {
+ "gyp-to-cmake": "bin/gyp-to-cmake.js"
+ }
+ },
+ "packages/gyp-to-cmake/node_modules/@commander-js/extra-typings": {
+ "version": "13.1.0",
+ "resolved": "https://registry.npmjs.org/@commander-js/extra-typings/-/extra-typings-13.1.0.tgz",
+ "integrity": "sha512-q5P52BYb1hwVWE6dtID7VvuJWrlfbCv4klj7BjUUOqMz4jbSZD4C9fJ9lRjL2jnBGTg+gDDlaXN51rkWcLk4fg==",
+ "license": "MIT",
+ "peerDependencies": {
+ "commander": "~13.1.0"
+ }
+ },
+ "packages/gyp-to-cmake/node_modules/commander": {
+ "version": "13.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
+ "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "packages/host": {
+ "name": "react-native-node-api",
"version": "0.1.0",
"license": "MIT",
"dependencies": {
@@ -12084,7 +12072,7 @@
"read-pkg": "^9.0.1"
},
"bin": {
- "react-native-node-api-modules": "bin/react-native-node-api-modules.mjs"
+ "react-native-node-api": "bin/react-native-node-api.mjs"
},
"devDependencies": {
"@babel/core": "^7.26.10",
@@ -12099,7 +12087,7 @@
"react-native": "0.79.1 || 0.79.2"
}
},
- "packages/react-native-node-api-modules/node_modules/@commander-js/extra-typings": {
+ "packages/host/node_modules/@commander-js/extra-typings": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/@commander-js/extra-typings/-/extra-typings-13.1.0.tgz",
"integrity": "sha512-q5P52BYb1hwVWE6dtID7VvuJWrlfbCv4klj7BjUUOqMz4jbSZD4C9fJ9lRjL2jnBGTg+gDDlaXN51rkWcLk4fg==",
@@ -12108,7 +12096,7 @@
"commander": "~13.1.0"
}
},
- "packages/react-native-node-api-modules/node_modules/ansi-regex": {
+ "packages/host/node_modules/ansi-regex": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
@@ -12120,7 +12108,7 @@
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
- "packages/react-native-node-api-modules/node_modules/chalk": {
+ "packages/host/node_modules/chalk": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz",
"integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==",
@@ -12132,14 +12120,14 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
- "packages/react-native-node-api-modules/node_modules/ci-info": {
+ "packages/host/node_modules/ci-info": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
"integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
"dev": true,
"license": "MIT"
},
- "packages/react-native-node-api-modules/node_modules/cli-cursor": {
+ "packages/host/node_modules/cli-cursor": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
"integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
@@ -12154,7 +12142,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/commander": {
+ "packages/host/node_modules/commander": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
"integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
@@ -12163,7 +12151,7 @@
"node": ">=18"
}
},
- "packages/react-native-node-api-modules/node_modules/debug": {
+ "packages/host/node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
@@ -12173,13 +12161,13 @@
"ms": "2.0.0"
}
},
- "packages/react-native-node-api-modules/node_modules/emoji-regex": {
+ "packages/host/node_modules/emoji-regex": {
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
"integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
"license": "MIT"
},
- "packages/react-native-node-api-modules/node_modules/is-interactive": {
+ "packages/host/node_modules/is-interactive": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
"integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
@@ -12191,7 +12179,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/is-unicode-supported": {
+ "packages/host/node_modules/is-unicode-supported": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
"integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
@@ -12203,7 +12191,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/log-symbols": {
+ "packages/host/node_modules/log-symbols": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
"integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
@@ -12219,7 +12207,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "packages/host/node_modules/log-symbols/node_modules/is-unicode-supported": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
"integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
@@ -12231,7 +12219,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/metro": {
+ "packages/host/node_modules/metro": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro/-/metro-0.81.1.tgz",
"integrity": "sha512-fqRu4fg8ONW7VfqWFMGgKAcOuMzyoQah2azv9Y3VyFXAmG+AoTU6YIFWqAADESCGVWuWEIvxTJhMf3jxU6jwjA==",
@@ -12286,7 +12274,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-babel-transformer": {
+ "packages/host/node_modules/metro-babel-transformer": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.81.1.tgz",
"integrity": "sha512-JECKDrQaUnDmj0x/Q/c8c5YwsatVx38Lu+BfCwX9fR8bWipAzkvJocBpq5rOAJRDXRgDcPv2VO4Q4nFYrpYNQg==",
@@ -12302,7 +12290,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-cache": {
+ "packages/host/node_modules/metro-cache": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.81.1.tgz",
"integrity": "sha512-Uqcmn6sZ+Y0VJHM88VrG5xCvSeU7RnuvmjPmSOpEcyJJBe02QkfHL05MX2ZyGDTyZdbKCzaX0IijrTe4hN3F0Q==",
@@ -12317,7 +12305,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-cache-key": {
+ "packages/host/node_modules/metro-cache-key": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.81.1.tgz",
"integrity": "sha512-5fDaHR1yTvpaQuwMAeEoZGsVyvjrkw9IFAS7WixSPvaNY5YfleqoJICPc6hbXFJjvwCCpwmIYFkjqzR/qJ6yqA==",
@@ -12330,7 +12318,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-config": {
+ "packages/host/node_modules/metro-config": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.81.1.tgz",
"integrity": "sha512-VAAJmxsKIZ+Fz5/z1LVgxa32gE6+2TvrDSSx45g85WoX4EtLmdBGP3DSlpQW3DqFUfNHJCGwMLGXpJnxifd08g==",
@@ -12350,7 +12338,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-core": {
+ "packages/host/node_modules/metro-core": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.81.1.tgz",
"integrity": "sha512-4d2/+02IYqOwJs4dmM0dC8hIZqTzgnx2nzN4GTCaXb3Dhtmi/SJ3v6744zZRnithhN4lxf8TTJSHnQV75M7SSA==",
@@ -12365,7 +12353,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-file-map": {
+ "packages/host/node_modules/metro-file-map": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.81.1.tgz",
"integrity": "sha512-aY72H2ujmRfFxcsbyh83JgqFF+uQ4HFN1VhV2FmcfQG4s1bGKf2Vbkk+vtZ1+EswcBwDZFbkpvAjN49oqwGzAA==",
@@ -12386,7 +12374,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-minify-terser": {
+ "packages/host/node_modules/metro-minify-terser": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.81.1.tgz",
"integrity": "sha512-p/Qz3NNh1nebSqMlxlUALAnESo6heQrnvgHtAuxufRPtKvghnVDq9hGGex8H7z7YYLsqe42PWdt4JxTA3mgkvg==",
@@ -12400,7 +12388,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-resolver": {
+ "packages/host/node_modules/metro-resolver": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.81.1.tgz",
"integrity": "sha512-E61t6fxRoYRkl6Zo3iUfCKW4DYfum/bLjcejXBMt1y3I7LFkK84TCR/Rs9OAwsMCY/7GOPB4+CREYZOtCC7CNA==",
@@ -12413,7 +12401,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-runtime": {
+ "packages/host/node_modules/metro-runtime": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.81.1.tgz",
"integrity": "sha512-pqu5j5d01rjF85V/K8SDDJ0NR3dRp6bE3z5bKVVb5O2Rx0nbR9KreUxYALQCRCcQHaYySqCg5fYbGKBHC295YQ==",
@@ -12427,7 +12415,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-source-map": {
+ "packages/host/node_modules/metro-source-map": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.81.1.tgz",
"integrity": "sha512-1i8ROpNNiga43F0ZixAXoFE/SS3RqcRDCCslpynb+ytym0VI7pkTH1woAN2HI9pczYtPrp3Nq0AjRpsuY35ieA==",
@@ -12449,7 +12437,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-symbolicate": {
+ "packages/host/node_modules/metro-symbolicate": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.81.1.tgz",
"integrity": "sha512-Lgk0qjEigtFtsM7C0miXITbcV47E1ZYIfB+m/hCraihiwRWkNUQEPCWvqZmwXKSwVE5mXA0EzQtghAvQSjZDxw==",
@@ -12470,7 +12458,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-transform-plugins": {
+ "packages/host/node_modules/metro-transform-plugins": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.81.1.tgz",
"integrity": "sha512-7L1lI44/CyjIoBaORhY9fVkoNe8hrzgxjSCQ/lQlcfrV31cZb7u0RGOQrKmUX7Bw4FpejrB70ArQ7Mse9mk7+Q==",
@@ -12488,7 +12476,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro-transform-worker": {
+ "packages/host/node_modules/metro-transform-worker": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.81.1.tgz",
"integrity": "sha512-M+2hVT3rEy5K7PBmGDgQNq3Zx53TjScOcO/CieyLnCRFtBGWZiSJ2+bLAXXOKyKa/y3bI3i0owxtyxuPGDwbZg==",
@@ -12513,7 +12501,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/metro/node_modules/chalk": {
+ "packages/host/node_modules/metro/node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
@@ -12530,14 +12518,14 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
- "packages/react-native-node-api-modules/node_modules/ms": {
+ "packages/host/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"dev": true,
"license": "MIT"
},
- "packages/react-native-node-api-modules/node_modules/ob1": {
+ "packages/host/node_modules/ob1": {
"version": "0.81.1",
"resolved": "https://registry.npmjs.org/ob1/-/ob1-0.81.1.tgz",
"integrity": "sha512-1PEbvI+AFvOcgdNcO79FtDI1TUO8S3lhiKOyAiyWQF3sFDDKS+aw2/BZvGlArFnSmqckwOOB9chQuIX0/OahoQ==",
@@ -12550,7 +12538,7 @@
"node": ">=18.18"
}
},
- "packages/react-native-node-api-modules/node_modules/onetime": {
+ "packages/host/node_modules/onetime": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
"integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
@@ -12565,7 +12553,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/ora": {
+ "packages/host/node_modules/ora": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
"integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
@@ -12588,7 +12576,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/restore-cursor": {
+ "packages/host/node_modules/restore-cursor": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
"integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
@@ -12604,7 +12592,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/signal-exit": {
+ "packages/host/node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
@@ -12616,7 +12604,7 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "packages/react-native-node-api-modules/node_modules/string-width": {
+ "packages/host/node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
@@ -12633,7 +12621,7 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "packages/react-native-node-api-modules/node_modules/strip-ansi": {
+ "packages/host/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
@@ -12648,7 +12636,7 @@
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
- "packages/react-native-node-api-modules/node_modules/ws": {
+ "packages/host/node_modules/ws": {
"version": "7.5.10",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
"integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
@@ -12669,6 +12657,71 @@
"optional": true
}
}
+ },
+ "packages/node-addon-examples": {
+ "name": "@react-native-node-api/node-addon-examples",
+ "devDependencies": {
+ "cmake-rn": "*",
+ "gyp-to-cmake": "*",
+ "node-addon-examples": "github:nodejs/node-addon-examples#4213d4c9d07996ae68629c67926251e117f8e52a",
+ "read-pkg": "^9.0.1"
+ }
+ },
+ "packages/node-addon-examples-tests": {
+ "extraneous": true,
+ "devDependencies": {
+ "gyp-to-cmake": "*",
+ "node-addon-examples": "github:nodejs/node-addon-examples#4213d4c9d07996ae68629c67926251e117f8e52a",
+ "react-native-node-api-cmake": "*"
+ }
+ },
+ "packages/react-native-node-api-cmake": {
+ "version": "0.1.0",
+ "extraneous": true,
+ "dependencies": {
+ "@commander-js/extra-typings": "^13.1.0",
+ "bufout": "^0.3.1",
+ "chalk": "^5.4.1",
+ "cmake-js": "^7.3.1",
+ "commander": "^13.1.0",
+ "ora": "^8.2.0"
+ },
+ "bin": {
+ "react-native-node-api-cmake": "bin/react-native-node-api-cmake.js"
+ },
+ "peerDependencies": {
+ "node-addon-api": "^8.3.1",
+ "node-api-headers": "^1.5.0"
+ }
+ },
+ "packages/react-native-node-api-modules": {
+ "version": "0.1.0",
+ "extraneous": true,
+ "license": "MIT",
+ "dependencies": {
+ "@commander-js/extra-typings": "^13.1.0",
+ "bufout": "^0.3.1",
+ "chalk": "^5.4.1",
+ "commander": "^13.1.0",
+ "ora": "^8.2.0",
+ "pkg-dir": "^8.0.0",
+ "read-pkg": "^9.0.1"
+ },
+ "bin": {
+ "react-native-node-api-modules": "bin/react-native-node-api-modules.mjs"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.26.10",
+ "@babel/types": "^7.27.0",
+ "fswin": "^3.24.829",
+ "metro-config": "0.81.1",
+ "node-api-headers": "^1.5.0",
+ "zod": "^3.24.3"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.26.10",
+ "react-native": "0.79.1 || 0.79.2"
+ }
}
}
}
diff --git a/package.json b/package.json
index 13093305..20d7948a 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "react-native-node-api-modules-root",
+ "name": "@react-native-node-api/root",
"description": "Node-API Modules for React Native",
"type": "module",
"private": true,
@@ -7,13 +7,13 @@
"apps/*",
"packages/*"
],
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules#readme",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api#readme",
"scripts": {
"build": "tsc --build",
"clean": "tsc --build --clean",
"dev": "tsc --build --watch",
"lint": "eslint .",
- "test": "npm run test --workspace react-native-node-api-modules --workspace react-native-node-api-cmake --workspace gyp-to-cmake --workspace node-addon-examples"
+ "test": "npm run test --workspace react-native-node-api --workspace cmake-rn --workspace gyp-to-cmake --workspace node-addon-examples"
},
"author": {
"name": "Callstack",
diff --git a/packages/react-native-node-api-cmake/README.md b/packages/cmake-rn/README.md
similarity index 91%
rename from packages/react-native-node-api-cmake/README.md
rename to packages/cmake-rn/README.md
index 6d10fb4f..1f37f269 100644
--- a/packages/react-native-node-api-cmake/README.md
+++ b/packages/cmake-rn/README.md
@@ -1,4 +1,4 @@
-# `react-native-node-api-cmake`
+# `cmake-rn`
A wrapper around CMake making it easier to produce [prebuilt binaries](./docs/PREBUILDS.md) targeting iOS and Android matching the [the prebuilt binary specification](./docs/PREBUILDS.md).
diff --git a/packages/react-native-node-api-cmake/bin/react-native-node-api-cmake.js b/packages/cmake-rn/bin/cmake-rn.js
similarity index 100%
rename from packages/react-native-node-api-cmake/bin/react-native-node-api-cmake.js
rename to packages/cmake-rn/bin/cmake-rn.js
diff --git a/packages/react-native-node-api-cmake/package.json b/packages/cmake-rn/package.json
similarity index 76%
rename from packages/react-native-node-api-cmake/package.json
rename to packages/cmake-rn/package.json
index ff0803d8..72903718 100644
--- a/packages/react-native-node-api-cmake/package.json
+++ b/packages/cmake-rn/package.json
@@ -1,16 +1,16 @@
{
- "name": "react-native-node-api-cmake",
+ "name": "cmake-rn",
"version": "0.1.0",
"description": "Build React Native Node API modules with CMake",
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api",
"repository": {
"type": "git",
- "url": "git+https://github.com/callstackincubator/react-native-node-api-modules.git",
- "directory": "packages/react-native-node-api-cmake"
+ "url": "git+https://github.com/callstackincubator/react-native-node-api.git",
+ "directory": "packages/cmake-rn"
},
"type": "module",
"bin": {
- "react-native-node-api-cmake": "./bin/react-native-node-api-cmake.js"
+ "cmake-rn": "./bin/cmake-rn.js"
},
"files": [
"bin",
diff --git a/packages/react-native-node-api-cmake/src/android.ts b/packages/cmake-rn/src/android.ts
similarity index 97%
rename from packages/react-native-node-api-cmake/src/android.ts
rename to packages/cmake-rn/src/android.ts
index 88f14877..dfe5a534 100644
--- a/packages/react-native-node-api-cmake/src/android.ts
+++ b/packages/cmake-rn/src/android.ts
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
-import { AndroidTriplet } from "react-native-node-api-modules";
+import { AndroidTriplet } from "react-native-node-api";
export const DEFAULT_ANDROID_TRIPLETS = [
"aarch64-linux-android",
diff --git a/packages/react-native-node-api-cmake/src/apple.ts b/packages/cmake-rn/src/apple.ts
similarity index 99%
rename from packages/react-native-node-api-cmake/src/apple.ts
rename to packages/cmake-rn/src/apple.ts
index fb5a0811..da8a7ab4 100644
--- a/packages/react-native-node-api-cmake/src/apple.ts
+++ b/packages/cmake-rn/src/apple.ts
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
-import { AppleTriplet, isAppleTriplet } from "react-native-node-api-modules";
+import { AppleTriplet, isAppleTriplet } from "react-native-node-api";
export const DEFAULT_APPLE_TRIPLETS = [
"arm64;x86_64-apple-darwin",
diff --git a/packages/react-native-node-api-cmake/src/cli.ts b/packages/cmake-rn/src/cli.ts
similarity index 98%
rename from packages/react-native-node-api-cmake/src/cli.ts
rename to packages/cmake-rn/src/cli.ts
index 4465366c..bc03b705 100644
--- a/packages/react-native-node-api-cmake/src/cli.ts
+++ b/packages/cmake-rn/src/cli.ts
@@ -30,7 +30,7 @@ import {
createAppleFramework,
createXCframework,
determineXCFrameworkFilename,
-} from "react-native-node-api-modules";
+} from "react-native-node-api";
// We're attaching a lot of listeners when spawning in parallel
EventEmitter.defaultMaxListeners = 100;
@@ -83,12 +83,12 @@ const ndkVersionOption = new Option(
const noAutoLinkOption = new Option(
"--no-auto-link",
- "Don't mark the output as auto-linkable by react-native-node-api-modules"
+ "Don't mark the output as auto-linkable by react-native-node-api"
);
const noWeakNodeApiLinkageOption = new Option(
"--no-weak-node-api-linkage",
- "Don't pass the path of the weak-node-api library from react-native-node-api-modules"
+ "Don't pass the path of the weak-node-api library from react-native-node-api"
);
const xcframeworkExtensionOption = new Option(
@@ -96,7 +96,7 @@ const xcframeworkExtensionOption = new Option(
"Don't rename the xcframework to .apple.node"
).default(false);
-export const program = new Command("react-native-node-api-cmake")
+export const program = new Command("cmake-rn")
.description("Build React Native Node API modules with CMake")
.addOption(sourcePathOption)
.addOption(configurationOption)
diff --git a/packages/react-native-node-api-cmake/src/headers.ts b/packages/cmake-rn/src/headers.ts
similarity index 100%
rename from packages/react-native-node-api-cmake/src/headers.ts
rename to packages/cmake-rn/src/headers.ts
diff --git a/packages/react-native-node-api-cmake/src/run.ts b/packages/cmake-rn/src/run.ts
similarity index 100%
rename from packages/react-native-node-api-cmake/src/run.ts
rename to packages/cmake-rn/src/run.ts
diff --git a/packages/react-native-node-api-cmake/src/weak-node-api.ts b/packages/cmake-rn/src/weak-node-api.ts
similarity index 93%
rename from packages/react-native-node-api-cmake/src/weak-node-api.ts
rename to packages/cmake-rn/src/weak-node-api.ts
index 42d97507..4cf1982e 100644
--- a/packages/react-native-node-api-cmake/src/weak-node-api.ts
+++ b/packages/cmake-rn/src/weak-node-api.ts
@@ -6,14 +6,14 @@ import {
isAndroidTriplet,
isAppleTriplet,
SupportedTriplet,
-} from "react-native-node-api-modules";
+} from "react-native-node-api";
import { ANDROID_ARCHITECTURES } from "./android.js";
import { getNodeAddonHeadersPath, getNodeApiHeadersPath } from "./headers.js";
export function getWeakNodeApiPath(triplet: SupportedTriplet): string {
const { pathname } = new URL(
- import.meta.resolve("react-native-node-api-modules/weak-node-api")
+ import.meta.resolve("react-native-node-api/weak-node-api")
);
assert(fs.existsSync(pathname), "Weak Node API path does not exist");
if (isAppleTriplet(triplet)) {
diff --git a/packages/react-native-node-api-cmake/tsconfig.json b/packages/cmake-rn/tsconfig.json
similarity index 100%
rename from packages/react-native-node-api-cmake/tsconfig.json
rename to packages/cmake-rn/tsconfig.json
diff --git a/packages/ferric-example/package.json b/packages/ferric-example/package.json
index 8d9ac9e9..73869b66 100644
--- a/packages/ferric-example/package.json
+++ b/packages/ferric-example/package.json
@@ -2,10 +2,10 @@
"name": "ferric-example",
"private": true,
"version": "0.1.0",
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api",
"repository": {
"type": "git",
- "url": "git+https://github.com/callstackincubator/react-native-node-api-modules.git",
+ "url": "git+https://github.com/callstackincubator/react-native-node-api.git",
"directory": "packages/ferric-example"
},
"main": "ferric_example.js",
diff --git a/packages/ferric/package.json b/packages/ferric/package.json
index 6759907e..bd89b0ae 100644
--- a/packages/ferric/package.json
+++ b/packages/ferric/package.json
@@ -2,10 +2,10 @@
"name": "ferric-cli",
"version": "0.1.0",
"description": "Rust Node-API Modules for React Native",
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api",
"repository": {
"type": "git",
- "url": "git+https://github.com/callstackincubator/react-native-node-api-modules.git",
+ "url": "git+https://github.com/callstackincubator/react-native-node-api.git",
"directory": "packages/ferric"
},
"type": "module",
diff --git a/packages/ferric/src/build.ts b/packages/ferric/src/build.ts
index d54ac713..799dcfdf 100644
--- a/packages/ferric/src/build.ts
+++ b/packages/ferric/src/build.ts
@@ -16,7 +16,7 @@ import {
createUniversalAppleLibrary,
determineLibraryBasename,
prettyPath,
-} from "react-native-node-api-modules";
+} from "react-native-node-api";
import { UsageError } from "./errors.js";
import { ensureCargo, build } from "./cargo.js";
diff --git a/packages/ferric/src/cargo.ts b/packages/ferric/src/cargo.ts
index e227a849..79e6bc40 100644
--- a/packages/ferric/src/cargo.ts
+++ b/packages/ferric/src/cargo.ts
@@ -15,7 +15,7 @@ import {
} from "./targets.js";
const WEAK_NODE_API_PATH = new URL(
- import.meta.resolve("react-native-node-api-modules/weak-node-api")
+ import.meta.resolve("react-native-node-api/weak-node-api")
).pathname;
const APPLE_XCFRAMEWORK_CHILDS_PER_TARGET: Record = {
diff --git a/packages/gyp-to-cmake/README.md b/packages/gyp-to-cmake/README.md
index 91a8f911..cbb554bd 100644
--- a/packages/gyp-to-cmake/README.md
+++ b/packages/gyp-to-cmake/README.md
@@ -1,3 +1,3 @@
# `gyp-to-cmake`
-A tool to transform `binding.gyp` files into `CMakeLists.txt` files, intended for `cmake-js` or `react-native-node-api-cmake` to build from.
+A tool to transform `binding.gyp` files into `CMakeLists.txt` files, intended for `cmake-js` or `cmake-rn` to build from.
diff --git a/packages/gyp-to-cmake/package.json b/packages/gyp-to-cmake/package.json
index e6c7564f..2c08ad45 100644
--- a/packages/gyp-to-cmake/package.json
+++ b/packages/gyp-to-cmake/package.json
@@ -3,10 +3,10 @@
"version": "0.1.0",
"private": true,
"description": "Convert binding.gyp files to CMakeLists.txt",
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api",
"repository": {
"type": "git",
- "url": "git+https://github.com/callstackincubator/react-native-node-api-modules.git",
+ "url": "git+https://github.com/callstackincubator/react-native-node-api.git",
"directory": "packages/gyp-to-cmake"
},
"type": "module",
diff --git a/packages/gyp-to-cmake/src/transformer.ts b/packages/gyp-to-cmake/src/transformer.ts
index aa1b5e6f..6a33c160 100644
--- a/packages/gyp-to-cmake/src/transformer.ts
+++ b/packages/gyp-to-cmake/src/transformer.ts
@@ -87,7 +87,7 @@ export function bindingGypToCmakeLists({
);
}
- // Adding this post-amble from the template, although not used by react-native-node-api-modules
+ // Adding this post-amble from the template, although not used by react-native-node-api
lines.push(
"",
"if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)",
diff --git a/packages/react-native-node-api-modules/.gitignore b/packages/host/.gitignore
similarity index 100%
rename from packages/react-native-node-api-modules/.gitignore
rename to packages/host/.gitignore
diff --git a/packages/react-native-node-api-modules/README.md b/packages/host/README.md
similarity index 100%
rename from packages/react-native-node-api-modules/README.md
rename to packages/host/README.md
diff --git a/packages/react-native-node-api-modules/android/CMakeLists.txt b/packages/host/android/CMakeLists.txt
similarity index 95%
rename from packages/react-native-node-api-modules/android/CMakeLists.txt
rename to packages/host/android/CMakeLists.txt
index 6b4d2a5f..b913de7f 100644
--- a/packages/react-native-node-api-modules/android/CMakeLists.txt
+++ b/packages/host/android/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.13)
-project(react-native-node-api-modules)
+project(react-native-node-api)
set(CMAKE_CXX_STANDARD 20)
find_package(ReactAndroid REQUIRED CONFIG)
diff --git a/packages/react-native-node-api-modules/android/build.gradle b/packages/host/android/build.gradle
similarity index 96%
rename from packages/react-native-node-api-modules/android/build.gradle
rename to packages/host/android/build.gradle
index 5c04e7d3..df86c99a 100644
--- a/packages/react-native-node-api-modules/android/build.gradle
+++ b/packages/host/android/build.gradle
@@ -143,7 +143,7 @@ task linkNodeApiModules {
doLast {
exec {
// TODO: Support --strip-path-suffix
- commandLine 'npx', 'react-native-node-api-modules', 'link', '--android', rootProject.rootDir.absolutePath
+ commandLine 'npx', 'react-native-node-api', 'link', '--android', rootProject.rootDir.absolutePath
standardOutput = System.out
errorOutput = System.err
// Enable color output
diff --git a/packages/react-native-node-api-modules/android/gradle.properties b/packages/host/android/gradle.properties
similarity index 100%
rename from packages/react-native-node-api-modules/android/gradle.properties
rename to packages/host/android/gradle.properties
diff --git a/packages/react-native-node-api-modules/android/src/main/AndroidManifest.xml b/packages/host/android/src/main/AndroidManifest.xml
similarity index 100%
rename from packages/react-native-node-api-modules/android/src/main/AndroidManifest.xml
rename to packages/host/android/src/main/AndroidManifest.xml
diff --git a/packages/react-native-node-api-modules/android/src/main/AndroidManifestNew.xml b/packages/host/android/src/main/AndroidManifestNew.xml
similarity index 100%
rename from packages/react-native-node-api-modules/android/src/main/AndroidManifestNew.xml
rename to packages/host/android/src/main/AndroidManifestNew.xml
diff --git a/packages/react-native-node-api-modules/android/src/main/cpp/OnLoad.cpp b/packages/host/android/src/main/cpp/OnLoad.cpp
similarity index 100%
rename from packages/react-native-node-api-modules/android/src/main/cpp/OnLoad.cpp
rename to packages/host/android/src/main/cpp/OnLoad.cpp
diff --git a/packages/react-native-node-api-modules/android/src/main/java/com/callstack/node_api_modules/NodeApiModulesPackage.kt b/packages/host/android/src/main/java/com/callstack/node_api_modules/NodeApiModulesPackage.kt
similarity index 100%
rename from packages/react-native-node-api-modules/android/src/main/java/com/callstack/node_api_modules/NodeApiModulesPackage.kt
rename to packages/host/android/src/main/java/com/callstack/node_api_modules/NodeApiModulesPackage.kt
diff --git a/packages/react-native-node-api-modules/babel-plugin.js b/packages/host/babel-plugin.js
similarity index 100%
rename from packages/react-native-node-api-modules/babel-plugin.js
rename to packages/host/babel-plugin.js
diff --git a/packages/react-native-node-api-modules/bin/react-native-node-api-modules.mjs b/packages/host/bin/react-native-node-api-modules.mjs
similarity index 100%
rename from packages/react-native-node-api-modules/bin/react-native-node-api-modules.mjs
rename to packages/host/bin/react-native-node-api-modules.mjs
diff --git a/packages/react-native-node-api-modules/cpp/AddonLoaders.hpp b/packages/host/cpp/AddonLoaders.hpp
similarity index 100%
rename from packages/react-native-node-api-modules/cpp/AddonLoaders.hpp
rename to packages/host/cpp/AddonLoaders.hpp
diff --git a/packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.cpp b/packages/host/cpp/CxxNodeApiHostModule.cpp
similarity index 99%
rename from packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.cpp
rename to packages/host/cpp/CxxNodeApiHostModule.cpp
index af448026..727241cc 100644
--- a/packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.cpp
+++ b/packages/host/cpp/CxxNodeApiHostModule.cpp
@@ -89,7 +89,7 @@ bool CxxNodeApiHostModule::loadNodeAddon(NodeAddon &addon,
// TODO: Read "node_api_module_get_api_version_v1" to support the addon
// declaring its Node-API version
// @see
- // https://github.com/callstackincubator/react-native-node-api-modules/issues/4
+ // https://github.com/callstackincubator/react-native-node-api/issues/4
} else {
log_debug("[%s] Failed to load library", libraryName.c_str());
}
@@ -104,7 +104,7 @@ bool CxxNodeApiHostModule::initializeNodeModule(jsi::Runtime &rt,
napi_status status = napi_ok;
// TODO: Read the version from the addon
// @see
- // https://github.com/callstackincubator/react-native-node-api-modules/issues/4
+ // https://github.com/callstackincubator/react-native-node-api/issues/4
napi_env env = reinterpret_cast(rt.createNodeApiEnv(8));
// Create the "exports" object
diff --git a/packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.hpp b/packages/host/cpp/CxxNodeApiHostModule.hpp
similarity index 100%
rename from packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.hpp
rename to packages/host/cpp/CxxNodeApiHostModule.hpp
diff --git a/packages/react-native-node-api-modules/cpp/Logger.cpp b/packages/host/cpp/Logger.cpp
similarity index 100%
rename from packages/react-native-node-api-modules/cpp/Logger.cpp
rename to packages/host/cpp/Logger.cpp
diff --git a/packages/react-native-node-api-modules/cpp/Logger.hpp b/packages/host/cpp/Logger.hpp
similarity index 100%
rename from packages/react-native-node-api-modules/cpp/Logger.hpp
rename to packages/host/cpp/Logger.hpp
diff --git a/packages/react-native-node-api-modules/cpp/WeakNodeApiInjector.hpp b/packages/host/cpp/WeakNodeApiInjector.hpp
similarity index 100%
rename from packages/react-native-node-api-modules/cpp/WeakNodeApiInjector.hpp
rename to packages/host/cpp/WeakNodeApiInjector.hpp
diff --git a/packages/react-native-node-api-modules/ios/NodeApiHostModuleProvider.mm b/packages/host/ios/NodeApiHostModuleProvider.mm
similarity index 100%
rename from packages/react-native-node-api-modules/ios/NodeApiHostModuleProvider.mm
rename to packages/host/ios/NodeApiHostModuleProvider.mm
diff --git a/packages/react-native-node-api-modules/package.json b/packages/host/package.json
similarity index 83%
rename from packages/react-native-node-api-modules/package.json
rename to packages/host/package.json
index 836f960a..ce8e8b08 100644
--- a/packages/react-native-node-api-modules/package.json
+++ b/packages/host/package.json
@@ -1,17 +1,17 @@
{
- "name": "react-native-node-api-modules",
+ "name": "react-native-node-api",
"version": "0.1.0",
- "description": "Node-API Modules for React Native",
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules",
+ "description": "Node-API for React Native",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api",
"repository": {
"type": "git",
- "url": "git+https://github.com/callstackincubator/react-native-node-api-modules.git",
- "directory": "packages/react-native-node-api-cmake"
+ "url": "git+https://github.com/callstackincubator/react-native-node-api.git",
+ "directory": "packages/react-native-node-api"
},
"main": "dist/react-native/index.js",
"type": "commonjs",
"bin": {
- "react-native-node-api-modules": "./bin/react-native-node-api-modules.mjs"
+ "react-native-node-api": "./bin/react-native-node-api.mjs"
},
"exports": {
".": {
@@ -43,7 +43,7 @@
"copy-node-api-headers": "tsx scripts/copy-node-api-headers.ts",
"generate-weak-node-api": "tsx scripts/generate-weak-node-api.ts",
"generate-weak-node-api-injector": "tsx scripts/generate-weak-node-api-injector.ts",
- "build-weak-node-api": "npm run generate-weak-node-api && react-native-node-api-cmake --android --apple --no-auto-link --no-weak-node-api-linkage --xcframework-extension --source ./weak-node-api",
+ "build-weak-node-api": "npm run generate-weak-node-api && cmake-rn --android --apple --no-auto-link --no-weak-node-api-linkage --xcframework-extension --source ./weak-node-api",
"test": "tsx --test src/node/**/*.test.ts src/node/*.test.ts"
},
"keywords": [
diff --git a/packages/react-native-node-api-modules/react-native-node-api-modules.podspec b/packages/host/react-native-node-api-modules.podspec
similarity index 97%
rename from packages/react-native-node-api-modules/react-native-node-api-modules.podspec
rename to packages/host/react-native-node-api-modules.podspec
index 618b4346..7592a3c1 100644
--- a/packages/react-native-node-api-modules/react-native-node-api-modules.podspec
+++ b/packages/host/react-native-node-api-modules.podspec
@@ -27,7 +27,7 @@ Pod::Spec.new do |s|
s.authors = package["author"]
s.platforms = { :ios => min_ios_version_supported }
- s.source = { :git => "https://github.com/callstackincubator/react-native-node-api-modules.git", :tag => "#{s.version}" }
+ s.source = { :git => "https://github.com/callstackincubator/react-native-node-api.git", :tag => "#{s.version}" }
s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "weak-node-api/include/*.h", "weak-node-api/*.hpp"
s.public_header_files = "weak-node-api/include/*.h"
diff --git a/packages/react-native-node-api-modules/react-native.config.js b/packages/host/react-native.config.js
similarity index 100%
rename from packages/react-native-node-api-modules/react-native.config.js
rename to packages/host/react-native.config.js
diff --git a/packages/react-native-node-api-modules/scripts/copy-node-api-headers.ts b/packages/host/scripts/copy-node-api-headers.ts
similarity index 100%
rename from packages/react-native-node-api-modules/scripts/copy-node-api-headers.ts
rename to packages/host/scripts/copy-node-api-headers.ts
diff --git a/packages/react-native-node-api-modules/scripts/generate-weak-node-api-injector.ts b/packages/host/scripts/generate-weak-node-api-injector.ts
similarity index 97%
rename from packages/react-native-node-api-modules/scripts/generate-weak-node-api-injector.ts
rename to packages/host/scripts/generate-weak-node-api-injector.ts
index 0d3a61a8..ff73b0ed 100644
--- a/packages/react-native-node-api-modules/scripts/generate-weak-node-api-injector.ts
+++ b/packages/host/scripts/generate-weak-node-api-injector.ts
@@ -11,7 +11,7 @@ export const CPP_SOURCE_PATH = path.join(__dirname, "../cpp");
*/
export function generateSource(functions: FunctionDecl[]) {
return `
- // This file is generated by react-native-node-api-modules
+ // This file is generated by react-native-node-api
#include
#include
#include
diff --git a/packages/react-native-node-api-modules/scripts/generate-weak-node-api.ts b/packages/host/scripts/generate-weak-node-api.ts
similarity index 95%
rename from packages/react-native-node-api-modules/scripts/generate-weak-node-api.ts
rename to packages/host/scripts/generate-weak-node-api.ts
index 27be13db..23a3c89d 100644
--- a/packages/react-native-node-api-modules/scripts/generate-weak-node-api.ts
+++ b/packages/host/scripts/generate-weak-node-api.ts
@@ -11,7 +11,7 @@ export const WEAK_NODE_API_PATH = path.join(__dirname, "../weak-node-api");
*/
export function generateHeader(functions: FunctionDecl[]) {
return [
- "// This file is generated by react-native-node-api-modules",
+ "// This file is generated by react-native-node-api",
"#include ", // Node-API
"#include ", // fprintf()
"#include ", // abort()
@@ -34,7 +34,7 @@ export function generateHeader(functions: FunctionDecl[]) {
*/
export function generateSource(functions: FunctionDecl[]) {
return [
- "// This file is generated by react-native-node-api-modules",
+ "// This file is generated by react-native-node-api",
`#include "weak_node_api.hpp"`, // Generated header
// Generate the struct of function pointers
"WeakNodeApiHost g_host;",
diff --git a/packages/react-native-node-api-modules/scripts/node-api-functions.ts b/packages/host/scripts/node-api-functions.ts
similarity index 100%
rename from packages/react-native-node-api-modules/scripts/node-api-functions.ts
rename to packages/host/scripts/node-api-functions.ts
diff --git a/packages/react-native-node-api-modules/scripts/patch-hermes.rb b/packages/host/scripts/patch-hermes.rb
similarity index 74%
rename from packages/react-native-node-api-modules/scripts/patch-hermes.rb
rename to packages/host/scripts/patch-hermes.rb
index 6e200250..2d986e4a 100644
--- a/packages/react-native-node-api-modules/scripts/patch-hermes.rb
+++ b/packages/host/scripts/patch-hermes.rb
@@ -1,6 +1,6 @@
Pod::UI.warn "!!! PATCHING HERMES WITH NODE-API SUPPORT !!!"
-VENDORED_HERMES_DIR ||= `npx react-native-node-api-modules vendor-hermes --silent '#{Pod::Config.instance.installation_root}'`.strip
+VENDORED_HERMES_DIR ||= `npx react-native-node-api vendor-hermes --silent '#{Pod::Config.instance.installation_root}'`.strip
if Dir.exist?(VENDORED_HERMES_DIR)
Pod::UI.info "Hermes vendored into #{VENDORED_HERMES_DIR.inspect}"
else
diff --git a/packages/react-native-node-api-modules/src/node/babel-plugin/index.ts b/packages/host/src/node/babel-plugin/index.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/babel-plugin/index.ts
rename to packages/host/src/node/babel-plugin/index.ts
diff --git a/packages/react-native-node-api-modules/src/node/babel-plugin/plugin.test.ts b/packages/host/src/node/babel-plugin/plugin.test.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/babel-plugin/plugin.test.ts
rename to packages/host/src/node/babel-plugin/plugin.test.ts
diff --git a/packages/react-native-node-api-modules/src/node/babel-plugin/plugin.ts b/packages/host/src/node/babel-plugin/plugin.ts
similarity index 97%
rename from packages/react-native-node-api-modules/src/node/babel-plugin/plugin.ts
rename to packages/host/src/node/babel-plugin/plugin.ts
index 2431af69..49733089 100644
--- a/packages/react-native-node-api-modules/src/node/babel-plugin/plugin.ts
+++ b/packages/host/src/node/babel-plugin/plugin.ts
@@ -30,7 +30,7 @@ export function replaceWithRequireNodeAddon(
t.callExpression(
t.memberExpression(
t.callExpression(t.identifier("require"), [
- t.stringLiteral("react-native-node-api-modules"),
+ t.stringLiteral("react-native-node-api"),
]),
t.identifier("requireNodeAddon")
),
diff --git a/packages/react-native-node-api-modules/src/node/cli/android.ts b/packages/host/src/node/cli/android.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/cli/android.ts
rename to packages/host/src/node/cli/android.ts
diff --git a/packages/react-native-node-api-modules/src/node/cli/apple.ts b/packages/host/src/node/cli/apple.ts
similarity index 98%
rename from packages/react-native-node-api-modules/src/node/cli/apple.ts
rename to packages/host/src/node/cli/apple.ts
index d7191bd1..5de453d6 100644
--- a/packages/react-native-node-api-modules/src/node/cli/apple.ts
+++ b/packages/host/src/node/cli/apple.ts
@@ -45,7 +45,7 @@ export async function linkXcframework({
const newLibraryName = getLibraryName(modulePath, naming);
const outputPath = getLinkedModuleOutputPath(platform, modulePath, naming);
const tempPath = await fs.promises.mkdtemp(
- path.join(os.tmpdir(), `react-native-node-api-modules-${newLibraryName}-`)
+ path.join(os.tmpdir(), `react-native-node-api-${newLibraryName}-`)
);
try {
if (incremental && fs.existsSync(outputPath)) {
diff --git a/packages/react-native-node-api-modules/src/node/cli/hermes.ts b/packages/host/src/node/cli/hermes.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/cli/hermes.ts
rename to packages/host/src/node/cli/hermes.ts
diff --git a/packages/react-native-node-api-modules/src/node/cli/link-modules.ts b/packages/host/src/node/cli/link-modules.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/cli/link-modules.ts
rename to packages/host/src/node/cli/link-modules.ts
diff --git a/packages/react-native-node-api-modules/src/node/cli/options.ts b/packages/host/src/node/cli/options.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/cli/options.ts
rename to packages/host/src/node/cli/options.ts
diff --git a/packages/react-native-node-api-modules/src/node/cli/program.ts b/packages/host/src/node/cli/program.ts
similarity index 98%
rename from packages/react-native-node-api-modules/src/node/cli/program.ts
rename to packages/host/src/node/cli/program.ts
index 62c1ef27..963ca414 100644
--- a/packages/react-native-node-api-modules/src/node/cli/program.ts
+++ b/packages/host/src/node/cli/program.ts
@@ -28,7 +28,7 @@ import { linkAndroidDir } from "./android";
// We're attaching a lot of listeners when spawning in parallel
EventEmitter.defaultMaxListeners = 100;
-export const program = new Command("react-native-node-api-modules").addCommand(
+export const program = new Command("react-native-node-api").addCommand(
vendorHermes
);
diff --git a/packages/react-native-node-api-modules/src/node/cli/run.ts b/packages/host/src/node/cli/run.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/cli/run.ts
rename to packages/host/src/node/cli/run.ts
diff --git a/packages/react-native-node-api-modules/src/node/duplicates.ts b/packages/host/src/node/duplicates.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/duplicates.ts
rename to packages/host/src/node/duplicates.ts
diff --git a/packages/react-native-node-api-modules/src/node/index.ts b/packages/host/src/node/index.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/index.ts
rename to packages/host/src/node/index.ts
diff --git a/packages/react-native-node-api-modules/src/node/path-utils.test.ts b/packages/host/src/node/path-utils.test.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/path-utils.test.ts
rename to packages/host/src/node/path-utils.test.ts
diff --git a/packages/react-native-node-api-modules/src/node/path-utils.ts b/packages/host/src/node/path-utils.ts
similarity index 98%
rename from packages/react-native-node-api-modules/src/node/path-utils.ts
rename to packages/host/src/node/path-utils.ts
index e09b31ac..ec93df86 100644
--- a/packages/react-native-node-api-modules/src/node/path-utils.ts
+++ b/packages/host/src/node/path-utils.ts
@@ -45,13 +45,13 @@ export function isNodeApiModule(modulePath: string): boolean {
if (!entries.includes(fileName)) {
return false;
}
-
+
const filePath = path.join(dir, fileName);
-
+
try {
// First, check if file exists (works the same on all platforms)
fs.accessSync(filePath, fs.constants.F_OK);
-
+
// Then check if it's readable (behavior differs by platform)
if (!isReadableSync(filePath)) {
throw new Error(`Found an unreadable module ${fileName}`);
@@ -237,7 +237,7 @@ export const MAGIC_FILENAME = "react-native-node-api-module";
* Default patterns to use when excluding paths from the search for Node-API modules.
*/
export const DEFAULT_EXCLUDE_PATTERNS = [
- /\/react-native-node-api-modules\//,
+ /\/react-native-node-api\//,
/\/node_modules\//,
/\/.git\//,
];
@@ -277,12 +277,12 @@ export function findNodeApiModulePaths(
}
const candidatePath = path.join(fromPath, suffix);
// Normalize path separators for consistent pattern matching on all platforms
- const normalizedSuffix = suffix.split(path.sep).join('/');
-
+ const normalizedSuffix = suffix.split(path.sep).join("/");
+
if (excludePatterns.some((pattern) => pattern.test(normalizedSuffix))) {
return [];
}
-
+
return fs
.readdirSync(candidatePath, { withFileTypes: true })
.flatMap((file) => {
diff --git a/packages/react-native-node-api-modules/src/node/prebuilds/android.ts b/packages/host/src/node/prebuilds/android.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/prebuilds/android.ts
rename to packages/host/src/node/prebuilds/android.ts
diff --git a/packages/react-native-node-api-modules/src/node/prebuilds/apple.ts b/packages/host/src/node/prebuilds/apple.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/prebuilds/apple.ts
rename to packages/host/src/node/prebuilds/apple.ts
diff --git a/packages/react-native-node-api-modules/src/node/prebuilds/triplets.ts b/packages/host/src/node/prebuilds/triplets.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/prebuilds/triplets.ts
rename to packages/host/src/node/prebuilds/triplets.ts
diff --git a/packages/react-native-node-api-modules/src/node/test-utils.ts b/packages/host/src/node/test-utils.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/node/test-utils.ts
rename to packages/host/src/node/test-utils.ts
diff --git a/packages/react-native-node-api-modules/src/react-native/NativeNodeApiHost.ts b/packages/host/src/react-native/NativeNodeApiHost.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/react-native/NativeNodeApiHost.ts
rename to packages/host/src/react-native/NativeNodeApiHost.ts
diff --git a/packages/react-native-node-api-modules/src/react-native/index.ts b/packages/host/src/react-native/index.ts
similarity index 100%
rename from packages/react-native-node-api-modules/src/react-native/index.ts
rename to packages/host/src/react-native/index.ts
diff --git a/packages/react-native-node-api-modules/tsconfig.json b/packages/host/tsconfig.json
similarity index 100%
rename from packages/react-native-node-api-modules/tsconfig.json
rename to packages/host/tsconfig.json
diff --git a/packages/react-native-node-api-modules/tsconfig.node-scripts.json b/packages/host/tsconfig.node-scripts.json
similarity index 100%
rename from packages/react-native-node-api-modules/tsconfig.node-scripts.json
rename to packages/host/tsconfig.node-scripts.json
diff --git a/packages/react-native-node-api-modules/tsconfig.node-tests.json b/packages/host/tsconfig.node-tests.json
similarity index 100%
rename from packages/react-native-node-api-modules/tsconfig.node-tests.json
rename to packages/host/tsconfig.node-tests.json
diff --git a/packages/react-native-node-api-modules/tsconfig.node.json b/packages/host/tsconfig.node.json
similarity index 100%
rename from packages/react-native-node-api-modules/tsconfig.node.json
rename to packages/host/tsconfig.node.json
diff --git a/packages/react-native-node-api-modules/tsconfig.react-native.json b/packages/host/tsconfig.react-native.json
similarity index 100%
rename from packages/react-native-node-api-modules/tsconfig.react-native.json
rename to packages/host/tsconfig.react-native.json
diff --git a/packages/react-native-node-api-modules/types/node-api-headers/index.d.ts b/packages/host/types/node-api-headers/index.d.ts
similarity index 100%
rename from packages/react-native-node-api-modules/types/node-api-headers/index.d.ts
rename to packages/host/types/node-api-headers/index.d.ts
diff --git a/packages/react-native-node-api-modules/weak-node-api/CMakeLists.txt b/packages/host/weak-node-api/CMakeLists.txt
similarity index 100%
rename from packages/react-native-node-api-modules/weak-node-api/CMakeLists.txt
rename to packages/host/weak-node-api/CMakeLists.txt
diff --git a/packages/node-addon-examples/README.md b/packages/node-addon-examples/README.md
index 2f818659..11439dee 100644
--- a/packages/node-addon-examples/README.md
+++ b/packages/node-addon-examples/README.md
@@ -1,5 +1,5 @@
# `react-native-node-addon-examples`
-A wrapper around the examples in the [nodejs/node-addon-examples](https://github.com/nodejs/node-addon-examples) repo, using `gyp-to-cmake` and `react-native-node-api-cmake` to prepare prebuilds and scaffolding for loading the addons.
+A wrapper around the examples in the [nodejs/node-addon-examples](https://github.com/nodejs/node-addon-examples) repo, using `gyp-to-cmake` and `cmake-rn` to prepare prebuilds and scaffolding for loading the addons.
The main purpose is to use these as tests to verify the implementation. We choose to use this as our first signal for compliance, over the [js-native-api tests in the Node.js project](https://github.com/nodejs/node/tree/main/test/js-native-api), because the examples depends much less on Node.js built-in runtime APIs.
diff --git a/packages/node-addon-examples/package.json b/packages/node-addon-examples/package.json
index e39654eb..1863b785 100644
--- a/packages/node-addon-examples/package.json
+++ b/packages/node-addon-examples/package.json
@@ -1,10 +1,10 @@
{
- "name": "react-native-node-addon-examples",
+ "name": "@react-native-node-api/node-addon-examples",
"private": true,
- "homepage": "https://github.com/callstackincubator/react-native-node-api-modules",
+ "homepage": "https://github.com/callstackincubator/react-native-node-api",
"repository": {
"type": "git",
- "url": "git+https://github.com/callstackincubator/react-native-node-api-modules.git",
+ "url": "git+https://github.com/callstackincubator/react-native-node-api.git",
"directory": "packages/node-addon-examples"
},
"scripts": {
@@ -16,9 +16,9 @@
"test": "npm run copy-and-build && npm run verify"
},
"devDependencies": {
+ "cmake-rn": "*",
"node-addon-examples": "github:nodejs/node-addon-examples#4213d4c9d07996ae68629c67926251e117f8e52a",
"gyp-to-cmake": "*",
- "react-native-node-api-cmake": "*",
"read-pkg": "^9.0.1"
}
}
diff --git a/packages/node-addon-examples/scripts/build-examples.mts b/packages/node-addon-examples/scripts/build-examples.mts
index 1a5ed30b..f43f446f 100644
--- a/packages/node-addon-examples/scripts/build-examples.mts
+++ b/packages/node-addon-examples/scripts/build-examples.mts
@@ -5,10 +5,10 @@ import { findCMakeProjects } from "./cmake-projects.mjs";
const projectDirectories = findCMakeProjects();
for (const projectDirectory of projectDirectories) {
- console.log(`Running "react-native-node-api-cmake" in ${projectDirectory}`);
+ console.log(`Running "cmake-rn" in ${projectDirectory}`);
execSync(
- "react-native-node-api-cmake --android --apple",
- // "react-native-node-api-cmake --triplet aarch64-linux-android --triplet arm64-apple-ios-sim",
+ "cmake-rn --android --apple",
+ // "cmake-rn --triplet aarch64-linux-android --triplet arm64-apple-ios-sim",
{
cwd: projectDirectory,
stdio: "inherit",
diff --git a/tsconfig.json b/tsconfig.json
index 8bf7d5f4..4b931432 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,9 +1,9 @@
{
"files": [],
"references": [
- { "path": "./packages/react-native-node-api-modules/tsconfig.json" },
+ { "path": "./packages/host/tsconfig.json" },
{ "path": "./packages/gyp-to-cmake/tsconfig.json" },
- { "path": "./packages/react-native-node-api-cmake/tsconfig.json" },
+ { "path": "./packages/cmake-rn/tsconfig.json" },
{ "path": "./packages/ferric/tsconfig.json" }
]
}