Skip to content

Commit

Permalink
Preparing to publish (#40)
Browse files Browse the repository at this point in the history
* Disable debug libs publishing

* Removing package-lock.json from the neon lib, updating README.md (switching to the yarn)

* Add testing instructions in the neon library README
  • Loading branch information
EvgenKor authored Dec 22, 2022
1 parent d711bc1 commit 9582514
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 45 deletions.
22 changes: 15 additions & 7 deletions libzkbob-rs-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ This project was bootstrapped by [create-neon](https://www.npmjs.com/package/cre

Installing libzkbob-rs-node requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support).

You can install the project with npm. In the project directory, run:
You can install the project with yarn. In the project directory, run:

```sh
$ npm install
$ yarn install
```

This fully installs the project, including installing any dependencies and running the build.
Expand All @@ -19,7 +19,7 @@ This fully installs the project, including installing any dependencies and runni
If you have already installed the project and only want to run the build, run:

```sh
$ npm run build
$ yarn build
```

This command uses the [cargo-cp-artifact](https://github.com/neon-bindings/cargo-cp-artifact) utility to run the Rust build and copy the built library into `./index.node`.
Expand All @@ -44,15 +44,23 @@ console.log('Proof', proof);

In the project directory, you can run:

### `npm install`
### `yarn install`

Installs the project, including running `npm run build`.
Installs the project, including running `yarn build`.

### `npm build`
### `yarn build`

Builds the Node addon (`index.node`) from source.

### `npm test`
### `yarn test`

Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/).

## Testing suite

You can find the library usage example with few tests in `test.js` file
You can launch it with the following command after building the local library:

```sh
$ node test.js
```
32 changes: 0 additions & 32 deletions libzkbob-rs-node/package-lock.json

This file was deleted.

8 changes: 4 additions & 4 deletions libzkbob-rs-node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# yarn lockfile v1


"cargo-cp-artifact@^0.1":
"integrity" "sha512-CQw0doK/aaF7j041666XzuilHxqMxaKkn+I5vmBsd8SAwS0cO5CqVEVp0xJwOKstyqWZ6WK4Ww3O6p26x/Goyg=="
"resolved" "https://registry.npmjs.org/cargo-cp-artifact/-/cargo-cp-artifact-0.1.6.tgz"
"version" "0.1.6"
cargo-cp-artifact@^0.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/cargo-cp-artifact/-/cargo-cp-artifact-0.1.7.tgz#1181b9d6e71f00f17c068c05e3cd1b0864783341"
integrity sha512-pxEV9p1on8vu3BOKstVisF9TwMyGKCBRvzaVpQHuU2sLULCKrn3MJWx/4XlNzmG6xNCTPf78DJ7WCGgr2mOzjg==
4 changes: 2 additions & 2 deletions libzkbob-rs-wasm/scripts/publish
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )"

npm publish $PARENT_DIR/web
npm publish $PARENT_DIR/web-mt
npm publish $PARENT_DIR/web-debug
npm publish $PARENT_DIR/web-mt-debug
#npm publish $PARENT_DIR/web-debug
#npm publish $PARENT_DIR/web-mt-debug

0 comments on commit 9582514

Please sign in to comment.