From d766f5138a0f7f7e85b6a309a5da78e08b29c3e6 Mon Sep 17 00:00:00 2001 From: Andrew Carbonetto Date: Wed, 10 Apr 2024 10:01:55 -0700 Subject: [PATCH] Node: Fix build section for node DEVELOPER.md (#1250) * Fix build section for node DEVELOPER.md Signed-off-by: Andrew Carbonetto * Fix numbers in DEVELOPER.md Signed-off-by: Andrew Carbonetto * Run prettier --------- Signed-off-by: Andrew Carbonetto Co-authored-by: Jonathan Louie --- node/DEVELOPER.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/node/DEVELOPER.md b/node/DEVELOPER.md index a6d019eea3..dfbe4b4172 100644 --- a/node/DEVELOPER.md +++ b/node/DEVELOPER.md @@ -54,17 +54,17 @@ source "$HOME/.cargo/env" Before starting this step, make sure you've installed all software requirments. -1. Clone the repository: +1. Clone the repository: ```bash VERSION=0.1.0 # You can modify this to other released version or set it to "main" to get the unstable branch git clone --branch ${VERSION} https://github.com/aws/glide-for-redis.git cd glide-for-redis ``` -2. Initialize git submodule: +2. Initialize git submodule: ```bash git submodule update --init --recursive ``` -3. Install all node dependencies: +3. Install all node dependencies: ```bash cd node npm i @@ -72,35 +72,36 @@ Before starting this step, make sure you've installed all software requirments. npm i cd .. ``` -4. Build the Node wrapper: - Choose a build option from the following and run it from the `node` folder: +4. Build the Node wrapper (Choose a build option from the following and run it from the `node` folder): - 1. Build in release mode, stripped from all debug symbols (optimized and minimized binary size): + 1. Build in release mode, stripped from all debug symbols (optimized and minimized binary size): - ```bash - npm run build:release - ``` + ```bash + npm run build:release + ``` - 2. Build in release mode with debug symbols (optimized but large binary size): + 2. Build in release mode with debug symbols (optimized but large binary size): - ```bash - npm run build:benchmark - ``` + ```bash + npm run build:benchmark + ``` - 3. For testing purposes, you can execute an unoptimized but fast build using: - `bash + 3. For testing purposes, you can execute an unoptimized but fast build using: + ```bash npm run build - ` Once building completed, you'll find the compiled JavaScript code in the`./build-ts` folder. + ``` + + Once building completed, you'll find the compiled JavaScript code in the`./build-ts` folder. -5. Run tests: +5. Run tests: 1. Ensure that you have installed redis-server and redis-cli on your host. You can find the Redis installation guide at the following link: [Redis Installation Guide](https://redis.io/docs/install/install-redis/install-redis-on-linux/). 2. Execute the following command from the node folder: ```bash npm test ``` -6. Integrating the built GLIDE package into your project: - Add the package to your project using the folder path with the command `npm install /node`. +6. Integrating the built GLIDE package into your project: + Add the package to your project using the folder path with the command `npm install /node`. - For a fast build, execute `npm run build`. This will perform a full, unoptimized build, which is suitable for developing tests. Keep in mind that performance is significantly affected in an unoptimized build, so it's required to build with the `build:release` or `build:benchmark` option when measuring performance. - If your modifications are limited to the TypeScript code, run `npm run build-external` to build the external package without rebuilding the internal package.