From f1a2a1c04226cc68ec86831fd3acb13695e8dfdf Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Fri, 20 Jun 2025 11:21:16 -0400 Subject: [PATCH 1/3] rework readmes --- README.md | 26 ++++++++++++-------------- examples/expo/README.md | 28 ++++++++++++++++++++++++++++ examples/hello-electron/README.md | 4 ++-- 3 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 examples/expo/README.md diff --git a/README.md b/README.md index 68d974ec..1943579e 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ To install dependencies, run $ npm ci ``` -## Available Scripts +## Electron Builds the electron library in debug mode: -### `nx build electron` +`nx build electron` -Buld the electron library in release mode, suitable for distribution: +Build the electron library in release mode, suitable for distribution: -### `nx build electron -c release` +`nx build electron -c release` Runs the test suite: -### `nx test electron` +`nx test electron` -## Exploring capture-es +### Exploring Electron After building capture-es, you can explore its exports at the Node REPL: @@ -34,14 +34,12 @@ $ node > require('./dist/native.node').init("") ``` -## Distribution +## React Native -To distribute the electron library, run: +The React Native library needs to run in the context of an app, so use the `expo` example app +to build and develop the plugin. By opening the `expo` app in XCode or Android Studio, the +plugin files can be edited directly for a smoother development experience. -```sh -nx build electron -c release -npm pack ./dist/electron -``` - -This produces a .tgz in the project root that can be distributed and installed with npm. +## Example Apps +To run either of the example apps, refer to the READMEs in `examples/` diff --git a/examples/expo/README.md b/examples/expo/README.md new file mode 100644 index 00000000..ad552564 --- /dev/null +++ b/examples/expo/README.md @@ -0,0 +1,28 @@ +# Install + +From the root of the project, run: + +```bash +npm ci +``` + +Before running the example app, you need to create an .env file, so from the `expo` directory, run: + +```bash +cp .env.example .env +vim .env +``` + +And edit your env file with the proper values for the environment you're trying to test against. + +# Usage + +To run the example app, from the root of the project, run: + +```bash +nx ios expo-example # Run on iOS +nx android expo-example # Run on Android +``` + +Depending on the changes you're making locally, you may need to clean up the `ios/` and `android/` directory within `expo-example`, +as this is generated as part of the build and won't always be properly re-generated on changes. diff --git a/examples/hello-electron/README.md b/examples/hello-electron/README.md index c4c99b35..88b157db 100644 --- a/examples/hello-electron/README.md +++ b/examples/hello-electron/README.md @@ -3,10 +3,10 @@ From the root of the project, run: ```bash -npm install +npm ci ``` -Bofore running the example app, you need to create an .env file, so from the `hello-electron` directory, run: +Before running the example app, you need to create an .env file, so from the `hello-electron` directory, run: ```bash cp .env.example .env From b7a5b821a6c7f9b6a62c3a70289119756b017d51 Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Fri, 20 Jun 2025 11:34:34 -0400 Subject: [PATCH 2/3] update README --- README.md | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1943579e..265369eb 100644 --- a/README.md +++ b/README.md @@ -12,27 +12,34 @@ $ npm ci ## Electron -Builds the electron library in debug mode: +The electron library consists of two parts -`nx build electron` +- `@bitdrift/core` - the native bindings that allow calling into the Rust shared code. +- `@bitdrift/electron` - the top level library providing a JS API for `@bitdrift/core`. -Build the electron library in release mode, suitable for distribution: +The indirection allows us to have users install `@bitdrift/electron` and download the +architecture appropriate version of `@bitdrift/core`. -`nx build electron -c release` +### Useful commands -Runs the test suite: +Builds the electron native library in debug mode: -`nx test electron` +`nx build @bitdrift/core` -### Exploring Electron +Build the electron native library in release mode, suitable for distribution: -After building capture-es, you can explore its exports at the Node REPL: +`nx build @bitdrift/core -c release` -```sh -$ nx build electron -$ node -> require('./dist/native.node').init("") -``` +Runs the electron native library test suite: + +`nx test @bitdrift/core` + +Runs the electron JS library test suite: + +`nx test @bitdrift/electron` + +Most of the development of the electron logger tends to be done via the example app which can +be used to interact with the library. ## React Native @@ -43,3 +50,7 @@ plugin files can be edited directly for a smoother development experience. ## Example Apps To run either of the example apps, refer to the READMEs in `examples/` + +``` + +``` From a930f5ebc54d581ebc7238be90d95b94e4198170 Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Fri, 20 Jun 2025 11:39:48 -0400 Subject: [PATCH 3/3] fix ``` --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 265369eb..79df0d2a 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,4 @@ plugin files can be edited directly for a smoother development experience. ## Example Apps -To run either of the example apps, refer to the READMEs in `examples/` - -``` - -``` +To run either of the example apps, refer to the READMEs in `examples/`.