@abtnode/util 1.16.31 → 1.16.32-beta-0b7f1250

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/lib/security.js +8 -5
  2. package/package.json +6 -6
package/lib/security.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const { BLOCKLET_MODES } = require('@blocklet/constant');
2
- const fs = require('fs');
3
2
  const crypto = require('crypto');
4
3
  const AES = require('@ocap/mcrypto/lib/crypter/aes-legacy').default;
5
4
  const semver = require('semver');
@@ -102,10 +101,14 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
102
101
 
103
102
  const pm2Path = getPm2Path();
104
103
  const meiliSearchPath = findExecutable('meilisearch');
105
- const meiliSearchPathAlt = fs.existsSync('/data/bin/meilisearch') ? '/data/bin/meilisearch' : '';
104
+ const meiliSearchPathAlt = '/data/bin/meilisearch';
106
105
  const blockletCliPath = findExecutable('blocklet');
107
- const pnpmPath = findExecutable('pnpm');
108
- const pnpmGlobalPath = pnpmPath ? join(dirname(pnpmPath), 'global') : '';
106
+
107
+ // @see: https://pnpm.io/npmrc#global-dir
108
+ const pnpmGlobalPaths = [
109
+ process.env.XDG_DATA_HOME ? join(process.env.XDG_DATA_HOME, 'pnpm/global/') : '',
110
+ process.env.PNPM_HOME ? join(process.env.PNPM_HOME, 'global/') : '',
111
+ ];
109
112
 
110
113
  options.push(
111
114
  '--experimental-permission',
@@ -145,7 +148,7 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
145
148
  dirname(dirname(process.execPath)),
146
149
  process.cwd(),
147
150
  tmpdir(),
148
- pnpmGlobalPath,
151
+ ...pnpmGlobalPaths,
149
152
  ]
150
153
  .filter(Boolean)
151
154
  .filter((x) => x !== sep)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.31",
6
+ "version": "1.16.32-beta-0b7f1250",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,11 +18,11 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.16.31",
22
- "@abtnode/logger": "1.16.31",
21
+ "@abtnode/constant": "1.16.32-beta-0b7f1250",
22
+ "@abtnode/logger": "1.16.32-beta-0b7f1250",
23
23
  "@arcblock/pm2": "^5.4.0",
24
- "@blocklet/constant": "1.16.31",
25
- "@blocklet/meta": "1.16.31",
24
+ "@blocklet/constant": "1.16.32-beta-0b7f1250",
25
+ "@blocklet/meta": "1.16.32-beta-0b7f1250",
26
26
  "@ocap/client": "1.18.135",
27
27
  "@ocap/mcrypto": "1.18.135",
28
28
  "@ocap/util": "1.18.135",
@@ -82,5 +82,5 @@
82
82
  "fs-extra": "^11.2.0",
83
83
  "jest": "^29.7.0"
84
84
  },
85
- "gitHead": "03edde3e617b126c1873caa67b1d828ee1419a70"
85
+ "gitHead": "62fd56ede8cf3e0b295c88a8e75f89184a48514c"
86
86
  }