dsh-code-server-app 0.1.27 → 0.1.31
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/README.en.md +64 -29
- package/README.md +60 -28
- package/lib/client.js +3 -3
- package/lib/index.js +1 -1
- package/package.json +5 -5
- package/scripts/setup-code-server.mjs +10 -7
package/lib/index.js
CHANGED
|
@@ -361,7 +361,7 @@ export async function apply(ctx, config) {
|
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
/** 读 setup 失败标记文件(
|
|
364
|
+
/** 读 setup 失败标记文件(按需安装失败时写入;成功则不存在)→ 用户可查看。
|
|
365
365
|
* 标记在安装根:<profile>\.code-server-app\last-setup-error.json。 */
|
|
366
366
|
function readLastSetupError() {
|
|
367
367
|
try {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-code-server-app",
|
|
3
|
-
|
|
4
|
-
"description": "Integrate code-server (VS Code in the browser) into DSH Web:
|
|
3
|
+
"version": "0.1.31",
|
|
4
|
+
"description": "Integrate code-server (VS Code in the browser) into DSH Web: right-sidebar tab (DSH >= 0.1.5-alpha.1) with a floating-ball fallback for older hosts, over a /code-server JSON API (host-side process lifecycle).",
|
|
5
5
|
"homepage": "https://github.com/jinsiyu/dsh-code-server-app",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
"inject": [
|
|
24
24
|
"@deepseek-ai/dsh-client-connection",
|
|
25
25
|
"@deepseek-ai/dsh-client-runtime",
|
|
26
|
-
"@deepseek-ai/dsh-client-ui-settings"
|
|
26
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
27
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right"
|
|
27
28
|
]
|
|
28
29
|
},
|
|
29
30
|
"env": {
|
|
30
|
-
"minVersion": "0.1.
|
|
31
|
+
"minVersion": "0.1.5-alpha.1"
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
"engines": {
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
"README.en.md"
|
|
50
51
|
],
|
|
51
52
|
"scripts": {
|
|
52
|
-
"postinstall": "node scripts/setup-code-server.mjs",
|
|
53
53
|
"setup:code-server": "node scripts/setup-code-server.mjs",
|
|
54
54
|
"build:client": "node scripts/build-client.mjs"
|
|
55
55
|
},
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
// scripts/setup-code-server.mjs —
|
|
1
|
+
// scripts/setup-code-server.mjs — 按需安装 code-server(Windows 兼容)。
|
|
2
2
|
//
|
|
3
3
|
// 背景:code-server 的官方 postinstall 是 `sh ./postinstall.sh`(依赖 bash/symlink),
|
|
4
4
|
// Windows 无 sh 会直接失败;pnpm 的 build-scripts 许可只认宿主根 pnpm-workspace.yaml,
|
|
5
|
-
// 依赖包声明无效。因此把 code-server 从 dependencies
|
|
6
|
-
//
|
|
7
|
-
// - npm 读取包内 package.json 的 allowScripts(code-server:false 跳过 sh;argon2/unrs
|
|
5
|
+
// 依赖包声明无效。因此把 code-server 从 dependencies 移除,改由本脚本用 **npm** 安装:
|
|
6
|
+
// - npm 读取安装根 package.json 的 allowScripts(code-server:false 跳过 sh;argon2/unrs
|
|
8
7
|
// true 构建 native)——无需 --ignore-scripts,无需改宿主配置,零报错;
|
|
9
|
-
// - 安装落在
|
|
8
|
+
// - 安装落在 **profile 专用目录**(--prefix 钉死),不写全局、不动 profile 顶层。
|
|
10
9
|
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
10
|
+
// 调用时机(插件安装期没有 postinstall,安装过程零脚本):
|
|
11
|
+
// - host 运行时:POST /code-server/setup(启动安装指引弹窗「开始安装」/ 设置卡片「安装环境」);
|
|
12
|
+
// - 手动:npm run setup:code-server / node scripts/setup-code-server.mjs。
|
|
13
|
+
//
|
|
14
|
+
// 幂等:code-server 已实例化(entry + VS Code 内部依赖 + argon2 native 均在)且版本与
|
|
15
|
+
// npm latest 一致则跳过;版本不一致则升级(每次调用都重新检查 → 自愈)。
|
|
13
16
|
import { spawnSync } from 'node:child_process';
|
|
14
17
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, readdirSync, rmSync } from 'node:fs';
|
|
15
18
|
import { dirname, join } from 'node:path';
|