@openwallet-foundation/askar-nodejs 0.3.2-alpha-20250318162328 → 0.3.2

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.
Files changed (2) hide show
  1. package/package.json +5 -8
  2. package/scripts/install.js +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openwallet-foundation/askar-nodejs",
3
- "version": "0.3.2-alpha-20250318162328",
3
+ "version": "0.3.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Nodejs wrapper for Askar",
6
6
  "main": "build/index",
@@ -22,10 +22,9 @@
22
22
  "dependencies": {
23
23
  "@2060.io/ffi-napi": "^4.0.9",
24
24
  "@2060.io/ref-napi": "^3.0.6",
25
- "@mapbox/node-pre-gyp": "^1.0.11",
26
25
  "ref-array-di": "^1.2.2",
27
26
  "ref-struct-di": "^1.1.1",
28
- "@openwallet-foundation/askar-shared": "0.3.2-alpha-20250318162328"
27
+ "@openwallet-foundation/askar-shared": "0.3.2"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@types/node": "^20.12.11",
@@ -34,11 +33,9 @@
34
33
  "typescript": "~5.4.5"
35
34
  },
36
35
  "binary": {
37
- "module_name": "aries_askar",
38
- "module_path": "native",
39
- "remote_path": "v0.4.1",
40
- "host": "https://github.com/openwallet-foundation/askar/releases/download/",
41
- "package_name": "library-{platform}-{arch}.tar.gz"
36
+ "version": "v0.4.1",
37
+ "host": "https://github.com/openwallet-foundation/askar/releases/download",
38
+ "packageName": "library-{platform}-{arch}.tar.gz"
42
39
  },
43
40
  "engines": {
44
41
  "node": ">= 18"
@@ -1,5 +1,8 @@
1
- const { execSync } = require('node:child_process')
1
+ const { downloadBinaryIfNeeded } = require('@openwallet-foundation/askar-shared/installBinary')
2
2
  const { arch, platform: osPlatform } = require('os')
3
+ const path = require('path')
4
+
5
+ const { binary } = require('../package.json')
3
6
 
4
7
  const archTable = {
5
8
  x64: 'x86_64',
@@ -8,8 +11,12 @@ const archTable = {
8
11
 
9
12
  const platform = osPlatform()
10
13
  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
+ const targetArchitecture = platform === 'darwin' ? 'universal' : archTable[arch()]
15
+ const packageName = binary.packageName.replace('{platform}', targetPlatform).replace('{arch}', targetArchitecture)
14
16
 
15
- execSync(command)
17
+ downloadBinaryIfNeeded({
18
+ packageName,
19
+ host: binary.host,
20
+ version: binary.version,
21
+ targetDirectory: path.join(__dirname, '../native'),
22
+ })