dsh-code-server-app 0.1.2 → 0.1.19
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.md +23 -10
- package/lib/client.js +5 -944
- package/lib/index.js +14 -5
- package/package.json +8 -3
- package/scripts/setup-code-server.mjs +1 -3
package/README.md
CHANGED
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
**作为插件依赖随装**(package.json dependencies),插件启动时自动发现并使用它,
|
|
7
7
|
无需全局 npm 安装、无需配置 `bin`。
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
|
|
9
|
+
- **右下角悬浮球**(code-server 官方图标,输入框上方):点击**展开浮窗并亮起**(蓝色光环),再点击**收起并复原**;
|
|
10
|
+
**可按住拖动到任意位置**(松手后记忆,刷新不丢;拖完不会误触发点击);
|
|
11
|
+
无侧栏按钮、无窗口控制按钮组(球是唯一入口/开关);球上带运行状态点(绿=运行 / 黄=启动中 / 红=错误);
|
|
12
|
+
- 窗口为**内部浮动窗口**(参照 dsh-univer-office 的 WorktreeWindow 模式):固定定位浮窗 + 空转根容器,窗口接管指针事件,
|
|
13
|
+
**无标题栏无按钮**——顶部细条拖动(悬停有淡色提示;**拖到窗口顶部松开 = 最大化**,
|
|
14
|
+
**最大化后按住顶部细条向下拖 = 恢复**并继续跟手拖动)、双击最大化、8 向缩放、Esc 关闭(与球收起等效),
|
|
11
15
|
初始位置在输入框上方靠右,最大化与缩放都止于输入栏上方,不遮挡 composer;
|
|
12
|
-
-
|
|
16
|
+
- 窗口内直接是 code-server 页面(iframe);未运行/启动失败时显示状态说明与错误信息;
|
|
13
17
|
- code-server 服务目录**跟随活动工作区/会话**:浮层打开期间切换 DSH 会话/工作区,code-server 自动重启到新目录
|
|
14
18
|
(解析优先级:当前会话 cwd → 会话所属 workspace.path → recentWorkspace.path → 首个 workspace.path);
|
|
15
|
-
|
|
19
|
+
打开目录显示在 code-server 页面内(`?folder=<cwd>`,跟随切换时页面自动重新加载);
|
|
16
20
|
实现要点:iframe src 必须带 `?folder=<cwd>`——code-server 前端会记住“最近工作区”并自行恢复,
|
|
17
21
|
仅用裸根 URL 只会显示上一次打开的目录、不会跟随切换(本机实测确认)。
|
|
18
22
|
**Windows 路径格式(实测)**:folder 参数必须以 `/` 开头且全部正斜杠,形如 `/C:/Users/User/Desktop/biss`;
|
|
@@ -31,6 +35,9 @@
|
|
|
31
35
|
```powershell
|
|
32
36
|
# 1) 打包(在插件工作区)
|
|
33
37
|
cd C:\Users\User\Desktop\dsh-code-server-app
|
|
38
|
+
# 全新克隆:先装开发依赖并生成 client bundle(lib/client.js 不入库,由 src/factory.js 构建)
|
|
39
|
+
pnpm install # esbuild + motion(仅打包用)
|
|
40
|
+
pnpm run build:client # src/factory.js → lib/client.js
|
|
34
41
|
pnpm pack
|
|
35
42
|
|
|
36
43
|
# 2) 一次性前置:批准插件 postinstall 许可(pnpm 只认宿主根配置,无包内声明路径)
|
|
@@ -44,7 +51,7 @@ pnpm approve-builds dsh-code-server-app # 交互选 yes;失败时手动编辑
|
|
|
44
51
|
|
|
45
52
|
```powershell
|
|
46
53
|
# 3) 安装(发布形态 tarball;无需 --ignore-scripts / --allow-build)
|
|
47
|
-
dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app\dsh-code-server-app-0.1.
|
|
54
|
+
dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app\dsh-code-server-app-0.1.15.tgz
|
|
48
55
|
```
|
|
49
56
|
|
|
50
57
|
### 安装机制
|
|
@@ -74,6 +81,10 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
|
|
|
74
81
|
|
|
75
82
|
> 源码路径以 `link:` 安装,pnpm 会把 code-server 装到**插件工作区 node_modules**;
|
|
76
83
|
> 与方案 D 的布局不同(host 已支持两种)。首次也需按上面的步骤 2 批准 postinstall 许可。
|
|
84
|
+
>
|
|
85
|
+
> **改动 client bundle**:编辑 `src/factory.js` 后执行 `pnpm run build:client`
|
|
86
|
+
> 重新生成 `lib/client.js`(仓库不跟踪该产物;浏览器刷新即生效,host 无需重启)。
|
|
87
|
+
> 窗口动画由内嵌 `motion` 驱动,手感参数在 `src/factory.js` 的 `winPhysics`(一处)。
|
|
77
88
|
|
|
78
89
|
### Windows 原生构建要点(本机实测,ARM64)
|
|
79
90
|
|
|
@@ -94,7 +105,8 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
|
|
|
94
105
|
### 兼容旧的 runtime 目录安装
|
|
95
106
|
|
|
96
107
|
`runtime/node_modules/code-server`(早期 README 的手动安装方式)已移除支持——
|
|
97
|
-
host 探测顺序:`<profile>\.code-server-app`(专用目录)> 插件包内 `node_modules`>
|
|
108
|
+
host 探测顺序:`<profile>\.code-server-app`(专用目录)> 插件包内 `node_modules`> PATH/配置 `bin`
|
|
109
|
+
(profile 顶层 hoisted 属历史布局,已不再探测)。
|
|
98
110
|
|
|
99
111
|
## 设置卡片(设置 → 插件 → Code Server)
|
|
100
112
|
|
|
@@ -104,16 +116,17 @@ host 探测顺序:`<profile>\.code-server-app`(专用目录)> 插件包内 `node
|
|
|
104
116
|
| 键 | 默认 | 说明 |
|
|
105
117
|
|---|---|---|
|
|
106
118
|
| `reserveComposer` | `true` | 窗口是否**保留输入框上方空间**:开启时窗口初始/拖动/缩放/最大化都止于输入栏上方(不遮挡 composer);关闭后允许盖住输入框(最大化到视口底) |
|
|
119
|
+
| `windowedOpen` | `false` | **窗口化打开**:开启后点击悬浮球在浏览器**新标签页**打开 code-server(自动启动并跟随当前工作区目录);关闭(默认)使用内部浮动窗口 |
|
|
107
120
|
|
|
108
|
-
> 卡片改动经 `scope.watch` 实时生效(host 端 status API 同步返回 `reserveComposer
|
|
109
|
-
>
|
|
110
|
-
>
|
|
121
|
+
> 卡片改动经 `scope.watch` 实时生效(host 端 status API 同步返回 `reserveComposer` 与
|
|
122
|
+
> `windowedOpen`,客户端立即生效);无需重启 dsh。**新增设置键后首次使用前需重启 dsh web**,
|
|
123
|
+
> 让 host 重新注册设置命名空间(schema 含新键),否则新键的保存与校验不生效。
|
|
111
124
|
|
|
112
125
|
## 配置(cordis.patch.yml 的 `config`,均有默认值)
|
|
113
126
|
|
|
114
127
|
| 键 | 默认 | 说明 |
|
|
115
128
|
|---|---|---|
|
|
116
|
-
| `bin` | `code-server`(占位) | 启动优先级:本配置显式 `bin` > `<profile>\.code-server-app`(专用目录,自动以 node 运行)> 插件包内 `node_modules`>
|
|
129
|
+
| `bin` | `code-server`(占位) | 启动优先级:本配置显式 `bin` > `<profile>\.code-server-app`(专用目录,自动以 node 运行)> 插件包内 `node_modules`> PATH 中的 `code-server`。都不存在时启动报错并给出安装指引 |
|
|
117
130
|
| `host` | `127.0.0.1` | 绑定地址;`auth: none` 仅允许回环(localhost/127.0.0.1/::1) |
|
|
118
131
|
| `port` | `8090` | 端口;被占用时启动失败并给出诊断(不自动换端口) |
|
|
119
132
|
| `auth` | `none` | `none` \| `password`;非回环 host 自动要求 password |
|