Skip to content

fix(web): resolve preview and probe script paths from the repository root - #51

Open
nothingp wants to merge 1 commit into
techflag:mainfrom
nothingp:fix/web-preview-script-paths
Open

nothingp wants to merge 1 commit into
techflag:mainfrom
nothingp:fix/web-preview-script-paths

Conversation

@nothingp

Copy link
Copy Markdown

问题

apps/web/README.zh-CN.md 的「从源码运行」写的是 pnpm install --frozen-lockfile → build → preview:install → preview。在未修改的干净检出上,第一步就直接失败:

ENOENT: no such file or directory,
open '.../apps/web/packages/plugins/skills/package.json'

原因

2210a86fd7(#32 的 apps 目录迁移)把 workdsh-web/ 挪成 apps/web/、把共享包挪到仓库根,但漏改了两类路径:

  1. shared-profile-features.mjs 用 root = apps/web/ 去解析 plan 里的 feature.directory——那些条目是仓库根相对的(packages/plugins/skills),于是找成了不存在的 apps/web/packages/plugins/skills。同一个迁移里,读取 plan 文件本身的路径被改成了 ../../profiles/...(说明作者知道要退两层),但 feature 目录没有跟着改。
  2. install-preview.mjs / start-preview.mjs / install-project-release.mjs 和 7 个 probe-*.mjs 给已经相对 DSH_HOME 的路径又加了 ../../profiles/...。profile 实际位于 <DSH_HOME>/profiles/<name>(DSH_HOME 默认 ~/.dsh,preview 下是 apps/web/.test-runtime/preview),多退了两层。同一个文件里其余条目用的是 '../../packages/...' 这种相对 apps/web 的写法,是数组里两种约定混用。

验证

macOS 上从干净检出跑通:

  • 修复前:corepack pnpm preview:install 在第一步 sharedProfileFeatures() 直接 ENOENT(已复现)
  • 修复后:corepack pnpm preview:install 完成安装(六个功能层各自的官方 Profile 层均装上);corepack pnpm preview 起服务,浏览器里会话、专家·技能·连接器(6 个已装技能)、项目、资料库四个视图都正常渲染
  • 12 个 preview 包目录全部解析成功;start-preview 解析出的 profile 路径确实存在

未验证:probe-*.mjs 与 install-project-release.mjs 只做了同一规则的机械修正,没有实跑——它们需要浏览器或临时 profile 安装。如果希望我补上对应的验证,请告知运行方式。

为什么 main 一直是绿的

这些脚本都不在 corepack yarn check 的 headless 门禁里(门禁只跑 layout、版本对齐和 dsh-plugin-desktop 的 build/typecheck/test)。所以文档里的源码运行路径坏了,门禁仍然通过。6527ce03 "fix: validate builds and packaging after apps migration" 说明迁移遗漏当时是知道的,只是这几个不在门禁覆盖范围内的脚本被漏掉了。

建议把 preview:install(或至少它的路径解析部分)纳入门禁,否则同样的漂移还会再发生一次。

范围

只改路径解析,不动任何产品行为、插件组合或官方依赖版本。

🤖 Generated with Claude Code

…root

The apps migration in techflag#32 moved workdsh-web to apps/web and the shared packages
to the repository root, but left two classes of path arithmetic behind, so the
source run path documented in apps/web/README.zh-CN.md fails on a clean
checkout.

shared-profile-features.mjs resolved the plan's feature.directory entries
(repository-root relative, e.g. packages/plugins/skills) against apps/web, so
preview:install stopped at ENOENT looking for apps/web/packages/plugins/skills.
install-preview.mjs, start-preview.mjs, install-project-release.mjs and seven
probe scripts prefixed ../../profiles/ to paths already resolved against
DSH_HOME, where profiles live at <DSH_HOME>/profiles/<name>.

Verified on macOS: preview:install now completes and preview serves the UI
(conversation, skills, projects and library views render). The probe and
release-installer scripts received the same mechanical correction but were not
executed, as they need a browser or a temporary profile installation.

None of these scripts are covered by corepack yarn check, which is why main
stayed green while the documented source path was broken.

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant