dsh-code-server-app 0.1.32 → 0.1.37
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 +134 -90
- package/README.md +123 -88
- package/lib/client.js +3 -3
- package/lib/index.js +159 -90
- package/lib/native.js +86 -0
- package/lib/vendor.js +107 -0
- package/package.json +59 -11
- package/scripts/vendor-code-server-pkg.mjs +137 -0
- package/scripts/vendor-code-server.mjs +293 -0
- package/scripts/vendor-repacks.mjs +449 -0
- package/vendor/VENDOR.json +9 -0
- package/scripts/setup-code-server.mjs +0 -239
package/README.md
CHANGED
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
> - 微软**开源系**扩展(Python、TypeScript 调试、ESLint 等)在 Open VSX 有镜像,搜索正常可装;
|
|
11
11
|
> - **需要微软专有扩展时**:从 Marketplace 网页下载 `.vsix`,用 `code-server --install-extension <文件>`(或放入 `--extensions-dir`)手动安装,即可在插件列表使用。
|
|
12
12
|
|
|
13
|
-
静态 profile 插件(npm 包形态,host + client bundle)
|
|
14
|
-
|
|
15
|
-
无需全局 npm 安装、无需配置 `bin
|
|
13
|
+
静态 profile 插件(npm 包形态,host + client bundle),把 [code-server](https://github.com/coder/code-server)
|
|
14
|
+
**内置在插件包里**(打包期产物 `vendor/code-server`,无安装脚本、无 postinstall),插件目录里就地运行;
|
|
15
|
+
VS Code 内部依赖与预编译原生模块**全部由包管理器随插件一起装好** —— 无需全局 npm 安装、无需配置 `bin`、
|
|
16
|
+
无需改 profile 配置、无需第二条安装命令。
|
|
16
17
|
|
|
17
18
|
## UI 载体(DSH 版本决定,运行时特性检测)
|
|
18
19
|
|
|
@@ -50,62 +51,96 @@
|
|
|
50
51
|
`file:///C:/...` 形式则报 “Workspace does not exist”。
|
|
51
52
|
- process 生命周期由 host 插件管理:启动写 `$DSH_HOME/code-server/pid.json`,停止树级终止(taskkill /T 或进程组 SIGKILL),
|
|
52
53
|
崩溃/退出实时更新状态;DSH host 重启后自动 adopt 仍在运行的实例(校验 pid + /healthz),不重复启动、不误杀别的进程;
|
|
53
|
-
- `node_modules`
|
|
54
|
-
"
|
|
54
|
+
- `node_modules`、`vendor/` 与 `repack/` 已被 `.gitignore` 排除,推送/克隆仓库后按下方
|
|
55
|
+
"打包(如何出包)"执行 `pnpm install` → `pnpm run build:client` → `pnpm run vendor:code-server` →
|
|
56
|
+
(发布预编译原生包)→ `pnpm pack` + `dsh plugin --profile web add` 即可。
|
|
55
57
|
|
|
56
|
-
> 本机(BM: Windows 11 ARM64)实测:`code-server@4.
|
|
57
|
-
>
|
|
58
|
+
> 本机(BM: Windows 11 ARM64)实测:`code-server@4.136.2`(with Code 1.136.1)随插件包内置、
|
|
59
|
+
> 依赖(35 个纯 JS + 16 个预编译原生包,经平台聚合包装回原名)由 pnpm 一条命令装好 →
|
|
60
|
+
> 插件就地运行 → healthz 200 → 运行中切换 cwd 重启 → 停止 → 回收全链路验证。
|
|
58
61
|
|
|
59
|
-
##
|
|
62
|
+
## 打包(如何出包)
|
|
60
63
|
|
|
61
64
|
```powershell
|
|
62
|
-
# 1) 打包(在插件工作区)
|
|
63
65
|
cd C:\Users\User\Desktop\dsh-code-server-app
|
|
64
|
-
#
|
|
65
|
-
pnpm
|
|
66
|
-
pnpm run
|
|
67
|
-
pnpm
|
|
66
|
+
pnpm install # 开发依赖(esbuild + motion);allowBuilds 已显式声明 → 不执行任何 postinstall
|
|
67
|
+
pnpm run build:client # src/factory.js → lib/client.js(不入库,必须先构建)
|
|
68
|
+
pnpm run vendor:check # 可选:查看内置 code-server 版本 vs npm 最新版
|
|
69
|
+
pnpm run vendor:code-server # 生成 vendor/code-server(code-server 本体 + 自身依赖)
|
|
70
|
+
node scripts/vendor-repacks.mjs --target win32-arm64,win32-x64 --pack # 生成/重打包预编译原生包
|
|
71
|
+
pnpm run publish:repacks # 发布 @jinsiyu/dshcs-* 与平台聚合包(需 npm 登录)
|
|
72
|
+
pnpm pack # → dsh-code-server-app-<version>.tgz(约 59MB)
|
|
73
|
+
npm publish dsh-code-server-app-<version>.tgz --access public # 发布插件本体(同一次验证的 tarball)
|
|
68
74
|
```
|
|
69
75
|
|
|
76
|
+
| 目标 | 命令 |
|
|
77
|
+
|---|---|
|
|
78
|
+
| **打 npm 最新版 code-server** | `pnpm run vendor:latest`(= `--force`):从 registry 取 `code-server@latest` 快照到 `vendor/code-server`;之后**必须**重跑 `vendor-repacks.mjs` 更新预编译原生包并发布 |
|
|
79
|
+
| **指定版本** | `pnpm run vendor:code-server -- --version 4.136.2` |
|
|
80
|
+
| **从已装好的树快照** | `pnpm run vendor:code-server -- --from <code-server 目录>`(秒级) |
|
|
81
|
+
| **重建预编译原生包** | `node scripts/vendor-repacks.mjs [--from <已完整安装的树>] --target win32-arm64,win32-x64 --pack`(不给 `--from` 会自己 npm install 解包 + 编译,耗时) |
|
|
82
|
+
| **发布预编译原生包** | `pnpm run publish:repacks`(`--dry-run` 预览;`--only <子串>` 过滤;`--otp <code>` / `--limit N` 应对 2FA) |
|
|
83
|
+
| **发布插件本体** | `npm publish dsh-code-server-app-<version>.tgz --access public`(发布**已验证过的那份 tarball**,不会重新打包) |
|
|
84
|
+
| **只报告版本** | `pnpm run vendor:check` |
|
|
85
|
+
|
|
86
|
+
> `pnpm pack` 的 `prepack` 会自动跑一次 `vendor-code-server` 脚本;`vendor/code-server` 已存在时它是
|
|
87
|
+
> **秒级 no-op**,所以日常只改插件代码的话直接 `pnpm pack` 即可(不会偷偷升级 code-server)。
|
|
88
|
+
> 升级 code-server 必须显式 `pnpm run vendor:latest`(或 `--force`/`--version`),并重发预编译包。
|
|
89
|
+
|
|
90
|
+
## 安装插件(一条命令;依赖全部由包管理器装好)
|
|
91
|
+
|
|
70
92
|
```powershell
|
|
71
|
-
#
|
|
72
|
-
dsh plugin --profile web add
|
|
93
|
+
# 包内无 postinstall → 无需 pnpm approve-builds / allowBuilds;一条命令装完
|
|
94
|
+
dsh plugin --profile web add dsh-code-server-app@0.1.36
|
|
95
|
+
# 本地 tarball 同理:
|
|
96
|
+
dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app\dsh-code-server-app-0.1.36.tgz
|
|
73
97
|
```
|
|
74
98
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
装完即用,**没有第二步、没有「安装环境」、不弹安装指引**:
|
|
100
|
+
|
|
101
|
+
- `code-server` 本体(`vendor/code-server/`)随插件包发布,**就在插件目录里就地运行**
|
|
102
|
+
(`<profile>\node_modules\dsh-code-server-app\vendor\code-server\out\node\entry.js`);
|
|
103
|
+
- VS Code 内部依赖里**纯 JS 的部分**(35 个:xterm / katex / typescript / ws / tar …)写在插件
|
|
104
|
+
`dependencies`,由 pnpm 随插件一起装到 profile 的 `node_modules`(hoisted);
|
|
105
|
+
- **需要编译的原生包**(node-pty / @vscode/sqlite3 / kerberos / koffi / ssh2 / cpu-features /
|
|
106
|
+
@parcel/watcher / @vscode/windows-* …共 16 个)由 `@jinsiyu/dshcs-*` 预编译包提供,
|
|
107
|
+
经**平台聚合包** `@jinsiyu/dsh-code-server-runtime-<platform>-<arch>` 用 `npm:` 别名装回**原始名字**;
|
|
108
|
+
聚合包挂在插件 `optionalDependencies` 上(os/cpu 限定)→ pnpm **按架构自动选中**当前平台那一份;
|
|
109
|
+
- 因此依赖图里**没有任何带 pre/install/postinstall 或 binding.gyp 的包** →
|
|
110
|
+
不需要 profile 的 `allowBuilds`、不执行任何构建、**使用者机器不需要 C++ 工具链**。
|
|
111
|
+
|
|
112
|
+
### 安装机制(为什么这样设计)
|
|
113
|
+
|
|
114
|
+
- **pnpm 11 的硬约束**:依赖树里任何带 `preinstall|install|postinstall`(或包内含 `binding.gyp`/`.hooks`)
|
|
115
|
+
的包都被判定"需要构建",必须由**宿主 profile** 的 `pnpm-workspace.yaml` 用 `allowBuilds` 批准,
|
|
116
|
+
否则 `dsh plugin add` 直接 `[ERR_PNPM_IGNORED_BUILDS]` exit 1。依赖包自己的 `pnpm.allowBuilds`、
|
|
117
|
+
`.npmrc`、`patch:` 协议、`optionalDependencies` 全都不起作用(实测 2026-09,pnpm 11.25);
|
|
118
|
+
- **code-server 本体**因此以普通文件随包发布(而不是写进 `dependencies`)。打包期
|
|
119
|
+
`npm install code-server@<版本> --ignore-scripts`(跳过官方 `sh ./postinstall.sh`:Windows 无 sh,
|
|
120
|
+
且它只认 npm/yarn 的 user-agent)→ 补齐 argon2 native(win32-arm64 无预编译;可复用本机已有
|
|
121
|
+
`argon2.node`,见 `DSHCS_ARGON2_BINARY`)→ 剥掉残留安装脚本 → 快照到 `vendor/code-server/`;
|
|
122
|
+
- **需要编译的包**由 `scripts/vendor-repacks.mjs` 在打包期重打包成 `@jinsiyu/dshcs-*`:
|
|
123
|
+
复制已编译的包目录 → **删除 `scripts` / `files` / `binding.gyp` / `.hooks` / `.npmignore`**
|
|
124
|
+
(保留编译好的 `.node` 与全部运行时文件)→ 依赖里的同集包改成 `npm:` 别名 → 平台专属的加
|
|
125
|
+
`os`/`cpu` 与 `-<platform>-<arch>` 后缀;
|
|
126
|
+
- **平台聚合包**把重打包包按原始名字装回去(如 `"node-pty": "npm:@jinsiyu/dshcs-node-pty@1.2.0-beta.15"`),
|
|
127
|
+
于是 VS Code 内部代码 `require('node-pty')` 不用改;聚合包本身 `os`/`cpu` 限定,
|
|
128
|
+
插件 `optionalDependencies` 同时声明 win32-arm64 与 win32-x64 两份 → 一条命令自动选对;
|
|
129
|
+
- **解析路径**:`vendor/code-server/out/node/entry.js` 向上查找 →
|
|
130
|
+
`<插件>/vendor/code-server/node_modules` → `<插件>/node_modules` → `<profile>/node_modules`,
|
|
131
|
+
profile 的 `nodeLinker: hoisted` 让所有依赖都落在 `<profile>/node_modules`,与运行时一致。
|
|
132
|
+
|
|
133
|
+
> **体积提示**:插件 tarball 约 **59MB**(内置 code-server 解包 232MB);内部依赖与预编译原生包
|
|
134
|
+
> 由 pnpm 另行下载(约 300–350MB,其中原生包 ~250MB)。`vendor/` 与 `repack/` 都不入 git
|
|
135
|
+
> (见 `.gitignore`),但 `vendor/` **必须**随 npm 包发布(`files` 已包含)。
|
|
136
|
+
|
|
137
|
+
> **从 ≤ 0.1.35 升级**:旧版的安装根 `<profile>\.code-server-app`(含约 1.4GB 内部依赖)与
|
|
138
|
+
> 「安装环境」步骤都不再需要 —— 新版本会检测到它并打一条日志提示可安全删除:
|
|
139
|
+
> `Remove-Item -Recurse -Force <profile>\.code-server-app`。profile 的 `pnpm-workspace.yaml` 里
|
|
140
|
+
> 若还留着 `dsh-code-server-app: false` 之类的旧条目,也可以删掉(新版不再需要任何构建许可)。
|
|
141
|
+
|
|
142
|
+
> **卸载**:`dsh plugin --profile web remove dsh-code-server-app` 即可(插件目录含 code-server 本体,
|
|
143
|
+
> 一并删除);若还残留旧安装根,再手动删除 `<profile>\.code-server-app`。
|
|
109
144
|
|
|
110
145
|
> 安装/依赖变化后请**重启 `dsh web`**(静态插件行与 host 探测路径在启动时加载)。
|
|
111
146
|
|
|
@@ -115,63 +150,59 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app\dsh-code-
|
|
|
115
150
|
dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
|
|
116
151
|
```
|
|
117
152
|
|
|
118
|
-
> 源码路径以 `link:`
|
|
119
|
-
>
|
|
120
|
-
>
|
|
153
|
+
> 源码路径以 `link:` 安装。开发机上没有 `vendor/code-server` 时先 `pnpm run vendor:code-server`;
|
|
154
|
+
> 依赖(内部 JS 依赖 + 平台聚合包)同样由 pnpm 安装 —— 但本地未发布的 `@jinsiyu/*` 需要先发布,
|
|
155
|
+
> 或把 `repack/tgz/*.tgz` 以 `file:` 依赖临时装进 profile。
|
|
121
156
|
>
|
|
122
157
|
> **改动 client bundle**:编辑 `src/factory.js` 后执行 `pnpm run build:client`
|
|
123
158
|
> 重新生成 `lib/client.js`(仓库不跟踪该产物;浏览器刷新即生效,host 无需重启)。
|
|
124
159
|
> 窗口动画由内嵌 `motion` 驱动,手感参数在 `src/factory.js` 的 `winPhysics`(一处)。
|
|
125
160
|
|
|
126
|
-
###
|
|
161
|
+
### 打包机环境要求(使用者机器什么都不需要)
|
|
127
162
|
|
|
128
|
-
|
|
163
|
+
**工具链只在打包期需要;使用者机器不需要 C++ 工具链,也不需要联网装依赖之外的任何东西。**
|
|
129
164
|
|
|
130
|
-
|
|
|
131
|
-
|---|---|---|---|
|
|
132
|
-
| **code-server**(主包) | 官方 `sh ./postinstall.sh` 已被 `allowScripts: code-server: false` 跳过(Windows 无 sh) | ❌ | ❌ |
|
|
133
|
-
| **argon2** | `node-gyp-build`(binding.gyp + node-addon-api) | ✅ **必须** | ✅ **也必须**——prebuilds 目录里只有 Linux 的 `*.glibc.node`,**Windows 无任何预编译** |
|
|
134
|
-
| **unrs-resolver** | `napi-postinstall check`,加载 `@unrs/resolver-binding-win32-{x64,arm64}-msvc` 预编译绑定 | ❌ 纯预编译 | ❌ 纯预编译 |
|
|
135
|
-
| **VS Code 内部依赖**(`lib/vscode/node_modules`,144 包) | `ensureNpmDeps` 逐一 `npm install`,自带 postinstall(node-pty/koffi/kerberos 等) | ⚠️ 多数预编译 | ⚠️ 多数预编译 |
|
|
136
|
-
|
|
137
|
-
**基础环境清单(Windows 实测)**:
|
|
138
|
-
|
|
139
|
-
| 环境 | 版本/要求 | ARM64 | x64 |
|
|
165
|
+
| 环境 | 版本/要求 | 使用者机器 | 打包机 |
|
|
140
166
|
|---|---|---|---|
|
|
141
167
|
| Node.js | **v24.x**(code-server 最新要求;本机 v24.13.1) | 必需 | 必需 |
|
|
142
|
-
| npm | 跟随 Node | 必需 | 必需 |
|
|
143
|
-
| **MSVC 构建工具** | **VS Community 2026
|
|
144
|
-
| **VS Spectre 缓解库** |
|
|
145
|
-
| Python | **3.13.x**
|
|
146
|
-
| node-gyp | **13.x**(
|
|
168
|
+
| npm / pnpm | npm 跟随 Node;pnpm 由 DSH 提供 | 必需(装依赖) | 必需 |
|
|
169
|
+
| **MSVC 构建工具** | **VS Community 2026 + C++ 桌面负载** | ❌ 不需要 | 打包期需要(编译 16 个原生包 + argon2) |
|
|
170
|
+
| **VS Spectre 缓解库** | ARM64 与 **x86/x64** 各一份("MSVC v14x Spectre-mitigated libs") | ❌ 不需要 | 打包期需要(否则 MSB8040) |
|
|
171
|
+
| Python | **3.13.x** | ❌ 不需要 | 打包期需要(node-gyp) |
|
|
172
|
+
| node-gyp | **13.x**(旧版不识别 VS 2026) | ❌ 不需要 | 打包期需要 |
|
|
147
173
|
|
|
148
|
-
>
|
|
149
|
-
>
|
|
150
|
-
> - 其余(unrs-resolver、VS Code 内部依赖)走预编译,无需额外工具;
|
|
151
|
-
> - 若开发机没有工具链,可将安装根 `package.json` 的 `allowScripts.argon2` 设为 `false` 跳过(但 argon2 缺失会导致 code-server 启动报 `node-gyp-build` 错误——仅适合不依赖 argon2 的场景,通常不建议)。
|
|
174
|
+
> **缺 Spectre 库也能出包**:`vendor-repacks.mjs` 在某个包编译失败时会自动把该架构 `*.gyp` 里的
|
|
175
|
+
> `SpectreMitigation` 降级为 `false` 并重试(只是少了 Spectre 加固,功能不受影响),日志会明确提示。
|
|
152
176
|
|
|
153
|
-
### Windows 原生构建要点(
|
|
177
|
+
### Windows 原生构建要点(打包期,本机实测 ARM64)
|
|
154
178
|
|
|
155
179
|
- **VS 需 Spectre 缓解库组件**(MSB8040):Visual Studio Installer → 单个组件 →
|
|
156
|
-
"
|
|
180
|
+
"MSVC v14x Spectre-mitigated libs",**ARM64 与 x86/x64 要分别安装**(只装一个架构会缺另一个)。
|
|
157
181
|
- **node-gyp 13.x**(旧版 9.x 不识别 VS 2026):`npm install -g node-gyp@latest`。
|
|
158
|
-
-
|
|
182
|
+
- **x64 交叉编译**:`vendor-repacks.mjs` 用 `npm install --os=win32 --cpu=x64 --ignore-scripts`
|
|
183
|
+
取包,再 `npm rebuild --arch=x64` 逐个编译,已验证产物 PE 架构正确(kerberos / sqlite3 / spdlog …)。
|
|
184
|
+
- code-server 最新版要求 **Node v24**。
|
|
159
185
|
- 若不需要插件自足(例如已有全局 code-server),可跳过安装:
|
|
160
186
|
插件会回退到 PATH/配置的 `bin`(见"配置"表)。
|
|
161
187
|
|
|
162
188
|
### 升级 code-server 版本
|
|
163
189
|
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
190
|
+
- **打包期决定版本**:`pnpm run vendor:latest`(= `--force`)取 npm **最新版**并重建 `vendor/code-server`;
|
|
191
|
+
也可 `pnpm run vendor:code-server -- --version 4.136.2` 或设 `DSHCS_CODE_SERVER_VERSION`。
|
|
192
|
+
已有 `vendor/code-server` 时,不带 `--force`/`--version` 不会升级(日常 `pnpm pack` 是 no-op)。
|
|
193
|
+
- **先查再升**:`pnpm run vendor:check` 打印「内置版本 / npm latest」。
|
|
194
|
+
- **换版本后必须重发预编译原生包**(内部依赖版本会跟着 code-server 变):
|
|
195
|
+
`node scripts/vendor-repacks.mjs --target win32-arm64,win32-x64 --pack` →
|
|
196
|
+
`pnpm run publish:repacks` → bump 插件版本 → `pnpm pack`。
|
|
197
|
+
脚本会把新的「纯 JS 直装集」写进插件 `dependencies`,并更新两个聚合包的版本号。
|
|
198
|
+
- **不再有运行期自动升级**:不会在启动时联网取 latest;版本完全由内置产物决定。
|
|
199
|
+
- 本机当前内置:`code-server@4.136.2`(with Code 1.136.1)。
|
|
169
200
|
|
|
170
|
-
###
|
|
201
|
+
### 兼容旧安装位
|
|
171
202
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
(
|
|
203
|
+
host 探测顺序:`<插件>/vendor/code-server`(**正式布局,就地运行**)> 旧版安装根
|
|
204
|
+
`<profile>\.code-server-app\node_modules\code-server`(兼容 0.1.35 及更早,仅当插件包内缺失时)> 插件包内
|
|
205
|
+
`node_modules/code-server`(开发期)> PATH/配置 `bin`。旧安装根只在启动日志里提示可删除,不再被写入。
|
|
175
206
|
|
|
176
207
|
## 设置卡片(设置 → 插件 → Code Server)
|
|
177
208
|
|
|
@@ -183,6 +214,10 @@ host 探测顺序:`<profile>\.code-server-app`(专用目录)> 插件包内 `node
|
|
|
183
214
|
| `reserveComposer` | `true` | 窗口是否**保留输入框上方空间**:开启时窗口初始/拖动/缩放/最大化都止于输入栏上方(不遮挡 composer);关闭后允许盖住输入框(最大化到视口底)。**仅对旧版 DSH 的浮窗生效**——右侧栏模式下该行隐藏 |
|
|
184
215
|
| `windowedOpen` | `false` | **窗口化打开**:开启后各入口(产物按钮 / 设置卡 / 悬浮球)在浏览器**新标签页**打开 code-server(自动启动并跟随当前工作区目录);关闭(默认)使用右侧栏标签(旧版 DSH 为内部浮动窗口) |
|
|
185
216
|
|
|
217
|
+
卡片底部是**环境检测**(点「检测环境」读取 host `status.env`):
|
|
218
|
+
入口、`native`(argon2)、VS Code 内部依赖、**预编译原生包**(平台聚合包名 + 已解析模块数)。
|
|
219
|
+
0.1.36 起没有「安装环境」按钮 —— 依赖由包管理器安装,卡片里只显示结果。
|
|
220
|
+
|
|
186
221
|
> 卡片改动经 `scope.watch` 实时生效(host 端 status API 同步返回 `reserveComposer` 与
|
|
187
222
|
> `windowedOpen`,客户端立即生效);无需重启 dsh。**新增设置键后首次使用前需重启 dsh web**,
|
|
188
223
|
> 让 host 重新注册设置命名空间(schema 含新键),否则新键的保存与校验不生效。
|
|
@@ -191,7 +226,7 @@ host 探测顺序:`<profile>\.code-server-app`(专用目录)> 插件包内 `node
|
|
|
191
226
|
|
|
192
227
|
| 键 | 默认 | 说明 |
|
|
193
228
|
|---|---|---|
|
|
194
|
-
| `bin` | `code-server`(占位) | 启动优先级:本配置显式 `bin` >
|
|
229
|
+
| `bin` | `code-server`(占位) | 启动优先级:本配置显式 `bin` > 插件包内 `vendor/code-server/out/node/entry.js` > 旧安装根 `.code-server-app` > 插件包内 `node_modules` > PATH 中的 `code-server`。都不存在时启动报错并给出排查提示 |
|
|
195
230
|
| `host` | `127.0.0.1` | 绑定地址;`auth: none` 仅允许回环(localhost/127.0.0.1/::1) |
|
|
196
231
|
| `port` | `8090` | 端口;被占用时启动失败并给出诊断(不自动换端口) |
|
|
197
232
|
| `auth` | `none` | `none` \| `password`;非回环 host 自动要求 password |
|
|
@@ -219,10 +254,10 @@ desktop profile 由 `apps/desktop-host` 把 `/api/*` 交给同一个 `createShar
|
|
|
219
254
|
|
|
220
255
|
| 方法 | 路径 | 说明 |
|
|
221
256
|
|---|---|---|
|
|
222
|
-
| GET | `/api/code-server/status` | `{ ok, running, status, host, port, pid, cwd, url, version, error, logTail, adopted }`(另含 `env` 环境检测与 `setup`
|
|
257
|
+
| GET | `/api/code-server/status` | `{ ok, running, status, host, port, pid, cwd, url, version, error, logTail, adopted }`(另含 `env` 环境检测与 `setup` 兼容字段) |
|
|
223
258
|
| POST | `/api/code-server/start` | body `{ cwd? }`(省略 cwd 不切换工作目录);幂等 |
|
|
224
259
|
| POST | `/api/code-server/stop` | 停止并回收进程树 |
|
|
225
|
-
| POST | `/api/code-server/setup` |
|
|
260
|
+
| POST | `/api/code-server/setup` | **兼容空操作**:0.1.36 起依赖由包管理器安装,调用只重新自检 `env` 并返回 |
|
|
226
261
|
| POST | `/api/code-server/open-file` | body `{ file }` — 写信号文件,由内置扩展 `dshcs-open-file` 在 code-server 中打开 |
|
|
227
262
|
|
|
228
263
|
> 插件不再注册 `/code-server/*` 这类 webServer 专有路由;code-server 图标已内联为 data URI(client bundle 内),
|