dsh-code-server-app 0.1.38 → 0.1.39
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/index.js +17 -1
- package/package.json +1 -1
- package/vendor/VENDOR.json +1 -1
package/lib/index.js
CHANGED
|
@@ -237,12 +237,28 @@ function checkInnerDeps() {
|
|
|
237
237
|
return { declared: declared.length, resolved, missing };
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
/** 从 code-server 运行位置解析某个模块的包目录(与运行时同一套向上查找规则)。
|
|
241
|
+
* 先试 `<name>/package.json`,再退回模块入口。找不到返回 null。 */
|
|
242
|
+
function resolveModuleDir(fromDir, name) {
|
|
243
|
+
try {
|
|
244
|
+
const from = createRequire(path.join(fromDir ?? PACKAGE_ROOT, 'package.json'));
|
|
245
|
+
for (const spec of [`${name}/package.json`, name]) {
|
|
246
|
+
try {
|
|
247
|
+
return path.dirname(from.resolve(spec));
|
|
248
|
+
} catch { /* 试下一个 */ }
|
|
249
|
+
}
|
|
250
|
+
} catch { /* 解析器不可用 */ }
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
|
|
240
254
|
/** 环境检测:code-server 入口 + 原生模块(argon2) + 内部依赖 + 预编译原生包。
|
|
241
255
|
* 返回 { ok, entry, native, vscodeInner, innerDeps, codeServer, vendored, upToDate, nativeRuntime, node, platform, arch }。 */
|
|
242
256
|
function envCheck() {
|
|
243
257
|
const entry = bundledRuntimeEntry();
|
|
244
258
|
const csRoot = entry ? path.dirname(path.dirname(path.dirname(entry))) : null; // .../code-server
|
|
245
|
-
|
|
259
|
+
// argon2 不在 code-server 本体包里(它由平台包 @<scope>/dshcs-argon2-<平台>-<架构> 提供,
|
|
260
|
+
// 经聚合包用 npm: 别名装回原名)→ 按运行时同一套规则解析它的真实位置。
|
|
261
|
+
const argon2 = resolveModuleDir(csRoot, 'argon2');
|
|
246
262
|
// 必须按当前平台判定:argon2 的 prebuilds 目录存在不代表本平台有二进制(win32-arm64 就缺)。
|
|
247
263
|
const nativeOk = argon2 !== null && (
|
|
248
264
|
fs.existsSync(path.join(argon2, 'build', 'Release', 'argon2.node')) ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-code-server-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"description": "Integrate code-server (VS Code in the browser) into DSH Web and Desktop: right-sidebar tab (DSH >= 0.1.5-alpha.1) with a floating-ball fallback for older hosts, over the Connection /api channel (ctx.connection.fetch; no webServer dependency) with host-side process lifecycle.",
|
|
5
5
|
"homepage": "https://github.com/jinsiyu/dsh-code-server-app",
|
|
6
6
|
"repository": {
|