Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
19 changes: 10 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- name: Set up Node.JS 18.x
uses: actions/setup-node@v4
with:
Expand All @@ -253,19 +257,16 @@ jobs:
name: library-linux-x86_64

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Build
run: yarn build
run: pnpm build

- name: Lint
run: yarn lint

- name: Check format
run: yarn check-format
run: pnpm style:check

- name: Check types
run: yarn check-types
run: pnpm types:check

- name: Run local node pool
run: |
Expand All @@ -279,8 +280,8 @@ jobs:
- name: Run tests
env:
# binary is downloaded to root of repository
LIB_INDY_VDR_PATH: ../../../
run: yarn test
LIB_INDY_VDR_PATH: ../../
run: pnpm test

- name: Publish JavaScript Wrapper
if: |
Expand Down
4 changes: 0 additions & 4 deletions wrappers/javascript/.eslintignore

This file was deleted.

107 changes: 0 additions & 107 deletions wrappers/javascript/.eslintrc.js

This file was deleted.

3 changes: 1 addition & 2 deletions wrappers/javascript/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ android.iml

# node.js
node_modules/
yarn-error.log

# BUCK
buck-out/
Expand All @@ -48,4 +47,4 @@ react-native/android/gradle*

**/build
**/native/mobile
genesis.txn
genesis.txn
5 changes: 0 additions & 5 deletions wrappers/javascript/.prettierrc

This file was deleted.

10 changes: 5 additions & 5 deletions wrappers/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ This document focuses on developer documentation for the wrapper. For usage see

### Prerequisites

- Node.js 16.11.0 or higher
- Yarn
- Node.js 18 or higher
- PNPM

### Installation

```sh
yarn install
pnpm install
```

### Running Tests
Expand All @@ -24,15 +24,15 @@ First make sure you've built the library using the `build.sh` script in the root
Then run the tests with the following command. This will automatically use the local build of Indy VDR.

```sh
yarn test:local-build
pnpm test:local-build
```

## Releasing

You can change the version of all packages in the `wrappers/javascript` directory by running the following command:

```sh
yarn set-version 0.2.0 # make sure to change version
pnpm set-version 0.2.0 # make sure to change version
```

The packages will automatically be released when a release is created on GitHub, or the workflow dispatch event is triggered.
30 changes: 30 additions & 0 deletions wrappers/javascript/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"organizeImports": {
"enabled": true
},
"vcs": {
"useIgnoreFile": true,
"clientKind": "git",
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"quoteStyle": "single"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedImports": "error"
}
}
}
}
14 changes: 12 additions & 2 deletions wrappers/javascript/indy-vdr-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This library requires (and has been tested extensively with) Node.js version `18
## Installation

```sh
yarn add @hyperledger/indy-vdr-nodejs
pnpm add @hyperledger/indy-vdr-nodejs
```

## Usage
Expand Down Expand Up @@ -47,7 +47,17 @@ cd wrappers/javascript

docker exec $(docker ps -aqf "ancestor=test_pool") cat /var/lib/indy/sandbox/pool_transactions_genesis >> genesis.txn

yarn test:local-build
pnpm test:local-build
```

> **Note**: If you want to use this library in a cross-platform environment you need to import methods from the `@hyperledger/indy-vdr-shared` package instead. This is a platform independent package that allows to register the native bindings. The `@hyperledger/indy-vdr-nodejs` package uses this package under the hood. See the [Indy VDR Shared README](https://github.com/hyperledger/indy-vdr/tree/main/wrappers/javascript/indy-vdr-shared/README.md) for documentation on how to use this package.

## Version Compatibility

The JavaScript wrapper is versioned independently from the native bindings. The following table shows the compatibility between the different versions:

| Indy VDR | JavaScript Wrapper |
| ------------- | ------------------ |
| v0.4.0-dev.16 | v0.1.0 |
| v0.4.1 | v0.2.x |
| v0.4.3 | v0.3.0 |
18 changes: 0 additions & 18 deletions wrappers/javascript/indy-vdr-nodejs/babel.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions wrappers/javascript/indy-vdr-nodejs/jest.config.ts

This file was deleted.

24 changes: 7 additions & 17 deletions wrappers/javascript/indy-vdr-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/indy-vdr-nodejs",
"version": "0.2.0-dev.6",
"version": "0.3.0-dev.0",
"license": "Apache-2.0",
"description": "Nodejs wrapper for Indy Vdr",
"source": "src/index",
Expand All @@ -15,33 +15,23 @@
"publishConfig": {
"access": "public"
},
"files": [
"build",
"scripts"
],
"files": ["build", "scripts"],
"scripts": {
"build": "yarn clean && yarn compile",
"build": "pnpm clean && pnpm compile",
"clean": "rimraf -rf ./build",
"compile": "tsc -p tsconfig.build.json",
"test": "jest",
"install": "node scripts/install.js"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.26",
"@types/node": "^20.14.2",
"@types/ref-struct-di": "^1.1.6",
"babel-plugin-module-resolver": "^4.0.0",
"jest": "^28.0.2",
"prettier": "2.6.2",
"ts-node": "^10.7.0",
"typescript": "~4.9.4"
"rimraf": "^5.0.7",
"typescript": "~5.4.5"
},
"dependencies": {
"@2060.io/ffi-napi": "4.0.9",
"@2060.io/ref-napi": "3.0.6",
"@hyperledger/indy-vdr-shared": "0.2.0-dev.6",
"@hyperledger/indy-vdr-shared": "workspace:*",
"@mapbox/node-pre-gyp": "^1.0.10",
"@types/ref-array-di": "^1.2.8",
"ref-array-di": "^1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions wrappers/javascript/indy-vdr-nodejs/scripts/install.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { execSync } = require('node:child_process')
const { arch, platform: osPlatform } = require('os')
const { arch, platform: osPlatform } = require('node:os')

const archTable = {
x64: 'x86_64',
Expand All @@ -8,7 +8,7 @@ const archTable = {

const platform = osPlatform()
const targetPlatform = platform === 'win32' ? 'windows' : platform
const targetArchitecture = platform == 'darwin' ? 'universal' : archTable[arch]
const targetArchitecture = platform === 'darwin' ? 'universal' : archTable[arch]

const command = `node-pre-gyp install --target_arch=${targetArchitecture} --target_platform=${targetPlatform}`

Expand Down
Loading