mirror of
https://github.com/anywhere-labs/dsh-desktop.git
synced 2026-09-28 13:13:40 +08:00
把 beta 与 market 从 0.1.7-alpha.1 升到 0.1.7-alpha.2,重建 vendor 运行时、前移 patch、重写 resolutions。stable 的产品内核保持 0.1.5-rc.2 不变。alpha.2 上游没有增删包(仍是 309 个 tarball)。 vendor 与依赖 - vendor/dsh-runtime/0.1.7-alpha.2/ 由 scripts/sync-vendored-runtime.mjs --write --channel beta 生成,打包前先跑了上游 pnpm run clean 再从零 构建(原因见下方 subprocess-local)。 - 移除 0.1.7-alpha.1 目录;0.1.6-alpha.2 目录 #1136 的提交说明写了移除, 但实际仍被跟踪且已无任何引用,本提交一并删掉。 - root resolutions 按通道重写:stable 的 rc.2 条目原样保留,beta 的 alpha.1 条目全部换成 alpha.2。 - 上游把内部 DSH 依赖改为精确版本、vendor 依赖改为 ~ 范围,并抬了一批 cordis 框架包。.yarnrc.yml 的 npmPreapprovedPackages 追加:cosmokit 1.8.5、cordis 4.0.4、cordis-plugin-group 1.0.4 / include 1.0.9 / loader 1.0.5 / timer 1.1.6、schemastery 3.18.4(旧条目保留给 stable)。 - beta / market / next 的 package.json 同步抬 cordis 4.0.4 与上述插件, schemastery ^3.18.4;否则 workspace 提供的 cordis-plugin-group 1.0.3 满足不了 alpha.2 包要求的 ~1.0.4。 - yarn.lock 是本仓库唯一一份,next 的 @deepseek-ai/dsh* 依赖号与 upstream-reference.json 也在本提交里跟到 alpha.2;next 的源码改动在 下一个提交。 patch 前移(17 → 17) 17 个 patch 全部改名到 @0.1.7-alpha.2,16 个内容不变、可原样打上。 dsh-subprocess-local 的 patch 改挂到 runner-launch-B2zsQ1Dz.js: alpha.2 里这个 chunk 换了哈希,index.js 和 runner.js 都改从 B2zsQ1Dz 导入。旧名 DGV26RBf 之所以还能"打上",是因为本地上次构建 alpha.1 时留在 lib/ 的旧产物被 files 里的 lib/runner-*.js 一起打进了 tarball——patch 打在一个没人加载的文件上,Windows 的私有 runner 因此 拿不到 ELECTRON_RUN_AS_NODE,会以 GUI 模式拉起 Electron。beta 的 package.spec 里"starts the private runner in Electron Node mode"这条 用例抓到了它。修法:上游 clean 后重新构建打包(逐包比对确认除去这个 旧 chunk 外,其余差异只有 package.json 键序和三处 .d.ts 联合类型的 成员顺序),再把 patch 按新文件名重新生成。 测试与注释 - market 的 contracts.spec、stable 的 desktop-runtime-environment.spec 里的 beta 版本号跟到 0.1.7-alpha.2。 - "Beta rides dsh 0.1.7-alpha.1" 一类描述通道当前版本的注释改成不带 预发布号的 0.1.7;描述"alpha.1 删掉/改名了某 API"的历史注释保留。
43 lines
2.1 KiB
Diff
43 lines
2.1 KiB
Diff
diff --git a/lib/bin.js b/lib/bin.js
|
|
index be1c2f8..0c9cd2f 100644
|
|
--- a/lib/bin.js
|
|
+++ b/lib/bin.js
|
|
@@ -99,7 +99,7 @@ function resolveBoot(program, profile, options, args) {
|
|
* @param version - version string printed by `--version`.
|
|
* @returns the resolved invocation.
|
|
*/
|
|
-function parseDshArgs(argv, version) {
|
|
+function parseDshArgs(argv, version, allowDesktopProfile = false) {
|
|
const first = argv[0];
|
|
let resolved;
|
|
const program = new Command();
|
|
@@ -110,14 +110,14 @@ function parseDshArgs(argv, version) {
|
|
}
|
|
const profile = options.profile;
|
|
if (profile === "") program.error("error: --profile needs a name");
|
|
- rejectElectronProfile(program, profile);
|
|
+ if (!allowDesktopProfile) rejectElectronProfile(program, profile);
|
|
resolved = resolveBoot(program, profile, options, args);
|
|
});
|
|
if (first === "plugin") {
|
|
const plugin = program.command("plugin").description("manage a profile's plugins by forwarding the remaining arguments to pnpm in the profile directory");
|
|
plugin.requiredOption("--profile <name>", "the profile whose plugins to manage (initialized on first use)", selectProfile).allowUnknownOption().argument("[args...]", "pnpm arguments, forwarded verbatim (add <pkg>, remove <pkg>, why <pkg>, ...)").action((args, options) => {
|
|
if (options.profile === "") program.error("error: --profile needs a name");
|
|
- rejectElectronProfile(plugin, options.profile);
|
|
+ if (!allowDesktopProfile) rejectElectronProfile(plugin, options.profile);
|
|
if (args.length === 0) program.error("error: plugin needs pnpm arguments to forward (e.g. add <package>)");
|
|
resolved = {
|
|
mode: "plugin",
|
|
@@ -208,9 +208,9 @@ function readVersion() {
|
|
* Run the public dsh command-line interface.
|
|
* @returns a promise that settles when the selected command mode finishes.
|
|
*/
|
|
-async function runCli() {
|
|
+async function runCli({ allowDesktopProfile = false } = {}) {
|
|
const version = readVersion();
|
|
- const invocation = parseDshArgs(process.argv.slice(2), version);
|
|
+ const invocation = parseDshArgs(process.argv.slice(2), version, allowDesktopProfile);
|
|
switch (invocation.mode) {
|
|
case "profile": {
|
|
const { runProfile } = await import("./profile-boot.js");
|