@valkey/valkey-glide-darwin-x64 1.2.0-rc000 → 1.2.0-rc003
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/glide-rs/glide-rs.darwin-x64.node +0 -0
- package/package.json +5 -3
- package/.ort.yml +0 -9
- package/.prettierignore +0 -7
- package/DEVELOPER.md +0 -191
|
Binary file
|
package/package.json
CHANGED
|
@@ -67,10 +67,12 @@
|
|
|
67
67
|
"tests/",
|
|
68
68
|
"rust-client/**",
|
|
69
69
|
"!build-ts/**",
|
|
70
|
-
"
|
|
70
|
+
".prettierignore",
|
|
71
71
|
"jest.config.js",
|
|
72
72
|
"hybrid-node-tests/**",
|
|
73
|
-
"docs/"
|
|
73
|
+
"docs/",
|
|
74
|
+
"DEVELOPER.md",
|
|
75
|
+
".ort.yml"
|
|
74
76
|
]
|
|
75
77
|
},
|
|
76
78
|
"//": [
|
|
@@ -83,5 +85,5 @@
|
|
|
83
85
|
"darwin"
|
|
84
86
|
],
|
|
85
87
|
"name": "@valkey/valkey-glide-darwin-x64",
|
|
86
|
-
"version": "1.2.0-
|
|
88
|
+
"version": "1.2.0-rc003"
|
|
87
89
|
}
|
package/.ort.yml
DELETED
package/.prettierignore
DELETED
package/DEVELOPER.md
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
# Developer Guide
|
|
2
|
-
|
|
3
|
-
This document describes how to set up your development environment to build and test Valkey GLIDE Node wrapper.
|
|
4
|
-
|
|
5
|
-
### Development Overview
|
|
6
|
-
|
|
7
|
-
The GLIDE Node wrapper consists of both TypeScript and Rust code. Rust bindings for Node.js are implemented using [napi-rs](https://github.com/napi-rs/napi-rs). The Node and Rust components communicate using the [protobuf](https://github.com/protocolbuffers/protobuf) protocol.
|
|
8
|
-
|
|
9
|
-
### Build from source
|
|
10
|
-
|
|
11
|
-
#### Prerequisites
|
|
12
|
-
|
|
13
|
-
Software Dependencies
|
|
14
|
-
|
|
15
|
-
##### **Note:** Nodejs Supported Version
|
|
16
|
-
|
|
17
|
-
If your Nodejs version is below the supported version specified in the client's [documentation](https://github.com/valkey-io/valkey-glide/blob/main/node/README.md#nodejs-supported-version), you can upgrade it using [NVM](https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script).
|
|
18
|
-
|
|
19
|
-
- npm
|
|
20
|
-
- git
|
|
21
|
-
- GCC
|
|
22
|
-
- pkg-config
|
|
23
|
-
- protoc (protobuf compiler)
|
|
24
|
-
- openssl
|
|
25
|
-
- openssl-dev
|
|
26
|
-
- rustup
|
|
27
|
-
|
|
28
|
-
**Dependencies installation for Ubuntu**
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
sudo apt update -y
|
|
32
|
-
sudo apt install -y nodejs npm git gcc pkg-config protobuf-compiler openssl libssl-dev
|
|
33
|
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
34
|
-
source "$HOME/.cargo/env"
|
|
35
|
-
# Check the installed node version
|
|
36
|
-
node -v
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
> **Note:** Ensure that you installed a supported Node.js version. For Ubuntu 22.04 or earlier, please refer to the instructions [here](#note-nodejs-supported-version) to upgrade your Node.js version.
|
|
40
|
-
|
|
41
|
-
**Dependencies installation for CentOS**
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
sudo yum update -y
|
|
45
|
-
sudo yum install -y nodejs git gcc pkgconfig protobuf-compiler openssl openssl-devel gettext
|
|
46
|
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
47
|
-
source "$HOME/.cargo/env"
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Dependencies installation for MacOS**
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
brew update
|
|
54
|
-
brew install nodejs git gcc pkgconfig protobuf openssl
|
|
55
|
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
56
|
-
source "$HOME/.cargo/env"
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
#### Building and installation steps
|
|
60
|
-
|
|
61
|
-
Before starting this step, make sure you've installed all software requirments.
|
|
62
|
-
|
|
63
|
-
1. Clone the repository:
|
|
64
|
-
```bash
|
|
65
|
-
git clone https://github.com/valkey-io/valkey-glide.git
|
|
66
|
-
cd valkey-glide
|
|
67
|
-
```
|
|
68
|
-
2. Install all node dependencies:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
cd node
|
|
72
|
-
npm i
|
|
73
|
-
cd rust-client
|
|
74
|
-
npm i
|
|
75
|
-
cd ..
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
3. Build the Node wrapper (Choose a build option from the following and run it from the `node` folder):
|
|
79
|
-
|
|
80
|
-
1. Build in release mode, stripped from all debug symbols (optimized and minimized binary size):
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npm run build:release
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
2. Build in release mode with debug symbols (optimized but large binary size):
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
npm run build:benchmark
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
3. For testing purposes, you can execute an unoptimized but fast build using:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
npm run build
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Once building completed, you'll find the compiled JavaScript code in the`./build-ts` folder.
|
|
99
|
-
|
|
100
|
-
4. Run tests:
|
|
101
|
-
1. Ensure that you have installed server and valkey-cli on your host. You can download Valkey at the following link: [Valkey Download page](https://valkey.io/download/).
|
|
102
|
-
2. Execute the following command from the node folder:
|
|
103
|
-
```bash
|
|
104
|
-
npm run build # make sure we have a debug build compiled first
|
|
105
|
-
npm test
|
|
106
|
-
```
|
|
107
|
-
5. Integrating the built GLIDE package into your project:
|
|
108
|
-
Add the package to your project using the folder path with the command `npm install <path to GLIDE>/node`.
|
|
109
|
-
|
|
110
|
-
- 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.
|
|
111
|
-
- If your modifications are limited to the TypeScript code, run `npm run build-external` to build the external package without rebuilding the internal package.
|
|
112
|
-
- If your modifications are limited to the Rust code, execute `npm run build-internal` to build the internal package and generate TypeScript code.
|
|
113
|
-
- To generate Node's protobuf files, execute `npm run build-protobuf`. Keep in mind that protobuf files are generated as part of full builds (e.g., `build`, `build:release`, etc.).
|
|
114
|
-
|
|
115
|
-
> Note: Once building completed, you'll find the compiled JavaScript code in the `node/build-ts` folder.
|
|
116
|
-
|
|
117
|
-
### Troubleshooting
|
|
118
|
-
|
|
119
|
-
- If the build fails after running `npx tsc` because `glide-rs` isn't found, check if your npm version is in the range 9.0.0-9.4.1, and if so, upgrade it. 9.4.2 contains a fix to a change introduced in 9.0.0 that is required in order to build the library.
|
|
120
|
-
|
|
121
|
-
### Test
|
|
122
|
-
|
|
123
|
-
To run tests, use the following command:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
npm test
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
To execute a specific test, include the [`testNamePattern`](https://jestjs.io/docs/cli#--testnamepatternregex) option. For example:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npm run test -- --testNamePattern="transaction"
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
IT suite starts the server for testing - standalone and cluster installation using `cluster_manager` script.
|
|
136
|
-
To run the integration tests with existing servers, run the following command:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npm run test -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Submodules
|
|
143
|
-
|
|
144
|
-
After pulling new changes, ensure that you update the submodules by running the following command:
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
git submodule update
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Linters
|
|
151
|
-
|
|
152
|
-
Development on the Node wrapper may involve changes in either the TypeScript or Rust code. Each language has distinct linter tests that must be passed before committing changes.
|
|
153
|
-
|
|
154
|
-
#### Language-specific Linters
|
|
155
|
-
|
|
156
|
-
**TypeScript:**
|
|
157
|
-
|
|
158
|
-
- ESLint
|
|
159
|
-
- Prettier
|
|
160
|
-
|
|
161
|
-
**Rust:**
|
|
162
|
-
|
|
163
|
-
- clippy
|
|
164
|
-
- fmt
|
|
165
|
-
|
|
166
|
-
#### Running the linters
|
|
167
|
-
|
|
168
|
-
1. TypeScript
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Run from the node folder
|
|
172
|
-
npm run lint
|
|
173
|
-
# To automatically apply ESLint and/or prettier recommendations
|
|
174
|
-
npx run lint:fix
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
2. Rust
|
|
178
|
-
```bash
|
|
179
|
-
# Run from the `node/rust-client` folder
|
|
180
|
-
rustup component add clippy rustfmt
|
|
181
|
-
cargo clippy --all-features --all-targets -- -D warnings
|
|
182
|
-
cargo fmt --manifest-path ./Cargo.toml --all
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Recommended extensions for VS Code
|
|
186
|
-
|
|
187
|
-
- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - JavaScript / TypeScript formatter.
|
|
188
|
-
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - linter.
|
|
189
|
-
- [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) - in-editor test runner.
|
|
190
|
-
- [Jest Test Explorer](https://marketplace.visualstudio.com/items?itemName=kavod-io.vscode-jest-test-adapter) - adapter to the VSCode testing UI.
|
|
191
|
-
- [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) - Rust language support for VSCode.
|