Skip to content

Commit

Permalink
Node: Fix build section for node DEVELOPER.md (valkey-io#1250)
Browse files Browse the repository at this point in the history
* Fix build section for node DEVELOPER.md

Signed-off-by: Andrew Carbonetto <[email protected]>

* Fix numbers in DEVELOPER.md

Signed-off-by: Andrew Carbonetto <[email protected]>

* Run prettier

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Jonathan Louie <[email protected]>
  • Loading branch information
acarbonetto and jonathanl-bq authored Apr 10, 2024
1 parent 939a519 commit d766f51
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions node/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,53 +54,54 @@ 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
cd rust-client
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 <path to GLIDE>/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 <path to GLIDE>/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.
Expand Down

0 comments on commit d766f51

Please sign in to comment.