This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(plugin-detail,plugin-list): add missing @object-ui/permissions dev edge so turbo ^build reaches it - #3242
Merged
xuyushun441-sys merged 1 commit intoAug 3, 2026
Conversation
…v edge `@object-ui/permissions` was declared only in `peerDependencies` of both packages. pnpm still symlinks such a peer into node_modules, so the module path resolved — but turbo reads package.json, not the lockfile, and the `type-check` task's `dependsOn: ["^build"]` walks dependencies/devDependencies only. `permissions/dist` therefore never got built and a scoped `turbo run type-check --filter=@object-ui/plugin-detail` failed with TS2307 plus the TS7006 cascade that follows a failed import. The full-repo `pnpm type-check` stayed green (another package's build dragged permissions up as a side effect), so CI could not see this — only the scoped, per-package typecheck could, which is exactly the command to run after touching one package. Adds a workspace-wide guard so the invariant is enforced rather than restored by hand: a peer that lives in this workspace must also carry a dependencies/devDependencies edge. Fixes #3207 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
xuyushun441-sys
marked this pull request as ready for review
August 3, 2026 07:20
xuyushun441-sys
deleted the
claude/issue-3207-plugin-detail-permissions-dev-dep
branch
August 3, 2026 07:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3207
问题
@object-ui/permissions只出现在plugin-detail/plugin-list的peerDependencies,不在dependencies/devDependencies。turbo 的type-check任务dependsOn: ["^build"],而^只沿 dependencies/devDependencies 走,所以permissions/dist永远不会为这条命令构建出来。值得强调的一点(原单没写,但它解释了为什么这是构建图问题而不是安装问题):pnpm 其实已经把这个 peer 软链进了
node_modules—— 改动前的 lockfile 里,@object-ui/permissions被记在 importer 的dependencies下(specifier: workspace:^)。也就是说包的路径一直能解析,tsc找得到那个目录,只是目录里没有.d.ts,于是报 TS2307。turbo 读的是package.json,不是 lockfile,两者不一致正是缺口所在。缺口有两处
按「
peerDependencies里的工作区包未同时出现在dependencies/devDependencies」逐个扫全工作区(46 个包,含apps/*与examples/*),命中两个:两处都改
package.json且都会动pnpm-lock.yaml,分两个 PR 必然互撞,所以一并修。改动
devDependencies各补一行"@object-ui/permissions": "workspace:*"(与同文件其余 peer 的写法一致),pnpm install重新生成 lockfile。scripts/__tests__/workspace-peer-dependency-edges.test.ts—— 把这条不变量机械化,而不是手工修完就算。关于那条 guard
原单的深层意思是:一个包改完后最该跑的那条 scoped typecheck,返回的却是一屏与改动无关的红。补一行依赖只恢复了今天的状态,挡不住下一个包再捅同样的窟窿 —— 所以补了 guard。
判据用的是「这个 peer 是不是工作区里的包」,而不是「名字是不是
@object-ui/开头」。后者只是巧合,前者才是 turbo 真正在乎的东西(外部 peer 如react/@objectstack/spec从 registry 装来就是构建好的,不需要这条边)。几个刻意的设计:
pnpm-workspace.yaml读,不写死,新增工作区根当天就被覆盖到;解析器只认文件里实际用的两种写法,遇到看不懂的语法抛错而不是跳过(悄悄少看半个工作区的 guard 比没有 guard 更糟)。discovers the workspace断言兜底,防止解析器坏掉后所有断言在空列表上「真空通过」。它落在
scripts/**/*.test.ts,vitest.config.mts的unitproject 已经覆盖这个 glob,所以随pnpm test自动跑,不需要另外改 workflow(少一处可能忘掉的接线)。全量耗时 272ms。反向验证过:临时把
plugin-detail那行 devDep 删掉,guard 如期变红并指名道姓;恢复后转绿。关于 changeset(未加,理由如下)
按 AGENTS.md「纯 bug 修复不需要 changeset」,且这次改的只有
devDependencies—— 消费者安装依赖时不会装 devDependencies,peerDependencies/dependencies一个字没动,发布物的行为零变化,属于仓库内构建图/DX 修复。加 changeset 会让fixed组 39 个包为一次消费者观察不到的改动集体 patch 发版。若维护者认为仍需留一条 changelog 记录,我可以补一个patch。验证
改动前(干净 worktree,
packages/permissions/dist不存在):plugin-list复现的是同一类失败(只有一处 import,所以只有一条),不是依赖边本来就完整。改动后(先
rm -rf packages/permissions/dist,以证明是 turbo 自己把它构建出来的):@object-ui/permissions:build出现在依赖图里 —— 这正是原先缺失的那条边。其余:
Generated by Claude Code