Skip to content

Commit 44479af

Browse files
committed
chore: move to pnpm
1 parent e8c6b6a commit 44479af

File tree

5 files changed

+689
-608
lines changed

5 files changed

+689
-608
lines changed

BUILDING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Building instructions
22

3-
yarn install
3+
pnpm install
44

5-
For more advanced/customized builds, you may want to invoke `yarn cmake-js ...` directly.
5+
For more advanced/customized builds, you may want to invoke `pnpm cmake-js ...` directly.

Readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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

5-
### Issue with Yarn
5+
### Issue with pnpm
66

77
The yarn package manager (used on session-desktop) does understand what is a git url in a dependency as part of a package.json file, but won't do a full clone including submodules when forking such a repository. For more details, see https://github.com/yarnpkg/yarn/issues/1488
88

@@ -20,16 +20,16 @@ git clone --recursive [email protected]:oxen-io/libsession-util-nodejs.git
2020
```
2121

2222
Always do your changes in `[FOLDER_NOT_IN_SESSION_DESKTOP]/libsession-util-nodejs`, never in the one under session-desktop's `node_modules` as you might override your local changes.
23-
Then, you can quickly compile a non-electron build by running `yarn cmake-js` from that folder. This is a quick incremental build which can check for C++ compilation errors.
23+
Then, you can quickly compile a non-electron build by running `pnpm cmake-js` from that folder. This is a quick incremental build which can check for C++ compilation errors.
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_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
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 && pnpm install && cd [SESSION_DESKTOP_PATH] && pnpm build:workers
2828
```
2929

3030
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.
3131

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.
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 `pnpm build:workers` command.
3333

3434
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.
3535

@@ -62,15 +62,15 @@ And then upload the generated `libsession_util_nodejs-v$PACKAGE_VERSION.tar.gz`
6262
The git-archive-all relies on the `.gitattributes` to know what to include or exclude.
6363

6464
Once this is done, update the dependency on `session-desktop`.
65-
Make sure to remove the existing one first (with the include `yarn remove` below) as you might have messed up your `node_modules` doing the dev instructions.
65+
Make sure to remove the existing one first (with the include `pnpm remove` below) as you might have messed up your `node_modules` doing the dev instructions.
6666

6767
```
68-
yarn remove libsession_util_nodejs && yarn add https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.15/libsession_util_nodejs-v0.1.15.tar.gz
68+
pnpm remove libsession_util_nodejs && pnpm add https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.15/libsession_util_nodejs-v0.1.15.tar.gz
6969
```
7070

7171
Keep in mind that you need to update the two version numbers (e.g. `0.1.15`) to the just created release version of this project.
7272

73-
The cmake-js script will be run on the yarn add and should recompile your latest release of the `libsession-util-nodejs` as part of the build process and as part of the github actions on `session-desktop`.
74-
You most likely need to recompile the workers to include those new changes: `yarn worker:utils && yarn worker:libsession`.
73+
The cmake-js script will be run on the pnpm add and should recompile your latest release of the `libsession-util-nodejs` as part of the build process and as part of the github actions on `session-desktop`.
74+
You most likely need to recompile the workers to include those new changes: `pnpm worker:utils && pnpm worker:libsession`.
7575

7676
You should have your changes in the next release!

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22
"main": "index.js",
33
"name": "libsession_util_nodejs",
44
"description": "Wrappers for the Session Util Library",
5-
"version": "0.3.4",
5+
"version": "0.3.5",
66
"license": "GPL-3.0",
77
"author": {
88
"name": "Oxen Project",
99
"email": "[email protected]"
1010
},
1111
"config": {
12-
"electron": "25.8.4"
12+
"electron": ""
1313
},
1414
"scripts": {
15-
"install": "run-script-os",
16-
"install:default": "cmake-js compile --runtime=electron --runtime-version=$npm_package_config_electron -p16",
17-
"install:win32": "cmake-js compile --runtime=electron --runtime-version=%npm_package_config_electron% -p16"
15+
"preinstall": "npx only-allow pnpm",
16+
"install": "cmake-js compile --runtime=electron --runtime-version=25.8.4 -p16"
1817
},
1918
"devDependencies": {
2019
"clang-format": "^1.8.0"
2120
},
2221
"dependencies": {
2322
"cmake-js": "^7.2.1",
24-
"node-addon-api": "^6.1.0",
25-
"run-script-os": "^1.1.6"
23+
"node-addon-api": "^6.1.0"
2624
},
2725
"typings": "index.d.ts"
2826
}

0 commit comments

Comments
 (0)