Skip to content

[PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 - #3078

Closed
ranxianglei wants to merge 2 commits into
masterfrom
2026-10-14_dsh-desktop-pkgjson-export
Closed

ranxianglei wants to merge 2 commits into
masterfrom
2026-10-14_dsh-desktop-pkgjson-export

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Scope (updated after rebase onto current master)

The functional fix for #3077 — adding "./package.json" to exports — already shipped via #3052 (merged as 18514114b). That PR added the same line to both package.json and the dsh client shim (src/launcher.ts) and pinned it with a static manifest check plus a shim resolution probe.

Rebasing this branch onto master collapsed those redundant hunks (they were byte-identical to what #3052 landed). What remains is the one non-redundant piece: a regression test in tests/index-entry-guard.test.ts that drives Node's real exports resolution of <pkg>/package.json through a node_modules symlink of the published package root — the exact path DSH Desktop's createRequire(...) fallback takes when the host process lacks --expose-internals. Without the export that call throws ERR_PACKAGE_PATH_NOT_EXPORTED and the client half is dropped silently (no settings row, no log line).

This complements #3052's static field check by exercising the actual resolution machinery rather than asserting on the JSON value, so it catches the specific failure mode end-to-end.

Verified locally (dependency-free): without the export the probe throws ERR_PACKAGE_PATH_NOT_EXPORTED; with it, resolution succeeds and points at the package root. Full suite + typecheck run on CI.

Closes #3077

… hosts (#3077)

The functional fix (exports ['./package.json']) already shipped via #3052 (commit 1851411), which also added a static manifest check and a shim probe. This PR is reduced to its one non-redundant piece: a regression test driving Node's real exports resolution of <pkg>/package.json through a node_modules symlink of the published package root - the exact path DSH Desktop's createRequire fallback takes without --expose-internals. Without the export this throws ERR_PACKAGE_PATH_NOT_EXPORTED and the client half is dropped silently.
@ranxianglei
ranxianglei force-pushed the 2026-10-14_dsh-desktop-pkgjson-export branch 2 times, most recently from e4440d8 to 31b6e28 Compare October 13, 2026 17:58
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-14_dsh-desktop-pkgjson-export (f7a54aa)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3509-pr.3078.92c24f9

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3078.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

处理的是「上游 PR 冲突」唤醒:我自己的 PR #3078 与 master 冲突。查下来根子不是普通代码冲突——这个功能修复其实已经通过 #3052 合进 master 了(同一个缺陷:exports 缺 "./package.json",导致 DSH Desktop 静默丢掉客户端半边)。两个 PR 撞在同一行上,所以显示 dirty。已 rebase 收口,按八问汇报:

  1. 是什么问题:DSH Desktop 装完看不到 "bili设置"——桌面宿主进程不带 --expose-internals,装配客户端插件时走 createRequire('<pkg>/package.json') 回退解析,缺该 export 就抛 ERR_PACKAGE_PATH_NOT_EXPORTED 被静默吞掉,插件整段跳过、无设置项也无日志。
  2. 什么原因导致的:同一个缺陷被 [Bug] exports 缺少 "./package.json",导致 DSH 客户端半体(设置页)完全不加载 #3043(→fix: expose ./package.json in exports so dsh client scanner loads the browser half (#3043) #3052) 和 [dsh] DSH Desktop 设置里看不到"bili设置":exports 缺少 "./package.json" 导致客户端插件被静默丢弃 #3077(→[PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 #3078) 各报一次、各开一个 PR,都往 exports 补同一行 "./package.json"。fix: expose ./package.json in exports so dsh client scanner loads the browser half (#3043) #3052 先合入 master;[PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 #3078 基于更早的 master 开出,相同的改动于是冲突。
  3. 影响范围与严重程度:用户侧 bug 已被 fix: expose ./package.json in exports so dsh client scanner loads the browser half (#3043) #3052 修好(master 已含该 export),无残留运行时影响;本次只是 [PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 #3078 一度被挡在合并前。收敛后剩余改动是纯测试。
  4. 怎么修复的:把 [PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 #3078 rebase 到最新 master,去掉三处与 fix: expose ./package.json in exports so dsh client scanner loads the browser half (#3043) #3052 逐字节重复的改动(package.json、src/launcher.ts、tests/launcher.test.ts),只保留唯一不重复的部分——tests/index-entry-guard.test.ts 里一个走 Node 真实 exports 解析的回归测试(node_modules symlink 指向发布包根,精确复现 DSH Desktop 那条失败路径)。force-push(带 lease)更新分支,并把 PR 描述改成与现状一致。
  5. 是否有回归问题:无。最终相对 master 只多一个测试文件(+25 行),未触碰 package.json / launcher.ts / 任何 wire、配置、持久化;fix: expose ./package.json in exports so dsh client scanner loads the browser half (#3043) #3052 已有的静态检查与 shim 探针原样保留。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有。
  8. 是否引入新配置:无新 env/config/flag。

验证:本地用零依赖脚本实测该机制——去掉 export 时探针抛 ERR_PACKAGE_PATH_NOT_EXPORTED,加上后解析成功且指向包根,证明这条测试真能兜住回归而非恒真断言。全量套件与 typecheck 交 CI(本工作区无 node_modules/dist)。

现状:PR 已转为可合并(mergeable=true,当前 blocked 仅因等 CI / 保护规则)。建议:CI 转绿后直接合并即可;若你认为 #3052 已完全覆盖、不想再留一个纯测试 PR,说一声我就关掉它(这条测试要不要单独挪个位置也由你定)。

另:#3077 里顺带提的 DSH 侧 locatePkgJson 静默 return(不记日志、不计入 composition failure)属外部项目,我尚未向 DSH 提交任何东西;要我去反馈的话请明确目标仓库与形式后再批准。

结论:冲突已解、PR 收敛为最小且有价值的形态,等 CI 绿即可合,或按你意愿关闭。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

又收到一条「上游 PR 冲突(dirty)」转发。我没有照单重做,先核了线上真实状态:

也就是说当前并不存在冲突——这条应是上一轮已被我 force-push 解决的那次冲突的延迟/重复通知。按「冲突解完不重复 rebase」的纪律,我不再对同一个基点做无意义的重复 rebase/push。

八问(相对我上一条报告,均无变化):

  1. 是什么问题:同一缺陷已由 fix: expose ./package.json in exports so dsh client scanner loads the browser half (#3043) #3052 合入 master;[PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 #3078 已收敛为纯回归测试 PR。本轮无新问题。
  2. 什么原因导致的:无新原因;这条转发是陈旧/重复事件。
  3. 影响范围与严重程度:无用户侧影响;PR 可合并,仅待 CI。
  4. 怎么修复的:无需再修——已 rebase 到最新 master、只保留唯一不重复的测试并推送完成。
  5. 是否有回归问题:无(最终 diff 仅 +1 个测试文件,+25 行)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有。
  8. 是否引入新配置:无。

结论:这条冲突通知对应的是已解决的状态,当前 PR 干净、可合并,等 CI 转绿即可,无需进一步操作。

@ranxianglei ranxianglei changed the title fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 [PR] fix: add "./package.json" to exports, "bili settings" now visible in DSH Desktop settings | [PR] fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 Oct 16, 2026
@ranxianglei ranxianglei changed the title [PR] fix: add "./package.json" to exports, "bili settings" now visible in DSH Desktop settings | [PR] fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 [PR] fix: add "./package.json" to exports, "bili settings" is now visible in DSH Desktop settings | fix: exports 补 "./package.json",DSH Desktop 设置里能看到 "bili设置"了 Oct 17, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

陈旧票清理(第三批动作①):目标 issue #3077 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dsh] DSH Desktop 设置里看不到"bili设置":exports 缺少 "./package.json" 导致客户端插件被静默丢弃

1 participant