Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use yarn, fix comments #1953

Merged
merged 7 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/bindings-nodejs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: yarn build

- name: Update Cargo.toml with git
run: sed -i 's#path = "../core"#git = "https://github.com/iotaledger/iota-sdk", rev = "'$GITHUB_SHA'"#g' Cargo.toml
run: sed -i 's#path = "../core"#git = "https://github.com/iotaledger/iota-sdk", rev = "'$GITHUB_SHA'"#g' Cargo.toml

- name: Print Cargo.toml
run: cat Cargo.toml
Expand All @@ -50,7 +50,7 @@ jobs:
shell: sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
run: yarn publish --access public

nodejs-binding-prebuild:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
id: prepare_release
shell: bash
run: |
echo "tag_name=iota-sdk-nodejs-v$(npm pkg get version --workspaces=false | tr -d \")" >> "$GITHUB_OUTPUT"
echo "tag_name=iota-sdk-nodejs-v$(cat package.json | jq -r '.version')" >> "$GITHUB_OUTPUT"
working-directory: bindings/nodejs

- name: Sign and notarize index.node binary (macOS arm64)
Expand All @@ -235,7 +235,7 @@ jobs:
AC_PASSWORD: ${{ secrets.ASC_PASSWORD }}
working-directory: bindings/nodejs
run: |
TAR_NAME=sdk-v$(npm pkg get version --workspaces=false | tr -d \")-napi-v6-darwin-arm64.tar.gz
TAR_NAME=sdk-v$(cat package.json | jq -r '.version')-napi-v6-darwin-arm64.tar.gz

# unpack to only get the index.node
tar -xvf prebuilds/@iota/$TAR_NAME
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bindings-wasm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ jobs:
shell: sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
run: yarn publish --access public

- name: Prepare Github release
id: prepare_release
run: |
yarn pack
echo "tag_name=iota-sdk-wasm-v$(npm pkg get version --workspaces=false | tr -d \")" >> "$GITHUB_OUTPUT"
echo "tag_name=iota-sdk-wasm-v$(cat package.json | jq -r '.version')" >> "$GITHUB_OUTPUT"

- name: Upload package to Github release
uses: softprops/action-gh-release@v1
Expand Down
31 changes: 11 additions & 20 deletions bindings/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- [Windows](#windows)
- [Getting Started](#getting-started)
- [Installation Using a Package Manager](#installation-using-a-package-manager)
- [npm](#npm)
- [Yarn](#yarn)
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved
- [Install the Binding from Source](#install-the-binding-from-source)
- [Build nodejs bindings](#build-nodejs-bindings)
Expand All @@ -17,10 +16,10 @@
- [Examples](#examples)
- [API Reference](#api-reference)
- [Available Scripts](#available-scripts)
- [`npm install` or `yarn install`](#npm-install-or-yarn-install)
- [`npm run build` or `yarn build`](#npm-run-build-or-yarn-build)
- [`npm run test` or `yarn test`](#npm-run-test-or-yarn-test)
- [`npm run create-api-docs` or `yarn create-api-docs`](#npm-run-create-api-docs-or-yarn-create-api-docs)
- [`yarn install`](#yarn-install)
- [`yarn build`](#yarn-build)
- [`yarn test`](#yarn-test)
- [`yarn create-api-docs`](#yarn-create-api-docs)
- [Important Files and Directories](#important-files-and-directories)
- [Learn More](#learn-more)

Expand All @@ -44,15 +43,7 @@ an environment variable `RUSTFLAGS` to `-C target-feature=+crt-static`.

### Installation Using a Package Manager

To install the library from your package manager of choice, you only need to run the following:

#### npm

```sh
npm i @iota/sdk
```

#### Yarn:
To install the library with yarn, you only need to run the following:

```sh
yarn add @iota/sdk
Expand All @@ -70,7 +61,7 @@ This will guide you in any dependencies and running the build.
If you have already installed the project and only want to run the build, run the following:

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

This command uses the [cargo-cp-artifact](https://github.com/neon-bindings/cargo-cp-artifact) utility to run the Rust
Expand Down Expand Up @@ -159,21 +150,21 @@ You can find the API reference for the Node.js bindings in the

In the project directory, you can run the following:

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

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

### `npm run build` or `yarn build`
### `yarn build`

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

### `npm run test` or `yarn 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/).

### `npm run create-api-docs` or `yarn create-api-docs`
### `yarn create-api-docs`
Alex6323 marked this conversation as resolved.
Show resolved Hide resolved

This is mainly just used to create the API docs in the [Wiki](https://github.com/iota-wiki/iota-wiki). Executed locally it will generate a `docs` folder in the current working directory with the API docs.

Expand Down
Loading
Loading