Skip to content

Commit d230239

Browse files
authored
Merge pull request #15 from yougotwill/feat/no-ref/fixed_electron_version
feat: fixed electron version to match session-desktop project to prevent build issues
2 parents 2e5be95 + f6f6306 commit d230239

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Libsession-util NodeJS
22

3-
This library is the wrappers around libsession-util for NodeJS. It is built using the node-native-addon and cmake-js. The build and dev instructions are quite custom, so check them out below.
3+
This library is the wrappers around libsession-util for NodeJS. It is built using the [node-addon-api](https://github.com/nodejs/node-addon-api) and [cmake-js](https://github.com/cmake-js/cmake-js). The build and dev instructions are quite custom, so check them out below.
44

55
### Issue with Yarn
66

@@ -24,13 +24,14 @@ Then, you can quickly compile a non-electron build by running `yarn cmake-js` fr
2424
Once your changes are ready to be tested in the `session-desktop` you can compile an electron build using this command:
2525

2626
```
27-
cd [SESSION_DESKTOP_FOLDER]
28-
rm -rf node_modules/libsession_util_nodejs; cp -R [FOLDER_NOT_IN_SESSION_DESKTOP]/libsession-util-nodejs node_modules/libsession_util_nodejs; rm -rf node_modules/libsession_util_nodejs/build && yarn cmake-js --runtime=electron --runtime-version=25.3.0 --arch=x64 -d node_modules/libsession_util_nodejs -p16 && yarn build:workers
27+
cd [SESSION_DESKTOP_PATH]; rm -rf node_modules/libsession_util_nodejs; cp -R [THIS_PROJECT_PATH] node_modules/libsession_util_nodejs; cd node_modules/libsession_util_nodejs && rm -rf build && yarn install && cd [SESSION_DESKTOP_PATH] && yarn build:workers
2928
```
3029

31-
Every part of this command is needed and might need to be updated using your paths. Also, the `worker:libsession` needs to be recompiled too to include the just created .node file in itself.
30+
Replace `[SESSION_DESKTOP_PATH]` with the full path to your `session-desktop` folder, replace `[THIS_PROJECT_PATH]` with the path to the root of this project folder.
3231

33-
Note: the `--runtime-version` will need to be updated in this command and in the `package.json` install script every time we update electron. It is a node version, but not part of the official node docs. If you compiled the node module for an incorrect electron/node version you will get an error on session-desktop start. Just google it to find the required electron version to compile the node module for.
32+
Every part of this command is needed and might need to be updated using your paths. Also, the `worker:libsession` needs to be recompiled too to include the just created .node file in itself. This is done by the `yarn build:workers` command.
33+
34+
Note: The `electron` property in the `config` object will need to be updated in the `package.json` every time we update `electron` package in [session-desktop](https://github.com/oxen-io/session-desktop/) so that the versions match. It is a node version, but not part of the official node docs. If you compiled the node module for an incorrect electron/node version you will get an error on `session-desktop` start.
3435

3536
### Making a Release and updating Session-desktop
3637

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
"name": "Oxen Project",
99
"email": "[email protected]"
1010
},
11+
"config": {
12+
"electron": "25.8.4"
13+
},
1114
"scripts": {
12-
"install": "cmake-js compile --runtime=electron --runtime-version=25.3.0 -p16"
15+
"install": "cmake-js compile --runtime=electron --runtime-version=$npm_package_config_electron -p16"
1316
},
1417
"devDependencies": {
1518
"clang-format": "^1.8.0"

0 commit comments

Comments
 (0)