refactor: remove .deps-installed.json marker file to match upstream#253
Closed
shuv1337 wants to merge 2 commits intointegrationfrom
Closed
refactor: remove .deps-installed.json marker file to match upstream#253shuv1337 wants to merge 2 commits intointegrationfrom
shuv1337 wants to merge 2 commits intointegrationfrom
Conversation
Revert to upstream behavior for plugin dependency installation: - Skip dependency installation when running locally (isLocal check) - Remove marker file caching mechanism that was dropping .deps-installed.json in user project directories - Remove .deps-installed.json from .gitignore template - Remove related test that was specific to marker file behavior This fixes user confusion when .deps-installed.json appears in project directories, matching upstream opencode behavior.
| await BunProc.run(["add", "@opencode-ai/plugin@" + targetVersion, "--exact"], { | ||
| // Use BASE_VERSION for @opencode-ai/plugin since it's published by upstream without our -N suffix | ||
| await BunProc.run( | ||
| ["add", "@opencode-ai/plugin@" + (Installation.isLocal() ? "latest" : Installation.BASE_VERSION), "--exact"], |
There was a problem hiding this comment.
logic: The ternary Installation.isLocal() ? "latest" : Installation.BASE_VERSION is unreachable since line 169 returns early when Installation.isLocal() is true. Simplify to just use Installation.BASE_VERSION.
Suggested change
| ["add", "@opencode-ai/plugin@" + (Installation.isLocal() ? "latest" : Installation.BASE_VERSION), "--exact"], | |
| ["add", "@opencode-ai/plugin@" + Installation.BASE_VERSION, "--exact"], |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/opencode/src/config/config.ts
Line: 183:183
Comment:
**logic:** The ternary `Installation.isLocal() ? "latest" : Installation.BASE_VERSION` is unreachable since line 169 returns early when `Installation.isLocal()` is true. Simplify to just use `Installation.BASE_VERSION`.
```suggestion
["add", "@opencode-ai/plugin@" + Installation.BASE_VERSION, "--exact"],
```
How can I resolve this? If you propose a fix, please make it concise.Apply Greptile suggestion - the Installation.isLocal() check on line 169 returns early, making the ternary unreachable. Simplify to just use Installation.BASE_VERSION.
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.
Summary
Removes the
.deps-installed.jsonmarker file mechanism that was dropping files in user project directories, causing confusion for users developing against the opencode repo.Changes
Refactoring
installDependencies()inconfig.tsto match upstream behaviorInstallation.isLocal()check).deps-installed.jsonin project directories.deps-installed.jsonfrom the.gitignoretemplateBreaking Changes
None
Testing
Existing tests cover changes. The removed test was specific to the marker file caching mechanism which is no longer used.
Greptile Summary
Reverted the
installDependencies()function to match upstream behavior by removing the.deps-installed.jsonmarker file caching mechanism that was creating files in user project directories.Key Changes:
Installation.isLocal()check.deps-installed.jsonfrom.gitignoretemplateIssues Found:
config.ts:183- the ternary check forInstallation.isLocal()is unnecessary since the function returns early when this condition is trueConfidence Score: 4/5
packages/opencode/src/config/config.ts- fix the unreachable ternary on line 183Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Config participant Installation participant BunProc participant FileSystem User->>Config: get() Config->>Config: installDependencies(dir) alt Installation.isLocal() == true Config->>Installation: isLocal() Installation-->>Config: true Config-->>User: return (skip install) else Installation.isLocal() == false Config->>Installation: isLocal() Installation-->>Config: false Config->>FileSystem: check package.json exists alt package.json missing Config->>FileSystem: write empty package.json end Config->>FileSystem: check .gitignore exists alt .gitignore missing Config->>FileSystem: write .gitignore with patterns end Config->>Installation: BASE_VERSION Config->>BunProc: add @opencode-ai/plugin@VERSION BunProc-->>Config: success/failure Config->>BunProc: install (additional deps) BunProc-->>Config: success/failure Config-->>User: return end