dsh-code-server-app 0.3.45 → 0.3.46
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/package.json +5 -1
- package/scripts/vendor-repacks.mjs +55 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-code-server-app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.46",
|
|
4
4
|
"description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). Since 0.3.0 the bundle also ships an editor bridge (assets/extensions/dshcs-editor-bridge): a read-only channel between the in-tree VS Code extension host and DSH, giving the agent what only the editor knows (unsaved buffers, language-server diagnostics, the active selection) and letting editor gestures drive the session. Since 0.3.22 the ask panel renders that session's new content with DSH's own Markdown renderer (pinned to the deployed DSH UI version); since 0.3.23 it is a full-width dialog with collapsible thinking rows and can answer approval requests in place — the bridge's only non-read-only route (POST /approve, constrained to pending in-process requests and the outcomes allowed-once/rejected; panel-first for 5 minutes, handed back to the official card the moment the panel closes). The tab claims DSH file addresses (dsh-resource://file/**) by file type (setting claimExtensions), so the product's own produced-file chips, delivered-file previews and inline prose mentions open in the workbench. The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads it. Opening the tab switches the right sidebar to fullscreen by default (setting fullscreenOnOpen). Following a workspace switch is lightweight: the workbench re-navigates with the new ?folder= and the IDE process is not restarted (since 0.2.12). Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions get a single upgrade notice on the settings page and no other UI. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
|
|
5
5
|
"homepage": "https://github.com/jinsiyu/dsh-code-server-app",
|
|
6
6
|
"repository": {
|
|
@@ -138,17 +138,21 @@
|
|
|
138
138
|
"@xterm/addon-webgl": "0.20.0-beta.299",
|
|
139
139
|
"@xterm/headless": "6.1.0-beta.302",
|
|
140
140
|
"@xterm/xterm": "6.1.0-beta.303",
|
|
141
|
+
"bindings": "1.5.0",
|
|
141
142
|
"cookie": "0.7.2",
|
|
142
143
|
"detect-libc": "2.1.2",
|
|
144
|
+
"fs-extra": "11.4.0",
|
|
143
145
|
"http-proxy-agent": "7.0.0",
|
|
144
146
|
"https-proxy-agent": "7.0.2",
|
|
145
147
|
"jschardet": "3.1.4",
|
|
146
148
|
"minimist": "1.2.8",
|
|
149
|
+
"mkdirp": "1.0.4",
|
|
147
150
|
"node-addon-api": "6.1.0",
|
|
148
151
|
"tar": "7.5.22",
|
|
149
152
|
"tas-client": "0.4.3",
|
|
150
153
|
"tslib": "2.8.1",
|
|
151
154
|
"typescript": "6.0.3",
|
|
155
|
+
"uuid": "14.0.2",
|
|
152
156
|
"vscode-oniguruma": "1.7.0",
|
|
153
157
|
"vscode-regexpp": "3.1.0",
|
|
154
158
|
"vscode-textmate": "9.3.2",
|
|
@@ -493,6 +493,49 @@ function readModules(targets) {
|
|
|
493
493
|
return modules;
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
+
/** 平台专属重打包包(写在插件 `optionalDependencies`)自带的**注册表依赖** —— 必须同时提成插件
|
|
497
|
+
* 自己的直接依赖。原因(0.3.46 实测,复现与证据见 docs/desktop-first-install-root-cause.md 第 5 节):
|
|
498
|
+
* pnpm 的增量 hoisted 安装会把「optional 子树里 depth≥2」的依赖整支丢进 `node_modules/.modules.yaml`
|
|
499
|
+
* 的 `skipped`(`bindings` / `fs-extra` / `uuid` / `mkdirp` 全在内),而 dsh-desktop 在 `pnpm add`
|
|
500
|
+
* 之后**立刻**用 `require.resolve.paths()` 校验依赖图 ⇒ 首次安装报
|
|
501
|
+
* `@jinsiyu/dshcs-kerberos-win32-arm64 requires missing bindings@^1.5.0`;
|
|
502
|
+
* 更糟的是 `pnpm install --frozen-lockfile` 会认为 «Already up to date»(锁文件本身也缺这些条目),
|
|
503
|
+
* 于是 profile 永远修不好,只能靠删 node_modules 重装。提到插件根依赖后它们落在 profile 根
|
|
504
|
+
* `node_modules`,校验器与运行时都能解析到。这些都是纯 JS、无 ABI 约束,版本在此钉死;
|
|
505
|
+
* 将来平台专属包新增注册表依赖时 verifyOptionalSubtreeDeps() 会在构建期直接报错。 */
|
|
506
|
+
const OPTIONAL_SUBTREE_DEPS = {
|
|
507
|
+
bindings: '1.5.0',
|
|
508
|
+
mkdirp: '1.0.4',
|
|
509
|
+
'fs-extra': '11.4.0',
|
|
510
|
+
uuid: '14.0.2',
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
/** 构建期闸门:平台专属重打包清单里的每个非别名依赖都必须在 OPTIONAL_SUBTREE_DEPS 里。
|
|
514
|
+
* @param dirs - 已生成的平台专属重打包目录。 */
|
|
515
|
+
function verifyOptionalSubtreeDeps(dirs) {
|
|
516
|
+
const seen = new Set();
|
|
517
|
+
for (const dir of dirs) {
|
|
518
|
+
const m = readJson(join(dir, 'package.json'));
|
|
519
|
+
if (m === null) continue;
|
|
520
|
+
for (const fld of ['dependencies', 'optionalDependencies']) {
|
|
521
|
+
for (const [name, spec] of Object.entries(m[fld] ?? {})) {
|
|
522
|
+
if (String(spec).startsWith('npm:')) continue; // 已重打包(真名子包),不走注册表
|
|
523
|
+
seen.add(name);
|
|
524
|
+
if (!Object.hasOwn(OPTIONAL_SUBTREE_DEPS, name)) {
|
|
525
|
+
throw new Error(`${m.name}: 注册表依赖 ${name}@${spec} 不在 OPTIONAL_SUBTREE_DEPS 里 ——`
|
|
526
|
+
+ ' 它位于 optional 子树(depth≥2),pnpm 的增量 hoisted 安装会丢包,'
|
|
527
|
+
+ ' dsh-desktop 安装后立刻校验必报 requires missing;请把它提为插件直接依赖'
|
|
528
|
+
+ '(见 docs/desktop-first-install-root-cause.md 第 5 节)');
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const unused = Object.keys(OPTIONAL_SUBTREE_DEPS).filter((name) => !seen.has(name));
|
|
534
|
+
if (unused.length > 0) {
|
|
535
|
+
console.warn(` ⚠ OPTIONAL_SUBTREE_DEPS 里的 ${unused.join(', ')} 已不再被任何平台专属包需要,可以删掉`);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
496
539
|
function main() {
|
|
497
540
|
const hostKey = `${process.platform}-${process.arch}`;
|
|
498
541
|
const targets = TARGETS.length > 0 ? TARGETS : [hostKey];
|
|
@@ -610,6 +653,7 @@ function main() {
|
|
|
610
653
|
}
|
|
611
654
|
}
|
|
612
655
|
// 3) 平台专属包:host 用现成树,其它目标用交叉安装树(--reuse 时用已打包目录)
|
|
656
|
+
const platformDirs = [];
|
|
613
657
|
if (!REUSE) for (const target of targets) {
|
|
614
658
|
const map = byTarget.get(target);
|
|
615
659
|
const specs = [...repack].filter(([, r]) => r.platformSpecific).map(([name, r]) => ({ name, version: r.pkg.version }));
|
|
@@ -624,10 +668,16 @@ function main() {
|
|
|
624
668
|
continue;
|
|
625
669
|
}
|
|
626
670
|
const dir = writeRepack(srcDir, info, `${flat(name)}-${target}`);
|
|
671
|
+
platformDirs.push(dir);
|
|
627
672
|
plan.push({ dir, file: tgzName(info.pkgName, r.pkg.version) });
|
|
628
673
|
}
|
|
629
674
|
if (crossTree !== null) rmSync(crossTree, { recursive: true, force: true });
|
|
630
675
|
}
|
|
676
|
+
// 3b) --reuse 时平台专属目录已存在,就地复查闸门
|
|
677
|
+
if (REUSE) for (const item of reusedItems) {
|
|
678
|
+
if (PLATFORM_SUFFIX.test(String(readJson(join(item.dir, 'package.json'))?.name ?? ''))) platformDirs.push(item.dir);
|
|
679
|
+
}
|
|
680
|
+
verifyOptionalSubtreeDeps(platformDirs);
|
|
631
681
|
// 3) 重打包表(lib/vendored.json,随插件发布):运行时用它把真名子包补成原始名字
|
|
632
682
|
const vendoredDoc = {
|
|
633
683
|
schemaVersion: 1,
|
|
@@ -649,7 +699,8 @@ function main() {
|
|
|
649
699
|
console.log(`[repack] 生成 ${plan.length} 个待打包目录 → repack/ (计划:repack/pack-plan.json)`);
|
|
650
700
|
|
|
651
701
|
// 4) 改写插件 package.json 的依赖:树 + 纯 JS 直装集 + **全平台**重打包包写 dependencies(真名);
|
|
652
|
-
// 平台专属的重打包包按目标写 optionalDependencies(真名 + 包自带 os/cpu,包管理器按架构自动选)
|
|
702
|
+
// 平台专属的重打包包按目标写 optionalDependencies(真名 + 包自带 os/cpu,包管理器按架构自动选),
|
|
703
|
+
// 它们自己的注册表依赖再由 OPTIONAL_SUBTREE_DEPS 提到 dependencies(否则 pnpm 丢包,见该表注释)。
|
|
653
704
|
// 这样每个包在依赖图里都是「根项目的直接依赖」,不依赖 pnpm 对可选子树别名的处理
|
|
654
705
|
// (见 docs/desktop-first-install-root-cause.md)。
|
|
655
706
|
const pkgFile = join(pkgRoot, 'package.json');
|
|
@@ -658,13 +709,15 @@ function main() {
|
|
|
658
709
|
[vscodePkg.name, vscodePkg.version],
|
|
659
710
|
...declare.map((d) => [d.name, d.version]),
|
|
660
711
|
...independent.map((m) => [m.package, m.version]),
|
|
712
|
+
...Object.entries(OPTIONAL_SUBTREE_DEPS),
|
|
661
713
|
].sort(([a], [b]) => a.localeCompare(b)));
|
|
662
714
|
pluginPkg.optionalDependencies = Object.fromEntries(targets
|
|
663
715
|
.flatMap((t) => specific.map((m) => [`${m.package}-${t}`, m.version]))
|
|
664
716
|
.sort(([a], [b]) => a.localeCompare(b)));
|
|
665
717
|
writeFileSync(pkgFile, JSON.stringify(pluginPkg, null, 2) + '\n', 'utf8');
|
|
666
718
|
console.log(`[repack] 已写入 package.json:dependencies ${Object.keys(pluginPkg.dependencies).length} 个`
|
|
667
|
-
+ `(VS Code 树 + 纯 JS + ${independent.length}
|
|
719
|
+
+ `(VS Code 树 + 纯 JS + ${independent.length} 个全平台重打包包`
|
|
720
|
+
+ ` + ${Object.keys(OPTIONAL_SUBTREE_DEPS).length} 个 optional 子树兜底依赖),`
|
|
668
721
|
+ `optionalDependencies ${Object.keys(pluginPkg.optionalDependencies).length} 个`
|
|
669
722
|
+ `(${specific.length} 个平台专属重打包包 × ${targets.length} 个目标)`);
|
|
670
723
|
|