dsh-code-server-app 0.1.2 → 0.1.17
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 +19 -7
- package/lib/client.js +5 -944
- package/lib/index.js +3 -4
- package/package.json +8 -3
- package/scripts/setup-code-server.mjs +1 -3
package/lib/index.js
CHANGED
|
@@ -105,11 +105,10 @@ function win32() {
|
|
|
105
105
|
return process.platform === 'win32';
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/** 插件自带 code-server
|
|
108
|
+
/** 插件自带 code-server 入口探测,兼容两种依赖布局:
|
|
109
109
|
* 1. profile 专用目录:profileRoot/.code-server-app/node_modules/code-server/...
|
|
110
110
|
* (方案 D 默认安装位,独立项目、避开 profile 依赖树冲突);
|
|
111
|
-
* 2.
|
|
112
|
-
* 3. pnpm hoisted:profile node_modules/code-server/...(历史布局)。
|
|
111
|
+
* 2. 包内:插件目录/node_modules/code-server/...(开发期 link:/独立 npm install 布局)。
|
|
113
112
|
* 不存在 → 回退配置/PATH。 */
|
|
114
113
|
function bundledRuntimeEntry() {
|
|
115
114
|
try {
|
|
@@ -117,8 +116,8 @@ function bundledRuntimeEntry() {
|
|
|
117
116
|
const candidates = [
|
|
118
117
|
// profile 专用目录:here=.../dsh-code-server/lib → ../..=node_modules → ../../..=profile根
|
|
119
118
|
path.join(here, '..', '..', '..', '.code-server-app', 'node_modules', 'code-server', 'out', 'node', 'entry.js'),
|
|
119
|
+
// 包内(dev link / 独立目录):here=.../lib → ../node_modules
|
|
120
120
|
path.join(here, '..', 'node_modules', 'code-server', 'out', 'node', 'entry.js'),
|
|
121
|
-
path.join(here, '..', '..', 'code-server', 'out', 'node', 'entry.js'),
|
|
122
121
|
];
|
|
123
122
|
for (const entry of candidates) {
|
|
124
123
|
if (fs.existsSync(entry)) return entry;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-code-server-app",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Integrate code-server (VS Code in the browser) into DSH Web:
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"description": "Integrate code-server (VS Code in the browser) into DSH Web: floating ball entry + fullscreen overlay, host-side process lifecycle over a /code-server JSON API (motion-based spring window animations).",
|
|
5
5
|
"homepage": "https://github.com/jinsiyu/dsh-code-server-app",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -36,7 +36,12 @@
|
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
38
|
"postinstall": "node scripts/setup-code-server.mjs",
|
|
39
|
-
"setup:code-server": "node scripts/setup-code-server.mjs"
|
|
39
|
+
"setup:code-server": "node scripts/setup-code-server.mjs",
|
|
40
|
+
"build:client": "node scripts/build-client.mjs"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"esbuild": "^0.25.0",
|
|
44
|
+
"motion": "^12.0.0"
|
|
40
45
|
},
|
|
41
46
|
"license": "MIT",
|
|
42
47
|
"allowScripts": {
|
|
@@ -52,13 +52,11 @@ function profileRootOf() {
|
|
|
52
52
|
function findCodeServer() {
|
|
53
53
|
// 布局候选(与安装目标同顺序):
|
|
54
54
|
// 1. profile 专用目录:profileRoot\code-server-app\node_modules\code-server
|
|
55
|
-
// 2.
|
|
56
|
-
// 3. 包内:pkgRoot/node_modules/code-server(回退/独立目录)
|
|
55
|
+
// 2. 包内:pkgRoot/node_modules/code-server(开发期 link:/独立目录)
|
|
57
56
|
const profileRoot = profileRootOf();
|
|
58
57
|
const cands = [];
|
|
59
58
|
if (profileRoot !== null) {
|
|
60
59
|
cands.push(join(profileRoot, APP_DIR_NAME, 'node_modules', 'code-server'));
|
|
61
|
-
cands.push(join(profileRoot, 'node_modules', 'code-server'));
|
|
62
60
|
}
|
|
63
61
|
cands.push(join(pkgRoot, 'node_modules', 'code-server'));
|
|
64
62
|
for (const cand of cands) {
|