@abtnode/util 1.16.47-beta-20250729-133234-77359596 → 1.16.47-beta-20250730-070104-87a128a5
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/lib/security.js +21 -3
- package/package.json +6 -6
package/lib/security.js
CHANGED
|
@@ -83,17 +83,33 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
|
|
|
83
83
|
|
|
84
84
|
if (
|
|
85
85
|
nodeOptions.includes('--experimental-permission') ||
|
|
86
|
+
nodeOptions.includes('--permission') ||
|
|
86
87
|
nodeOptions.includes('--allow-fs-read') ||
|
|
87
|
-
nodeOptions.includes('--allow-fs-write')
|
|
88
|
+
nodeOptions.includes('--allow-fs-write') ||
|
|
89
|
+
nodeOptions.includes('--allow-addons') ||
|
|
90
|
+
nodeOptions.includes('--allow-child-process') ||
|
|
91
|
+
nodeOptions.includes('--allow-worker')
|
|
88
92
|
) {
|
|
93
|
+
console.error('getSecurityNodeOptions', {
|
|
94
|
+
nodeOptions,
|
|
95
|
+
});
|
|
89
96
|
throw new Error(
|
|
90
|
-
'process.env.NODE_OPTIONS should not include --experimental-permission or --allow-fs-read or --allow-fs-write'
|
|
97
|
+
'process.env.NODE_OPTIONS should not include --experimental-permission or --permission or --allow-fs-read or --allow-fs-write or --allow-addons or --allow-child-process or --allow-worker'
|
|
91
98
|
);
|
|
92
99
|
}
|
|
93
100
|
if (!blocklet) {
|
|
94
101
|
throw new Error('blocklet is not defined');
|
|
95
102
|
}
|
|
96
103
|
|
|
104
|
+
// 当我们处于调试模式的时候,那么自动跳过权限模型,否则无法正常工作。see: https://github.com/microsoft/vscode-js-debug/issues/2245#issuecomment-3045560337
|
|
105
|
+
if (
|
|
106
|
+
nodeOptions.includes('ms-vscode.js-debug/src/bootloader.js') &&
|
|
107
|
+
(blocklet.mode === BLOCKLET_MODES.DEVELOPMENT ||
|
|
108
|
+
blocklet.environmentObj.BLOCKLET_MODE === BLOCKLET_MODES.DEVELOPMENT)
|
|
109
|
+
) {
|
|
110
|
+
return nodeOptions;
|
|
111
|
+
}
|
|
112
|
+
|
|
97
113
|
// @note: vscode 开启调试模式的时候,需要携带某些权限
|
|
98
114
|
const options = [nodeOptions].filter((x) => Boolean(x) && x !== 'undefined');
|
|
99
115
|
|
|
@@ -113,7 +129,7 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
|
|
|
113
129
|
];
|
|
114
130
|
|
|
115
131
|
options.push(
|
|
116
|
-
'--
|
|
132
|
+
'--permission',
|
|
117
133
|
...[
|
|
118
134
|
blocklet.environmentObj.BLOCKLET_DATA_DIR, // allow each component to write it's own data
|
|
119
135
|
blocklet.environmentObj.BLOCKLET_APP_DIR, // allow each component to write it's own source code: for example, to install dependencies
|
|
@@ -155,6 +171,8 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
|
|
|
155
171
|
process.cwd(),
|
|
156
172
|
tmpdir(),
|
|
157
173
|
join(homedir(), '.cursor-server'),
|
|
174
|
+
// @note: 兼容 Mac OS 下的 Cursor 的安装路径
|
|
175
|
+
'/Applications/Cursor.app',
|
|
158
176
|
...pnpmGlobalPaths,
|
|
159
177
|
]
|
|
160
178
|
.filter(Boolean)
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.47-beta-
|
|
6
|
+
"version": "1.16.47-beta-20250730-070104-87a128a5",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,13 +18,13 @@
|
|
|
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.47-beta-
|
|
22
|
-
"@abtnode/db-cache": "1.16.47-beta-
|
|
21
|
+
"@abtnode/constant": "1.16.47-beta-20250730-070104-87a128a5",
|
|
22
|
+
"@abtnode/db-cache": "1.16.47-beta-20250730-070104-87a128a5",
|
|
23
23
|
"@arcblock/did": "1.21.0",
|
|
24
24
|
"@arcblock/pm2": "^6.0.12",
|
|
25
|
-
"@blocklet/constant": "1.16.47-beta-
|
|
25
|
+
"@blocklet/constant": "1.16.47-beta-20250730-070104-87a128a5",
|
|
26
26
|
"@blocklet/error": "^0.2.5",
|
|
27
|
-
"@blocklet/meta": "1.16.47-beta-
|
|
27
|
+
"@blocklet/meta": "1.16.47-beta-20250730-070104-87a128a5",
|
|
28
28
|
"@blocklet/xss": "^0.2.2",
|
|
29
29
|
"@ocap/client": "1.21.0",
|
|
30
30
|
"@ocap/mcrypto": "1.21.0",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"fs-extra": "^11.2.0",
|
|
90
90
|
"jest": "^29.7.0"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "a202f415488de553a2534d1a3d2a489dda27936c"
|
|
93
93
|
}
|