@hyperledger/anoncreds-nodejs 0.2.0-dev.1 → 0.2.0-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperledger/anoncreds-nodejs",
3
- "version": "0.2.0-dev.1",
3
+ "version": "0.2.0-dev.11",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Nodejs wrapper for Anoncreds",
6
6
  "main": "build/index",
@@ -20,32 +20,32 @@
20
20
  "scripts"
21
21
  ],
22
22
  "scripts": {
23
- "build": "yarn clean && yarn compile",
23
+ "check-types": "pnpm compile --noEmit",
24
+ "build": "pnpm clean && pnpm compile",
24
25
  "clean": "rimraf -rf ./build",
25
- "compile": "tsc -p tsconfig.build.json",
26
- "install": "node-pre-gyp install --target_arch=$(node scripts/arch.js) --target_platform=$(node scripts/platform.js)"
26
+ "compile": "tsc -p ./tsconfig.build.json",
27
+ "install": "node scripts/install.js"
27
28
  },
28
29
  "dependencies": {
29
30
  "@2060.io/ffi-napi": "4.0.8",
30
31
  "@2060.io/ref-napi": "3.0.6",
31
- "@hyperledger/anoncreds-shared": "0.2.0-dev.1",
32
- "@mapbox/node-pre-gyp": "^1.0.10",
33
- "node-cache": "5.1.2",
32
+ "@hyperledger/anoncreds-shared": "0.2.0-dev.11",
33
+ "@mapbox/node-pre-gyp": "^1.0.11",
34
34
  "ref-array-di": "1.2.2",
35
35
  "ref-struct-di": "1.1.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/node": "17.0.31",
39
- "@types/ref-array-di": "1.2.3",
40
- "@types/ref-struct-di": "1.1.6",
41
- "typescript": "4.5.5"
38
+ "@types/node": "^20.6.1",
39
+ "@types/ref-array-di": "^1.2.5",
40
+ "@types/ref-struct-di": "^1.1.9",
41
+ "typescript": "~5.2.2"
42
42
  },
43
43
  "binary": {
44
44
  "module_name": "anoncreds",
45
45
  "module_path": "native",
46
- "remote_path": "v0.2.0-dev.1",
46
+ "remote_path": "v0.2.0-dev.11",
47
47
  "host": "https://github.com/hyperledger/anoncreds-rs/releases/download/",
48
48
  "package_name": "library-{platform}-{arch}.tar.gz"
49
49
  },
50
- "gitHead": "f938a364c2f42ce9a4c7a598ba9fc7e3a41d381c"
50
+ "gitHead": "c12eb3cb793fe1f2b6c53488384b97a2f1b1bcc3"
51
51
  }
@@ -0,0 +1,15 @@
1
+ const { execSync } = require('node:child_process')
2
+ const { arch, platform: osPlatform } = require('os')
3
+
4
+ const archTable = {
5
+ x64: 'x86_64',
6
+ arm64: 'aarch64'
7
+ }
8
+
9
+ const platform = osPlatform()
10
+ const targetPlatform = platform === 'win32' ? 'windows' : platform
11
+ const targetArchitecture = platform == 'darwin' ? 'universal' : archTable[arch]
12
+
13
+ const command = `node-pre-gyp install --target_arch=${targetArchitecture} --target_platform=${targetPlatform}`
14
+
15
+ execSync(command)
package/scripts/arch.js DELETED
@@ -1,22 +0,0 @@
1
- const os = require('os')
2
-
3
- // Find appropriate target architecture for retrieving the anoncreds library
4
- const arch = os.arch()
5
-
6
- // Architecture mapping
7
- // This is used because node-pre-gyp uses `os.arch()` for
8
- // architecture detection, but our library uses a different
9
- // naming convention
10
- const archTable = {
11
- x64: 'x86_64',
12
- arm64: 'aarch64',
13
- }
14
-
15
- const targetArchitecture = archTable[arch]
16
-
17
- if (targetArchitecture) {
18
- // We console.log here because when we use the `yarn install` script
19
- // er evaluate this script and use the output as an argument to
20
- // node-pre-gyp as `--arch=$(node -e arch.js)`
21
- console.log(targetArchitecture)
22
- }
@@ -1,13 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- /* eslint-disable no-console */
3
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
- /* eslint-disable no-undef */
5
- const os = require('os')
6
-
7
- // Find appropriate target architecture for retrieving the anoncreds library
8
- const platform = os.platform()
9
-
10
- // We swap win32 with windows as that is the key that we use
11
- const targetPlatform = platform == 'win32' ? 'windows' : platform
12
-
13
- console.log(targetPlatform)