fix(dev): inject local src/ext overlay when present so dev matches release#1210
Merged
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题
packages/opencode支持可选的本地扩展模块(src/ext/)。release 构建会自动把这些模块纳入产物,但bun run dev直接跑src/index.ts,不做任何注入——开源 checkout 里src/ext/不存在时没问题,但当扩展源放在相邻目录时,dev 看不到它们,导致 dev 与 release 行为不一致。改动
新增
packages/opencode/script/dev.ts作为 dev 启动器:src/ext/不存在且相邻目录存在扩展源,则拷入src/ext/,进程退出(含 Ctrl-C)时自动清理,保持工作树干净。package.json的dev脚本指向该启动器。验证
bun run dev自动注入,退出后src/ext/已清理Test plan
bun run dev在有/无扩展源两种情况下都能正常启动src/ext/残留)